����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 162.0.232.25 / Your IP : 3.145.202.60 Web Server : LiteSpeed System : Linux premium276.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : kwacuqig ( 988) PHP Version : 8.2.26 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/kwacuqig/gateman.skilltainment.org/ |
Upload File : |
<?php include './head.php'; include './header.php'; include './sidebar.php'; ?> <!--********************************** Content body start ***********************************--> <div class="content-body"> <!-- row --> <div class="page-titles"> <ol class="breadcrumb"> <li> <h5 class="bc-title">Teachers</h5> </li> <li class="breadcrumb-item"><a href="index.html"> <svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M2.125 6.375L8.5 1.41667L14.875 6.375V14.1667C14.875 14.5424 14.7257 14.9027 14.4601 15.1684C14.1944 15.4341 13.8341 15.5833 13.4583 15.5833H3.54167C3.16594 15.5833 2.80561 15.4341 2.53993 15.1684C2.27426 14.9027 2.125 14.5424 2.125 14.1667V6.375Z" stroke="#2C2C2C" stroke-linecap="round" stroke-linejoin="round" /> <path d="M6.375 15.5833V8.5H10.625V15.5833" stroke="#2C2C2C" stroke-linecap="round" stroke-linejoin="round" /> </svg> Home</a> </li> <li class="breadcrumb-item"><a href="javascript:void(0)">Teachers</a></li> </ol> </div> <div class="container-fluid"> <div class="row"> <div class="col-xl-12"> <div class="card"> <div class="card-body p-0"> <div class="table-responsive active-projects style-1"> <div class="tbl-caption"> <h4 class="heading mb-0">Teachers</h4> <div> <a class="btn btn-primary btn-sm" data-bs-toggle="offcanvas" href="#offcanvasExample" role="button" aria-controls="offcanvasExample">+ Add Teacher</a> </div> </div> <table id="empoloyees-tblwrapper" class="table"> <thead> <tr> <th>Teachers Name</th> <th>Email Address</th> <th>Contact Number</th> <th>Gender</th> <th>Birth</th> <th></th> </tr> </thead> <tbody> <?php $run = mysqli_query($conn, "SELECT * FROM `users` ORDER BY `firstname` ASC") or die(mysqli_error($conn)); while ($row = mysqli_fetch_array($run)) { $name=$row['firstname'].' '.$row['surname']; ?> <tr> <td><span><?php echo $row['firstname'].' '.$row['surname'];?></span></td> <td><span class="text-primary"><?php echo $row['email'];?></span></td> <td> <span><?php echo $row['mobile'];?></span> </td> <td> <span><?php echo $row['gender'];?></span> </td> <td> <span><?php echo $row['dob'];?></span> </td> <td> <a href="" class="btn btn-primary"><i class="fa fa-pencil"></i></a> <a href="delete-teacher.php?id=<?php echo $row['uid'];?>" class="btn btn-danger" onclick="return confirm('Delete <?php echo $name;?>?')"><i class="fa fa-trash"></i></a> </td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> <!--********************************** Content body end ***********************************--> <?php include './footer.php'; ?> <div class="offcanvas offcanvas-end customeoff" tabindex="-1" id="offcanvasExample"> <div class="offcanvas-header"> <h5 class="modal-title" id="#gridSystemModal">Add Teacher</h5> <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"> <i class="fa-solid fa-xmark"></i> </button> </div> <div class="offcanvas-body"> <div class="container-fluid"> <?php if (isset($_POST['submit'])) { $fname = mysqli_real_escape_string($conn, htmlentities($_POST['fname'])); $lname = mysqli_real_escape_string($conn, htmlentities($_POST['lname'])); $email = mysqli_real_escape_string($conn, htmlentities($_POST['email'])); $mobile = mysqli_real_escape_string($conn, htmlentities($_POST['mobile'])); $dob = mysqli_real_escape_string($conn, htmlentities(($_POST['dob']))); $fingerID = mysqli_real_escape_string($conn, htmlentities(($_POST['fingerID']))); $gender = mysqli_real_escape_string($conn, htmlentities($_POST['gender'])); $password = mysqli_real_escape_string($conn, htmlentities(md5($_POST['password']))); $confirm = mysqli_real_escape_string($conn, htmlentities(md5($_POST['confirm']))); $_SESSION['fname'] = $fname; $_SESSION['lname'] = $lname; $_SESSION['email_f'] = $email; $_SESSION['mobile_f'] = $mobile; $_SESSION['dob'] = $dob; $_SESSION['gender'] = $gender; $_SESSION['fingerID'] = $fingerID; $query = "SELECT * FROM `users` WHERE `email`='$email'"; $run = mysqli_query($conn, $query) or die(mysqli_error($conn)); $count = mysqli_num_rows($run); if ($count == 0) { if ($password == $confirm) { if (strlen($_POST['password']) >= 5) { $query2 = "INSERT INTO `users`(`fingerID`,`email`,`mobile`,`password`,`firstname`,`surname`,`dob`,`gender`) VALUES('$fingerID', '$email','$mobile','$password','$fname','$lname','$dob','$gender')"; if ($run2 = mysqli_query($conn, $query2)) { //destroying all three sessions unset($_SESSION['fingerID'], $_SESSION['fname'], $_SESSION['lname'], $_SESSION['email_f'], $_SESSION['dob'], $_SESSION['mobile_f'], $_SESSION['gender'],); ?> <script type="text/javascript"> swal("", "<?php echo "$fname $lname"; ?> was registered successfully", "success"); </script> <?php } else { die(mysqli_error($conn)); } } else { ?> <script type="text/javascript"> swal("", "Password is too short", "warning"); </script> <?php } } else { ?> <script type="text/javascript"> swal("", "Passwords do not match", "warning"); </script> <?php } } else { unset($_SESSION['email']); ?> <script type="text/javascript"> swal("", "<?php echo $email; ?> is already registered", "error"); </script> <?php } } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <div class="row"> <div class="col-xl-6 mb-3"> <label for="exampleFormControlInput2" class="form-label">First Name<span class="text-danger">*</span></label> <input type="text" class="form-control" id="exampleFormControlInput2" name="fname" placeholder="Enter First Name" value="<?php echo isset($_SESSION['fname']) ? $_SESSION['fname'] : ''; ?>" required> </div> <div class="col-xl-6 mb-3"> <label for="exampleFormControlInput2" class="form-label">Last Name<span class="text-danger">*</span></label> <input type="text" class="form-control" id="exampleFormControlInput2" name="lname" placeholder="Enter Last Name" value="<?php echo isset($_SESSION['lname']) ? $_SESSION['lname'] : ''; ?>" required> </div> <div class="col-xl-6 mb-3"> <label for="exampleFormControlInput3" class="form-label">Email<span class="text-danger">*</span></label> <input type="email" class="form-control" id="exampleFormControlInput3" name="email" placeholder="Enter Email" value="<?php echo isset($_SESSION['email_f']) ? $_SESSION['email_f'] : ''; ?>" required> </div> <div class="col-xl-6 mb-3"> <label for="exampleFormControlInput88" class="form-label">Mobile<span class="text-danger">*</span></label> <input type="number" class="form-control" id="exampleFormControlInput88" name="mobile" placeholder="Enter Mobile" value="<?php echo isset($_SESSION['mobile_f']) ? $_SESSION['mobile_f'] : ''; ?>" required> </div> <div class="col-xl-6 mb-3"> <label class="form-label">Gender<span class="text-danger">*</span></label> <select class="default-select style-1 form-control" name="gender"> <option value="" disabled>Please select</option> <option value="male">Male</option> <option value="female">Female</option> <option value="other">Other</option> </select> </div> <div class="col-xl-6 mb-3"> <label for="exampleFormControlInput8" class="form-label">Date of Birth<span class="text-danger">*</span></label> <input type="date" class="form-control" id="exampleFormControlInput8" name="dob" value="<?php echo isset($_SESSION['dob']) ? $_SESSION['dob'] : ''; ?>" required> </div> <div class="col-xl-6 mb-3"> <label for="exampleFormControlInput8" class="form-label">Fingerprint ID<span class="text-danger">*</span></label> <input type="text" class="form-control" id="exampleFormControlInput8" name="fingerID" placeholder="Enter Fingerprint ID" value="<?php echo isset($_SESSION['fingerID']) ? $_SESSION['fingerID'] : ''; ?>" required> </div> <div class="col-xl-6 mb-3"> <label for="exampleFormControlInput4" class="form-label">Password<span class="text-danger">*</span></label> <input type="password" class="form-control" id="exampleFormControlInput4" name="password" placeholder="Enter Password" required> </div> <div class="col-xl-6 mb-3"> <label for="exampleFormControlInput4" class="form-label">Confirm Password<span class="text-danger">*</span></label> <input type="password" class="form-control" id="exampleFormControlInput4" name="confirm" placeholder="Confirm Password" required> </div> </div> <div> <button class="btn btn-danger light ms-1">Cancel</button> <button class="btn btn-primary me-1" type="submit" name="submit">Submit</button> </div> </form> </div> </div> </div> <?php include './scripts.php'; ?> <script> document.querySelector('title').innerHTML="Gateman ~ Teachers"; </script>