<div class="col-sm-12" ><br>  <hr></div>
<div class="col-sm-12" >
    <div class="col-sm-12 gray_ttc" style="border-bottom: 2px solid #8CC73F;padding-top: 10px;padding-bottom: 10px;font-weight: bold">
        <div class="col-sm-3">Category Name</div>
        <div class="col-sm-3">Parent Category</div>
        <div class="col-sm-2">Access Level</div>
        <div class="col-sm-2">View Status</div>
        <div class="col-sm-2">Action</div>
    </div>
    <div id="view_category_page">
        <?php
        foreach ($all_course_category as $category_value) {
            ?>
            <div class="col-sm-12"><br></div> 
            <div class="col-sm-12 gray_ttc " style="padding-top: 10px;padding-bottom: 10px;">
                <div class="col-sm-3 "><?php echo $category_value->course_category_name; ?></div>
                <div class="col-sm-3 "><?php 
                    if(isset($parent_category[$category_value->course_category_parent_id]->course_category_name)){
                        echo $parent_category[$category_value->course_category_parent_id]->course_category_name; 
                    } ?>
                </div>
                <div class="col-sm-2 text-center" id="access_level_action<?php echo $category_value->course_category_id; ?>">
                    <?php
                    if ($category_value->course_category_access_level == 2) {
                        ?>
                        <a href="javascript:void(0)"
                           onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Access Level', 'public')" >
                            <i class="fa fa-users" title="Public"></i>
                        </a>
                        <?php
                    } else if ($category_value->course_category_access_level == 1) {
                        ?>
                        <a href="javascript:void(0)"
                           onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Access Level', 'tt_user')" >
                            <img src="<?php echo base_url() ?>image/dashboard-tt-icon.png" title="TalhaTraining" alt="TalhaTraining">
                        </a>
                        <?php
                    }
                    ?>
                </div>
                <div class="col-sm-2 text-center" id="view_status_action<?php echo $category_value->course_category_id; ?>">
                    <?php
                    if ($category_value->course_category_home_page_view == 1) {
                        ?>
                        <a href="javascript:void(0)"
                           onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'View Status', 'yes')" >
                            <i class="fa fa-check-circle" title="Yes"></i>
                        </a>
                        <?php
                    } else if ($category_value->course_category_home_page_view == 2) {
                        ?>
                        <a href="javascript:void(0)"
                           onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'View Status', 'no')" >
                            <i class="fa fa-times" title="NO"></i>
                        </a>
                        <?php
                    }
                    ?>

                </div>
                <div class="col-sm-2" id="status_action<?php echo $category_value->course_category_id; ?>">
                    <?php
                    switch ($category_value->course_category_status) {
                        case 1:
                            ?>
                            <span>&nbsp;</span>
                            <a href="javascript:void(0)"
                               onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Status', 'inactive')" >
                                <i class="fa fa-user-times" title="Inactive"></i>
                            </a>
                            <span>&nbsp;</span>
                            <a href="javascript:void(0)"
                               onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Status', 'pending')" >
                                <i class="fa fa-refresh fa-spin" title="Pending"></i>
                            </a>
                            <span>&nbsp;</span>
                            <a href="javascript:void(0)"
                               onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Status', 'archive')" >
                                <i class="fa fa-archive" title="Archive"></i>
                            </a>
                            <span>&nbsp;</span>
                            <a href="javascript:void(0)"
                               onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Status', 'delete')" >
                                <i class="fa fa-trash-o" title="Delete"></i>
                            </a>
                            <span>&nbsp;</span>
                            <a href="<?php echo base_url() . 'super-admin/edit-course-category/' . $category_value->url ?>"><i class="fa fa-edit" title="Edit"></i></a>
                            <?php
                            break;
                        case 2:
                            ?>
                            <span>&nbsp;</span>
                            <a href="javascript:void(0)"
                               onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Status', 'active')" >
                                <i class="fa fa-user-plus" title="Acitve"></i>
                            </a>
                            <span>&nbsp;</span>
                            <a href="javascript:void(0)"
                               onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Status', 'pending')" >
                                <i class="fa fa-refresh fa-spin" title="Pending"></i>
                            </a>
                            <span>&nbsp;</span>
                            <a href="javascript:void(0)"
                               onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Status', 'archive')" >
                                <i class="fa fa-archive" title="Archive"></i>
                            </a>
                            <span>&nbsp;</span>
                            <a href="javascript:void(0)"
                               onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Status', 'delete')" >
                                <i class="fa fa-trash-o" title="Delete"></i>
                            </a>
                            <span>&nbsp;</span>
                            <a href="<?php echo base_url() . 'super-admin/edit-course-category/' . $category_value->url ?>"><i class="fa fa-edit" title="Edit"></i></a>
                            <?php
                            break;
                        case 3:
                            ?>
                            <span>&nbsp;</span>
                            <a href="javascript:void(0)"
                               onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Status', 'active')" >
                                <i class="fa fa-user-plus" title="Acitve"></i>
                            </a>
                            <span>&nbsp;</span>
                            <a href="javascript:void(0)"
                               onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Status', 'delete')" >
                                <i class="fa fa-trash-o" title="Delete"></i>
                            </a>
                            <span>&nbsp;</span>
                            <a href="<?php echo base_url() . 'super-admin/edit-course-category/' . $category_value->url ?>"><i class="fa fa-edit" title="Edit"></i></a>
                            <?php
                            break;
                        case 4:
                            ?>
                            <span>&nbsp;</span>
                            <a href="javascript:void(0)"
                               onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Status', 'approved')" >
                                <i class="glyphicon glyphicon-ok" title="Approved"></i>
                            </a>
                            <span>&nbsp;</span>
                            <a href="javascript:void(0)"
                               onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Status', 'delete')" >
                                <i class="fa fa-trash-o" title="Delete"></i>
                            </a>
                            <span>&nbsp;</span>
                            <a href="<?php echo base_url() . 'super-admin/edit-course-category/' . $category_value->url ?>"><i class="fa fa-edit" title="Edit"></i></a>
                            <?php
                            break;
                        case 5:
                            ?>
                            <span>&nbsp;</span>
                            <a href="javascript:void(0)"
                               onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Status', 'active')" >
                                <i class="fa fa-user-plus" title="Acitve"></i>
                                <span>&nbsp;</span>
                                <a href="javascript:void(0)"
                                   onclick="checkChildID('<?php echo base_url() . 'super-admin/change-course-category-action'; ?>', '<?php echo $category_value->course_category_id; ?>', 'Status', 'delete')" >
                                    <i class="fa fa-trash-o" title="Delete"></i>
                                </a>
                                <span>&nbsp;</span>
                                <a href="<?php echo base_url() . 'super-admin/edit-course-category/' . $category_value->url ?>"><i class="fa fa-edit" title="Edit"></i></a>
                                <?php
                                break;
                        }
                        ?>
                </div>
            </div>
            <?php
        }
        ?>
    </div>

    <!--Start Pagination-->
    <?php
    $total_page = ceil($total_course_category->total_course_category / 10);
    if ($total_page > 1) {
        ?>
        <nav class="course-pagination">
            <ul class="pagination">
                <?php
                if ($page > 2) {
                    ?>
                    <li>
                        <a href="<?php echo base_url() . 'super-admin/manage-course-category/'; ?>" aria-label="Previous">
                            <span aria-hidden="true" title="First Page">&laquo;&laquo;</span>
                        </a>
                    </li>
                    <li>
                        <a href="<?php echo base_url() . 'super-admin/manage-course-category/' . ($page - 1); ?>" aria-label="Previous">
                            <span aria-hidden="true" title="Previous Page">&laquo;</span>
                        </a>
                    </li>
                <?php } elseif ($page > 1) { ?>
                    <li>
                        <a href="<?php echo base_url() . 'super-admin/manage-course-category/' . ($page - 1); ?>" aria-label="Previous">
                            <span aria-hidden="true" title="Previous Page">&laquo;</span>
                        </a>
                    </li>
                    <?php
                }
                for ($i = 0; $total_page > $i; $i++) {
                    echo '<li><a href="' . base_url() . 'super-admin/manage-course-category/' . ($i + 1) . '">' . ($i + 1) . '</a></li>';
                }
                if ($total_page != $page) {
                    ?>
                    <li>
                        <a href="<?php echo base_url() . 'super-admin/manage-course-category/' . ($page + 1); ?>" aria-label="Next">
                            <span aria-hidden="true" title="Next Page">&raquo;</span>
                        </a>
                    </li>
                    <li>
                        <a href="<?php echo base_url() . 'super-admin/manage-course-category/' . $total_page; ?>" aria-label="Next">
                            <span aria-hidden="true" title="Last Page">&raquo;&raquo;</span>
                        </a>
                    </li>
                <?php } ?>
            </ul>
        </nav>
    <?php } ?>

    <!--End Pagination-->

</div>