BBnepal-Accounts/application/views/admin/course-deleted.php

149 lines
7.8 KiB
PHP
Raw Normal View History

2024-07-10 12:43:19 +00:00
<div class="wraper responsive-width">
<main class="" id="main">
<div class="from-group">
<a href="<?= base_url(); ?>admin/course"><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">Deleted Course List <p id="success" style="color:green;"></p></div>
<div class="view_del-subjects"><a href="<?php echo base_url(); ?>Admin/course_deleted">View Deleted Items</a></div>
<table id="tbl" class="display table-responsive">
<thead>
<tr>
<th>Sl.No</th>
<th>Course Name</th>
<th>Subject Name</th>
<th>Course Fee</th>
<th>Application Fee</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i=1; foreach($course as $cur){
$data = $this->Admin_model->get_subjectName($cur['subject_id']);
?>
<tr>
<td><?= $i; ?></td>
<td><?= $cur['course_name']; ?></td>
<td><?php foreach($data as $val){ echo $val['subject_name'].'<br>'; } ?></td>
<td><?= $cur['course_fee']; ?></td>
<td><?= $cur['application_fee']; ?></td>
<td>
<div class="sub_tabbtnsec sub_tabbtnsec_restore ">
<a data-toggle="modal" onclick = "coursedel(<?php echo $cur['id']; ?>)" 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 = "coursedel(<?php echo $cur['id']; ?>)" href="#deleteModal">
<div class="sub_delbtn" >
<i class="fa fa-trash" aria-hidden="true"></i>
</div>
</a>
</div>
</td>
</tr>
<?php $i++; } ?>
</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">&times;</button>
<div class="delete-modal">
<i class="far fa-times-circle"></i>
<input type = "hidden" id = "crid" />
<h4>Are you sure?</h4>
<p>Are you sure you want to restore this subject?</p>
<div class="delete-modal-btn">
<button type="button" class="subject_addbtn subject_addbtn_red" onclick="restoredata($('#crid').val(), 'course');">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">&times;</button>
<div class="delete-modal">
<i class="far fa-times-circle"></i>
<input type = "hidden" id = "crid" />
<h4>Are you sure?</h4>
<p>Are you sure you want to delete this item permanently?</p>
<div class="delete-modal-btn">
<button type="button" class="subject_addbtn subject_addbtn_red" onclick="deletedata($('#crid').val(), 'course');">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 coursedel(icn){
// alert(icn);
$('#crid').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/course_deleted";
// }, 3000);
}
}
});
}
</script>
<script type="text/javascript">
function deletedata(id, table){
$('#deleteModal').modal('hide');
$.ajax({
type : 'POST',
url : "<?php echo base_url(); ?>Admin/delete_data_permanent",
data : {id : id, table : table},
success:function(resposne){
if(resposne == '1'){
window.location.href = "<?php echo base_url(); ?>Admin/course_deleted";
}
}
});
}
</script>