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

175 lines
9.1 KiB
PHP
Raw Permalink 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/teacher"><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 Teacher List <p id="success" style="color:green;"></p></div>
<table id="tbl" class="display">
<thead>
<tr>
<th>Sl.No</th>
<th>Profile</th>
<th>User Name</th>
<th>Name</th>
<th>Email</th>
<th>Mobile</th>
<th>Address</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i=1; foreach($teacher as $teach){
?>
<tr>
<td><?= $i; ?></td>
<td><img src="<?= base_url(); ?>assets_admin/images/teacher-profile/<?= $teach['photo']; ?>" alt="Profile Picture" width="50px;" height="50px;"></td>
<td><?= $teach['teacherId']; ?></td>
<td><?= $teach['teacher_name']; ?></td>
<td><div class="email-width" title="<?= $teach['email']; ?>"><?= $teach['email']; ?></div></td>
<td><?= $teach['mobile']; ?></td>
<td><?= $teach['address']; ?></td>
<td>
<div class="sub_tabbtnsec">
<a data-toggle="modal" onclick = "teachdel(<?php echo $teach['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 = "teachdel(<?php echo $teach['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="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>
<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('<?= $teach['id']; ?>', 'teacher');">Delete</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="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 = "thid" value = ''/>
<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($('#thid').val(), 'teacher');">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 = "tid" value = '' />
<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($('#tid').val(), 'teacher');">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 teachdel(icn){
alert(icn);
$('#tid').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/teacher_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'){
// $('#success').html('Data deleted successfully.');
// setTimeout(function() {
window.location.href = "<?php echo base_url(); ?>Admin/teacher_deleted";
// }, 3000);
}
}
});
}
</script>