📁 File Manager
🏠 /
/
home
/
u857492117
/
domains
/
mangaldaicollege.org
/
public_html
/
deptadminpanel
Dosya Düzenle: update_teacher.php
<?php session_start(); include 'connect.php'; if (isset($_SESSION['Dept_HeadE'])) { $email = $_SESSION['Dept_HeadE']; $stmt = $con->prepare("SELECT * FROM deptLog WHERE Email = ?"); $stmt->bind_param("s", $email); $stmt->execute(); $qf = $stmt->get_result(); if ($rf = $qf->fetch_assoc()) { $_SESSION['Dept_Name'] = $rf['DeptName']; } // Get teacher id $id = isset($_GET['id']) ? intval($_GET['id']) : 0; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Dashboard Mangaldai College</title> <!-- Fonts and styles --> <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Nunito:200,300,400,600,700,900" rel="stylesheet"> <link href="css/sb-admin-2.min.css" rel="stylesheet"> <style> textarea { width: 100%; height: 150px; padding: 10px; border: 1px solid #ccc; border-radius: 4px; resize: vertical; } img#preview { margin-top: 10px; max-width: 200px; max-height: 200px; border-radius: 8px; border: 1px solid #ddd; } </style> </head> <body id="page-top"> <!-- Page Wrapper --> <div id="wrapper"> <!-- Sidebar --> <?php include("menu.php"); ?> <!-- End of Sidebar --> <!-- Content Wrapper --> <div id="content-wrapper" class="d-flex flex-column"> <!-- Main Content --> <div id="content"> <!-- Topbar --> <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 shadow"> <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3"> <i class="fa fa-bars"></i> </button> <ul class="navbar-nav ml-auto"> <li class="nav-item dropdown no-arrow"> <a class="nav-link dropdown-toggle" href="#" id="userDropdown"> <span class="mr-2 d-none d-lg-inline text-gray-600 small"> <b style="color:red;"><?php echo $_SESSION['Dept_Name']; ?></b> </span> <i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i> </a> <div class="dropdown-menu dropdown-menu-right shadow"> <a class="dropdown-item" href="profile.php"><i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i>Profile</a> <a class="dropdown-item" href="adminpwdchng.php"><i class="fas fa-cogs fa-sm fa-fw mr-2 text-gray-400"></i>Change Password</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="logout.php" data-toggle="modal" data-target="#logoutModal"> <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>Logout </a> </div> </li> </ul> </nav> <!-- End of Topbar --> <div class="container-fluid"> <!-- Update Profile --> <div class="card shadow mb-4"> <div class="card-header"><h6 class="m-0 font-weight-bold text-primary">Update Profile</h6></div> <div class="card-body"> <?php $stmt = $con->prepare("SELECT * FROM teacher WHERE TId = ?"); $stmt->bind_param("i", $id); $stmt->execute(); $q2 = $stmt->get_result(); $rw1 = $q2->fetch_assoc(); ?> <form action="updateTeacherCode.php" method="post" class="card p-4 shadow-sm"> <h4 class="mb-4">Update Teacher Information</h4> <input type="hidden" name="tid" value="<?php echo $id; ?>"> <div class="row g-3"> <div class="col-md-6 form-floating"> <input type="text" name="Tname" value="<?php echo htmlspecialchars($rw1['Name']); ?>" class="form-control" placeholder="Name"> <label>Name</label> </div> <div class="col-md-6 form-floating"> <input type="text" name="Address" value="<?php echo htmlspecialchars($rw1['Address']); ?>" class="form-control" placeholder="Address"> <label>Address</label> </div> <div class="col-md-6 form-floating"> <input type="email" name="Email" value="<?php echo htmlspecialchars($rw1['Email']); ?>" class="form-control" placeholder="Email"> <label>Email</label> </div> <div class="col-md-6 form-floating"> <input type="text" name="Phone" value="<?php echo htmlspecialchars($rw1['Phone']); ?>" class="form-control" placeholder="Phone"> <label>Phone</label> </div> <div class="col-md-6 form-floating"> <input type="text" name="Designation" value="<?php echo htmlspecialchars($rw1['Designation']); ?>" class="form-control" placeholder="Designation"> <label>Designation</label> </div> <div class="col-md-6 form-floating"> <input type="text" name="qualification" value="<?php echo htmlspecialchars($rw1['qualification']); ?>" class="form-control" placeholder="Qualification"> <label>Qualification</label> </div> <div class="col-md-6 form-floating"> <input type="text" name="interest" value="<?php echo htmlspecialchars($rw1['interest']); ?>" class="form-control" placeholder="Interest"> <label>Interest</label> </div> <div class="col-md-6 form-floating"> <input type="date" name="DOJ" value="<?php echo htmlspecialchars($rw1['DOJ']); ?>" class="form-control" placeholder="Date of Joining"> <label>Date of Joining</label> </div> <div class="col-md-6 form-floating"> <input type="text" name="HOD" value="<?php echo htmlspecialchars($rw1['HOD']); ?>" class="form-control" placeholder="HOD"> <label>HOD</label> </div> <div class="col-md-6 form-floating"> <input type="text" name="Spz" value="<?php echo htmlspecialchars($rw1['Spz']); ?>" class="form-control" placeholder="Specialization"> <label>Specialization</label> </div> <div class="col-md-6 form-floating"> <input type="number" name="priority" value="<?php echo htmlspecialchars($rw1['priority']); ?>" class="form-control" placeholder="Priority"> <label>Priority</label> </div> <div class="col-md-6 form-floating"> <input type="text" name="r_id" value="<?php echo htmlspecialchars($rw1['r_id']); ?>" class="form-control" placeholder="Research ID"> <label>Research ID</label> </div> <div class="col-md-6 form-floating"> <input type="text" name="l_member" value="<?php echo htmlspecialchars($rw1['l_member']); ?>" class="form-control" placeholder=""> </div> </div> <div class="text-center mt-4"> <button type="submit" class="btn btn-warning px-4">Update Now</button> </div> </form> </div> </div> <!-- Update Photo --> <div class="card shadow mb-4"> <div class="card-header"><h6 class="m-0 font-weight-bold text-primary">Update Profile Picture</h6></div> <div class="card-body"> <form action="updateTeacherphotoCode.php" method="post" enctype="multipart/form-data"> <table class="table table-bordered"> <thead> <tr><th>Name</th><th>Photo</th><th>Action</th></tr> </thead> <tbody> <?php $stmt = $con->prepare("SELECT * FROM teacher WHERE TId = ?"); $stmt->bind_param("i", $id); $stmt->execute(); $q2 = $stmt->get_result(); while ($rw1 = $q2->fetch_assoc()) { ?> <tr> <td><input type="text" value="<?php echo htmlspecialchars($rw1['Name']); ?>" readonly><input type="hidden" name="tid" value="<?php echo $id; ?>"></td> <td> <input type="file" name="profile_picture" id="profile_picture"> <br> <img id="preview" src="<?php echo htmlspecialchars($rw1['Photo']); ?>" alt="Profile Picture"> </td> <td><input type="submit" value="Update NOW!!" class="btn btn-warning"></td> </tr> <?php } ?> </tbody> </table> </form> </div> </div> <!-- Update Activity --> <div class="card shadow mb-4"> <div class="card-header"><h6 class="m-0 font-weight-bold text-primary">Update Activity</h6></div> <div class="card-body"> <table class="table table-bordered"> <thead><tr><th>Sl No</th><th>Type</th><th>Details</th><th>Action</th></tr></thead> <tbody> <?php $stmt = $con->prepare("SELECT * FROM tactivity WHERE TId = ?"); $stmt->bind_param("i", $id); $stmt->execute(); $q2 = $stmt->get_result(); while ($rw1 = $q2->fetch_assoc()) { ?> <tr> <form action="update_act_teacher.php" method="post"> <td><?php echo $rw1['slno']; ?></td> <td> <select name="Type"> <option value="JOURNAL" <?php if ($rw1['Type']=='JOURNAL') echo 'selected'; ?>>JOURNAL</option> <option value="CSW" <?php if ($rw1['Type']=='CSW') echo 'selected'; ?>>CSW</option> <option value="BOOKC" <?php if ($rw1['Type']=='BOOKC') echo 'selected'; ?>>BOOKC</option> <option value="MEMBER" <?php if ($rw1['Type']=='MEMBER') echo 'selected'; ?>>MEMBER</option> <option value="PROJECT" <?php if ($rw1['Type']=='PROJECT') echo 'selected'; ?>>PROJECT</option> <option value="OTHERS" <?php if ($rw1['Type']=='OTHERS') echo 'selected'; ?>>OTHERS</option> </select> </td> <td><textarea name="details"><?php echo htmlspecialchars($rw1['details']); ?></textarea></td> <td> <input type="hidden" name="slno" value="<?php echo $rw1['slno']; ?>"> <input type="hidden" name="tid" value="<?php echo $rw1['TId']; ?>"> <input type="submit" value="Submit" class="btn btn-warning"> </td> </form> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> <!-- End Content --> <!-- Footer --> <footer class="sticky-footer bg-white"> <div class="container my-auto"> <div class="copyright text-center my-auto"><span>Copyright © CSIT Team</span></div> </div> </footer> </div> </div> <!-- Scroll to Top--> <a class="scroll-to-top rounded" href="#page-top"><i class="fas fa-angle-up"></i></a> <!-- Logout Modal--> <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"><h5 class="modal-title">Ready to Leave?</h5> <button class="close" type="button" data-dismiss="modal"><span>×</span></button> </div> <div class="modal-body">Thank you for visiting us</div> <div class="modal-footer"> <button class="btn btn-secondary" data-dismiss="modal">Cancel</button> <a class="btn btn-primary" href="logout.php">Logout</a> </div> </div> </div> </div> <!-- Scripts --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <script src="vendor/jquery-easing/jquery.easing.min.js"></script> <script src="js/sb-admin-2.min.js"></script> <script> // Preview selected profile picture window.addEventListener('DOMContentLoaded', function() { document.getElementById('profile_picture').addEventListener('change', function(e) { const reader = new FileReader(); reader.onload = function(event) { document.getElementById('preview').setAttribute('src', event.target.result); } reader.readAsDataURL(e.target.files[0]); }); }); </script> </body> </html> <?php } else { header("location:login.php"); } ?>
💾 Kaydet
İptal