IMMREX7

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

<?php $__env->startSection('content'); ?>
<div class="row clearfix">
    <div class="col-lg-12 col-md-12 col-sm-12">
        <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\EmpAttendanceController@monthlyAttendance'], 'class' => 'form-horizontal']); ?>


                                    <div class="row clearfix">
                                        <div class="col-sm-4">
                                            <div class="row clearfix">
                                                <div class="col-sm-4 form-control-label">
                                                    <label for="classname">Departments</label>
                                                </div>
                                                <div class="col-sm-7">
                                                    <div class="form-group">
                                                        <?php echo Form::select('idDepartment',$departments,null,['class' => 'form-control show-tick ms']); ?>

                                                        <?php if($errors->has('idDepartment')): ?>
                                                        <label id="minmaxlength-error" class="error" for="minmaxlength">
                                                            <strong><?php echo e($errors->first('idDepartment')); ?></strong>
                                                        </label>
                                                        <?php endif; ?>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-4">
                                            <div class="row clearfix">
                                                <div class="col-sm-4 form-control-label">
                                                    <label for="classname">Designation</label>
                                                </div>
                                                <div class="col-sm-7">
                                                    <div class="form-group">
                                                    <div id="idDesignation" style="border:1px solid #ccc; width:200px; height: 150px; overflow-y: scroll;">
                                                        <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>
                                                        <?php $__currentLoopData = $designation; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key =>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:100px;"><?php echo e($value); ?></label><input type="checkbox" name="designations[]" value="<?php echo e($key); ?>" class="designationclass"></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">EC No.</label>
                                                </div>
                                                <div class="col-sm-7">
                                                    <div class="form-group">
                                                        <div id="idEmployee" style="border:1px solid #ccc; width:200px; height: 150px; overflow-y: scroll;">

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

                                        </div>
                                    </div>
                                    <div class="row clearfix">
                                        <div class="col-sm-1 form-control-label required">
                                            <label for="classname">Year</label>
                                        </div>
                                        <div class="col-sm-2">
                                            <div class="form-group">
                                                <?php echo Form::select('year',['2024'=>'2024','2025'=>'2025','2021'=>'2021',2022=>'2022','2023'=>'2023','2020'=>'2020','2019'=>'2019'],null,['class' => 'form-control show-tick ms']); ?>

                                            </div>
                                        </div>
                                        <div class="col-sm-1 form-control-label required">
                                            <label for="classname">Month</label>
                                        </div>
                                        <div class="col-sm-2">
                                            <div class="form-group">
                                                <?php echo Form::select('idMonth',getMonths(),$current_month->idMonth,['class' => 'form-control show-tick ms']); ?>

                                                <?php if($errors->has('idMonth')): ?>
                                                <label id="minmaxlength-error" class="error" for="minmaxlength">
                                                    <strong><?php echo e($errors->first('idMonth')); ?></strong>
                                                </label>
                                                <?php endif; ?>
                                            </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" data-toggle="tab" href="#profile">Month</a></li>
                        <li class="nav-item"><a class="nav-link" data-toggle="tab" href="#messages">All Time</a></li>
                    </ul>                        -->
                    <!-- Tab panes -->
                    <div>  <div class="header"><h2><strong>Employee Attandance Report (MONTHLY)</strong></h2></div>
                        <div class="body table-responsive">
                            <?php if(isset($month)): ?>
                            <?php if(count($employees)>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($var[1] == 'SUNDAY'): ?>
                                            <span style="color:green; font-weight: bold;"><?php echo e(Carbon\Carbon::parse($var[0])->format('d-m')); ?></span>
                                            <?php elseif($var[1]!=null && $var[1]!='SUNDAY'): ?>
                                            <span style="color:green; font-weight: bold;"><?php echo e(Carbon\Carbon::parse($var[0])->format('d-m')); ?></span>
                                            <?php else: ?>
                                            <?php echo e(Carbon\Carbon::parse($var[0])->format('d-m')); ?>

                                            <?php endif; ?>
                                        </th>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                       
                                        <th>TP</th>
                                        <th>TA</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__currentLoopData = $employees; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $emp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                          <?php 
                                                $total_present = 0; 
                                                $total_absent = 0; 
                                                ?>
                                        <td><?php echo e($emp->enrollmentNo); ?></td>
                                        <td><?php echo e($emp->firstName); ?> <?php echo e($emp->middleName); ?> <?php echo e($emp->lastName); ?></td>
                                        <?php $__currentLoopData = $days; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$var): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <td>
                                                 <?php
                                                   $tdate = Carbon\Carbon::parse($var[0]);
                                                   $now = Carbon\Carbon::now();
                                                   $jdate = $tdate->format('Y-m-d');
                                                   $length = $tdate->diffInDays($now);
                                                   $doSpecialShiftExisits = DB::table('special_shifts')->where('idEmployee', '=', $emp->idEmployee)->where('shift_date',$jdate)->where('type','S')->first();

                                                    $holiday = getHoliday($emp,$jdate);            

                                                    $pholiday = \App\HrmsHoliday::where('idSchool', '=', Auth::guard('school')->user()->idSchool)
                                                                ->where('idEmployee',$emp->idEmployee)
                                                                ->whereDate('fromDate', '<=', $jdate)
                                                                ->whereDate('toDate', '>=', $jdate)
                                                                ->first();            
                                                   
                                                    $aintime = \App\EmpAttendance::where('Enrollment_Number', '=', $emp->enrollmentNo)
                                                            ->where('Device_ID', '=', $school->Device_ID)
                                                            ->whereDate('date', '=', $jdate)
                                                            ->where('status', '=', 'IN')
                                                            ->where('idType', '=', 'A')
                                                            ->first();
                                                    $aouttime = \App\EmpAttendance::where('Enrollment_Number', '=', $emp->enrollmentNo)
                                                            ->where('Device_ID', '=', $school->Device_ID)
                                                            ->whereDate('date', '=', $jdate)
                                                            ->where('status', '=', 'OUT')
                                                            ->where('idType', '=', 'A')
                                                            ->first();
                                                    $a_mat = \App\EmpAttendance::where('Enrollment_Number', '=', $emp->enrollmentNo)
                                                            ->where('idSchool', '=', $school->idSchool)
                                                            ->whereDate('date', '=', $jdate)
                                                            ->where('idType', '=', 'M')
                                                            ->first();

                                                    if($doSpecialShiftExisits != null){
                                                        $var[1] = null;
                                                    }        
 
                                                   ?>
                                                    <?php if($holiday != null || $pholiday != null): ?>
                                                    <span style="color:#6572b8;font-weight:bold"><?php if($holiday != null): ?> <?php echo e($holiday->holidayName); ?> <?php else: ?> <?php echo e($pholiday->holidayName); ?> <?php endif; ?> </span>
                                                    <?php elseif($var[1] == 'SUNDAY'): ?>
                                                    <span><?php echo e($var[1]); ?></span>
                                                    <?php elseif($var[1]!=null && $var[1]!='SUNDAY'): ?>
                                                    <span><?php echo e($var[1]); ?></span>
                                                    <?php elseif($aintime || $aouttime): ?>
                                                    <span style="color:green;font-weight:bold">P</span><br>
                                                     <?php $total_present = $total_present + 1; ?>
                                                    <?php if($aintime): ?>
                                                    <span style="color:green;font-weight: bold">IN: <?php echo e(explode(" ",$aintime->TimeStamp)[1]); ?></span><br>
                                                    <?php endif; ?>
                                                    <?php if($aouttime): ?>
                                                    <span style="color:red;font-weight: bold">OUT: <?php echo e(explode(" ",$aouttime->TimeStamp)[1]); ?></span>
                                                    <?php endif; ?>
                                                    <?php elseif($a_mat): ?>
                                                    <span style="color:green;font-weight:bold">P</span>
                                                     <?php $total_present = $total_present + 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; ?>
                                            </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 else: ?>
                            <p style="color:red;"><strong>To get Attendance Report please go to 'Advance Search' and select Month.</strong></p>
                            <?php endif; ?>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
$(document).ready(function() {
    $('select[name="idDepartment"]').on('change', function() {
        var departmentID = $(this).val();
        if(departmentID) {
            $.ajax({
                url: "<?php echo e(url('/school/departments')); ?>"+'/' +departmentID + "/designations",
                type: "GET",
                dataType: "json",
                success:function(data) {
                    $('#idDesignation').empty();
                    $('#idDesignation').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) {
                       $('#idDesignation').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:100px;">'+value+'</label><input type="checkbox" name="designations[]" value="'+key+'" class="designationclass"></div>');
                        
                    });
                }
            });
        }else{
            $('select[name="idDesignation"]').empty();
        }
    });
});
$(document).on('click', '.select-all', function(){
    var checkAll = this.checked;
        if(checkAll === true){
            $('input[type=checkbox]').each(function () {
                this.checked = checkAll;
            });
            var designationIds = [];
            $("input:checkbox[name='designations[]']:checked").each(function () {
                designationIds.push($(this).val());
            });
            if (designationIds.length > 0) {
                    $.ajax({
                        url: "<?php echo e(url('/school/designations')); ?>"+'/' +designationIds + "/employees",
                        type: "GET",
                        dataType: "json",
                        success:function(data) {
                            $('#idEmployee').empty();
                            $('#idEmployee').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) {
                               $('#idEmployee').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:50px;">'+value+'</label><input type="checkbox" name="employees[]" value="'+key+'" class="empallselect"></div>');

                            });
                        }
                    });
                }
        }else{
            $('#idEmployee').empty();
            $('input[type=checkbox]').each(function () {
                this.checked = checkAll;
            });
        }
        
    
});
$(document).on('click', '.designationclass', function(){
    var designationIds = [];
        $("input:checkbox[name='designations[]']:checked").each(function () {
            designationIds.push($(this).val());
        });
        if (designationIds.length > 0) {
                $.ajax({
                        url: "<?php echo e(url('/school/designations')); ?>"+'/' +designationIds + "/employees",
                        type: "GET",
                        dataType: "json",
                        success:function(data) {
                            $('#idEmployee').empty();
                            $('#idEmployee').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) {
                               $('#idEmployee').append('<div class="checkbox-inline" style="padding-left:10px;"><label style="margin-right:50px;">'+value+'</label><input type="checkbox" name="employees[]" value="'+key+'" class="empallselect"></div>');

                            });
                        }
                    });
            }else{
                $('#idEmployee').empty();
            }
});
$(document).on('click', '.select-allstd', function(){
    var checkAllstd = this.checked;
        if(checkAllstd === true){
            $("input:checkbox[name='employees[]']").each(function () {
               this.checked = checkAllstd;
           });
        }else{
            $('.empallselect').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: [
                        'csv', 'excel', 'pdf', 'print'
                ]
        });
});
$('.dateselector').datepicker({
      autoclose: true,
      autoWidth: false,
      format: 'dd-mm-yyyy',
      endDate: '+0d',
      orientation: 'auto'
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('schools.school_layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

Copyright © 2021 - 2025 IMMREX7