BBnepal-Accounts/application/views/admin/installment_delete.php
Sampanna Rimal 9cd05ef3cb commitall
2024-07-10 18:28:19 +05:45

163 lines
10 KiB
PHP

<div class="wraper responsive-width">
<main class="" id="main">
<div class="from-group">
<a href="<?= base_url(); ?>admin/fee-installment"><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">Course Fee Installment List</div>
<div class="fee_table">
<table id="tbl" class="display table-responsive">
<thead>
<tr>
<th>S No</th>
<th>Course Name</th>
<th>Payment option</th>
<th>Amount</th>
<th>Due Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i = 0 ;
$courseunique = array();
// print_r($installment);
foreach($installment as $in){
if(array_search( $in['course_name'],$installment) == false)
{
array_push($courseunique,$in['course_name']);
}
}
$posprev = -1;
foreach($installment as $inst){ $i++; ?>
<tr>
<td><?= $i ?></td>
<?php $pos = array_search($inst["course_name"],$courseunique);
if($posprev != $pos) { ?>
<td><?php echo $inst["course_name"]; $posprev = $pos;?></td>
<?php } else { ?>
<td></td>
<?php } ?>
<td><?= $inst["payment_installment"]?></td>
<td><?= $inst["payable_amount"]?></td>
<td><?= str_replace(',','<br>',$inst["duedates"])?></td>
<td>
<div class="sub_tabbtnsec">
<a data-toggle="modal" href="#deleteModal">
<div class="sub_delbtn" onclick = "installrestore(<?php echo $in['id']; ?>)"><img src="<?= base_url(); ?>assets_admin/images/icons/restore.png" class="restore-icon"></div>
</a>
<div class="sub_delbtn" >
<i class="fa fa-trash" aria-hidden="true" title="Delete permanently"></i>
</div>
</div>
</td>
</tr> <?php $prev = $inst["course_name"]; } ?>
<!--tr>
<td>1</td>
<td>1st standard</td>
<td>Full payment</td>
<td>Rs 5000</td>
<td>Date</td>
<td>
<div class="sub_tabbtnsec">
<a href="<?php echo base_url(); ?>admin/add-edit-fee-installment/">
<div class="sub_editbtn"><i class="fas fa-pencil-alt"></i></div>
</a>
<a data-toggle="modal" href="#deleteModal">
<div class="sub_delbtn" ><i class="fa fa-trash" aria-hidden="true"></i></div>
</a>
</div>
</td>
</tr-->
</tbody>
</table>
</div>
</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>
<input type = "hidden" id = "inid" />
<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($('#inid').val(), 'installment');">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>
<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('1', 'installment');">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 installrestore(icn){
// alert(icn);
$('#inid').val(icn);
}
function restoredata(id, table){
$.ajax({
type : 'POST',
url : "<?php echo base_url(); ?>admin/restore_data",
data : {id : id, table : table},
success:function(resposne){
if(resposne == '1'){
window.location.href = "<?php echo base_url(); ?>admin/fee-installment";
}
}
});
}
</script>