IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-lg-5 col-md-5 col-sm-5">
<div class="card">
<div class="header">
<h2><strong><?php if(isset($holiday)): ?>Edit <?php else: ?> Add <?php endif; ?></strong> Event / Holiday
</h2>
</div>
<div class="body">
<?php if(isset($holiday)): ?>
<?php echo Form::model($holiday, ['method' => 'PATCH', 'action' => ['School\HolidayController@update', $holiday->idHoliday], 'class' => 'form-horizontal']); ?>
<?php else: ?>
<?php echo Form::open(['url' => 'school/holidays', 'class' => 'form-horizontal']); ?>
<?php endif; ?>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname" class="required">Class</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::select('idClass',$classes,null,['class' => 'form-control show-tick ms']); ?>
<?php if($errors->has('idClass')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('idClass')); ?></strong>
</label>
<?php endif; ?>
<span id='classerror'></span>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname" class="required">Select Type</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::select('type',getHolidaytype(),null,['class' => 'form-control show-tick ms']); ?>
<?php if($errors->has('type')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('type')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname" class="required">Event / Holiday Name</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::text('holidayName',null,['class' => 'form-control show-tick ms']); ?>
<?php if($errors->has('holidayName')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('holidayName')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname" class="required">From Date</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::text('fromDate',null,['class' => 'form-control datepicker']); ?>
<?php if($errors->has('fromDate')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('fromDate')); ?></strong>
</label>
<?php endif; ?>
<span id='fdate_error'></span>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-5 form-control-label">
<label for="classname" class="required">To Date</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php echo Form::text('toDate',null,['class' => 'form-control datepicker']); ?>
<?php if($errors->has('toDate')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('toDate')); ?></strong>
</label>
<?php endif; ?>
<span id='todate_error'></span>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-8 offset-sm-2">
<?php if(isset($holiday)): ?>
<?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-7">
<div class="card">
<div class="header">
<h2><strong>Holidays</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>Type</th>
<th>Class</th>
<th>Holiday Name</th>
<th>From Date</th>
<th>To Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
<?php $__currentLoopData = $holidays; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<th scope="row"><?php echo e($i); ?></th>
<td><?php echo e($var->type); ?></td>
<td><?php if(isset($var->className)): ?> <?php echo e($var->className); ?> <?php else: ?> All <?php endif; ?> </td>
<td><?php echo e($var->holidayName); ?></td>
<td><?php echo e($var->fromDate); ?></td>
<td><?php echo e($var->toDate); ?></td>
<td>
<a href="<?php echo e(url('school/holidays/' . $var->idHoliday . '/edit')); ?>" class="btn btn-raised btn-info waves-effect btn-round">Edit </a>
<button class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" data-id="<?php echo e($var->idHoliday); ?>" 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 Holiday!",
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/holidays/')); ?>" +"/"+id,
data: {id:id}
})
.done(function(data) {
swal({
title: "Deleted",
text: "Holiday 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 -