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

179 lines
8.7 KiB
PHP

<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets-bustracking/css/style-drivers.css">
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets-bustracking/css/jquery.dataTable.min.css">
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets-bustracking/css/bootstrap4-toggle.min.css">
<main class="common_margin" id="main">
<div class="main-wrap">
<div class="common-heading">
<h2>Drivers</h2>
<div class="dashboard-btn-wrap">
<a href="<?php echo base_url()?>add-edit-driver/0">
<button class="btn btn-success btn-sm">+ Add Driver </button>
</a>
</div>
</div>
<?php if($this->session->flashdata('success')) { ?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<p><?php echo $this->session->flashdata('success') ?></p>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<?php } ?>
<?php if($this->session->flashdata('failed')) { ?>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<p><?php echo $this->session->flashdata('failed') ?></p>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<?php } ?>
<table class="table dash-table" id="tbl">
<thead>
<tr>
<th scope="col" class="dash-th">SI.No</th>
<th scope="col" class="dash-th">Name</th>
<th scope="col" class="dash-th rooms-th">Contact</th>
<th scope="col" class="dash-th rooms-th">Driver's License</th>
<th scope="col" class="dash-th rooms-th">DOB</th>
<th scope="col" class="dash-th rooms-th">Address</th>
<th scope="col" class="dash-th-action">Action</th>
</tr>
</thead>
<tbody>
<?php if (!empty($result) && isset($result)) {
$si_no=0;
foreach ($result as $key => $value) {
$si_no++;
?>
<tr>
<td><?php echo $si_no; ?></td>
<td><?php echo $value['name'] ?></td>
<td class="rooms-td"><?php echo $value['contact_number'] ?></td>
<td class="rooms-td"><?php echo $value['licence'] ?></td>
<td class="rooms-td"><?php echo $value['dob'] ?></td>
<td class="rooms-td"><?php echo $value['address'] ?></td>
<td class="preview-img">
<div class="sub_viewbtn" title="View">
<a href="<?php echo base_url()?>view-driver/<?php echo $value['id']; ?>">
<i class="fa fa-eye" aria-hidden="true"></i>
</a>
</div>
<a href="<?php echo base_url()?>add-edit-driver/<?php echo $value['id']; ?>">
<div class="sub_editbtn">
<i class="fas fa-pencil-alt"></i>
</div>
</a>
<a data-toggle="modal" onclick = "driverdel(<?php echo $value['id']; ?>)" href="#deleteModal">
<div class="sub_delbtn">
<i class="fa fa-trash" aria-hidden="true"></i>
</div>
</a>
</td>
</tr>
<?php } } else{?>
<tr class="text-center"> <td colspan="6"> No Data Found<td></tr>
<?php } ?>
</tbody>
</table>
<!-- <div class="table-footer">
<div class="table-footer-left">
<p>Showing 1 of 200 entries</p>
</div>
<div class="table-footer-right">
<p class="footer-right-prev">Previous</p>
<p class="tab-footer-count">1</p>
<p class="footer-right-next">Next</p>
</div>
</div> -->
</div>
</div>
</main>
<!--End right-top side-->
</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 = "thid" />
<h4>Are you sure?</h4>
<p>You want to delete this item?</p>
<div class="delete-modal-btn">
<button type="button" class="subject_addbtn subject_addbtn_red" onclick="deletedata($('#thid').val(), 'bt_drivers');">Delete</button>
<button type="button" class="subject_addbtn subject_addbtn_cancel" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!--End right-top side-->
<script>
function driverdel(icn){
//alert(icn);
$('#thid').val(icn);
}
function deletedata(id, table){
$(".alert-dismissible").hide();
$.ajax({
type : 'POST',
url : "<?php echo base_url(); ?>delete-driver",
data : {id : id, table : table},
success:function(resposne){
if(resposne == '1'){
window.location.href = "<?php echo base_url(); ?>BustrackingAdmin/drivers_list/1";
}else if(resposne == '0'){
window.location.href = "<?php echo base_url(); ?>BustrackingAdmin/drivers_list/0";
}
}
});
}
</script>
<!-- <script src="assets/js/jquery-3.2.1.slim.min.js"></script> -->
<script src="<?php echo base_url();?>assets-bustracking/js/jquery-3.4.1.min.js" ></script>
<script src="<?php echo base_url();?>assets-bustracking/js/popper.min.js"></script>
<script src="<?php echo base_url();?>assets-bustracking/js/bootstrap.min.js"></script>
<script defer src="<?php echo base_url();?>assets-bustracking/js/all.js"></script>
<script defer src="<?php echo base_url();?>assets-bustracking/js/main.js"></script>
<script src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.1/js/bootstrap-select.min.js"></script>
<script src="<?php echo base_url();?>assets-bustracking/owl-carousel/js/owl.carousel.min.js"></script>
<script>
$(document).ready(function(){
$('.user-drpdown').click(function(){
$('.drpdown-items').toggle();
});
});
//table js
$('#tbl').DataTable( {
"lengthMenu": [[5,10, 25, 50, -1], [5,10, 25, 50, "All"]]
} );
//table js end
//multiple select js start
$('select').selectpicker();
//multiple select js end
</script>
<script src="<?php echo base_url();?>assets-bustracking/js/jquery-3.4.1.min.js" ></script>
<script src="<?php echo base_url();?>assets-bustracking/js/bootstrap.min.js"></script>
<script src="<?php echo base_url();?>assets-bustracking/js/bootstrap4-toggle.min.js"></script>
<script src="<?php echo base_url();?>assets-bustracking/js/jquery.dataTable.min.js"></script>