<?php if(count($em['em_id']) > 0): ?>
    <div id="DivIdToPrint">
        <style>
            @page  {
                size: auto;
                margin: 10px auto;
            }
            @media  print {
                html, body {
                    width: 210mm;
                    height: 297mm;
                    
                }
                .page-break{
                    page-break-before: always;
                }
            }
            table {
                border-collapse: collapse;
            }

            table, th, td {
                
            }
            table thead th {
                border: none;
            }
            .container{
                width: 1024px;
                margin: 0 auto;
                
            }
            .battambong
            {
                font-family: khmer os battambang !important;
                font-size: 12px;
            }
            .arial
            {
                font-family: Arial, Helvetica, sans-serif, khmer os battambang !important;
                font-size: 12px;
            }
        </style>
        <div class="col-sm-12 col-xs-12">
            <div class="wrapper-table">
                <table id="tblData" class="table table-bordered"  border="1" style="width: 100%;border-collapse: collapse;">
                    <thead>
                        <tr>
                            <th rowspan="2">No</th>
                            <th rowspan="2">Code</th>
                            <th rowspan="2">Name</th>
                            <th rowspan="2">Department</th>
                            <?php
                                $hh = [];
                            ?>
                            <?php $__currentLoopData = $dates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $date): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php
                                    $sun_day = \App\Helpers\IDate::getDayName($date);
                                    $styles = '';
                                    if ($sun_day == 'Sunday' || $sun_day == 'Saturday')
                                    {
                                        $styles = 'color:crimson;';
                                    }

                                    $getHol = \App\Helpers\IDate::getHol(\Carbon\Carbon::parse($date)->format('Y/m/d'), $sun_day);
                                    $hh[$date] = $getHol;
                                ?>
                                <th colspan="3"  style="white-space: nowrap; <?php echo e($styles.$hh[$date]); ?>"><?php echo e($date); ?></th>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tr>
                        <tr>
                            <?php
                                $hh = [];
                            ?>
                            <?php $__currentLoopData = $dates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $date): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php
                                    $sun_day = \App\Helpers\IDate::getDayName($date);
                                    $styles = '';
                                    if ($sun_day == 'Sunday' || $sun_day == 'Saturday')
                                    {
                                        $styles = 'color:crimson;';
                                    }

                                    $getHol = \App\Helpers\IDate::getHol(\Carbon\Carbon::parse($date)->format('Y/m/d'), $sun_day);
                                    $hh[$date] = $getHol;
                                ?>
                                <th style="white-space: nowrap; <?php echo e($styles.$hh[$date]); ?>">Present</th>
                                <th style="white-space: nowrap; <?php echo e($styles.$hh[$date]); ?>">Absent</th>
                                <th style="white-space: nowrap; <?php echo e($styles.$hh[$date]); ?>">Missing</th>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tr>
                    </thead>
                    <tbody>
                    <?php
                        $no = 1;
                    ?>
                    <?php $__currentLoopData = $em['rows']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td><?php echo e($no); ?></td>
                            <td><?php echo e($row->code); ?></td>
                            <td style="white-space: nowrap; "><?php echo e($row->name); ?></td>
                            <td style="white-space: nowrap; "><?php echo e(optional($row->_department)->english_name); ?></td>
                            <?php $__currentLoopData = $dates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $date): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php
                                    $att = App\Model\Hr\TimeAttendanceGenModel::where('emp_id', $row->id)
                                                        ->whereRaw(" (date(cin) = '{$date}' OR  date(cout) = '{$date}')")
                                                        ->selectRaw(' TIME(cin) AS cin,  TIME(cout) AS cout ')
                                                        ->first();
                                    
                                    $present = '';
                                    $miss = '';
                                    $absent = '';
                                    if ($att!= null)
                                    {
                                        $present = 'p';
                                        if($att->cin == '' || $att->cout == '')
                                        {
                                            $miss = 'm';
                                        }
                                    }else{
                                        $absent = 'a';
                                    }
            
                                ?>
                                <td><?php echo e($present); ?></td>
                                <td><?php echo e($absent); ?></td>
                                <td><?php echo e($miss); ?></td>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tr>
                        <?php
                            $no++
                        ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <tbody>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
<?php else: ?>
    <h1>No data!!</h1>
<?php endif; ?>
<?php /**PATH /home/nsowos/public_html/shr-brand/resources/views/hr/report-attendance/show-daily-attend-summary.blade.php ENDPATH**/ ?>