@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="print_table" class="table table-bordered"  border="1" style="width: 100%;border-collapse: collapse;">
                    <?php
                    $month = array('01' => 'January', 
                                    '02' => 'February', 
                                    '03' => 'March', 
                                    '04' => 'April', 
                                    '05' => 'May', 
                                    '06' => 'June',
                                    '07' => 'July', 
                                    '08' => 'August', 
                                    '09' => 'September', 
                                    '10' => 'October', 
                                    '11' => 'November', 
                                    '12' => 'December');
                    ?>

                    <tr>
                        <th style ="width: 50px;text-align: center">#</th>
                        <th style ="width: 50px;text-align: center">Employee</th>
                        @foreach($month as $val => $m)
                            <th style="width: 50px;text-align: center">{{$m}}</th>
                        @endforeach
                    </tr>
                    @foreach($em['rows'] as $key => $row)
                        <tr>
                            <td>{{$key+1}}</td>
                            <td>{{$row->name}}</td>
                            <?php $total = 0; ?>
                            @foreach($month as $val => $k)
                                @php
                                    $y = date('Y');
                                    $last_day   = App\Helpers\IDate::getLastDayMonth("$y/$val/01");
                                    $leave      = App\Model\Hr\EmpLeave::getLeaveByMonth($row->id,$last_day,$y);
                                @endphp
                                <td style="width: 50px;text-align: center">{{$leave}}</td>
                            @endforeach
                        </tr>
                    @endforeach
                </table>
            </div>
        </div>
    </div>
@else
    <h1>No data!!</h1>
@endif