ok
Direktori : /home2/selectio/public_html/thedentalpark.com/admin/ |
Current File : /home2/selectio/public_html/thedentalpark.com/admin/course-list.php |
<?php include "header.php"; if(isset($_GET['del_id']) && $_GET['del_id']!=''){ $id = isset($_GET['del_id']) ? $_GET['del_id'] : ''; $statement = $pdo->prepare("SELECT * FROM tbl_course WHERE id=?"); $statement->execute(array($id)); $edit_result = $statement->fetchAll(PDO::FETCH_ASSOC); $edit_count = $statement->rowCount(); if($edit_count > 0){ $statement = $pdo->prepare("DELETE FROM tbl_course WHERE id=?"); $result=$statement->execute(array($id)); if($result) { $_SESSION['course_success_message'] = 'Course Details Delete Successfully' ; header("Location:course-list.php"); exit; } else { $_SESSION['course_error_message'] = 'Error Occured Not Delete'; header("Location: course-list.php"); exit; } }else{ $_SESSION['course_error_message'] = 'Course Details Not Delete'; header("Location: course-list.php"); exit; } } ?> <div class="content-wrapper"> <section class="content-header"> <h1>Course List</h1> <ol class="breadcrumb"> <li><a href="index.php"><i class="fa fa-dashboard"></i> Home</a></li> <li class="active"> Course List</li> </ol> </section> <div class="clearfix"></div> <section class="content"> <div class="row"> <div class="col-xs-12"> <?php if(!empty($_SESSION['course_error_message'])) { ?> <div class="callout callout-danger"> <p><?php echo $_SESSION['course_error_message']; ?></p> </div> <?php unset($_SESSION['course_error_message']); }?> <?php if(!empty($_SESSION['course_success_message'])){ ?> <div class="callout callout-success"> <p><?php echo $_SESSION['course_success_message']; ?></p> </div> <?php unset($_SESSION['course_success_message']); } ?> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="box box-primary"> <div class="box-header"> <a href="course-add.php" class="btn btn-success btn-sm pull-right"><i class="fa fa-plus-circle"></i> Add Course</a> <span class="btn btn-default btn-sm pull-right filter" style="margin-right: 5px;"> Show/Hide Filter</span> <h3 class="box-title">Course List</h3> </div> <div class="box-body"> <div class="row" id="filter"> <div class="col-sm-3"> <div class="form-group"> <label class="control-label" for="status">College Name</label> <select name="college_id" class="form-control select2" style="width:100%" id="college_id" required="required"> <option value="">Select College Name</option> <?php $statement = $pdo->prepare("SELECT * FROM `tbl_college` where status=1"); $statement->execute(); $location_result = $statement->fetchAll(PDO::FETCH_ASSOC); foreach ($location_result as $result) { ?> <option value="<?=$result['id']?>"><?=$result['college_name']?></option> <?php } ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label class="control-label" for="status">Status</label> <select name="status" class="form-control select2" style="width:100%" id="status"> <option value="1">Active</option> <option value="0">In-Active</option> <option value="">All Status</option> </select> </div> </div> </div> <div class="clearfix"></div> <div class="table-responsive"> <table id="StData" class="table table-striped table-bordered table-condensed table-hover" style="margin-bottom:5px;"> <thead> <tr> <td colspan="10" class="p0"><input type="text" class="form-control b0" name="search_table" id="search_table" placeholder="Search Here" style="width:100%;background-color: darkblue;color: white;"></td> </tr> <tr class="active"> <th style="width:100px;">Actions</th> <th>S.No</th> <th>College Name</th> <th>Course Name</th> <th>Status</th> <th>Created Date</th> </tr> </thead> <tbody> <tr> <td colspan="10" class="dataTables_empty"><center> Loading Pls Wait Data</center></td> </tr> </tbody> </table> </div> <div class="clearfix"></div> </div> </div> </div> </div> </section> <?php include "footer.php";?> <script> $(document).ready(function(){ $('#filter').hide(); $('.filter').click(function(){ $("#filter").slideToggle(); return false; }); }); </script> <script type="text/javascript"> <?php $columns = "0, 1, 2, 3, 4, 5, 6, 7, 8"; $data_table = " var search_table = $('#search_table').val(); var college_id = $('#college_id').val(); var status = $('#status').val(); var table = $('#StData').DataTable({ 'ajax' : { url: 'data-tables/course-data-table.php', data:{search:search_table, status:status,college_id}, type: 'POST'}, bFilter: true, bDestroy: true, searching: true,pageLength: 10, 'buttons': [ { extend: 'copyHtml5', 'footer': false, exportOptions: { columns: [ $columns ] } }, { extend: 'excelHtml5', 'footer': false, exportOptions: { columns: [ $columns ] } }, { extend: 'csvHtml5', 'footer': false, exportOptions: { columns: [ $columns ] } }, { extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'A4', 'footer': false, exportOptions: { columns: [ $columns ] } }, { extend: 'colvis', text: 'Columns'}, ] });"; ?> $(document).ready(function() { get_data(); function get_data(){ <?=$data_table?> } $('#search_table').keyup(function() { get_data(); document.getElementById("search_table").focus(); }); $('#status, #college_id').change(function() { get_data(); }); $("#StData").on('click', '.course_delete', function() { if (!confirm("Confirm Want to Delete This Course?")) { return false; } }); }); function DynamicInActive(id){ var result = confirm("Confirm Want to In-Active This Course?"); if (result) { $.ajax({ type: 'POST', url: 'api/delete.php', data: {type:'dynamic_in_active',delete_id:id, table: 'tbl_course'}, success: function(response) { console.log(response); get_data(); } }); } } function DynamicActive(id){ var result = confirm("Confirm Want to Active This Course?"); if (result) { $.ajax({ type: 'POST', url: 'api/delete.php', data: {type:'dynamic_active',delete_id:id, table:'tbl_course'}, success: function(response) { console.log(response); get_data(); } }); } } function get_data(){ <?=$data_table?> } </script>