ok
Direktori : /home/ngwcolle/public_html/LIBRARY-NGWC/admin/ajax/ |
Current File : //home/ngwcolle/public_html/LIBRARY-NGWC/admin/ajax/promote_class.php |
<link rel="stylesheet" href=",,/assets/js/plugins/datatables/dataTables.bootstrap4.min.css"> <link rel="stylesheet" id="css-main" href="../assets/css/codebase.min.css"> <?php // session_start(); //error_reporting(0); // include('../includes/config.php'); include('../includes/dbconnection.php'); // if (strlen($_SESSION['adid']==0)) { // header('location:logout.php'); if(!empty($_POST)) { $output = ''; // $name = mysqli_real_escape_string($con, $_POST["name"]); // $address = mysqli_real_escape_string($connect, $_POST["address"]); // $gender = mysqli_real_escape_string($connect, $_POST["gender"]); // $designation = mysqli_real_escape_string($connect, $_POST["designation"]); $name = $_POST["lclass"]; // $assigndate=$_POST['assigndate']; $age=$_POST['uclass']; // $desc=$_POST['desc']; // $minage=$_POST['minage']; // $nextclass=$_POST['lastclassclass']; // $sql="UPDATE tblclass set nextclass=:nextclass where id=:id"; // $query=$dbh->prepare($sql); // $query->bindParam(':nextclass',$age,PDO::PARAM_INT); // // $query->bindParam(':nextclass',$name,PDO::PARAM_STR); // $query->bindParam(':id',$name,PDO::PARAM_INT); $update = $dbh->prepare("UPDATE tblclass SET nextclass='$age' WHERE id=$name"); // $update->bindParam(':settlementid', $settle_id); // $update->execute(); // $query->bindParam(':startdate',$age); // $query->bindParam(':nextclass',$nextclass); // $query->bindParam(':minage',$minage); // $query->bindParam(':status',1); // $query->execute(); if($update->execute()) { $cnt=0; $output .= '<label class="text-success">Data Updated</label>'; // $select_query = "SELECT * FROM "; // $result = mysqli_query($con, $select_query); $select = $dbh->prepare("SELECT tc.*,sum(ts.strength)as tot,count(ts.sectioncode) as counts from tblclass tc left join tblsection ts on tc.id=ts.classid GROUP by tc.id order by tc.id asc"); $select->execute(); $output .= ' <table class="table table-bordered table-striped table-vcenter js-dataTable-full-pagination"> <tr> <th class="text-center">ID</th> <th>Class Name</th> <th>Class Code</th> <th>No of Sections</th> <th>Student Strength</th> <th class="d-none d-sm-table-cell">Creation Date</th> <th class="d-none d-sm-table-cell" style="width: 15%;">Action</th> </tr> '; while($row=$select->fetch(PDO::FETCH_OBJ)){ { $cnt=$cnt+1; $active="Exit"; if(isset($row->status)){ $active="Active"; } $output .= ' <tr> <td>' . $cnt . '</td> <td>' . $row->classname . '</td> <td>' . $row->classcode . '</td> <td class="d-none d-sm-table-cell"> <span class="badge badge-primary">'.$row->counts.'</span></td> <td class="d-none d-sm-table-cell"> <span class="badge badge-primary">'.$row->tot.'</span></td> <td class="d-none d-sm-table-cell"> <span class="badge badge-primary">'.$row->startdate.'</span></td> "<td><a href="edit.php?id='.$row->id.'" onclick="return confirm(\'Are you sure you want to delete?\');"> <i class="fa fa-trash fa-delete" aria-hidden="true"></i> </a></td> </tr> '; } } $output .= '</table>'; } echo $output; } ?> <script src="../assets/js/core/jquery.min.js"></script> <script src="../assets/js/core/popper.min.js"></script> <script src="../assets/js/core/bootstrap.min.js"></script> <script src="../assets/js/core/jquery.slimscroll.min.js"></script> <script src="../assets/js/core/jquery.scrollLock.min.js"></script> <script src="../assets/js/core/jquery.appear.min.js"></script> <script src="../assets/js/core/jquery.countTo.min.js"></script> <script src="../assets/js/core/js.cookie.min.js"></script> <script src="../assets/js/codebase.js"></script> <!-- Page JS Plugins --> <script src="../assets/js/plugins/datatables/jquery.dataTables.min.js"></script> <script src="../assets/js/plugins/datatables/dataTables.bootstrap4.min.js"></script> <!-- Page JS Code --> <script src="../assets/js/pages/be_tables_datatables.js"></script>