
<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <style type="text/css">
        @media print {
            .print {
                display: none;
            }

            .rowcolor {
                background-color: #CCCCCC !important;
            }

            body {
                padding: 3px;
                font-size: 24px
            }
        }


        .loader {
            border: 16px solid #f3f3f3;
            border-radius: 50%;
            border-top: 16px solid #3498db;
            width: 120px;
            height: 120px;
            -webkit-animation: spin 2s linear infinite;
            animation: spin 2s linear infinite;
        }

        @-webkit-keyframes spin {
            0% { -webkit-transform: rotate(0deg); }
            100% { -webkit-transform: rotate(360deg); }
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        </style>
        <link rel="shortcut icon" href="<?php echo e(asset('assets/image/logo/icon.png')); ?>">
        <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>"/>
        <title> <?php echo $__env->yieldContent('title'); ?> | <?php echo e(__('messages.app_name')); ?></title>
        <link rel="stylesheet" href="<?php echo e(asset('assets/lib/bootstrap-5.3.1-dist/css/bootstrap.min.css')); ?>"/>
        <link rel="stylesheet" href="<?php echo e(asset('assets/css/reportStyle.css')); ?>"/>
        
        <script src="<?php echo e(asset('assets/lib/jquery/jquery@3.7.0_dist_jquery.min.js')); ?>"></script>
    </head>

    <body>
        <script type="text/javascript">
            function singleAttendance(session_id, reg_id, sdate, edate) {

                screenWidth = screen.width;
                screenHeight = screen.height;
                var wSize = (screenWidth * 70) / 100;
                var hSize = (screenHeight * 98) / 100;
                var left = (screenWidth * 10) / 100;
                var top = 20;

                // <?php /*var url = "{{ route('popup') }}" + "?param1=" + param1 + "&param2=" + param2*/ ?>;

                var url = '/system/hr_reports/attendReportDetails' + "?session_id=" + session_id + "&reg_id=" + reg_id +
                "&sdate=" + sdate + "&edate=" + edate;

                var newwindow = window.open(url, 'Attendance Details', 'width='+wSize+', height='+hSize+', scrollbars=yes,top = ' + top + ',left=' + left);

                if (window.focus) {
                    newwindow.focus();
                }
            }
        </script>
        <div class="container">
            <div class="row">
                <div class="col-md-12" style="text-align:center">
                    <font class="text-center">
                        <span style="border: 0px solid #000; padding: 3px 30px;">
                            <?php
                            echo '<p style="margin: 0px;font-size: 26px;font-weight:bold">'.$aInfo->name.'</p>';
                            ?>
                            <p style="margin: 0px;font-size: 16px">
                            <?php
                            $searchCriteria = '';
                            echo '<p style="margin: 0px;font-size: 15px;font-weight:bold">'.$stitle.'</p>';
                            // $searchCriteria .= "Year: <b>".$aInfo->semester_name."</b> ";
                            $searchCriteria .= "<br>Branch: <b>". (($branch_name) ? $branch_name : "All") ."</b>";
                            $searchCriteria .= ", Department: <b>". (($department_name) ? $department_name : "All") ."</b>";
                            $searchCriteria .= ", Designation: <b>". (($designation_name) ? $designation_name : "All") ."</b>";

                            $searchCriteria .= ($sdate and $edate) ? "<br>From: <b>'". date('d-M-Y', strtotime($sdate)) ."'</b> To: <b>'".date('d-M-Y', strtotime($edate))."'</b>" : "";
                            // $searchCriteria .= (!$emp_type) ? "<br> Employee Type: All Type" : (($emp_type == 'T') ? " <br> Employee Type: Teacher" : (($emp_type == 'S') ? " <br> Employee Type: Staff" : " <br> Employee Type: Founder"));
                            $searchCriteria .= (!$duty_shift) ? ", Shift: <b>Full Time</b>" : ", Shift: <b>$duty_shift</b>";
                            $searchCriteria .= (!$abPrStatus) ? ", Status: All Absent & Present" : (($abPrStatus == 'ab') ? ", Status: Absent " : ", Status: Present");
                            echo '<p style="margin: 0px;font-size: 13px">'.$searchCriteria.'</p>';?>
                            </p>
                        </span>
                    </font>
                    <style>
                    td th {
                        border-collapse: collapse !important;
                        border: 1px solid #ccc !important;
                        padding: 3px;
                    }
                    </style>

                    <table class="table table-hover table-striped table-bordered padding" border="1" width="100%" style="font-size: 12px">
                        <thead>
                            <tr style="background: #ccc !important">
                                <th valign="top">S/L</th>
                                <th valign="top" class="text-left">Employee ID</th>
                                <th valign="top" class="text-left">Employee Name</th>
                                <th valign="top" class="text-center">Designation</th>
                                <!-- <th valign="top" class="text-center">Phone No.</th> -->
                                <th valign="top" class="text-center">Shift</th>
                                <th valign="top" class="text-center">First Join<br>Date</th>
                                <th valign="top" class="text-center">Present<br>Days</th>
                                <th valign="top" class="text-center">Late</th>
                                <th valign="top" class="text-center">Absent<br>Days</th>
                                <th valign="top" class="text-center print_hide"></th>
                            </tr>
                        </thead>

                        <tbody class="contnts">
                            <?php if($attendanceData): ?>
                            <?php $__currentLoopData = $attendanceData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            
                            <tr>
                                <td valign="top" class="text-center"><?php echo e(++$key); ?></td>
                                <td valign="top" class="text-center"><?php echo e($row->employee_no); ?></td>
                                <td valign="top" class="text-left"><?php echo e($row->employee_name); ?></td>
                                <td valign="top" class="text-left"><?php echo e($row->post_name); ?></td>
                                <td valign="top" class="text-center"><?php echo e($row->duty_shift); ?></td>
                                <td valign="top" class="text-center"><?php echo e(date('d-M-Y', strtotime($row->joining_date))); ?></td>
                                <td valign="top" class="text-center" title="Present"><?php echo e($row->present ?: ''); ?></td>
                                <td valign="top" class="text-center" title="total late"><?php echo e($row->total_late ?: ''); ?></td>
                                <td valign="top" class="text-center" title="absent">
                                    <?php
                                        if($row->joined_date > $sdate) {
                                            $date1  = date_create("$row->joined_date");
                                        } else {
                                            $date1  = date_create("$sdate");
                                        }

                                        if($row->released_on) {
                                            if($row->released_on < $edate) {
                                                $date2  = date_create("$row->released_on");
                                            } else {
                                                $date2  = date_create("$edate");
                                            }
                                        } else {
                                            $date2  = date_create("$edate");
                                        }
                                        if($date1 < $date2) {
                                            $diff = date_diff($date1,$date2);
                                            $total_days_in_range = $diff->format("%a");
                                            echo (($total_days_in_range + 1) - ($row->present + $row->total_holidays + $row->total_leaves));
                                            // echo '<br>total_days_in_range: ' . $total_days_in_range . ', present: ' . $row->present . ', total_holidays: ' . $row->total_holidays . ', total_leaves: ' . $row->total_leaves;
                                        } else {
                                            echo 'Released';
                                        }
                                    ?>
                                </td>
                                <td valign="top" class="text-center print_hide">
                                    <a href="javascript:singleAttendance(<?php echo $session_id.",". $row->employee_no.",'". $sdate."','". $edate."'" ?>)" class="btn btn-sm btn-info">Details</a>
                                </td>
                            </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php endif; ?>
                        </tbody>
                        <tfoot>

                        </tfoot>
                    </table>
                    <br>
                    <br>
                    <div class="" style="position: fixed; bottom: 2px; left: 45%">
                        <input type="button" name="" value="Back" class="btn btn-sm btn-warning print_hide" onclick="window.close()">
                        <input type="button" name="" value="Print" class="btn btn-sm btn-success print_hide" onclick="window.print()">
                        <input type="button" name="" value="Close" class="btn btn-sm btn-danger print_hide" onclick="window.close()">
                    </div>
                </div>
            </div>
        </div>


        <div id="loading" style="display: none; position: fixed;top: 0; width: 100%; z-index: 1000000; background: rgba(0,0,0,0.5);height: 100%;">
            <div class="text-center" style="margin-left:50%; margin-top:10%">
                <div class="loader" aria-hidden="true"></div>
            </div>
        </div>
    </body>
</html>
<?php /**PATH /home/ussitbd/public_html/hr.ussitbd.com/resources/views/backend/hr/report/attendReportMulti.blade.php ENDPATH**/ ?>