IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>List Of Students Having Transport</strong></h2>
</div>
<div class="body table-responsive">
<?php echo Form::open(['method' => 'GET', 'action' => ['School\StudentTransportController@index'], 'class' => 'form-horizontal']); ?>
<div class="row clearfix">
<div class="col-sm-2"></div>
<div class="col-sm-2 form-control-label">
<label for="classname">Financial Year</label>
</div>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::select('idFinancialYear',fys(),null,['class' => 'form-control show-tick ms']); ?>
</div>
</div>
<div class="col-sm-2">
<?php echo Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
</div>
</div>
<?php echo Form::close(); ?>
<br>
<table class="table table-bordered table-striped table-hover js-route dataTable">
<thead>
<tr>
<th>S. No.</th>
<th>EC No.</th>
<th>Name</th>
<th>Class</th>
<th>Section</th>
<th>Route Name</th>
<th>Stop Name</th>
<th>Bus No</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
<?php $__currentLoopData = $stdtransport; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php if(isset($value->student)): ?>
<tr>
<th scope="row"><?php echo e($i); ?></th>
<td><?php echo e($value->student->ecNo); ?></td>
<td><?php echo e($value->student->firstName); ?> <?php echo e($value->student->middleName); ?> <?php echo e($value->student->lastName); ?></td>
<td><?php echo e($value->student->classM->className); ?></td>
<td><?php echo e($value->student->section->sectionName); ?></td>
<td><?php echo e($value->route->routeName); ?></td>
<td><?php echo e(isset($value->stop->stopName) ? $value->stop->stopName : ''); ?></td>
<?php
if($value->idBus != null)
$buses = DB::table('buses')->where('idBus','=',$value->idBus)->first();
else
$buses = DB::table('busroutes')->join('buses','busroutes.idBus','=','buses.idBus')->where('idRoute','=',$value->idRoute)->first();
?>
<td><?php if(isset($buses->busNo)): ?> <?php echo e($buses->busNo); ?> <?php endif; ?></td>
<td>
<a href='<?php echo e(url('/school/stdtransport/'.$value->idStdTransport.'/edit')); ?>' class="btn btn-raised btn-info waves-effect btn-round"><i class="fa fa-edit"></i>Edit</a>
<button class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" data-id="<?php echo e($value->idStdTransport); ?>" data-type="confirm">DELETE</button>
</td>
</tr>
<?php $i++; ?>
<?php endif; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
$(function(){
$('.js-route').DataTable({
dom: 'Bfrtip',
scrollY: "500px",
scrollX: true,
scrollCollapse: true,
fixedColumns: {
left: 1
},
buttons: [
{ extend: 'csv', text: 'Export to Excel',title:'Student Transport List',
exportOptions: {
columns: [0,1,2,3,4,5,6,7]
}
}
]
});
});
$(document).on('click', '.js-sweetalert', function (e) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
e.preventDefault();
var id = $(this).data('id');
swal({
title: "Are you sure?",
text: "Are You sure you want to remove this student from Transport Service!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: true
},
function() {
// console.log('here');
$.ajax({
type: "DELETE",
url: "<?php echo e(url('/school/stdtransport/')); ?>" +"/"+id,
data: {id:id}
})
.done(function(data) {
swal({
title: "Deleted",
text: "Student has been successfully removed from Transport Service",
type: "success"
},function() {
location.reload();
});
})
.error(function(data) {
swal("Oops", "We couldn't connect to the server!", "error");
});
return false;
});
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -