<?php 
    $running_year = $this->crud->getInfo('running_year');
    $info = base64_decode($data);
    $ex = explode('-', $info);
    $sub = $this->db->get_where('subject', array('subject_id' => $ex[2]))->result_array();
    foreach($sub as $row):
    $students   =   $this->db->get_where('enroll' , array('class_id' => $ex[0], 'section_id' => $ex[1] , 'year' => $running_year))->result_array();
?>
    <div class="content-w">
        <div class="conty">
        <?php include 'fancy.php';?>
        <div class="header-spacer"></div>
            <?php include 'subject_header.php';?>
            <div class="container-fluid">
                <div class="content-box">
                    <div class="back mb-3">
                        <a class="fs-16" href="<?php echo base_url();?>admin/subject_dashboard/<?php echo $data;?>/"><i class="picons-thin-icon-thin-0131_arrow_back_undo"></i> <span><?php echo getEduAppGTLang('return_to_dashboard');?></span></a>
                    </div>
                    <div class="row">
                        <main class="col col-xl-12 order-xl-2 col-lg-12 order-lg-1 col-md-12 col-sm-12 col-12">
                            <div class="ui-block">
                                <article class="hentry post thumb-full-width">                
                                    <div class="post__author author vcard inline-items">
                                        <img src="<?php echo base_url();?>public/uploads/<?php echo $this->crud->getInfo('logo');?>" class="no-border">                
                                        <div class="author-date">
                                            <a class="h6 post__author-name fn" href="javascript:void(0);"><?php echo getEduAppGTLang('students_progress');?>.</a>
                                        </div>                
                                    </div>         
                                    <?php $activities = $this->academic->getAllAcitivityProgress($ex[0], $ex[1], $ex[2]);?>
                                    <div class="edu-posts cta-with-media">
                                            <div class="table-responsive">
                                                <table class="table-bordered">
                                                    <tr style="background: #dadada;">
                                                        <td style="vertical-align:bottom" class="pda"><?php echo getEduAppGTLang('student');?></td>
                                                        <?php 
                                                            foreach($activities as $activity):
                                                        ?>
                                                        <td class='rtxt'>
                                                            <?php echo $activity['title'];?>
                                                        </td>
                                                        <?php endforeach;?>
                                                    </tr>
                                                    <?php $n = 1; foreach($students as $st): $n++;?>
                                                    <?php if($n == 2):?>
                                                    <tr>
                                                        <td style="padding:10px;"><?php echo getEduAppGTLang('name');?>/<?php echo getEduAppGTLang('activity');?></td>
                                                        <?php 
                                                            foreach($activities as $activity):
                                                        ?>
                                                        <td align="center" style="padding:10px;">
                                                            <?php if($activity['activity_type'] == 'homework'):?>
                                                            <svg data-toggle="tooltip" data-placement="right" data-original-title="<?php echo getEduAppGTLang('homework');?>" class="align-sub" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 36 36"><path fill="currentColor" d="M9 17.41V27h9.59l-2-2H11v-5.59z" class="clr-i-outline clr-i-outline-path-1"></path><path fill="currentColor" d="M34.87 32.29L32 29.38V32H4v-4.15h2v-1.6H4V19.6h2V18H4v-6.4h2V10H4V4.41l15.94 15.85v-2.82L3.71 1.29A1 1 0 0 0 2 2v31a1 1 0 0 0 1 1h31.16a1 1 0 0 0 .71-1.71" class="clr-i-outline clr-i-outline-path-2"></path><path fill="currentColor" d="M24 30h4a2 2 0 0 0 2-2V8.7l-2.3-4.23a2 2 0 0 0-1.76-1a2 2 0 0 0-1.76 1.08L22 8.72V28a2 2 0 0 0 2 2m0-20.8l1.94-3.77L28 9.21V24h-4Zm0 16.43h4v2.44h-4Z" class="clr-i-outline clr-i-outline-path-3"></path><path fill="none" d="M0 0h36v36H0z"></path></svg>
                                                            <?php elseif($activity['activity_type'] == 'exam'):?>
                                                            <svg data-toggle="tooltip" data-placement="right" data-original-title="<?php echo getEduAppGTLang('online_exam');?>" class="align-sub" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24"><path fill="currentColor" d="M4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H8V4h12zm-6.49-5.84c.41-.73 1.18-1.16 1.63-1.8c.48-.68.21-1.94-1.14-1.94c-.88 0-1.32.67-1.5 1.23l-1.37-.57C11.51 5.96 12.52 5 13.99 5c1.23 0 2.08.56 2.51 1.26c.37.6.58 1.73.01 2.57c-.63.93-1.23 1.21-1.56 1.81c-.13.24-.18.4-.18 1.18h-1.52c.01-.41-.06-1.08.26-1.66m-.56 3.79c0-.59.47-1.04 1.05-1.04c.59 0 1.04.45 1.04 1.04c0 .58-.44 1.05-1.04 1.05c-.58 0-1.05-.47-1.05-1.05"></path></svg>
                                                            <?php elseif($activity['activity_type'] == 'live'):?>
                                                            <svg data-toggle="tooltip" data-placement="right" data-original-title="<?php echo getEduAppGTLang('live_class');?>" class="align-sub" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 3h1m17 0h-1m0 0v12h-6m6-12H4m0 0v12h6m0 0l-2 6m2-6h4m0 0l2 6m-5-10V7l3 2z"></path></svg>
                                                            <?php elseif($activity['activity_type'] == 'forum'):?>
                                                            <svg data-toggle="tooltip" data-placement="right" data-original-title="<?php echo getEduAppGTLang('forum');?>" class="align-sub" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="2"><path d="M15 11H9"></path><path stroke-linejoin="round" d="M14 19c3.771 0 5.657 0 6.828-1.172C22 16.657 22 14.771 22 11c0-3.771 0-5.657-1.172-6.828C19.657 3 17.771 3 14 3h-4C6.229 3 4.343 3 3.172 4.172C2 5.343 2 7.229 2 11c0 3.771 0 5.657 1.172 6.828c.653.654 1.528.943 2.828 1.07"></path><path d="M14 19c-1.236 0-2.598.5-3.841 1.145c-1.998 1.037-2.997 1.556-3.489 1.225c-.492-.33-.399-1.355-.212-3.404L6.5 17.5"></path></g></svg>
                                                            <?php endif;?>
                                                        </td>
                                                        <?php endforeach;?>
                                                    </tr>
                                                    <?php endif;?>
                                                    <tr>
                                                        <td class="pda"><img alt="" src="<?php echo $this->crud->get_image_url('student',$st['student_id']);?>" width="25px" class="tbl-user"> <?php echo $this->crud->get_name('student', $st['student_id']);?></td>
                                                        <?php 
                                                            foreach($activities as $activity):
                                                        ?>
                                                        <td align="center" style="padding:3px">
                                                            <?php if($this->academic->checkActivityStatus($activity['activity_id'], $st['student_id'], $activity['activity_type']) == 1):?>
                                                            <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24"><g fill="none" stroke="#90be2e" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="4"/><path d="m9 12l2.25 2L15 10"/></g></svg>
                                                            <?php else:?>
                                                            <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24"><path fill="none" stroke="#e63d29" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7.2v9.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874c.427.218.987.218 2.105.218h9.606c1.118 0 1.677 0 2.104-.218c.377-.192.683-.498.875-.874c.218-.428.218-.986.218-2.104V7.197c0-1.118 0-1.678-.218-2.105a2.001 2.001 0 0 0-.875-.874C18.48 4 17.92 4 16.8 4H7.2c-1.12 0-1.68 0-2.108.218a1.999 1.999 0 0 0-.874.874C4 5.52 4 6.08 4 7.2"/></svg>
                                                            <?php endif;?>
                                                        </td>
                                                        <?php endforeach;?>
                                                    </tr>
                                                    <?php endforeach;?>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                </article>
                            </div>
                        </main>
                    </div>
                </div>
                <a class="back-to-top" href="javascript:void(0);">
                    <img src="<?php echo base_url();?>public/style/olapp/svg-icons/back-to-top.svg" alt="arrow" class="back-icon">
                </a>
            </div>
        </div>
    </div>
      <?php endforeach;?>