JezK
Edit File: teacherapp_usermanagement.php
<?php session_start(); include("session_check.php"); include("adm_operations.php"); if ($_SESSION['child']['current_academic_id'] != $_SESSION['child']['choosen_academic_id']) { echo "<script>alert('Users can not be managed for past Academic Years');</script>"; echo "<script>location.replace('academicyear_management.php');</script>"; } $operations = new adm_operations(); $rows = $operations->getteacherappusers($_SESSION['child']['log_school_id'], $_SESSION['child']['choosen_academic_id']); include("header.php"); ?> <style> #nav { margin: auto; width: 638px !important; padding-left: 0; padding-right: 0; list-style: none; background: #18b88d; } #nav li { display: inline-block; margin: 0 auto; text-align: center; } #nav li a { display: inline-block; padding: 7px 0; text-align: center; text-decoration: none; color: #FFFFFF; margin: auto; } #nav li:hover, li:active { background: rgb(54, 120, 102); width: 90px; } #nav li.selected { background: rgb(54, 120, 102); } select { width: 62px !important; background-color: #FFF; border: 1px solid #CCC; } .table-condensed>thead>tr>th, .table-condensed>tbody>tr>th, .table-condensed>tfoot>tr>th, .table-condensed>thead>tr>td, .table-condensed>tbody>tr>td, .table-condensed>tfoot>tr>td { padding: 3px; } </style> <script> function activeNdeactive(reference, state) { if (state == 1) { if (confirm("Do you want to activate the Teacher ?")) { $.post('ajax_posts.php', { stfid: reference, sts: state, acs: 'tch' }, function(data) { alert(data); window.location.href = "teacherapp_usermanagement.php"; }); } } else { if (confirm("Do you want to deactivate the Teacher ?")) { $.post('ajax_posts.php', { stfid: reference, sts: state, acs: 'tch' }, function(data) { // alert(data); window.location.href = "teacherapp_usermanagement.php"; }); } } } </script> <body style="overflow-x: hidden;"> <div class="row" style="margin-top:30px;"> <div class="col-md-9 text-left" style="font:Arial, Helvetica, sans-serif;font-style:normal;font-size:24px;"> <i class="fa-solid fa-user " title="User Management" style="font-size:20px;margin: 0px 0px 0px 19px;"></i> User Management </div> </div> <br> <div class="menuu"> <ul id="nav" class="margn_auto"> <li style="border-right:1px solid #FFFFFF;width:214px; text-align:center;margin-left:-3px;font-family:Arial, Helvetica, sans-serif;font-style:normal; font-size:14px;"> <a href="schooladmin_usermanagement.php"><img src="images/user_school-admin-white.png" title="Users for School Admin" style="margin-right:5px;" />Users for School Admin</a> </li> <li class="selected" style="border-right:1px solid #FFFFFF;width:215px; text-align:center; margin-left:-3px; font-family:Arial, Helvetica, sans-serif;font-style:normal; font-size:14px;"> <a href="teacherapp_usermanagement.php"><img src="images/user_teacher-app-white.png" title="Users for Teacher App" style="margin-right:5px;" />Users for Teacher App</a> </li> <li style="width:210px; text-align:center; margin-left:-3px; font-family:Arial, Helvetica, sans-serif;font-style:normal; font-size:14px;"> <a href="driverapp_usermanagement.php"><img src="images/user_driver-app-white.png" title="Users for Driver App" style="margin-right:5px;" />Users for Driver App</a> </li> </ul> </div> <div class="row" style="margin-left:10px;margin-right:10px;"> <div class="col-md-12 centered" style="font-family: Arial, Helvetica, sans-serif;margin-top:30px;"> <table id="myTable" class="table table-condensed table-hover" style="margin-top:-10px;"> <thead> <tr class="info"> <th class="col-md-1 text-center">Sl.No</th> <th>Teacher Name</th> <th>Email</th> <th>Phone Number</th> <th>Status</th> <th class="text-center">Action</th> </tr> </thead> <tbody> <?php $x = 1; if ($rows != 'not') foreach ($rows as $record) { if ($record['teacher_app_access'] == '1') { $sts = 'Active'; $deact = 0; $asts = '<i class="fa fa-ban" title="Deactivate" style="font-size: 13px; color:#ff0000;"></i>'; } else if ($record['teacher_app_access'] == null) { $sts = 'Inactive'; $deact = 1; $asts = '<i class="fa-solid fa-circle-check" title ="Activate" style="font-size: 13px; color:#0F9B0C!important;"></i>'; } else { $sts = 'Deactivated'; $deact = 1; $asts = '<i class="fa-solid fa-circle-check" title ="Activate" style="font-size: 13px; color:#0F9B0C!important;"></i>'; } echo ' <tr> <td class="col-sm-1 text-center" style=" font-size:14px; ">' . $x . '</td> <td style=" font-size:14px;">' . $record['staff_name'] . '</td> <td style=" font-size:14px; ">' . $record['staff_email'] . '</td> <td style=" font-size:14px; ">' . $record['staff_mobile'] . '</td> <td style=" font-size:14px; ">' . $sts . '</td> <td class="text-center"> <a href="javascript:void(0)" onclick="activeNdeactive(' . $record['staff_id'] . ',' . $deact . ')">' . $asts . '</a> </td> </tr>'; $x++; } ?> </tbody> </table> </div> </div> <script type="text/javascript" language="javascript" src="Excel/media/js/jquery.js"></script> <script type="text/javascript" language="javascript" src="Excel/media/js/jquery.dataTables.js"></script> <script type="text/javascript" language="javascript" src="Excel/js/dataTables.tableTools.js"></script> <script type="text/javascript" language="javascript" src="Excel/examples/resources/syntax/shCore.js"></script> <script type="text/javascript" language="javascript" src="Excel/examples/resources/demo.js"></script> <script type="text/javascript" language="javascript" class="init"></script> <script> $(document).ready(function() { $('#myTable').dataTable({ "pageLength": 100, stateSave: true }); }); </script> <!--<div class="some" style="position:fixed;left:0px;bottom:0px;height:30px;width:100%;color: #000000;margin-top:10px; line-height: 30px; height:40px; font-family:open sans;"> <div class="row"> <div class="col-md-12" style="text-align:center;"> © Designed | By : <a href=" # " style="color: #01aee6;">Krify Team</a> </div> </div> </div>--> </body> </html>