<div class="col-sm-10">
    <div class="row ">
        <div class="col-sm-12 padding-zero">
            <div class="col-sm-12 ">
                <div class="col-sm-4 form-group">
                    <a href="<?php echo base_url(); ?>admin/add-topic" class="btn btn-sm btn-success ">Add Topic</a>
                </div>
            </div>
        </div>


        <div class="col-sm-12 "><br></div>
        <div class="col-sm-12" id="view_course_topic">       
            <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-4 col-sm-offset-1">Topic Name</div>
                    <div class="col-sm-4 col-sm-offset-1">Topic Parent Name</div>
                    <div class="col-sm-2">Action</div>
                    <input type="hidden" id="editURL" value="<?php echo base_url() . 'admin/edit-topic' ?>">
                </div>


                <div class="col-sm-12"><br></div> 
                <?php
                foreach ($all_topic as $topic_value) {
                    ?>
                    <div class="col-sm-12 gray_ttc " style="padding-top: 10px;padding-bottom: 10px;">
                        <div class="col-sm-4 col-sm-offset-1"><?php echo $topic_value->topic_name; ?></div>
                        <?php
                        if ($topic_value->parent_topic_id != 0) {
                            echo '<div class="col-sm-4 col-sm-offset-1"><strong>' . $topic_info[$topic_value->parent_topic_id]->topic_name . '</strong></div>';
                        } else {
                            echo '<div class="col-sm-4 col-sm-offset-1">none</div>';
                        }
                        ?>
                        <div class="col-sm-2" id="topicAction<?php echo $topic_value->topic_id; ?>">
                            <?php
                            switch ($topic_value->topic_status) {
                                case 1:
                                    ?>
                                    <a href="javascript:void(0)" data-toggle="modal" data-target="#InactiveTopic<?php echo $topic_value->topic_id; ?>"><i class="fa fa-user-plus" title="Active"></i></a>
                                    <?php
                                    break;
                                case 2:
                                    ?>
                                    <a href="javascript:void(0)" data-toggle="modal" data-target="#PendingTopic<?php echo $topic_value->topic_id; ?>"><i class="fa fa-user-times" title="Inactive"></i></a>
                                    <?php
                                    break;
                                case 3:
                                    ?>
                                    <a href="javascript:void(0)" data-toggle="modal" data-target="#ActiveTopic<?php echo $topic_value->topic_id; ?>"><i class="fa fa-refresh fa-spin" title="Pending"></i></a>
                                    <?php
                                    break;
                                case 4:
                                    ?>
                                    <a href="javascript:void(0)" data-toggle="modal" data-target="#ActiveTopic<?php echo $topic_value->topic_id; ?>"><i class="fa fa-refresh fa-spin" title="Pending"></i></a>
                                    <?php
                                    break;
                                case 5:
                                    ?>
                                    <a href="javascript:void(0)" data-toggle="modal" data-target="#PendingTopic<?php echo $topic_value->topic_id; ?>"><i class="glyphicon glyphicon-ok" title="Approved"></i></a>
                                    <?php
                                    break;
                            }
                            ?>
                            <a href="<?php echo base_url() . 'admin/edit-topic/' . $topic_value->topic_id ?>"><i class="fa fa-edit" title="Edit"></i></a>
                            <a href="javascript:void(0)" data-toggle="modal" data-target="#deleteTopic<?php echo $topic_value->topic_id; ?>"><i class="fa fa-trash-o" title="Delete"></i></a>
                        </div>
                    </div>

                    <div class="modal" style="" id="ActiveTopic<?php echo $topic_value->topic_id; ?>" tabindex="-1" role="dialog" aria-labelledby="changeRole" aria-hidden="true">
                        <?php
                        $this->cf->get_topic_status_modal($topic_value->topic_id, 'Active');
                        ?>
                    </div>
                    <div class="modal" style="" id="InactiveTopic<?php echo $topic_value->topic_id; ?>" tabindex="-1" role="dialog" aria-labelledby="changeRole" aria-hidden="true">
                        <?php
                        $this->cf->get_topic_status_modal($topic_value->topic_id, 'Inactive');
                        ?>
                    </div>
                    <div class="modal" style="" id="PendingTopic<?php echo $topic_value->topic_id; ?>" tabindex="-1" role="dialog" aria-labelledby="changeRole" aria-hidden="true">
                        <?php
                        $this->cf->get_topic_status_modal($topic_value->topic_id, 'Pending');
                        ?>
                    </div>
                    <div class="modal" style="" id="deleteTopic<?php echo $topic_value->topic_id; ?>" tabindex="-1" role="dialog" aria-labelledby="changeRole" aria-hidden="true">
                        <?php
                        $this->cf->get_topic_status_modal($topic_value->topic_id, 'Delete');
                        ?>
                    </div>
                    <?php
                }
                ?>
            </div>
        </div>




    </div>
    <div class="col-sm-12 "><br></div>
    <div class="col-sm-12 gray" style="padding-left: 10px">
        <a href="<?php echo base_url(); ?>super-admin">Dashboard</a>->> <span> Manage Course Topic </span>
    </div>
    <div class="col-sm-12 "><br></div>
</div>


<script type="text/javascript" src="<?php echo base_url(); ?>back_end_resource/topic/topic.js"></script>