IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/storage/framework/views/bd5abc9219c1d9cea7c9223132af06a09c080983.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>Attendance Advance Search</strong></h2>
                                </div>
                                <div class="body">
                                    <?php echo Form::open(['method' => 'GET',  'action' => ['School\AttendanceController@index'], 'class' => 'form-horizontal']); ?>


                                    <div class="row clearfix">
                                        <div class="col-sm-4">
                                            <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>
                                        <div class="col-sm-4">
                                            <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>
                                        <div class="col-sm-4">
                                            <div class="row clearfix">
                                                <div class="col-sm-3 form-control-label">
                                                    <label for="classname">EC No.</label>
                                                </div>
                                                <div class="col-sm-7">
                                                    <div class="form-group">
                                                        <div id="idStudent" 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>
                                    </div>
                                    <div class="row clearfix">
                                        <div class="row clearfix">
                                            <div class="col-sm-3 form-control-label">
                                                <label for="classname">From Date</label>
                                            </div>
                                            <div class="col-sm-7">
                                                <div class="form-group">
                                                    <?php echo Form::text('fromDate',null,['class' => 'form-control dateselector','required'=>'required']); ?>

                                                </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-7">
                                                <div class="form-group">
                                                    <?php echo Form::text('toDate',null,['class' => 'form-control datepicker','required'=>'required']); ?>

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row clearfix">
                                        <div class="col-sm-8 offset-sm-2">
                                            <?php echo Form::submit('SHOW',['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-lg-12 col-md-12 col-sm-12">
        <div class="card">

            <div class="body">
                <div class="body"> 
                    <!-- Nav tabs -->
<!--                    <ul class="nav nav-tabs">
                        <li class="nav-item"><a class="nav-link active" data-toggle="tab" href="#home">DAY</a></li>
                        <li class="nav-item"><a class="nav-link" data-toggle="tab" href="#messages">All Time</a></li>
                    </ul>                        -->
                    <!-- Tab panes -->
                    <div class="tab-content">
                        <div> <div class="header"> <h2><strong>Attandance Report</strong></h2></div>
                            <div class="body table-responsive">
                                <?php if(count($students)>0): ?>
                            <table class="table table-bordered table-striped table-hover dataTable tableexp">
                                <thead>
                                    <tr>
                                        <th>EC No.</th>
                                        <th>Name</th>
                                        <?php $__currentLoopData = $days; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <th>
                                            <?php if(array_key_exists('1', $var)): ?>
                                            <?php if($var[1] == 'SUNDAY'): ?>
                                            <span style="color:green; font-weight: bold;"><?php echo e($var[0]); ?></span>
                                            <?php elseif($var[1]!=null && $var[1]!='SUNDAY'): ?>
                                            <span style="color:green; font-weight: bold;"><?php echo e($var[0]); ?></span>
                                            <?php else: ?>
                                            <?php echo e(Carbon\Carbon::parse($var[0])->format('d-m')); ?>

                                            <?php endif; ?>
                                            <?php endif; ?>
                                        </th>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                       
                                        <th>TP</th>
                                        <th>TA</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__currentLoopData = $students; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $std): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                         <?php  
                                            $total_present = 0;
                                            $total_absent = 0;
                                            $isAdded = 0;
                                        ?>
                                        <td><?php echo e($std->ecNo); ?></td>
                                        <td><?php echo e($std->firstName); ?> <?php echo e($std->middleName); ?> <?php echo e($std->lastName); ?></td>
                                        <?php $__currentLoopData = $days; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <td>
                                                 <?php
                                                   $isAdded = 0;
                                                   if(array_key_exists('0', $var)){
                                                    $tdate = Carbon\Carbon::parse($var[0]);
                                                    $now = Carbon\Carbon::now();
                                                    $jdate = $tdate->format('Y-m-d');
                                                    $length = $tdate->diffInDays($now);
                                                    $indiv =  \App\Holiday::where('idSchool', '=', Auth::guard('school')->user()->idSchool)
                                                            ->where('idClass',$std->idClass)
                                                            ->whereDate('fromDate', '<=', $jdate)
                                                            ->whereDate('toDate', '>=', $jdate)
                                                            ->first();
                                            
                                                    
                                                     $aintime = \App\Attendance::where('Enrollment_Number', '=', $std->ecNo)
                                                             ->where('Device_ID', '=', $school->Device_ID)
                                                             ->whereDate('date', '=', $jdate)
                                                             ->where('status', '=', 'IN')
                                                             ->where('idType', '=', 'A')
                                                             ->first();
                                                     $aouttime = \App\Attendance::where('Enrollment_Number', '=', $std->ecNo)
                                                             ->where('Device_ID', '=', $school->Device_ID)
                                                             ->whereDate('date', '=', $jdate)
                                                             ->where('status', '=', 'OUT')
                                                             ->where('idType', '=', 'A')
                                                             ->first();
                                                     $a_mat = \App\Attendance::where('Enrollment_Number', '=', $std->ecNo)
                                                             ->where('idSchool', '=', $school->idSchool)
                                                             ->whereDate('date', '=', $jdate)
                                                             ->where('idType', '=', 'M')->where('status', '=', 'P')
                                                             ->first();
                                                   }
                                                   ?>

                                                   <?php if($indiv != null): ?>
                                                   <span style="color:green;font-weight: bold;"><?php echo e($indiv->holidayName); ?></span>
                                                   <?php else: ?>


                                                   <?php if(array_key_exists('1', $var)): ?>
                                                   <?php if($var[1] == 'SUNDAY'): ?>
                                                    <span style="color:green;font-weight: bold;">SUNDAY</span>
                                                    <?php elseif($var[1]!=null && $var[1]!='SUNDAY'): ?>
                                                    <span style="color:green;font-weight: bold;"><?php echo e($var[1]); ?></span>
                                                   <?php elseif($aintime || $aouttime): ?>
                                                    <span style="color:green;font-weight: bold;">P</span>
                                                    <?php $total_present = $total_present + 1;
                                                    $isAdded = 1;
                                                    ?>    
                                                    <?php if($aintime): ?>
                                                    <span style="color:green;font-weight: bold;">IN: <?php echo e($aintime->TimeStamp->format('h:i:s')); ?></span>
                                                    <?php 
                                                    if($isAdded != 1) {
                                                        $total_present = $total_present + 1;
                                                         $isAdded = 1;
                                                    }
                                                    ?>   
                                                    <?php endif; ?>
                                                    <?php if($aouttime): ?>
                                                    <span style="color:red;font-weight: bold;">OUT: <?php echo e($aouttime->TimeStamp->format('h:i:s')); ?></span>
                                                    <?php endif; ?>
                                                    <?php elseif($a_mat): ?>
                                                    <span style="color:green;font-weight: bold;">P</span>
                                                    <?php
                                                        if($isAdded != 1) {
                                                        $total_present = $total_present + 1;
                                                         $isAdded = 1;
                                                    }
                                                    ?>   
                                                    <?php elseif($jdate <= $todaydate): ?>
                                                    <span style="color:red;font-weight: bold;">A</span>
                                                     <?php $total_absent = $total_absent + 1;?> 
                                                    <?php else: ?>
                                                    <span style="color:red;font-weight: bold;"></span>
                                                   <?php endif; ?>
                                                   <?php endif; ?>

                                                   <?php endif; ?>
                                            </td>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> 
                                        <td><?php echo e($total_present); ?></td>
                                        <td><?php echo e($total_absent); ?></td>
                                    </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>

                            </table>
                            <?php endif; ?>

                            </div>
                        </div>
                        
                        
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
$('.dateselector').datepicker({
      autoclose: true,
      autoWidth: false,
      format: 'dd-mm-yyyy',
      endDate: '+0d',
      orientation: 'auto'
});
$(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;
        });
    }
});
$(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:50px;">' + 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;
                });
        }
    });
$(function () {
    $('.tableexp').DataTable({
        'lengthMenu': [[25, 50, 100, - 1], [25, 50, 100, "All"]],
                dom: 'Bfrtip',
                scrollY:        "500px",
                scrollX:        true,
                scrollCollapse: true,
                fixedColumns:   {
                    left: 1
                },
                buttons: [
                        'pdf', 'print',
                        {
                            extend: 'pdfHtml5',
                            orientation: 'landscape',
                            pageSize: 'A4'

                        },
                        {
                            extend: 'csvHtml5',
                            exportOptions: {
                                format: {
                                    body: function ( data, row, column, node ) {
                                           if (column > 1) {
                                                //need to change double quotes to single
                                                splitData = data.split('<br>');
                                                data = '';
                                                for (i=0; i < splitData.length; i++) {
                                                     //add escaped double quotes around each line
                                                    splitData[i] = splitData[i].replace( '<span style="color:green;font-weight: bold;">', '' );
                                                    splitData[i] = splitData[i].replace( '<span style="color:red;font-weight: bold;">', '' );
                                                    splitData[i] = splitData[i].replace( '</span>', '' );

                                                    if (i > 0) {
                                                        data += splitData[i].replace(/\s+/g,'\n'); 
                                                    }else{
                                                        data += splitData[i];
                                                    }
                                                    
                                                }
                                                //Add concat function
                                                return data;
                                            }
                                            return data;
                                        }
                                    }
                                }
                            },{
                            extend: 'excelHtml5',
                            exportOptions: {
                                format: {
                                    body: function ( data, row, column, node ) {
                                           if (column > 1) {
                                                //need to change double quotes to single
                                                splitData = data.split('<br>');
                                                data = '';
                                                for (i=0; i < splitData.length; i++) {
                                                     //add escaped double quotes around each line
                                                    splitData[i] = splitData[i].replace( '<span style="color:green;font-weight: bold;">', '' );
                                                    splitData[i] = splitData[i].replace( '<span style="color:red;font-weight: bold;">', '' );
                                                    splitData[i] = splitData[i].replace( '</span>', '' );

                                                    if (i > 0) {
                                                        data += splitData[i].replace(/\s+/g,'\n'); 
                                                    }else{
                                                        data += splitData[i];
                                                    }
                                                    
                                                }
                                                //Add concat function
                                                return data;
                                            }
                                            return data;
                                        }
                                    }
                                }
                            }
                ]
        });
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Copyright © 2021 - 2025 IMMREX7