<div class="col-sm-8">
    <div class="row ">
        <div class="col-sm-12 ">
            <div class="col-sm-12">
            </div>

            <div class="col-sm-12 " >
                <div class="col-sm-12 gray_ttc text-left pa" style="border-bottom: 2px solid #8CC73F;padding-top: 20px;padding-bottom: 17px;font-weight: bold">

                    <div class="col-xs-7 col-sm-9 padding-zero">Class Details</div>
                    <div class="col-xs-5 col-sm-3 ">Action</div>

                </div>
                <div class="col-sm-12"><br></div> 
                <div class="col-sm-12">
                    <p>
                        <?php
                        if ($classroom_status_message !== '') {
                            echo $classroom_status_message;
                        }
                        ?>
                    </p>
                </div> 


                <?php
                $classroom_status = array('Not Started', 'Running', 'End', 'Unexpected End', 'Not Held', 'Canceled', 'Archived', 'Draft');
                foreach ($all_classes as $class_value) {
                    ++$i;
                    ?>
                    <div class="col-sm-12 <?php
                    if ($i % 2 == 0) {
                        echo 'white';
                    } else {
                        echo 'gray';
                    }
                    ?>">
                        <div class="col-xs-7  col-sm-9 text-left">
                            <address>
                                <span class="row col-sm-12" >   
                                    <span class="col-sm-4" style="padding:0">Course Name</span>
                                    <span class="col-sm-1" style="padding:0">: </span>
                                    <span class="col-sm-6" style="padding:0">
                                        <a href="<?php echo base_url() . $course_info[$class_value->classroom_id]->url; ?>" target="_blank">
                                            <?php
                                            echo $course_info[$class_value->classroom_id]->course_name;
                                            ?>
                                        </a>
                                    </span>
                                </span>

                                <span class="row col-sm-12">   
                                    <span class="col-sm-4" style="padding:0">Classroom Title</span>
                                    <span class="col-sm-1" style="padding:0">: </span>
                                    <span class="col-sm-6" style="padding:0"><?php echo $class_value->classroom_title ?></span>
                                </span>



                                <span class="row col-sm-12" >   
                                    <span class="col-sm-4" style="padding:0">Class Status</span>
                                    <span class="col-sm-1" style="padding:0">: </span>
                                    <span class="col-sm-6" style="padding:0">
                                        <?php
                                        if ($class_value->classroom_status == '0') {
                                            $todays_date1 = date('Y-m-d H:i', (time() - $this->session->userdata('time_offset')));
                                            if ($class_value->class_start_time > $todays_date1) {
                                                $todays_date = new DateTime($todays_date1, new DateTimeZone($person_info->person_time_zone));
                                                $class_start_time1 = date('Y-M-d H:i:s', (strtotime($class_value->class_start_time)));
                                                $class_start_time = new DateTime($class_start_time1, new DateTimeZone($person_info->person_time_zone));
                                                $interval = $class_start_time->diff($todays_date);
                                                echo 'Start In ' . $this->cf->format_interval($interval);
                                            } else {
                                                echo 'Not Started';
                                            }
                                        } else {
                                            echo $classroom_status[$class_value->classroom_status];
                                        }
                                        ?>    
                                    </span>
                                </span>

                                <span class="row col-sm-12" >
                                    <span class="col-sm-4" style="padding:0">Presented by</span>
                                    <span class="col-sm-1" style="padding:0">: </span>
                                    <span class="col-sm-6" style="padding:0">
                                        <?php
                                        if ($resource_person_info[$class_value->classroom_id]->resource_person_type == 3) {
                                            ?>
                                            <a href="<?php echo base_url() . $organization_info[$class_value->classroom_id]->url ?>">
                                                <?php echo $organization_info[$class_value->classroom_id]->person_first_name . ' ' . $organization_info[$class_value->classroom_id]->person_last_name; ?>
                                            </a>
                                            <?php
                                        } else if ($resource_person_info[$class_value->classroom_id]->resource_person_type == 1) {
                                            echo 'Talha Training';
                                        } else {
                                            ?>
                                            <a href="<?php echo base_url() . $resource_person_info[$class_value->classroom_id]->url ?>">
                                                <?php echo $resource_person_info[$class_value->classroom_id]->person_first_name . ' ' . $resource_person_info[$class_value->classroom_id]->person_last_name; ?>
                                            </a>
                                            <?php
                                        }
                                        ?>
                                    </span>
                                </span>

                                <span class="row col-sm-12" >   
                                    <span class="col-sm-4" style="padding:0">Duration</span>
                                    <span class="col-sm-1" style="padding:0">: </span>
                                    <span class="col-sm-6" style="padding:0"><?php echo $class_value->class_duration; ?> Minutes</span>
                                </span>
                            </address>
                        </div>
                        <div class="col-xs-5  col-sm-3 text-left" style="padding: 20px 0 0 0" >    
                            <?php
                            if ($status == 1) {
                                ?>
                                <span>&nbsp;&nbsp;</span>
                                <a href="javascript:void(0)" onclick="checkStudentClassroomAction('<?php echo base_url() . 'check-learner-classroom-action' ?>', 'Cancel', '<?php echo $class_value->classroom_student_id; ?>')">
                                    <i class="fa  fa-times" title="Cancel Class"></i>
                                </a>&nbsp;&nbsp;&nbsp;
                                <?php
                            } else if ($status == 2) {
//                                if ($class_value->classroom_status == 1) {
                                    ?>
                                    <a href="<?php echo base_url() . $class_value->url ?>" target="_blank" >
                                        <i class="fa  fa-play-circle-o" title="Join Class"></i>
                                    </a>&nbsp;&nbsp;&nbsp;
                                    <?php
//                                }
                            } else if ($status == 3) {
                                ?>
                                <span>&nbsp;&nbsp;</span>
                                <a href="javascript:void(0)" onclick="checkStudentClassroomAction('<?php echo base_url() . 'check-learner-classroom-action' ?>', 'Delete', '<?php echo $class_value->classroom_student_id; ?>')">
                                    <i class="fa fa-trash-o" title="Delete"></i>
                                </a>&nbsp;&nbsp;&nbsp;
                                <?php
                            }
                            ?>
                        </div>
                    </div>
                    <div class="col-sm-12"><br></div>
                    <?php
                }
                ?>


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


<!--                <div class="col-sm-12"><br></div>
                <div class="col-sm-12">
                    <h3>
                        TT Upcoming Course:
                    </h3>
                    <hr><br>
                </div>
                <div class="col-sm-12 " style="padding: 0">


                    <div><br></div>
                    <div class="text-right">
                        <a href="<?php //echo base_url() . 'course'; ?>" >More ...</a>
                    </div>
                </div>
                <div class="col-sm-12">
                    <h3>
                        TT Video course:
                    </h3>
                    <hr><br>

                </div>

                <div class="col-sm-12 " style="padding: 0">

                    <div><br></div>
                    <div class="text-right"><a href="<?php //echo base_url() . 'course'; ?>" >More ...</a></div>
                    <div><br><br></div>
                </div> -->
                <div class="col-sm-12"><br></div> 
            </div>
        </div><!-- /.row gray -->
    </div>
</div>
<script type="text/javascript" src="<?php echo base_url() ?>front_end_resource/classroom/classroom.js"></script>
