IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/705b44ba4f7d93d4ee5dc6c9793c0329429bb690.php

<?php $__env->startSection('content'); ?>
<div class="row clearfix">
    <div class="col-lg-12 col-md-12 col-sm-12">
        <!--<div class="card">-->
        <div class="body">
            <button class="btn btn-raised btn-warning btn-round waves-effect" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">Advance Search</button>
            <div class="collapse" id="collapseExample">
                <div class="well">
                    <div class="row clearfix">
                        <div class="col-lg-12 col-md-12 col-sm-12">
                            <div class="card">
                                <div class="header">
                                    <h2><strong>Advance Search</strong></h2>
                                </div>
                                <div class="body">
                                    <?php echo Form::open(['method' => 'GET',  'action' => ['School\StdTransactionReportController@pendingDues'], 'class' => 'form-horizontal']); ?>

                                    <div class="row clearfix">
                                        <div class="col-sm-6">
                                            <div class="row clearfix">
                                                <div class="col-sm-3 form-control-label">
                                                    <label for="classname">Class</label>
                                                </div>
                                                <div class="col-sm-7">
                                                    <div class="form-group">
                                                        <div style="border:1px solid #ccc; width:250px; height: 150px; overflow-y: scroll;">
                                                            <?php $__currentLoopData = $classes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <div class="checkbox-inline" style="padding-left:10px;padding-top:5px;">
                                                                <input type="checkbox" name="classes[]" value="<?php echo e($key); ?>" class="class_ids">
                                                                <label><?php echo e($value); ?></label>
                                                            </div>
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row clearfix">
                                                <div class="col-sm-3 form-control-label">
                                                    <label for="classname">From Date</label>
                                                </div>
                                                <div class="col-sm-5">
                                                    <div class="form-group">
                                                        <?php echo Form::text('fromDate',null,['class' => 'form-control datepicker']); ?>

                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-6">
                                            <div class="row clearfix">
                                                <div class="col-sm-3 form-control-label">
                                                    <label for="classname">Section</label>
                                                </div>
                                                <div class="col-sm-7">
                                                    <div class="form-group">
                                                        <div id="idSection" style="border:1px solid #ccc; width:250px; height: 150px; overflow-y: scroll;">

                                                        </div>
                                                        <!--<select name='idSection' id="idSection" class="form-control show-tick ms"></select>-->
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="row clearfix">
                                                <div class="col-sm-3 form-control-label">
                                                    <label for="classname">To Date</label>
                                                </div>
                                                <div class="col-sm-5">
                                                    <div class="form-group">
                                                        <?php echo Form::text('toDate',null,['class' => 'form-control datepicker']); ?>

                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row clearfix">
                                        <div class="col-sm-8 offset-sm-2">
                                            <?php echo Form::submit('Search',['class' => 'btn btn-raised btn-primary btn-round waves-effect']); ?>

                                            <?php echo Form::close(); ?> 
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--</div>-->
    </div>
</div>
<div class="row clearfix">
    <div class="col-sm-12">
        <div class="card">
            <div class="header">
                <h2><strong>Fee Due Data</strong></h2>
           </div>
           
            <div class="body table-responsive">
                <table class="table table-bordered table-striped table-hover dataTable" id="tableexp">
                    <thead>
                        <tr>
                            <th>Ec No.</th>
                            <th>Name</th>
                            <th>Student Category</th>
                            <th>Father </th>
                            <th>Mobile</th>
                            <th>Class</th>
                            <th>Section</th>
                            <th>Total Fee</th>
                            <th>Paid</th>
                            <th>Discount</th>
                            <th>Penalty</th>
                            <th>Total Due</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $students; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php
                                $paidHeaders=\DB::table('student_transaction_details')
                                        ->join('student_transaction', 'student_transaction_details.idTransaction', '=', 'student_transaction.idTransaction')
                                        ->join('feeheads', 'student_transaction_details.idFeehead', '=', 'feeheads.idFeehead')
                                        ->select('feeheads.feeheadName','student_transaction_details.status','feeheads.amount as totalPaid','student_transaction_details.fine','student_transaction_details.discount')
                                        ->where('student_transaction_details.idStudent', '=', $var->idStudent)
                                        ->where('student_transaction.idFinancialYear', '=', Session::get('idFinancialYear'))
                                        ->where(function($query) {
                                            $query->whereNull('student_transaction_details.status');
                                            $query->orWhere('student_transaction_details.status', '=', 'In-Process');
                                            $query->orWhere('student_transaction_details.status', '=', 'Cleared');
                                            $query->orWhere('student_transaction_details.status', '=', 'Success');
                                        })
                                        ->get();
                                $green = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                    ->where('idSection', '=', $var->idSection)
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('feeheadName',  'My contribution for green environment')
                                    ->whereNull('idStudent')->first();
                                $lessHeaders=\DB::table('lesser_transaction_details')
                                        ->join('lesser_transaction', 'lesser_transaction_details.idLesserTransaction', '=', 'lesser_transaction.idLesserTransaction')
                                        ->join('feeheads', 'lesser_transaction_details.idFeehead', '=', 'feeheads.idFeehead')
                                        ->select('feeheads.feeheadName','lesser_transaction_details.status','lesser_transaction.totalPaid','lesser_transaction_details.fine','lesser_transaction_details.discount')
                                        ->where('lesser_transaction_details.idStudent', '=', $var->idStudent)
                                        ->where('lesser_transaction.idFinancialYear', '=', Session::get('idFinancialYear'))
                                        ->where(function($query) {
                                            $query->whereNull('lesser_transaction_details.status');
                                            $query->orWhere('lesser_transaction_details.status', '=', 'In-Process');
                                            $query->orWhere('lesser_transaction_details.status', '=', 'Cleared');
                                            $query->orWhere('lesser_transaction_details.status', '=', 'Success');
                                        })
                                        ->get(); 
                                $totalPaid = 0; 
                                $totalFine = 0; 
                                $temp = [];
                                $totalDiscount = 0; 
                                $headerName = "";      
                                array_push($temp,$var->idStudent); 
                                foreach($paidHeaders as $headers){
                                    array_push($temp,$headers->feeheadName);

                                    if (str_contains( $headers->feeheadName, 'Full Payment')) {
                                        $headerName = "(Full Payment)";   
                                    }else if (str_contains( $headers->feeheadName, 'Installment')) $headerName = "Installment)";  

                                    $totalPaid = $totalPaid + $headers->totalPaid;
                                    if ( $headers->feeheadName == 'My contribution for green environment') {
                                        if($green != null)
                                        $totalPaid = $totalPaid - $green->amount; 
                                    }
                                    $totalFine = $totalFine + $headers->fine;
                                    $totalDiscount = $totalDiscount + $headers->discount;
                                }   
                                
                                /*$headerName = "(Full Payment)"; */   
                                if($headerName == "")   
                                foreach($lessHeaders as $headers){
                                    if (str_contains( $headers->feeheadName, 'Full Payment')) {
                                        $headerName = "(Full Payment)";   
                                    }else if (str_contains( $headers->feeheadName, 'Installment')) $headerName = "Installment)";  
                                     
                                    $totalPaid = $totalPaid + $headers->totalPaid;
                                    $totalFine = $totalFine + $headers->fine;
                                    $totalDiscount = $totalDiscount + $headers->discount;
                                }

                                $feeTotal = 0;
                                if($headerName == "(Full Payment)"){
                                    $class_feeheads = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                    ->where('idSection', '=', $var->idSection)
                                    ->where('studentCategory', '=', $var->studentType)
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('feeheadName', 'LIKE', '%(Full Payment)')
                                    ->whereNull('idStudent');
                                    //   ->get();
                                    $admission_feeheads = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                    ->where('idSection', '=', $var->idSection)
                                    ->where('studentCategory', '=', $var->studentType)
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('feeheadName', 'LIKE', 'Admission Confirmation%')
                                    ->whereNull('idStudent');
                                    
                                    $p1 = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                    ->where('idSection', '=', $var->idSection)
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('feeheadName', 'LIKE', 'P1%')
                                    ->whereNull('idStudent');
                                    $p2 = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                    ->where('idSection', '=', $var->idSection)
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('feeheadName', 'LIKE', 'P2%')
                                    ->whereNull('idStudent');
                                    //   ->get();
                                    $allcat_feeheads = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                            ->where('idSection', '=', $var->idSection)
                                            ->where('studentCategory', '=', 'All')
                                            ->where('idFinancialYear','=',$var->idFinancialYear)
                                            ->where('feeheadName', 'LIKE', '%(Full Payment)')
                                            ->whereNull('idStudent');
                                    //   ->get();
                                    $feeheads = \DB::table('feeheads')
                                    ->where('idStudent', '=', $var->idStudent)
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('feeheadName', 'LIKE', '%(Full Payment)')
                                            ->union($class_feeheads)
                                            ->union($allcat_feeheads)
                                            ->union($admission_feeheads)
                                            ->union($p1)
                                            ->union($p2)
                                            ->orderBy('toDate')
                                            ->get();
                                    foreach($feeheads as $ids){
                                        array_push($temp,$ids->idFeehead.'-'.$ids->feeheadName);
                                    }        
                                    $feeTotal = $feeheads->sum('amount');
                                }else if($headerName == "Installment)"){
                                    $installment_class_feeheads = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                    ->where('idSection', '=', $var->idSection)
                                    ->where('studentCategory', '=', $var->studentType)
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('feeheadName', 'LIKE', '% Installment)%')
                                    ->whereNull('idStudent');
                                    $admission_feeheads = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                    ->where('idSection', '=', $var->idSection)
                                    ->where('studentCategory', '=', $var->studentType)
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('feeheadName', 'LIKE', 'Admission Confirmation%')
                                    ->whereNull('idStudent');
                                   
                                    $p1 = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                    ->where('idSection', '=', $var->idSection)
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('feeheadName', 'LIKE', 'P1%')
                                    ->whereNull('idStudent');
                                    $p2 = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                    ->where('idSection', '=', $var->idSection)
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('feeheadName', 'LIKE', 'P2%')
                                    ->whereNull('idStudent');
                                    //   ->get();
                                    $installment_allcat_feeheads = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                            ->where('idSection', '=', $var->idSection)
                                            ->where('idFinancialYear','=',$var->idFinancialYear)
                                            ->where('studentCategory', '=', 'All')
                                            ->where('feeheadName', 'LIKE', '% Installment)%')
                                            ->whereNull('idStudent');
                                    //   ->get();
                                    $installment_feeheads = \DB::table('feeheads')
                                    ->where('idStudent', '=', $var->idStudent)
                                    ->where('feeheadName', 'LIKE', '% Installment)%')
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                            ->union($installment_class_feeheads)
                                            ->union($installment_allcat_feeheads)
                                            ->union($admission_feeheads)
                                            ->union($p1)
                                            ->union($p2)
                                            ->orderBy('toDate')
                                            ->get();
                                            foreach($installment_feeheads as $ids){
                                        array_push($temp,$ids->idFeehead.'-'.$ids->feeheadName);
                                    } 
                                    $feeTotal = $installment_feeheads->sum('amount');
                                }else{
                                    $admission_feeheads = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                    ->where('idSection', '=', $var->idSection)
                                    ->where('studentCategory', '=', $var->studentType)
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('feeheadName', 'LIKE', 'Admission Confirmation%')
                                    ->whereNull('idStudent');
                                   
                                    $p1 = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                    ->where('idSection', '=', $var->idSection)
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('feeheadName', 'LIKE', 'P1%')
                                    ->whereNull('idStudent');
                                    $p2 = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                    ->where('idSection', '=', $var->idSection)
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('feeheadName', 'LIKE', 'P2%')
                                    ->whereNull('idStudent');

                                    $fl_class_feeheads = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                    ->where('feeheadName', 'LIKE', '%(Full Payment)')
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('idSection', '=', $var->idSection)
                                    ->where('studentCategory', '=', $var->studentType)
                                    ->whereNull('idStudent');
                                    //   ->get();
                                    $fl_allcat_feeheads = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                    ->where('feeheadName', 'LIKE', '%(Full Payment)')
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                            ->where('idSection', '=', $var->idSection)
                                            ->where('studentCategory', '=', 'All')
                                            ->whereNull('idStudent');
                                    //   ->get();
                                    $fl_feeheads = \DB::table('feeheads')
                                    ->where('feeheadName', 'LIKE', '%(Full Payment)')
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('idStudent', '=', $var->idStudent)
                                            ->union($fl_class_feeheads)
                                            ->union($fl_allcat_feeheads)
                                            ->union($admission_feeheads)
                                            ->union($p1)
                                            ->union($p2)
                                            ->orderBy('toDate')
                                            ->get();
                                    foreach($fl_feeheads as $ids){
                                        array_push($temp,$ids->idFeehead.'-'.$ids->feeheadName);
                                    }         
                                    $check_full = \DB::table('feeheads')
                                    ->where('feeheadName', 'LIKE', '%(Full Payment)')
                                    ->where('idFinancialYear','=',$var->idFinancialYear)
                                    ->where('idStudent', '=', $var->idStudent)
                                            ->union($fl_class_feeheads)
                                            ->union($fl_allcat_feeheads)
                                            ->orderBy('toDate')
                                            ->get();
                                    $feeTotal = $fl_feeheads->sum('amount');
                                    if($feeTotal == 0 || count($check_full) == 0){
                                        $ins_class_feeheads = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                        ->where('feeheadName', 'LIKE', '% Installment%')
                                        ->where('idFinancialYear','=',$var->idFinancialYear)
                                        ->where('idSection', '=', $var->idSection)
                                        ->where('studentCategory', '=', $var->studentType)
                                        ->whereNull('idStudent');
                                        //   ->get();
                                        $ins_allcat_feeheads = \DB::table('feeheads')->where('idClass', '=', $var->idClass)
                                        ->where('feeheadName', 'LIKE', '% Installment%')
                                        ->where('idFinancialYear','=',$var->idFinancialYear)
                                                ->where('idSection', '=', $var->idSection)
                                                ->where('studentCategory', '=', 'All')
                                                ->whereNull('idStudent');
                                        //   ->get();
                                        $ins_feeheads = \DB::table('feeheads')
                                        ->where('feeheadName', 'LIKE', '% Installment)%')
                                        ->where('idFinancialYear','=',$var->idFinancialYear)
                                        ->where('idStudent', '=', $var->idStudent)
                                                ->union($ins_class_feeheads)
                                                ->union($ins_allcat_feeheads)
                                                ->union($admission_feeheads)
                                                ->union($p1)
                                                ->union($p2)
                                                ->orderBy('toDate')
                                                ->get();
                                        $feeTotal = $ins_feeheads->sum('amount');
                                    }
                                }
                            ?>
                            <?php if($totalPaid != $feeTotal): ?>
                        <tr>
                            <td><?php echo e($var->ecNo); ?></td>
                            <td><?php echo e($var->firstName); ?> <?php echo e($var->middleName); ?> <?php echo e($var->lastName); ?></td>
                            <td><?php echo e($var->studentType); ?></td>
                            <td><?php echo e($var->father_fname); ?> <?php echo e($var->father_lname); ?></td>
                            <td><?php echo e($var->father_mobile); ?></td>
                            <td><?php if(isset($var->classM)): ?> <?php echo e($var->classM->className); ?> <?php endif; ?></td>
                            <td><?php if(isset($var->section)): ?> <?php echo e($var->section->sectionName); ?> <?php endif; ?></td>
                            <td><?php echo e($feeTotal); ?></td>
                            <td>
                                <?php echo e($totalPaid); ?>

                            </td>
                            <td>
                                <?php echo e($totalFine); ?>

                            </td>
                            <td>
                               <?php echo e($totalDiscount); ?> 
                            </td>
                            <td>
                                <?php echo e($feeTotal - $totalPaid); ?>

                            </td>
                        </tr>
                        <?php endif; ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
           </div>
        </section>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
    $('.selectAll').on('click', function () {
        var checkAll = this.checked;
        if (checkAll === true) {
            $('input[type=checkbox]').each(function () {
                this.checked = checkAll;
            });
        } else {
            $('input[type=checkbox]').each(function () {
                this.checked = checkAll;
            });
        }
    });
    $(function () {
        $('#tableexp').DataTable({
        
            dom: 'Bfrtip',
            scrollY:        "500px",
            scrollX:        true,
            scrollCollapse: true,
            fixedColumns:   {
                left: 1
            },
            buttons: [
                {
                     extend: 'csv', footer: true, text: 'Export to Excel',title:'Student Due Report',
                }
                
            ]
        });
    });
    $(document).on('click', '.class_ids', function () {
        //var checkAll = this.checked;
        var classIds = [];
        $("input:checkbox[name='classes[]']:checked").each(function () {
            classIds.push($(this).val());
        });
        if (classIds.length > 0) {
            $.ajax({
                url: "<?php echo e(url('/school/schclass')); ?>" + '/' + classIds + "/sections",
                type: "GET",
                dataType: "json",
                success: function (data) {
                    $('#idSection').empty();
                    $('#idSection').append('<div class="checkbox-inline" style="padding-left:10px;padding-top:5px;"><input type="checkbox" class="select-all" id="selectall"><label><strong>Select All</label></strong></div>');
                    $.each(data, function (key, value) {
                        $('#idSection').append('<div class="checkbox-inline" style="padding-left:10px;"><input type="checkbox" name="sections[]" value="' + key + '" class="sectionclass"><label>' + value + '</label></div>');
                    });
                }
            });
        }
    });
    $(document).on('click', '.select-all', function () {
        var checkAll = this.checked;
        if (checkAll === true) {
            $('.sectionclass').each(function () {
                this.checked = checkAll;
            });
        } else {
            $('.sectionclass').each(function () {
                this.checked = checkAll;
            });
        }
    });
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Copyright © 2021 - 2025 IMMREX7