<?php
    $info = $this->db->get_where('teacher', array('teacher_id' => $teacher_id))->result_array();
    foreach($info as $row):
?>
    <div class="content-w"> 
	    <?php include 'fancy.php';?>
	    <div class="header-spacer"></div>
	    <div class="content-i">
		    <div class="content-box">
			    <div class="conty">
			        <div class="back backbutton">		
    	                <a title="<?php echo getEduAppGTLang('return');?>" href="<?php echo base_url();?>admin/teachers/"><i class="picons-thin-icon-thin-0131_arrow_back_undo"></i></a>	
	                </div>
    			    <div class="row">
        			    <main class="col col-xl-9 order-xl-2 col-lg-12 order-lg-1 col-md-12 col-sm-12 col-12">                
            			    <div id="newsfeed-items-grid">
    						    <div class="ui-block paddingtel">
          						    <div class="user-profile">
          							    <div class="up-head-w" style="background-image:url(<?php echo base_url();?>public/uploads/<?php echo $this->crud->getInfo('bglogin');?>)">
          								    <div class="up-main-info">
          								   	    <div class="user-avatar-w">
          								            <div class="user-avatar">
          								                <img alt="" src="<?php echo $this->crud->get_image_url('teacher', $row['teacher_id']);?>" class="bg-white">
              								        </div>
          								        </div>
          								        <h3 class="text-white"><?php echo $row['first_name'];?> <?php echo $row['last_name'];?></h3>
          								        <h5 class="up-sub-header">@<?php echo $row['username'];?></h5>
          								    </div>
          								    <svg class="decor" width="842px" height="219px" viewBox="0 0 842 219" preserveAspectRatio="xMaxYMax meet" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g transform="translate(-381.000000, -362.000000)" fill="#FFFFFF"><path class="decor-path" d="M1223,362 L1223,581 L381,581 C868.912802,575.666667 1149.57947,502.666667 1223,362 Z"></path></g></svg>
          							    </div>
          							    <div class="up-controls">
          								    <div class="row">
          								        <div class="col-lg-6">
          								            <div class="value-pair">
          								                <div><?php echo getEduAppGTLang('account_type');?>:</div>
              								            <div class="value badge badge-pill badge-success"><?php echo getEduAppGTLang('teacher');?></div>
          								            </div>
          								            <div class="value-pair">
          								                <div><?php echo getEduAppGTLang('member_since');?>:</div>
          								                <div class="value"><?php echo $row['since'];?>.</div>
              								        </div>
          								        </div>
              								</div>
          							    </div>
          							    <div class="ui-block">
										    <div class="ui-block-title">		
    											<h6 class="title"><?php echo getEduAppGTLang('assigned_subjects');?></h6>
										    </div>
										    <div class="ui-block-content">
										        <div class="row">
										        <?php 
										            $this->db->order_by('subject_id', 'desc');
										            $subjects = $this->db->get_where('subject', array('teacher_id' => $teacher_id))->result_array();
                                                    foreach ($subjects as $subject): 
                                                    $cname = $this->db->get_where('class', array('class_id' => $subject['class_id']))->row()->name;
                                                    $sname = $this->db->get_where('section', array('section_id' => $subject['section_id']))->row()->name;
                                                ?>
			                                        <div class="col col-xl-4 col-lg-6 col-md-6 col-sm-6 col-6">
			                                            <div class="ui-block" data-mh="friend-groups-item">
        				                                    <div class="friend-item friend-groups">
                                                                <div class="friend-item-content rmp">      
                                                                    <div class="course-image">
                                                                        <img src="<?php echo $this->crud->getCourseIMG($subject['icon']);?>">
                                                                    </div>
                                                                    <div class="friend-avatar">
                                                                        <div class="author-content course-content">
                                                                            <a href="<?php echo base_url();?>admin/subject_dashboard/<?php echo base64_encode($subject['class_id']."-".$subject['section_id']."-".$subject['subject_id']);?>/" class="fs16edu h5 author-name"><?php echo $subject['name'];?> - <?php echo $cname.' ('.$sname.')';?></a><br><br>
                                                                            <ul>
                                                                                <li>
                                                                                    <b><?php echo getEduAppGTLang('teacher');?>:</b> 
                                                                                    <img src="<?php echo $this->crud->get_image_url('teacher', $subject['teacher_id']);?>" class="img-teacher"> <span><?php echo $this->crud->get_name('teacher', $subject['teacher_id']);?></span>.</li>
                                                                                <li>
                                                                                    <b><?php echo getEduAppGTLang('students');?>:</b> 
                                                                                    <?php echo $this->crud->countStudentsByClass($subject['class_id'],$subject['section_id']);?>.
                                                                                </li>
                                                                                <li>
                                                                                    <b><?php echo getEduAppGTLang('reviews');?>:</b>
                                                                                    <svg class="align-sub" xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 32 32"><path fill="#fcd53f" d="m18.7 4.627l2.247 4.31a2.27 2.27 0 0 0 1.686 1.189l4.746.65c2.538.35 3.522 3.479 1.645 5.219l-3.25 2.999a2.225 2.225 0 0 0-.683 2.04l.793 4.398c.441 2.45-2.108 4.36-4.345 3.24l-4.536-2.25a2.282 2.282 0 0 0-2.006 0l-4.536 2.25c-2.238 1.11-4.786-.79-4.345-3.24l.793-4.399c.14-.75-.12-1.52-.682-2.04l-3.251-2.998c-1.877-1.73-.893-4.87 1.645-5.22l4.746-.65a2.23 2.23 0 0 0 1.686-1.189l2.248-4.309c1.144-2.17 4.264-2.17 5.398 0"/></svg>
                                                                                    <?php echo $this->crud->calculateSubjectAverage($subject['subject_id']);?>/5.0
                                                                                </li>
                                                                            </ul>
                                                                            <a class="btn btn-warning course-btn" href="<?php echo base_url();?>admin/subject_dashboard/<?php echo base64_encode($subject['class_id']."-".$subject['section_id']."-".$subject['subject_id']);?>/"><?php echo getEduAppGTLang('dashboard');?></a>
                                                                        </div>                          
                                                                    </div>   
                                                                </div>
                                                            </div>        
	    			                                    </div>
    		                                        </div>
                                                <?php endforeach;?>
			                                    </div>
    										</div>
									    </div>
              						</div>
                			    </div>
                			</div>
        			    </main>
        			    <?php include 'teacher_left.php';?>
    			    </div>
    			</div>
		    </div>
    	</div>
    </div>
<?php endforeach;?>