<div class="row">
    <div class="col-sm-12 col-md-12">
        <div class="panel panel-bd lobidrag">
            <div class="panel-heading">
                <div class="panel-title">
                    <h4><?php echo(!empty($title) ? $title : null) ?></h4>
                </div>
            </div>
            <div class="panel-body">
                <table width="100%" class="datatable table table-striped table-bordered table-hover">
                    <thead>
                    <tr>
                        <th><?php echo 'Name' ?></th>
                        <th><?php echo 'Start Date' ?></th>
                        <th><?php echo 'Start Time' ?></th>
                        <th><?php echo 'End Date' ?></th>
                        <th><?php echo 'End Time' ?></th>
                        <th><?php echo 'Reason' ?></th>
                        <th><?php echo 'Total Time (HH:MM)' ?></th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php if (!empty($overtimes)) { ?>
                        <?php $sl = 1; ?>
                        <?php foreach ($overtimes as $row) {
                            if ($row->approve_by_sup == 1) {
                                $approval = 'Approved';
                            } else if ($row->approve_by_sup == 0) {
                                $approval = 'Rejected';
                            } else {
                                $approval = 'Pending';
                            }

                            $total_time = $row->total_time;
                            $hour = floor($total_time);
                            $minute = round(($total_time - $hour) * 60);
                            ?>
                            <tr class="<?php echo ($sl & 1) ? "odd gradeX" : "even gradeC" ?>">
                                <td class="center">
                                    <p><?php echo $row->first_name . " " . $row->last_name ?></p>
                                </td>
                                <td class="center">
                                    <p><?php echo $row->ovt_start_date ?></p>
                                </td>
                                <td class="center">
                                    <p><?php echo $row->ovt_start_time ?></p>
                                </td>
                                <td class="center">
                                    <p><?php echo $row->ovt_end_date ?></p>
                                </td>
                                <td class="center">
                                    <p><?php echo $row->ovt_end_time ?></p>
                                </td>
                                <td class="center">
                                    <p><?php echo $row->ovt_reason ?></p>
                                </td>
                                <td class="center">
                                    <p><?php echo $hour . ":" . $minute ?></p>
                                </td>
                            </tr>
                            <?php $sl++; ?>
                        <?php } ?>
                    <?php } ?>
                    </tbody>
                </table>  <!-- /.table-responsive -->
            </div>
        </div>
    </div>
</div>