IMMREX7
<?php $__env->startSection('content'); ?>
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Edit </strong> Fee Header</h2>
</div>
<div class="body">
<?php echo Form::model($feehead, ['method' => 'PATCH', 'action' => ['School\NorthFeeHeaderController@update', $feehead->idFeehead], 'class' => 'form-horizontal']); ?>
<input type="hidden" name="demand_pv" value="<?php echo e($feehead->idFeehead); ?>"/>
<div class="row clearfix">
<div class="col-sm-2 form-control-label required">
<label for="classname">Select Class</label>
</div>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::select('idClass',$classes,null,['class' => 'form-control show-tick ms','disabled'=>'disabled']); ?>
<?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 class="col-sm-2 form-control-label required">
<label for="classname">Select Section</label>
</div>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::select('idSection',$sections,null,['class' => 'form-control show-tick ms']); ?>
<?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>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-2 form-control-label required">
<label for="classname">Demand Name</label>
</div>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::text('demandName',null,['class' => 'form-control']); ?>
<span id='feeheaderror'></span>
</div>
</div>
<div class="col-sm-2 form-control-label required">
<label for="classname">Student Category</label>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="checkbox-inline" style="padding-left:10px;"><input type="checkbox" name="studentCategory" value="<?php echo e($feehead->studentCategory); ?>" class="categoryclass" checked disabled>
<label> <?php echo e($feehead->studentCategory); ?> </label>
</div>
<?php if($errors->has('studentCategory')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('studentCategory')); ?></strong>
</label>
<?php endif; ?>
<span id='categoryerror'></span>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-2 form-control-label required">
<label for="classname">From Date</label>
</div>
<div class="col-sm-3">
<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 class="col-sm-2 form-control-label required">
<label for="classname">To Date</label>
</div>
<div class="col-sm-3">
<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-2 form-control-label required">
<label for="classname">Amount</label>
</div>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::text('amount',null,['class' => 'form-control','onkeypress'=>'return onlyNumbersandSpecialChar(event)','readonly'=>'readonly']); ?>
<?php if($errors->has('amount')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('amount')); ?></strong>
</label>
<?php endif; ?>
<span id='amounterror'></span>
</div>
</div>
<div class="col-sm-2 form-control-label required">
<label for="finename">Select Fine</label>
</div>
<div class="col-sm-3">
<div class="form-group">
<?php echo Form::select('idFine',['flat'=>'Flat Fine','per'=>'Fine Per Day'],null,['class' => 'form-control show-tick ms select2']); ?>
<?php if($errors->has('idFine')): ?>
<label id="minmaxlength-error" class="error" for="minmaxlength">
<strong><?php echo e($errors->first('idFine')); ?></strong>
</label>
<?php endif; ?>
<span id='fineerror'></span>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-2 form-control-label">
<label for="classname">Add EC No.</label>
</div>
<div class="col-sm-4">
<div class="form-group">
<div id="idStudent" style="border:1px solid #ccc; width:320px; height: 340px; overflow-y: scroll;">
<?php $__currentLoopData = $student; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php
$ecNo= explode("(", $value);
$seach_str=substr($ecNo[1],0,8);
?>
<div class="checkbox-inline" style="padding-left:10px;"><input type="checkbox" name="students[]" value="<?php echo e($key); ?>" class="stdallselect" <?php if(in_array($seach_str,$description)): ?> disabled <?php endif; ?>><label><?php echo e($value); ?></label></div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</div>
</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; ?>
</div>
<div class="row clearfix">
<div class="col-sm-2 form-control-label">
<label for="classname">EC No.</label>
</div>
<div class="col-sm-4">
<div class="form-group">
<div id="idSelectStudent" style="border:1px solid #ccc; width:320px; height: 340px; overflow-y: scroll;">
<?php $__currentLoopData = $students; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<div class="checkbox-inline" style="padding-left:10px;"><input type="checkbox" name="students[]" value="<?php echo e($key); ?>" class="stdallselect" checked disabled><label><?php echo e($value); ?></label></div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</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; ?>
</div>
</div>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-2 form-control-label required">
<label for="classname">Description</label>
</div>
<div class="col-sm-8">
<table class="table" id="header_table">
<thead>
<tr>
<th></th>
<th>Header Name</th>
<th>Amount</th>
<th></th>
</tr>
</thead>
<tbody id="optional_list">
<?php $i =1;?>
<?php $__currentLoopData = $childheads; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $headers): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<input type="hidden" name="header[<?php echo $i;?>][prevName]" value="<?php echo e($headers->idHeader); ?>"/>
<td class="sno"><?php echo e($i); ?></td>
<td>
<?php echo Form::select('header['.$i.'][idHeader]',$heads,$headers->idHeader,['class' => 'form-control show-tick ms']); ?>
</td>
<td>
<input class="form-control" type="number" name="header[<?php echo $i;?>][amountName]" required="required" value="<?php echo e($headers->amount); ?>" id="amount_<?php echo $i;?>"/>
<span id="amounterror1"></span>
</td>
<td style="text-align:right;vertical-align: middle;"><input type="submit" class="btn btn-sm btn-danger" value="Delete" data-id="<?php echo e($headers->idFeehead); ?>" id="remove_header"></td>
</tr>
<?php $i++ ; ?>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
<tr>
<td colspan="4" style="text-align: right"><input type="button" class="add-row btn btn-sm btn-success" value="Add Row"></td>
</tr>
</table>
</div>
</div>
<div class="row clearfix">
<div class="col-sm-8 offset-sm-2">
<?php if(isset($feehead)): ?>
<?php echo Form::submit('UPDATE',['class' => 'btn btn-raised btn-primary btn-round waves-effect disabled']); ?>
<?php else: ?>
<?php echo Form::submit('SAVE',['class' => 'btn btn-raised btn-primary btn-round waves-effect disabled','id'=>'submit-btn']); ?>
<?php endif; ?>
<?php echo Form::close(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<?php echo $__env->make('schools.feeheads.feehead_script', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<script>
$(document).ready(function() {
var i = $('.sno:last').text();
$(".add-row").click(function(){
i++;
var markup = '<tr><td class="sno">'+i+'</td>\
<td><select name="header['+i+'][idHeader]" class = "form-control show-tick ms"><?php $__currentLoopData = $heads; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($key); ?>"><?php echo e($value); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select><span id="headererror'+i+'"></span></td>\n\
<td><input class="form-control" type="number" name="header['+i+'][amountName]" required="required" id="amount_'+i+'"><span id="amounterror'+i+'"></span></td>\n\
<td style="text-align:right;vertical-align: middle;"><input type="button" 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();
var totalAmount=0;
$("#optional_list tr").each(function() {
// Within tr we find the last td child element and get content
$(this).find("td").find("input").each(function() {
if(this.value !='Delete' && this.id !='' && this.value!='')
totalAmount=parseInt(totalAmount)+parseInt(this.value);
});
});
$( "input[name='amount']" ).val(totalAmount);
});
$("tbody").on("change", "input", function () {
if(this.id !=''){
var totalAmount=0;
$("#optional_list tr").each(function() {
// Within tr we find the last td child element and get content
$(this).find("td").find("input").each(function() {
if(this.value !='Delete' && this.id !='' && this.value!='')
totalAmount=parseInt(totalAmount)+parseInt(this.value);
});
});
$( "input[name='amount']" ).val(totalAmount);
}
});
});
$(document).on('click', '#remove_header', function (e) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
e.preventDefault();
var id = $(this).data('id');
var row_index = $(this).closest('tr');
swal({
title: "Are you sure?",
text: "Are You sure you want to delete this feeheader!",
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/north/feeheads/')); ?>" +"/"+id,
data: {id:id}
})
.done(function(data) {
swal({
title: "Deleted",
text: "Feehead has been successfully deleted",
type: "success"
},function() {
row_index.remove();
var totalAmount=0;
$("#optional_list tr").each(function() {
// Within tr we find the last td child element and get content
$(this).find("td").find("input").each(function() {
if(this.value !='Delete' && this.id !='' && this.value!='')
totalAmount=parseInt(totalAmount)+parseInt(this.value);
});
});
$( "input[name='amount']" ).val(totalAmount);
});
})
.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 -