📁 File Manager
🏠 /
/
home
/
u857492117
/
domains
/
mangaldaicollege.org
/
public_html
/
adminpanel
Dosya Düzenle: update_teacher.php
<?php session_start(); include 'connect.php'; if (isset($_SESSION['Dept_head'])){ $email = $_SESSION['Dept_head']; $df = "select * from deptLog where Email = '$email'"; $qf = mysqli_query($con,$df); if ($rf=mysqli_fetch_array($qf)) { $deptName = $rf['DeptName']; $_SESSION['Dept_Name'] = $deptName; } ?> <!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"> <meta name="description" content=""> <meta name="author" content=""> <title>Dashboard Mangaldai College</title> <!-- Custom fonts for this template--> <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet"> <!-- Custom styles for this template--> <link href="css/sb-admin-2.min.css" rel="stylesheet"> <script> document.getElementById('profile_picture').addEventListener('change', function(e) { const reader = new FileReader(); reader.onload = function(e) { document.getElementById('preview').setAttribute('src', e.target.result); } reader.readAsDataURL(e.target.files[0]); }); </script> <style> /* Customize the textarea element */ textarea { width: 100%; height: 150px; padding: 10px; border: 1px solid #ccc; border-radius: 4px; resize: vertical; } </style> <!-- for counter css --> </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 static-top shadow"> <!-- Sidebar Toggle (Topbar) --> <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3"> <i class="fa fa-bars"></i> </button> <!-- Topbar Search --> <!-- search bar here --> <!-- Topbar Navbar --> <ul class="navbar-nav ml-auto"> <!-- Nav Item - Search Dropdown (Visible Only XS) --> <!-- mobile search bar here --> <!-- Nav Item -Outsider Message --> <li class="nav-item dropdown no-arrow mx-1"> <a class="nav-link dropdown-toggle" href="#" id="alertsDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <!-- Counter - Alerts --> <!-- <span class="badge badge-danger badge-counter">3+</span> --> </a> <!-- Dropdown - Alerts --> <!-- Nav Item - User Information --> <li class="nav-item dropdown no-arrow"> <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="mr-2 d-none d-lg-inline text-gray-600 small"><font color="red"><b><?php echo $_SESSION['Dept_Name']; ?></b></font></span> <i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i> </a> <!-- Dropdown - User Information --> <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in" aria-labelledby="userDropdown"> <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"> <h1 class="h3 mb-2 text-gray-800"></h1> <p class="mb-4"></p> <div class="card shadow mb-4"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Update profile.</h6> </div> <div class="card-body"> <div class="table-responsive"> <form action="updateTeacherCode.php" method="post" enctype="multipart/form-data"> <table class="table table-bordered" width="100%" cellspacing="0"> <thead> <tr> <th>Name</th> <th>Address</th> <th>Email</th> <th>Phone</th> <th>Designation</th> <th>Qualification</th> <th>Interest</th> <th>Date Of Joining </th> <th>HOD </th> <th>Spz</th> <th>priority </th> <th>r_id </th> <th>l_member</th> <th>Action</th> </tr> </thead> <tbody> <?php $id = $_GET['id']; $sql2 = "select * from teacher where TId = '$id'"; $q2 = mysqli_query($con, $sql2); while($rw1 = mysqli_fetch_array($q2)){ ?> <tr> <td><input type="text" name="Tname" value="<?php echo $rw1['Name']; ?>"> <input type="hidden" name="tid" value="<?php echo $id; ?>"></td> <td><input type="text" name="Address" value="<?php echo $rw1['Address']; ?>"></td> <td><input type="text" name="Email" value="<?php echo $rw1['Email']; ?>"></td> <td><input type="text" name="Phone" value="<?php echo $rw1['Phone']; ?>"></td> <td><input type="text" name="Designation" value="<?php echo $rw1['Designation']; ?>"></td> <td><input type="text" name="qualification" value="<?php echo $rw1['qualification']; ?>"></td> <td><input type="text" name="interest" value="<?php echo $rw1['interest']; ?>"></td> <td><input type="text" name="DOJ" value="<?php echo $rw1['DOJ']; ?>"></td> <td><input type="text" name="HOD" value="<?php echo $rw1['HOD']; ?>"> </td> <td><input type="text" name="Spz" value=" <?php echo $rw1['Spz']; ?>"></td> <td> <input type="text" name="priority" value="<?php echo $rw1['priority']; ?>"></td> <td> <input type="text" name="r_id" value="<?php echo $rw1['r_id']; ?>"></td> <td> <input type="text" name="l_member" value="<?php echo $rw1['l_member']; ?>"></td> <td><input type="submit" value="Update NOW" class="btn btn-warning"></td> </tr> <?php } ?> </table> </form> </div> </div> </div> </div> <div class="container-fluid"> <h1 class="h3 mb-2 text-gray-800"></h1> <p class="mb-4"></p> <div class="card shadow mb-4"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Update profile Picture</h6> </div> <div class="card-body"> <div class="table-responsive"> <form action="updateTeacherphotoCode.php" method="post" enctype="multipart/form-data"> <table class="table table-bordered" width="100%" cellspacing="0"> <thead> <tr> <th>Name</th> <th>Photo </th> <th>Action</th> </tr> </thead> <tbody> <?php $id = $_GET['id']; $sql2 = "select * from teacher where TId = '$id'"; $q2 = mysqli_query($con, $sql2); while($rw1 = mysqli_fetch_array($q2)){ ?> <tr> <td><input type="text" name="Tname" value="<?php echo $rw1['Name']; ?>"> <input type="hidden" name="tid" value="<?php echo $id; ?>"></td> <td> <input type="file" name="profile_picture" id="profile_picture"> <?php $photoPath = $rw1['Photo']; $imageSize = getimagesize($photoPath); $width = $imageSize[0]; // Width of the image in pixels $height = $imageSize[1]; // Height of the image in pixels $maxSize = 200; // Maximum width or height for the preview image // Check if a new file is selected if (isset($_FILES['profile_picture']) && $_FILES['profile_picture']['error'] === UPLOAD_ERR_OK) { $tmpFilePath = $_FILES['profile_picture']['tmp_name']; // Get the new dimensions for the preview image $newImageSize = getimagesize($tmpFilePath); $newWidth = $newImageSize[0]; $newHeight = $newImageSize[1]; // Move the uploaded file to the desired location $newPhotoPath = "path/to/save/updated_profile_picture.jpg"; move_uploaded_file($tmpFilePath, $newPhotoPath); // Update the photoPath variable to the new file path $photoPath = $newPhotoPath; } else { // Use the original profile picture path $photoPath = $rw1['Photo']; // Calculate the new dimensions to fit within the maximum size while maintaining aspect ratio if ($width > $height) { $newWidth = $maxSize; $newHeight = $height * ($maxSize / $width); } else { $newHeight = $maxSize; $newWidth = $width * ($maxSize / $height); } } ?> <img id="preview" src=../<?php echo $photoPath; ?> alt="Current Profile Picture" style="width: <?php echo $newWidth; ?>px; height: <?php echo $newHeight; ?>px;"> </td> <td><input type="submit" value="Update NOW" class="btn btn-warning"></td> </tr> <?php } ?> </table> </form> </div> </div> </div> </div> <!-- Begin Page Content --> <div class="container-fluid"> <h1 class="h3 mb-2 text-gray-800"></h1> <p class="mb-4"></p> <div class="card shadow mb-4"> <div class="card-header py-3"> <h6 class="m-0 font-weight-bold text-primary">Update Activity</h6> </div> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> <thead> <tr> <th>Sl No</th> <th>Type</th> <th>Details</th> <th>Action</th> </tr> </thead> <tbody> <?php $sql2 = "SELECT * FROM tactivity WHERE TId ='$id'"; $q2 = mysqli_query($con, $sql2); while ($rw1 = mysqli_fetch_array($q2)) { ?> <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> <!-- Add more options as needed --> </select> </td> <td> <textarea name="details"><?php echo $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> <!-- Content Row --> <!-- /.container-fluid --> <!-- End of Main 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> <!-- End of Footer --> </div> <!-- End of Content Wrapper --> </div> <!-- End of Page Wrapper --> <!-- Scroll to Top Button--> <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" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5> <button class="close" type="button" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body">Thank you for visiting us</div> <div class="modal-footer"> <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button> <a class="btn btn-primary" href="logout.php">Logout</a> </div> </div> </div> </div> <!-- Bootstrap core JavaScript--> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Core plugin JavaScript--> <script src="vendor/jquery-easing/jquery.easing.min.js"></script> <!-- Custom scripts for all pages--> <script src="js/sb-admin-2.min.js"></script> <!-- Page level plugins --> <script src="vendor/chart.js/Chart.min.js"></script> <!-- Page level custom scripts --> <script src="js/demo/chart-area-demo.js"></script> <script src="js/demo/chart-pie-demo.js"></script> <script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><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 src="vendor/chart.js/Chart.min.js"></script> <script src="js/demo/chart-area-demo.js"></script> <script src="js/demo/chart-pie-demo.js"></script> <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 src="vendor/datatables/jquery.dataTables.min.js"></script> <script src="vendor/datatables/dataTables.bootstrap4.min.js"></script> <script src="js/demo/datatables-demo.js"></script> <?php } else{ header("location:login.php"); } ?> </body> </html>
💾 Kaydet
İptal