<div class="col-sm-10">
    <div class="row ">

        <div class="col-sm-12 "><br></div>
        <div class="col-sm-12 ">
            <div class="col-sm-6">

                <label>Manage Knowledgebase </label>
                <?php //echo $total_knowledgebase->total_knowledgebase; ?>
            </div>
            <div class="col-sm-6 text-right">
                <a href="<?php echo base_url(); ?>knowledgebase" class="btn btn-success" title="Add knowledgebase"><i class="fa fa-plus-circle"></i></a>
            </div>

            <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-8">Knowledgebase Title</div>

                    <div class="col-sm-4">Action</div>
                </div>
                <div class="col-sm-12"><br></div> 
                <div class="col-sm-12 gray_ttc " style="padding-top: 10px;padding-bottom: 10px;">
                    <?php
                    foreach ($all_knowledgebase as $all_knowledgebase_info) {
                        ?>

                        <div class="col-sm-8"> <?php echo $all_knowledgebase_info->support_title; ?> </div>
                        <div class="col-sm-4">

                            <a href="<?php echo base_url();?>edit-knowledgebase/<?php echo $all_knowledgebase_info->support_id; ?>" ><i class="fa fa-edit" title="Edit"></i></a>&nbsp;
                           
                            
                            <?php if($all_knowledgebase_info->support_status == 0){ ?>
                            <a href="javascript:void(0)" data-toggle="modal" data-target="#activesupportalert<?php echo $all_knowledgebase_info->support_id ?>"><i class="fa fa-user-plus" title="Active"></i></a>&nbsp;
                           <?php } else {?>
                            <a href="javascript:void(0)" data-toggle="modal" data-target="#inactivesupportalert<?php echo $all_knowledgebase_info->support_id ?>"><i class="fa fa-user-times" title="Inactive"></i></a>&nbsp;
                            <?php }?> 
                            
                            
                            
                            <?php if ($manage_support_by_person->person_role == 6) { ?>
                                <a href="javascript:void(0)" data-toggle="modal" data-target="#deletesupportalert<?php echo $all_knowledgebase_info->support_id ?>"><i class="fa fa-trash" title="Delete"></i></a>&nbsp;
                            <?php } ?>
                        </div>


                        <div class="modal" style="" id="deletesupportalert<?php echo $all_knowledgebase_info->support_id ?>" tabindex="-1" role="dialog" aria-labelledby="changeRole" aria-hidden="true">
                            <div class="modal-dialog">
                                <div class="modal-content" style="top: 180px;border: 5px solid #80c12c;border-top: 20px solid #80c12c !important;margin: 0 auto;width: 450px">           
                                    <div class="modal-body">
                                        <h4 class="text-center">Are you sure you want to Delete this Knowledgebase?</h4>
                                    </div>
                                    <div class="modal-footer">
                                        <div  class="col-sm-12">               
                                            <button onclick="deleteknowledgebase('<?php echo base_url(); ?>delete-knowledgebase', '<?php echo base_url(); ?>manage-knowledgebase', '<?php echo $all_knowledgebase_info->support_id ?>')" style="margin-left: 90px" type="button" class="btn btn-success  col-sm-2" data-dismiss="modal">Yes</button>
                                            <button type="button" style="margin-left: 20px" class="btn btn-danger col-sm-2 col-sm-offset-4" data-dismiss="modal">No</button>
                                        </div>
                                    </div>            
                                </div>
                            </div>
                        </div> 
                        
                        
                         <div class="modal" style="" id="activesupportalert<?php echo $all_knowledgebase_info->support_id ?>" tabindex="-1" role="dialog" aria-labelledby="changeRole" aria-hidden="true">
                            <div class="modal-dialog">
                                <div class="modal-content" style="top: 180px;border: 5px solid #80c12c;border-top: 20px solid #80c12c !important;margin: 0 auto;width: 450px">           
                                    <div class="modal-body">
                                        <h4 class="text-center">Are you sure want to Active this Knowledgebase?</h4>
                                    </div>
                                    <div class="modal-footer">
                                        <div  class="col-sm-12">               
                                            <button onclick="activeknowledgebase('<?php echo base_url(); ?>active-knowledgebase', '<?php echo $all_knowledgebase_info->support_id ?>')" style="margin-left: 90px" type="button" class="btn btn-success  col-sm-2" data-dismiss="modal">Yes</button>
                                            <button type="button" style="margin-left: 20px" class="btn btn-danger col-sm-2 col-sm-offset-4" data-dismiss="modal">No</button>
                                        </div>
                                    </div>            
                                </div>
                            </div>
                        </div> 
                        
                        
                        
                          <div class="modal" style="" id="inactivesupportalert<?php echo $all_knowledgebase_info->support_id ?>" tabindex="-1" role="dialog" aria-labelledby="changeRole" aria-hidden="true">
                            <div class="modal-dialog">
                                <div class="modal-content" style="top: 180px;border: 5px solid #80c12c;border-top: 20px solid #80c12c !important;margin: 0 auto;width: 450px">           
                                    <div class="modal-body">
                                        <h4 class="text-center">Are you sure want to Inactive this Knowledgebase?</h4>
                                    </div>
                                    <div class="modal-footer">
                                        <div  class="col-sm-12">               
                                            <button onclick="inactiveknowledgebase('<?php echo base_url(); ?>inactive-knowledgebase', '<?php echo $all_knowledgebase_info->support_id ?>')" style="margin-left: 90px" type="button" class="btn btn-success  col-sm-2" data-dismiss="modal">Yes</button>
                                            <button type="button" style="margin-left: 20px" class="btn btn-danger col-sm-2 col-sm-offset-4" data-dismiss="modal">No</button>
                                        </div>
                                    </div>            
                                </div>
                            </div>
                        </div> 
                        
                    <?php }
                    ?>
                </div>
                <?php
                $total_page = ceil($total_knowledgebase->total_knowledgebase / 10);
                if ($total_page > 1) {
                    ?>
                    <nav class="course-pagination">
                        <ul class="pagination">
                            <?php
                            if ($page > 2) {
                                ?>
                                <li>
                                    <a href="<?php echo base_url() . 'manage-knowledgebase/'; ?>" aria-label="Previous">
                                        <span aria-hidden="true" title="First Page">««</span>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo base_url() . 'manage-knowledgebase/' . ($page - 1); ?>" aria-label="Previous">
                                        <span aria-hidden="true" title="Previous Page">«</span>
                                    </a>
                                </li>
                            <?php } elseif ($page > 1) { ?>
                                <li>
                                    <a href="<?php echo base_url() . 'manage-knowledgebase/' . ($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() . 'manage-knowledgebase/' . ($i + 1) . '">' . ($i + 1) . '</a></li>';
                            }
                            if ($total_page != $page) {
                                ?>                              
                                <li>
                                    <a href="<?php echo base_url() . 'manage-knowledgebase/' . ($page + 1); ?>" aria-label="Next">
                                        <span aria-hidden="true" title="Next Page">&raquo;</span>
                                    </a>
                                </li>
                                <li>
                                    <a href="<?php echo base_url() . 'manage-knowledgebase/' . $total_page; ?>" aria-label="Next">
                                        <span aria-hidden="true" title="Last Page">&raquo;&raquo;</span>
                                    </a>
                                </li>
                            <?php }
                            ?>
                        </ul>
                    </nav>

                <?php }
                ?>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="<?php echo base_url() ?>back_end_resource/support/support.js"></script>