
<!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="{{ asset('assets/image/logo/icon.png') }}">
        <meta name="csrf-token" content="{{ csrf_token() }}"/>
        <title> @yield('title') | {{ __('messages.app_name') }}</title>
        <link rel="stylesheet" href="{{asset('assets/lib/bootstrap-5.3.1-dist/css/bootstrap.min.css')}}"/>
        <link rel="stylesheet" href="{{asset('assets/css/reportStyle.css')}}"/>
        {{-- <script type="text/javascript" src="https://ims.akms.edu.bd/uicontents/js/jquery.min.js"></script> --}}
        <script src="{{asset('assets/lib/jquery/jquery@3.7.0_dist_jquery.min.js')}}"></script>
    </head>

    <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
                            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 .= ($att_date) ? "<br>Attendance Of: <b>'". date('d-M-Y', strtotime($att_date)) ."'</b>" : "";
                            $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: #e2e2e2;">
                                <th valign="top">S/L</th>
                                <th valign="top" class="text-center">Employee Name</th>
                                <th valign="top" class="text-center">Designation</th>
                                <th valign="top" class="text-center">Employee ID</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">Duty Shift</th>
                                <th valign="top" class="text-center">Present / Absent</th>
                            </tr>
                        </thead>

                        <tbody class="contnts">
                            <?php
                            $i = 1;
                            $present = $late = 0;
                            $tAbs = $tPre = $tLvs = 0; $attStr = $style = $dat1 = $dat2 = '';
                            $delay = 0;
                            if($employeeAttendanceStatusList)
                            foreach ($employeeAttendanceStatusList as $key => $row) {
                                if($row->att_status == 1) {
                                    $tPre += 1;
                                } else {
                                    $tAbs += 1;
                                }

                                if($row->is_delay) {
                                    $delay += 1;
                                }
                                ?>
                                <tr>
                                    <td valign="top"><?php echo $i++; ?></td>
                                    <td valign="top" class="text-left"><?php echo $row->employee_name; ?></td>
                                    <td valign="top" class="text-center"><?php echo $row->designation_name; ?></td>
                                    <td valign="top" class="text-center"><?php echo $row->employee_no; ?></td>
                                    <td valign="top" class="text-center"><?php echo $row->att_date; ?></td>
                                    <td valign="top" class="text-center"><?php if($row->att_date!=$row->out_time) { echo $row->out_time ;}?></td>
                                    <td valign="top" class="text-center"><?php echo ($row->is_delay) ? '<font style="color:black">Yes</font>' : ''; ?></td>
                                    <td valign="top" class="text-center"><?php echo $special_occasion; ?></td>
                                    <td valign="top" class="text-center"><?php echo $row->duty_shift; ?></td>
                                    <td valign="top" class="text-center"><?php echo $row->attStatusTxt; ?></td>
                                </tr>
                                <?php
                                $present += ($row->att_date) ? 1 : 0;
                            } ?>

                            <tr>
                                <td colspan="10" class="text-center text-strong"><?php echo "Total Present: ".$tPre." Day(s), Total Late: " .$delay. " Day(s) And Total Absent: ".$tAbs." Day(s)";//Total Leaves : ".$tLvs." Day(s),  ?></td>
                            </tr>
                        </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>
