171 lines
8.2 KiB
PHP
171 lines
8.2 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>Buses</h2>
|
||
|
<div class="dashboard-btn-wrap">
|
||
|
<a href="<?php echo base_url()?>add-edit-bus/0">
|
||
|
<button class="btn btn-success btn-sm">+ Add Bus</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">×</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">×</span>
|
||
|
</button>
|
||
|
</div>
|
||
|
|
||
|
<?php } ?>
|
||
|
<div class="dashboard-cover">
|
||
|
|
||
|
<div class="bus-table">
|
||
|
<table id="tbl" class="display dataTable table-responsive">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th>Sl.No</th>
|
||
|
<th>Reg. No</th>
|
||
|
<th>Bus Brand</th>
|
||
|
<th>Seats</th>
|
||
|
<th>Year</th>
|
||
|
<th>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['reg_no']; ?></td>
|
||
|
<td><?php echo $value['bus_brand']; ?></td>
|
||
|
<td><?php echo $value['seats']; ?></td>
|
||
|
<td><?php echo $value['year']; ?></td>
|
||
|
|
||
|
<td>
|
||
|
<div class="sub_tabbtnsec">
|
||
|
<div class="sub_viewbtn" title="View">
|
||
|
<a href="<?php echo base_url()?>view-bus/<?php echo $value['id']; ?>">
|
||
|
<i class="fa fa-eye" aria-hidden="true"></i>
|
||
|
</a>
|
||
|
</div>
|
||
|
<a href="<?php echo base_url()?>add-edit-bus/<?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>
|
||
|
</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<?php } } else{?>
|
||
|
|
||
|
<tr class="text-center"> <td colspan="6"> No Data Found<td></tr>
|
||
|
<?php } ?>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
</main>
|
||
|
<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">×</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_buses');">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 busdel(icn){
|
||
|
//alert(icn);
|
||
|
$('#thid').val(icn);
|
||
|
}
|
||
|
function deletedata(id, table){
|
||
|
$(".alert-dismissible").hide();
|
||
|
$.ajax({
|
||
|
type : 'POST',
|
||
|
url : "<?php echo base_url(); ?>delete-data",
|
||
|
data : {id : id, table : table},
|
||
|
success:function(resposne){
|
||
|
if(resposne == '1'){
|
||
|
window.location.href = "<?php echo base_url(); ?>BustrackingAdmin/bus_list/1";
|
||
|
}else if(resposne == '0'){
|
||
|
window.location.href = "<?php echo base_url(); ?>BustrackingAdmin/bus_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>
|