IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="card">
<div class="header">
<h2><strong><?php if(isset($route)): ?>Edit <?php else: ?> Add <?php endif; ?></strong> Bus Route</h2>
</div>
<div class="body">
<?php if(isset($route)): ?>
<?php echo Form::model( $route, ['route' => ['buses.update', $route->idBusRoute], 'method' => 'put','class'=>'form-horizontal'] ); ?>
<?php else: ?>
<?php echo Form::open(['url' => 'school/buses','class'=>'form-horizontal']); ?>
<?php endif; ?>
<div class="row clearfix" style="overflow-x: scroll;">
<table class="table table-bordered" style="min-width:1400px;">
<thead>
<tr>
<th>S.NO.</th>
<th style="width: 100px;">Bus No</th>
<th>Bus Name</th>
<th>Chesis No</th>
<th>Engine No</th>
<th>Seating Capacity</th>
<th>Driver Name</th>
<th>Supporter Name</th>
<th>Contact No</th>
<th></th>
</tr>
</thead>
<tbody id="optional_list">
<tr>
<td class="sno">1</td>
<td style="width: 100px;">
<input class="form-control" type="text" id="busrouterate1" name = "busroute[1][busNo]" required="required">
</td>
<td>
<input class="form-control" type="text" id="busrouterate1" name = "busroute[1][busName]" required="required">
</td>
<td>
<input class="form-control" type="text" id="busrouterate1" name = "busroute[1][chesisNo]" required="required">
</td>
<td>
<input class="form-control" type="text" id="busrouterate1" name = "busroute[1][engineNo]" required="required">
</td>
<td>
<input class="form-control" type="text" id="busrouterate1" name = "busroute[1][seatingCapacity]" required="required">
</td>
<td>
<input class="form-control" type="text" id="busrouterate1" name = "busroute[1][driverName]" required="required">
</td>
<td>
<input class="form-control" type="text" id="busrouterate1" name = "busroute[1][supporterName]" required="required">
</td>
<td>
<input class="form-control" type="text" id="busrouterate1" name = "busroute[1][contactNo]" required="required" minlength="10" maxlength="10" onkeypress = 'return isNumber(event)'>
</td>
</tr>
</tbody>
<tr>
<td colspan="9" style="text-align: right"><input type="button" class="add-row btn btn-sm btn-success" value="Add Row"></td>
</tr>
</table>
</div>
<div class="row clearfix">
<div class="col-sm-8 offset-sm-2">
<?php if(isset($route)): ?>
<?php echo Form::submit('UPDATE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<?php else: ?>
<?php echo Form::submit('SAVE',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>
<?php endif; ?>
<?php echo Form::close(); ?>
</div>
</div>
</div>
</div>
</div
</div>
</div>
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>List Of Bus Route</strong></h2>
</div>
<div class="body table-responsive">
<table class="table table-bordered table-striped table-hover js-basic-example dataTable">
<thead>
<tr>
<th>S.NO.</th>
<th>Bus No</th>
<th>Bus Name</th>
<th>Chesis No</th>
<th>Engine No</th>
<th>Seating Capacity</th>
<th>Driver Name</th>
<th>Supporter Name</th>
<th>Contact No</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
<?php $__currentLoopData = $routes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><?php echo e($i); ?></td>
<td><?php echo e($var->busNo); ?></td>
<td><?php echo e($var->busName); ?></td>
<td><?php echo e($var->chesisNo); ?></td>
<td><?php echo e($var->engineNo); ?></td>
<td><?php echo e($var->seatingCapacity); ?></td>
<td><?php echo e($var->driverName); ?></td>
<td><?php echo e($var->supporterName); ?></td>
<td><?php echo e($var->contactNo); ?></td>
<td>
<a href="<?php echo e(url('school/busdocs/'.$var->idBus.'/upload')); ?>" class="btn btn-raised btn-success waves-effect btn-round">Upload Document</a>
<a href='<?php echo e(url('/school/buses/'.$var->idBus.'/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($var->idBus); ?>" data-type="confirm">DELETE</button>
</td>
</tr>
<?php $i++; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
$(document).ready(function() {
var i = 1;
$(".add-row").click(function(){
i++;
var markup = '<tr><td class="sno">'+i+'</td>\
<td><input class="form-control" type="text" name="busroute['+i+'][busNo]" required="required"></td>\n\
\n\ <td><input class="form-control" type="text" name="busroute['+i+'][busName]" required="required"></td>\n\
\n\ <td><input class="form-control" type="text" name="busroute['+i+'][chesisNo]" required="required"></td>\n\
\n\ <td><input class="form-control" type="text" name="busroute['+i+'][engineNo]" required="required"></td>\n\
\n\ <td><input class="form-control" type="text" name="busroute['+i+'][seatingCapacity]" required="required"></td>\n\
<td><input class="form-control" type="text" name="busroute['+i+'][driverName]" required="required"></td>\n\
<td><input class="form-control" type="text" name="busroute['+i+'][supporterName]" required="required"></td>\n\
<td><input class="form-control" type="text" name="busroute['+i+'][contactNo]" required="required"></td>\n\
<td style="text-align:right;vertical-align: middle;"><input type="button" required="required" class="btn btn-sm btn-danger" value="Delete" id="remove_row"></td></tr>';
$("#optional_list").append(markup);
});
$('#optional_list').on('click', 'input[type="button"]', function () {
$(this).closest('tr').remove();
i = $('.sno:last').text();
});
//Add Input field if others is selecyted
});
$(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 delete this Bus !",
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/buses/')); ?>" +"/"+id,
data: {id:id}
})
.done(function(data) {
swal({
title: "Deleted",
text: "Bus has been successfully deleted",
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 -