155 lines
8.2 KiB
PHP
155 lines
8.2 KiB
PHP
<div class="wraper responsive-width">
|
|
<main class="long-tbl-main" id="main">
|
|
<div class="from-group">
|
|
<a href="<?= base_url(); ?>admin/classroom"><button type="button" class="btn btn-success btn-sm btn-dark">Back</button></a>
|
|
</div>
|
|
<div class="admin_tempblock">
|
|
<div class="admin_tempsec">
|
|
<div class="admin_sec">
|
|
<div class="subsec_sec">
|
|
<div class="subject_r subject_r_lng">
|
|
<div class="subject_lsec">
|
|
<div class="subject_lhead">Classroom List <p id="success" style="color:green;"></p></div>
|
|
|
|
<table id="tbl" class="display table-responsive">
|
|
<thead>
|
|
<tr>
|
|
<th>Sl.No</th>
|
|
<th>Classroom</th>
|
|
<th>Course</th>
|
|
<th>Subject</th>
|
|
<th>Teacher</th>
|
|
<!--th>Students</th-->
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php $i=1;
|
|
//echo "<pre>";
|
|
//print_r($final_details);
|
|
// print_r($classroom);
|
|
foreach($final_details as $classrm){
|
|
|
|
// print_r($final_details);
|
|
?>
|
|
|
|
|
|
<tr> <td><?= $i; ?></td>
|
|
<td><?= $classrm['classroom_name'];?></td>
|
|
<td><?= $classrm['course_name']; ?></td>
|
|
<td><?php echo $classrm['subject']; ?></td>
|
|
<td><?php echo $classrm['teacher']; ?></td>
|
|
|
|
<td>
|
|
<div class="sub_tabbtnsec">
|
|
<a data-toggle="modal" onclick = "classres('<?php echo $classrm['classroom_name'];?>')" href="#restoreModal">
|
|
<div class="sub_editbtn"><img src="<?= base_url(); ?>assets_admin/images/icons/restore.png" class="restore-icon"></div>
|
|
</a>
|
|
<a data-toggle="modal" onclick = "classdel('<?php echo $classrm['classroom_name'];?>')" href="#deleteModal">
|
|
<div class="sub_delbtn" >
|
|
<i class="fa fa-trash" aria-hidden="true"></i>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</td></tr>
|
|
<?php $i++; ?>
|
|
<?php } ?>
|
|
</tbody>
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
<div class="viewDoc delete-modal-wrap">
|
|
<div class="modal fade" id="restoreModal" role="dialog">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<div class="delete-modal">
|
|
|
|
<i class="far fa-times-circle"></i>
|
|
<input type = "hidden" id = "resid" />
|
|
<h4>Are you sure?</h4>
|
|
<p>Are you sure you want to restore this item?</p>
|
|
<div class="delete-modal-btn">
|
|
<button type="button" class="subject_addbtn subject_addbtn_red" onclick="restoredata($('#clsid').val(), 'classroom');">Restore</button>
|
|
<button type="button" class="subject_addbtn subject_addbtn_cancel" data-dismiss="modal">Cancel</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="viewDoc delete-modal-wrap">
|
|
<div class="modal fade" id="deleteModal" role="dialog">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<div class="delete-modal">
|
|
<i class="far fa-times-circle"></i>
|
|
<input type = "hidden" id = "clsid" />
|
|
<h4>Are you sure?</h4>
|
|
<p>Are you sure you want to delete this item?</p>
|
|
<div class="delete-modal-btn">
|
|
<button type="button" class="subject_addbtn subject_addbtn_red" onclick="deletedata($('#clsid').val(), 'classroom');">Delete</button>
|
|
<button type="button" class="subject_addbtn subject_addbtn_cancel" data-dismiss="modal">Cancel</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
$(document).ready(function(){
|
|
//table js
|
|
$('#tbl').DataTable( {
|
|
"lengthMenu": [[25,50, 100, 150, -1], [25,50, 100, 150, "All"]]
|
|
} );
|
|
//table js end
|
|
});
|
|
</script>
|
|
<script type="text/javascript">
|
|
function classdel(icn){
|
|
alert(icn);
|
|
$('#clsid').val(icn);
|
|
}
|
|
function classres(icn){
|
|
alert(icn);
|
|
$('#resid').val(icn);
|
|
}
|
|
function restoredata(id, table){
|
|
$('#restoreModal').modal('hide');
|
|
$.ajax({
|
|
type : 'POST',
|
|
url : "<?php echo base_url(); ?>Admin/restore_data",
|
|
data : {id : id, table : table},
|
|
success:function(resposne){
|
|
if(resposne == '1'){
|
|
// $('#success').html('Subject restored successfully.');
|
|
// setTimeout(function() {
|
|
// window.location.href = "<?php echo base_url(); ?>Admin/classroom_deleted";
|
|
// }, 3000);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function deletedata(id, table){
|
|
$.ajax({
|
|
type : 'POST',
|
|
url : "<?php echo base_url(); ?>Admin/delete_classroom_permanent",
|
|
data : {id : id, table : table},
|
|
success:function(resposne){
|
|
if(resposne == '1'){
|
|
window.location.href = "<?php echo base_url(); ?>Admin/classroom_deleted";
|
|
}
|
|
}
|
|
});
|
|
}
|
|
</script>
|