IMMREX7
<?php $__env->startSection('content'); ?>
<div role="tabpanel" class="tab-pane in active" id="details" aria-expanded="true">
<div class="card" id="details">
<div class="body">
<div class="row">
<div class="col-sm-6 col-sm-offset-1">
<address>
<strong> Student Name : </strong><?php echo e($student->firstName); ?> <?php echo e($student->middleName); ?> <?php echo e($student->lastName); ?><br>
<strong> Father Name : </strong><?php echo e($student->father_fname); ?> <?php echo e(isset($student->father_lname) ? $student->father_lname : ''); ?><br>
<strong> Mobile : </strong><?php echo e($student->father_mobile); ?><br>
<strong> Class : </strong><?php echo e($student->classM->className); ?><br>
<strong> Section : </strong><?php echo e($student->section->sectionName); ?><br>
<strong> Ec No. : </strong><?php echo e($student->ecNo); ?><br>
</address>
<?php if(session('status')): ?>
<?php if(session('status') == 'Payment Error'): ?>
<div class="alert alert-warning">
<?php echo e(session('status')); ?>
</div>
<?php else: ?>
<div class="alert alert-success">
<?php echo e(session('status')); ?>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<div class="mt-40"></div>
<div class="row">
<div class="col-md-12" style="margin:10px;">
<div class="table-responsive col-md-12">
<?php
$custID = $student->idStudent . "F" . $student->idFinancialYear;
$logo = \App\School::where('idSchool', '=', $student->idSchool)->first();
?>
<table class="table table-hover">
<thead>
<tr>
<th style="width:60px;"></th>
<th>Feehead</th>
<th>Amount</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $feeheads; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $fee): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<?php
$feepaid = \App\StudentExtraTransactionDetail::where('idStudent', '=', $student->idStudent)
->where(function($query) {
$query->whereNull('status');
$query->orWhere('status', '=', 'Cleared');
$query->orWhere('status', '=', 'In-Process');
$query->orWhere('status', '=', 'Success');
})
->where('idFeehead', '=', $fee->idExtraFeehead)->first();
?>
<tr>
<td>
<?php if($feepaid == null): ?>
<div class="checkbox-inline" style="padding-left:10px;"><input type="checkbox" name="selectedHeaders[]" value="<?php echo e($fee->idExtraFeehead); ?>" class="feeclass"></div>
<?php endif; ?>
</td>
<td>
<?php echo e($fee->feeheadName); ?>
<?php echo e($fee->description); ?>
<input type="hidden" name='feeheads[<?php echo e($fee->idExtraFeehead); ?>][idExtraFeehead]' value="<?php echo e($fee->idExtraFeehead); ?>">
</td>
<td class='amt'>
<?php echo e($fee->amount); ?>
<input type="hidden" name='feeheads[<?php echo e($fee->idExtraFeehead); ?>][famount]' value="<?php echo e($fee->amount); ?>">
</td>
<td>
<?php if($feepaid == null): ?>
<span class="badge badge-info">Due</span>
<?php else: ?>
<span class="badge badge-success">Paid </span>
<?php endif; ?>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
<div class="col-sm-12">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Date</th>
<th>Amount</th>
<!--<th>Balance</th>-->
<th>Payment Mode</th>
<th>Print</th>
</tr>
</thead>
<tbody>
<?php $__currentLoopData = $paidfees; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><?php echo e($var->paymentDate); ?></td>
<td><?php echo e($var->totalPaid); ?></td>
<!--<td></td>-->
<td><?php echo e($var->paymentMode); ?></td>
<td><a href="<?php echo e(url('student/stdtransaction-extra/'.$var->idTransaction.'/print')); ?>" target="_blank" class="btn btn-sm btn-info">Print</a></td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody>
</table>
</div>
</div>
</div>
<hr>
<div class="row col-md-12">
<div class="col-md-5">
<div class="row clearfix">
<div class="col-sm-6 form-control-label">
<label for="classname">Payable Amount</label>
</div>
<div class="col-sm-6">
<div class="form-group">
<?php if(isset($prevaccess_fee->excessAmount)): ?>
<?php if($prevaccess_fee->excessAmount > 0): ?>
<label id="access_note"><b>Excess Amount Available: </b><?php echo e($prevaccess_fee->excessAmount); ?> </label>
<?php endif; ?>
<?php endif; ?>
<input type="text" name="payableAmount" class="form-control" readonly="readonly" style="color: black;font-size: 1.2em;">
</div>
</div>
</div>
</div>
</div>
<!--<hr>-->
<div id="juspayDiv"></div>
<hr>
<div class="hidden-print col-md-12 text-right">
<button class="btn btn-primary btn-round" onclick="startPayments()">Pay Now</button>
</div>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script src="https://ebz-static.s3.ap-south-1.amazonaws.com/easecheckout/easebuzz-checkout.js"></script>
<script>
// Saving form data
$(document).ready(function(){
$('.otherpaymode').hide();
$('#paymode').change(function() {
var val = $(this).val();
if((val == 'Cheque')){
$('.otherpaymode').show();
}else if(val == 'DD'){
$('.otherpaymode').show();
}else{
$('.otherpaymode').hide();
}
});
});
var feeheaderIds = [];
$('.feeclass').change(function() {
feeheaderIds = [];
$("input:checkbox[name='selectedHeaders[]']:checked").each(function () {
feeheaderIds.push($(this).val());
});
if(feeheaderIds.length>0)
$.ajax({
url: "<?php echo e(url('/student/feeheaders-extra')); ?>"+'/' +feeheaderIds + "/students/"+<?php echo e($student->idStudent); ?>,
type: "GET",
dataType: "json",
success:function(data) {
$('input[name="payableAmount"]').val(data);
}
});
else $('input[name="payableAmount"]').val(" ");
});
function calculatePenalty(){
var penaltyAmt = parseFloat($('#penalty').val());
console.log(penaltyAmt);
$('#penaltyAmt').text(penaltyAmt.toFixed(2));
}
var sum = 0;
var discount = 0;
var fine = 0;
// iterate through each td based on class and add the values
$(".amt").each(function() {
var value = $(this).text();
// add only if the value is number
if(!isNaN(value) && value.length != 0) {
sum += parseFloat(value);
}
$('#total_fee').text(sum.toFixed(2));
});
$(".discount").each(function() {
var value = Number($(this).text());
// add only if the value is number
if(!isNaN(value) && value.length != 0) {
discount += parseFloat(value);
}
$('#total_discount').text(discount.toFixed(2));
});
$(".fine").each(function() {
var value = Number($(this).text());
// add only if the value is number
if(!isNaN(value) && value.length != 0) {
fine += parseFloat(value);
}
$('#total_fine').text(fine.toFixed(2));
});
var ftotal = parseFloat($('#total_fee').text());
var tdiscount = parseFloat($('#total_discount').text());
var tfine = parseFloat($('#total_fine').text());
var paidtot = parseFloat($('#total_paid').text());
var fbalance = parseFloat(ftotal+paidtot);
$('#total_balance').text(fbalance.toFixed(2));
var feetotal = parseFloat(ftotal);
$('#feetotal').val(feetotal.toFixed(2));
var distotal = parseFloat($('#total_discount').text());
$('#discounttotal').val(distotal.toFixed(2));
var tf = parseFloat($('#total_fine').text());
$('#finetotal').val(tf.toFixed(2));
var baltotal = parseFloat(ftotal+tfine-tdiscount);
$('#balance_total').text(baltotal.toFixed(2));
</script>
<script>
// Calling merchant backend which will call JUSPAY Session API and send Payment link to be opened in browser
// block:start:call-session-api
function startPayments() {
var requestPayload = JSON.stringify({
amount: $('input[name="payableAmount"]').val(),
idStudent: <?php echo e($student->idStudent); ?>,
idFinancialYear: <?php echo e($student->idFinancialYear); ?>,
selectedHeaders : feeheaderIds,
type : "extra"
});
var requestOptions = {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-CSRF-TOKEN": "<?php echo e(csrf_token()); ?>",
},
body: requestPayload,
};
fetch("https://online-login.online/student/makePayment", requestOptions)
.then((response) => response.json())
.then((result) => {
$('#paymentModal').modal('show')
var easebuzzCheckout = new EasebuzzCheckout(result.key, 'prod')
var options = {
access_key: result.token, // access key received via Initiate Payment
onResponse: (response) => {
if (response.status == "success") {
window.location.href = "<?php echo e(url('student/extra-fees')); ?>";
}
},
theme: "#11385b" // color hex
}
$('#submit-btn').hide();
easebuzzCheckout.initiatePayment(options);
})
.catch((error) => console.log("error", error));
return false;
}
// block:end:call-session-api
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('students.student_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
Copyright © 2021 -