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

175 lines
8.5 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="row dash-main-row">
<div class="col-md-12 col-lg-12 p-0">
<div class="common-heading">
<h2>Routes</h2>
<div class="block-heads-right">
<a href="<?php echo base_url()?>route-batch-list" style="display: inline-block;">
<button type="button" class="btn btn-success add-drivers-btn" > Assign Route</button>
</a>
<a href="<?php echo base_url()?>add-edit-route/0">
<button type="button" class="btn btn-success add-drivers-btn" > + Add Route</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 id="tbl" class="display dataTable table-responsive" >
<thead>
<tr>
<th scope="col" class="dash-th">SI.No</th>
<th scope="col" class="dash-th">Place Name</th>
<th scope="col" class="dash-th rooms-th">Latitude</th>
<th scope="col" class="dash-th rooms-th">Longitude</th>
<th scope="col" class="dash-th rooms-th">Driver</th>
<th scope="col" class="dash-th rooms-th">Bus</th>
<th scope="col" class="dash-th rooms-th">No of Stops</th>
<th scope="col" class="dash-th-action">Action</th>
</tr>
</thead>
<tbody>
<?php if (isset($result) && !empty($result)) {
$no=0;
foreach ($result as $key => $value) { $no++;?>
<tr>
<td ><?php echo $no; ?></td>
<td><?php echo $value['route_name']; ?></td>
<td class="rooms-td"><?php echo $value['latitude']; ?></td>
<td class="rooms-td"><?php echo $value['longitude']; ?></td>
<td class="rooms-td"><?php echo $value['driver_name']; ?></td>
<td class="rooms-td"><?php echo $value['bus_name']; ?></td>
<td class="rooms-td"><?php echo $value['stops']; ?></td>
<td class="preview-img">
<a href="<?php echo base_url()?>view-route/<?php echo $value['id']; ?>">
<div class="sub_viewbtn">
<i class="fa fa-eye" aria-hidden="true"></i>
</div>
</a>
<a href="<?php echo base_url()?>add-edit-route/<?php echo $value['id']; ?>">
<div class="sub_editbtn">
<i class="fas fa-pencil-alt"></i>
</div>
</a>
<a data-toggle="modal" onclick = "busdel(<?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="8">No Data Found</td>
</tr>
<?php } ?>
</tbody>
</table>
</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_routes');">Delete</button>
<button type="button" class="subject_addbtn subject_addbtn_cancel" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
</div>
</div>
<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/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>
function busdel(icn){
//alert(icn);
$('#thid').val(icn);
}
function deletedata(id, table){
$(".alert-dismissible").hide();
$.ajax({
type : 'POST',
url : "<?php echo base_url(); ?>delete-route",
data : {id : id, table : table},
success:function(resposne){
if(resposne == '1'){
window.location.href = "<?php echo base_url(); ?>BustrackingAdmin/routes_list/1";
}else if(resposne == '0'){
window.location.href = "<?php echo base_url(); ?>BustrackingAdmin/routes_list/0";
}
}
});
}
</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>
</body>
</html>