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($outstanding)): ?>Edit <?php else: ?> Add <?php endif; ?></strong> Outstanding Amount</h2>
</div>
<div class="body">
<?php if(isset($outstanding)): ?>
<?php echo Form::model( $outstanding, ['route' => ['outstanding.update', $outstanding->idOutstanding], 'method' => 'put','class'=>'form-horizontal'] ); ?>
<?php else: ?>
<?php echo Form::open(['url' => 'school/outstanding','class'=>'form-horizontal']); ?>
<?php endif; ?>
<div class="row clearfix">
<div class="col-sm-4 form-control-label">
<label for="classname" class="required">Class</label>
</div>
<div class="col-sm-8">
<div class="form-group">
<?php if(isset($outstanding)): ?>
<?php echo Form::select('idClass',[ $outstanding->idClass => $outstanding->className],null,['class' => 'form-control show-tick ms select2']); ?>
<?php else: ?>
<?php echo Form::select('idClass',$classes,null,['class' => 'form-control show-tick ms select2']); ?>
<?php endif; ?>
<?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-4 form-control-label">
<label for="classname" class="required">Select Section</label>
</div>
<div class="col-sm-8">
<div class="form-group">
<?php if(isset($outstanding)): ?>
<?php echo Form::select('idSection',[ $outstanding->idSection => $outstanding->sectionName],null,['class' => 'form-control show-tick ms select2']); ?>
<?php else: ?>
<div id="idSection" style="border:1px solid #ccc; width:250px; height: 110px; overflow-y: scroll;">
</div>
<?php if($errors->has('idSection')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('idSection')); ?></strong>
</label>
<?php endif; ?>
<span id='sectionerror'></span>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-4 form-control-label">
<label for="classname">EC No.</label>
</div>
<div class="col-sm-8">
<div class="form-group">
<?php if(isset($outstanding)): ?>
<?php echo Form::select('idStudent',[$outstanding->idStudent => $outstanding->firstName],null,['class' => 'form-control show-tick ms']); ?>
<?php else: ?>
<div id="idStudent" style="border:1px solid #ccc; width:250px; height: 110px; overflow-y: scroll;">
</div>
<?php if($errors->has('ecNO')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('ecNO')); ?></strong>
</label>
<?php endif; ?>
<?php endif; ?>
<span id="ecnoerror"></span>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-4 form-control-label required">
<label>Next Session</label>
</div>
<div class="col-sm-7">
<div class="form-group">
<?php echo Form::select('forFy',$sessions,null,['class' => 'form-control show-tick ms']); ?>
<?php if($errors->has('forFy')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('forFy')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-4 form-control-label required">
<label>Amount</label>
</div>
<div class="col-sm-7">
<div class="form-group">
<?php echo Form::number('amount', null, ['class' => 'form-control']); ?>
<?php if($errors->has('amount')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('amount')); ?></strong>
</label>
<?php endif; ?>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-8 offset-sm-2">
<?php if(isset($fy)): ?>
<?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-12">
<div class="card">
<div class="header">
<h2><strong>List Of Outstanding Amount</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>Class</th>
<th>Section</th>
<th>Student Name</th>
<th>Session (To be Paid In)</th>
<th>Amount</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $i = 1; ?>
<?php $__currentLoopData = $fys; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><?php echo e($i); ?></td>
<td><?php echo e($var->className); ?></td>
<td><?php echo e($var->sectionName); ?></td>
<td><?php echo e($var->ecNo); ?> - <?php echo e($var->firstName); ?></td>
<td><?php echo e($var->financialYearName); ?></td>
<td><?php echo e($var->amount); ?></td>
<td>
<a href='<?php echo e(url('/school/outstanding/'.$var->idOutstanding.'/edit')); ?>' class="btn btn-raised btn-info waves-effect btn-round">EDIT</a>
<!--<a href='#' data-toggle="modal" data-target="#exampleModal" class="btn btn-sm btn-danger">Delete</a>-->
<button class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" data-id="<?php echo e($var->idOutstanding); ?>" 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() {
$('select[name="idClass"]').on('change', function() {
var classID = $(this).val();
if(classID!='All') {
$.ajax({
url: "<?php echo e(url('/school/class')); ?>"+'/' +classID + "/sections",
type: "GET",
dataType: "json",
success:function(data) {
$('#idSection').empty();
$('#idSection').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><strong>Select All</label></strong><input type="checkbox" class="select-all" id="selectall"></div>');
$.each(data, function(key, value) {
$('#idSection').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:100px;">'+value+'</label><input type="checkbox" name="sections[]" value="'+key+'" class="sectionclass"></div>');
});
}
});
}else{
$('select[name="idSection"]').empty();
}
});
});
$(document).on('click', '.select-all', function(){
var checkAll = this.checked;
if(checkAll === true){
$('input[type=checkbox]').each(function () {
this.checked = checkAll;
});
var sectionIds = [];
$("input:checkbox[name='sections[]']:checked").each(function () {
sectionIds.push($(this).val());
});
if (sectionIds.length > 0) {
$.ajax({
url: "<?php echo e(url('/school/sec')); ?>"+'/' +sectionIds + "/students",
type: "GET",
dataType: "json",
success:function(data) {
$('#idStudent').empty();
$('#idStudent').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><strong>Select All</label></strong><input type="checkbox" class="select-allstd" id="selectallstd"></div>');
$.each(data, function(key, value) {
$('#idStudent').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:10px;">'+value+'</label><input type="checkbox" name="students[]" value="'+key+'" class="stdallselect"></div>');
});
}
});
}
}else{
$('#idStudent').empty();
$('input[type=checkbox]').each(function () {
this.checked = checkAll;
});
}
});
$(document).on('click', '.sectionclass', function(){
var sectionIds = [];
$("input:checkbox[name='sections[]']:checked").each(function () {
sectionIds.push($(this).val());
});
if (sectionIds.length > 0) {
$.ajax({
url: "<?php echo e(url('/school/sec')); ?>"+'/' +sectionIds + "/students",
type: "GET",
dataType: "json",
success:function(data) {
$('#idStudent').empty();
$('#idStudent').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><label style="margin-right:42px;"><strong>Select All</label></strong><input type="checkbox" class="select-allstd" id="selectallstd"></div>');
$.each(data, function(key, value) {
$('#idStudent').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:10px;">'+value+'</label><input type="checkbox" name="students[]" value="'+key+'" class="stdallselect"></div>');
});
}
});
}else{
$('#idStudent').empty();
}
});
$(document).on('click', '.select-allstd', function(){
var checkAllstd = this.checked;
if(checkAllstd === true){
$("input:checkbox[name='students[]']").each(function () {
this.checked = checkAllstd;
});
}else{
$('.stdallselect').each(function () {
this.checked = checkAllstd;
});
}
});
$(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 Session!",
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/outstanding/')); ?>" +"/"+id,
data: {id:id}
})
.done(function(data) {
swal({
title: "Deleted",
text: "Session 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 -