<table class="table table-striped table-bordered table-hover gridTable">
    <thead>
    <tr>
        <th>SN</th>
        <th>Degree</th>
        <th>POLICY</th>
        <th>LETTER</th>
        <th>MARKS FROM</th>
        <th>MARKS TO</th>
        <th>GRADE POINT</th>
        <th>Action</th>
    </tr>
    </thead>
    <tbody>
    <?php if (!empty($grade)): $sn = 1; ?>
        <?php foreach ($grade as $row) { ?>
            <tr class="gradeX" id="row_<?php echo $row->GR_ID; ?>">
                <td <?php echo ($row->ACTIVE_STATUS == 1) ? "" : "class='inactive'"; ?>>
                    <span><?php echo $sn++; ?></span><span class="hidden" id="loader_<?php echo $row->GR_ID; ?>"></span>
                </td>
                <td <?php echo ($row->ACTIVE_STATUS == 1) ? "" : "class='inactive'"; ?>><?php echo $row->DEGREE_NAME; ?></td>
                <td <?php echo ($row->ACTIVE_STATUS == 1) ? "" : "class='inactive'"; ?>><?php echo $row->GR_POLICY_NAME; ?></td>
                <td <?php echo ($row->ACTIVE_STATUS == 1) ? "" : "class='inactive'"; ?>><?php echo $row->GR_LETTER; ?></td>
                <td <?php echo ($row->ACTIVE_STATUS == 1) ? "" : "class='inactive'"; ?>><?php echo number_format($row->GR_MARKS_FROM, 2); ?></td>
                <td <?php echo ($row->ACTIVE_STATUS == 1) ? "" : "class='inactive'"; ?>><?php echo number_format($row->GR_MARKS_TO, 2); ?></td>
                <td <?php echo ($row->ACTIVE_STATUS == 1) ? "" : "class='inactive'"; ?>><?php echo number_format($row->GRADE_POINT, 2); ?></td>
                <td style="width: 140px" <?php echo ($row->ACTIVE_STATUS == 1) ? "" : "class='inactive'"; ?>>
                    <?php if ($previlages->UPDATE == 1) { ?>
                        <a class="label label-default openModal" id="<?php echo $row->GR_ID; ?>" title="Update Grade"
                           data-action="Coe/gradeFormUpdate" data-type="edit"><i class="fa fa-pencil"></i></a>
                    <?php
                    }
                    if ($previlages->DELETE == 1) {
                        ?>
                        <a class="label label-danger deleteItem" id="<?php echo $row->GR_ID; ?>"
                           title="Click For Delete" data-type="delete" data-field="GR_ID" data-tbl="exam_grade"><i
                                class="fa fa-times"></i></a>
                    <?php
                    }

                    if ($previlages->STATUS == 1) {
                        ?>
                        <a class="itemStatus" id="<?php echo $row->GR_ID; ?>"
                           data-status="<?php echo $row->ACTIVE_STATUS ?>" data-fieldId="GR_ID"
                           data-field="ACTIVE_STATUS" data-tbl="exam_grade" data-su-url="Coe/gradeById">
                            <?php echo ($row->ACTIVE_STATUS == 1) ? '<span class="label label-success" title="Click For Inactive">Inactive</span>' : '<span class="label label-danger" title="Click For Active">Active</span>' ?>
                        </a>
                    <?php
                    }
                    ?>
                </td>
            </tr>
        <?php } ?>
    <?php endif; ?>
    </tbody>
    <tfoot>
    <tr>
        <th>SN</th>
        <th>Degree</th>
        <th>POLICY</th>
        <th>LETTER</th>
        <th>MARKS FROM</th>
        <th>MARKS TO</th>
        <th>GRADE POINT</th>
        <th>Action</th>
    </tr>
    </tfoot>
</table>