
<!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>
    <script type="text/javascript">

    </script>

    <body>
        <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
                            $searchCriteria = '';
                            echo '<p style="margin: 0px;font-size: 26px;font-weight:bold">'.$aInfo->name.'</p>';
                            echo '<p style="margin: 0px;margin-bottom: 15px;font-size: 16px">'.'Address: '.$aInfo->address.'</p>';
                            echo '<p style="margin: 0px;font-size: 15px;font-weight:bold">'.$stitle.'</p>';
                            $duty_shift_str = ($sInfo->duty_shift) ? ", Shift Of Duty: <b>".$sInfo->duty_shift."</b>" : "";
                            $searchCriteria .= ($aInfo->session_name) ? "Year: <b>".$aInfo->session_name."</b>, " : "";

                            $searchCriteria .= ($sdate and $edate) ? "Date Period: <b>'". date('d-M-Y', strtotime($sdate)) ."'</b> To <b>'".date('d-M-Y', strtotime($edate))."'</b>" : "";
                            echo '<p style="margin: 0px;font-size: 13px">'.$searchCriteria.'</p>';
                            echo '<p style="margin: 0px;font-size: 13px">Name: <b>'.$sInfo->employee_name . '</b>, ID : <b>'.$sInfo->employee_no.'</b>, Designation: <b>'.$sInfo->name.'</b> </p>';?>
                        </span>
                    </font>
                    <style>
                        td th {
                            border-collapse: collapse !important;
                            border: 1px solid #ccc !important;
                            padding: 3px;
                        }
                    </style>
                    <center>
                    <table class="table table-hover table-striped table-bordered padding" border="1" width="60%" style="font-size: 12px">
                        <thead>
                            <tr>
                                <th valign="top">S/L</th>
                                <th valign="top" class="text-center">Academic Date</th>
                                <th valign="top" class="text-center">In Time</th>
                                <th valign="top" class="text-center">Out Time</th>
                                <th valign="top" class="text-center">Late</th>
                                <th valign="top" class="text-center">Special Day</th>
                                <th valign="top" class="text-center">Present or Absent</th>
                            </tr>
                        </thead>

                        <tbody>
                            <?php
                        $i = 1; $tAbs = $tPre = $tLvs = 0; $attStr = $style = $dat1 = $dat2 = '';
                        $delay = 0;
                        if($attendReportSingle) {
                            $leaveDatesArr = $leave_dates ? explode(",", $leave_dates) : array();
                            foreach ($attendReportSingle as $key => $row) {

                                $dat1 = date('Y-m', strtotime($row->att_date));
                                if($row->att_status == 1) {
                                    $tPre += 1;
                                    $style = " style='color:#000 !important'";
                                } else {
                                    if(!in_array($row->att_date, $leaveDatesArr)) {
                                        $tAbs += 1;
                                    } else {
                                        $tLvs += 1;
                                    }

                                    $style = " style='color:red !important'";
                                }

                                if($row->is_delay) {
                                    $delay += 1;
                                }
                                ?>
                                <?php if($dat1 != $dat2) {?>
                                <tr>
                                    <td colspan="7" valign="top" style="text-align:center;font-weight: bold;color: #004f0f"><?php echo date('M-Y', strtotime($row->att_date)); ?></td>
                                </tr>
                                <?php } ?>
                                <tr>
                                    <td valign="top"><?php echo $i++; ?>  </td>
                                    <td valign="top" class="text-center"><?php echo date('d-M-Y', strtotime($row->att_date)); ?></td>
                                    <?php if($row->att_status > 0) { ?>
                                        <td valign="top" class="text-center"><?php echo $row->in_time; ?></td>
                                        <td valign="top" class="text-center"><?php echo $row->out_time; ?></td>
                                        <td valign="top" class="text-center"><?php echo ($row->is_delay ? 'Yes' : '' );?></td>
                                    <?php } else { ?>
                                        <td valign="top" class="text-center"><?php //echo $row->in_time; ?></td>
                                        <td valign="top" class="text-center"><?php //echo $row->out_time; ?></td>
                                        <td valign="top" class="text-center"></td>
                                    <?php } ?>
                                    <td valign="top" class="text-center"><?php echo $row->special_occasion; ?></td>
                                    <td valign="top" class="text-center" <?php echo $style?>><?php echo (!in_array($row->att_date, $leaveDatesArr)) ? $row->attendance : '<b style="color:green !important">Leave</b>'; ?></td>
                                </tr>
                                <?php
                                $dat2 = date('Y-m', strtotime($row->att_date));
                            } ?>
                            <?php // $attStr = $tPre ? "Total Present: ".$tPre : ''?>
                            <tr>
                                <td colspan="7" class="text-center text-strong"><?php echo "Total Present: ".$tPre." Day(s), Total Leaves : ".$tLvs." Day(s), Total Late: " .$delay. " Day(s) And Total Absent: ".$tAbs." Day(s)"; ?></td>
                            </tr>
                            <?php
                        } ?>
                        </tbody>
                    </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 D:\laragon\www\hr_and_att\resources\views/backend/hr/report/attendReportDetail.blade.php ENDPATH**/ ?>