IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="card">
<div class="header">
<h2><strong>Leave Management</strong></h2>
</div>
<div class="body">
<?php if(isset($leave)): ?>
<?php echo Form::model( $leave, ['route' => ['hostel-leaves.update', $leave->idHosteliteLeave], 'method' => 'put','class'=>'form-horizontal'] ); ?>
<?php else: ?>
<?php echo Form::open(['url' => 'school/hostel-leaves','class'=>'form-horizontal','id'=>'form']); ?>
<?php endif; ?>
<div class="row clearfix">
<div class="col-sm-4 form-control-label required">
<label for="classname">Select Student</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::select('idHostelite',$students,null,['class' => 'form-control show-tick ms select2','required'=>'required']); ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-4 form-control-label required">
<label for="classname">Form Date</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::text('fromDate',null,['class' => 'form-control datepicker','required'=>'required']); ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-4 form-control-label required">
<label for="classname">To Date</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::text('toDate',null,['class' => 'form-control datepicker','required'=>'required']); ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-4 form-control-label required">
<label for="classname">Reason</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::textarea('remarks',null,['class' => 'form-control','size'=>'30x2']); ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-8 offset-sm-2">
<?php if(isset($leave)): ?>
<?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 class="col-sm-6">
<div class="card">
<div class="header">
<h2><strong>List Of Leaves</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>Name</th>
<th>Form Date</th>
<th>To Date</th>
<th>Reason</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
<?php $__currentLoopData = $leaves; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><?php echo e($i); ?></td>
<td><?php echo e($var->name); ?></td>
<td><?php echo e($var->fromDate); ?></td>
<td><?php echo e($var->toDate); ?></td>
<td><?php echo e($var->remarks); ?></td>
<td>
<a href='<?php echo e(url('/school/hostel-leaves/'.$var->idHosteliteLeave.'/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->idHosteliteLeave); ?>" 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).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 Leave!",
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/hostel-leaves/')); ?>" +"/"+id,
data: {id:id}
})
.done(function(data) {
swal({
title: "Deleted",
text: "Leave 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 -