<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 display('cid') ?></th>
                        <th><?php echo "Employee Name" ?></th>
                        <th><?php echo display('action') ?></th>
                        <th><?php echo 'Status By Supervisor' ?></th>
                        <th><?php echo 'Status By HR' ?></th>

                    </tr>
                    </thead>
                    <tbody>
                    <?php if (!empty($resignation_details)) { ?>
                        <?php $sl = 1; ?>
                        <?php foreach ($resignation_details as $row) {

                            if ($row->approve_by_supervisor == null) {
                                $approve_by_supervisor = "Pending";
                                $color = "warning";
                            } elseif ($row->approve_by_supervisor == 0) {
                                $approve_by_supervisor = "Rejected";
                                $color = "danger";
                            } elseif ($row->approve_by_supervisor == 1) {
                                $approve_by_supervisor = "Approved";
                                $color = "success";
                            } else {
                                $approve_by_supervisor = "";
                                $color = "";
                            }

                            if ($row->approve_by_hr == null) {
                                $approve_by_hr = "Pending";
                                $color_hr = "warning";
                            } elseif ($row->approve_by_hr == 0) {
                                $approve_by_hr = "Rejected";
                                $color_hr = "danger";
                            } elseif ($row->approve_by_hr == 1) {
                                $approve_by_hr = "Approved";
                                $color_hr = "success";
                            } else {
                                $approve_by_hr = "";
                                $color_hr = "";
                            }

                            ?>
                            <tr class="<?php echo ($sl & 1) ? "odd gradeX" : "even gradeC" ?>">
                                <td><?php echo $sl; ?></td>
                                <td><?php echo $row->first_name . " " . $row->last_name ?></td>

                                <td class="center">
                                    <a href="<?php echo base_url("resignation/Resignation/view_resignation_request/$row->res_id") ?>"
                                       class="btn btn-xs btn-success">Show</a>
                                </td>
                                <td class="center">
                                    <p class="btn btn-xs btn-<?php echo $color ?>"><?php echo $approve_by_supervisor ?></p>
                                </td>
                                <td class="center">
                                    <p class="btn btn-xs btn-<?php echo $color_hr ?>"><?php echo $approve_by_hr ?></p>
                                </td>
                            </tr>
                            <?php $sl++; ?>
                        <?php } ?>
                    <?php } ?>
                    </tbody>
                </table>  <!-- /.table-responsive -->
            </div>

        </div>
    </div>
</div>








