<?php
$acedemic_session=$this->session->userdata('acedemic_session');
$course_id=$this->uri->segment('3');
$courses_table='courses';
$course='';
$subject_stream='';
$get_course_info=$this->NewFeeModel->get_item_data($course_id,$courses_table);
if($get_course_info){
    foreach($get_course_info as $course_info){
        $course=$course_info['course'];
        $subject_stream=$course_info['subject_stream'];
    }
}
?>
<!DOCTYPE html>
<html>
    <head>
        <?php   
        $acedemic_session=$this->session->userdata('acedemic_session');
        ?>
        <style>
            .w-100{width:100%;}
            .w-50-1{width:50%;float:left;height:100%;border-right:1px dotted red;}
            .w-50-2{width:50%;float:left;height:100%;}
            .w-2{width:0%;float:left;}
            img{height:80px;width:auto;}
            html{padding:0px;margin:0px;}
            body{padding:25px;margin:0px;font-size:12px;}
        </style>
        <style>
            #student {
                font-family: Arial, Helvetica, sans-serif;
                border-collapse: collapse;
                width: 100%;
            }

            #student td, #student th {
                border: 1px solid #ddd;
                padding: 5px;
  
            }

            #student td{
                font-size:8px;
            }

            #student tr:nth-child(even){background-color: #f2f2f2;}

            #student tr:hover {background-color: #ddd;}

            #student th {
                padding-top: 8px;
                padding-bottom: 8px;
                text-align: left;
                background-color: #EAEDED;
                color: #000;
            }
        </style>
    </head>
    <body>
        <div class="container bg-white mt-3 mb-3 pt-3 pb-3">
            <div class="row">
                <div class="col-sm-12">
                    <table style="width:100%;margin:0px;padding:0px;border:1px solid;background:#fff;color:#4F3F85">
                        <tr style="width:100% !important;padding:0px !important;">
                            <th style="width:30%;background:;border-bottom:1px solid red;">
                                <img src="<?php echo school_logo_full; ?>" style="">
                            </th>
                            <td style="width:70%;height:80px;background:;margin:0px;text-align:center;padding:0px;border-bottom:1px solid red;padding-right:20px;">
                                <p style="padding:0px;margin:0px;font-size:26px;font-weight:700;"><?php echo school_full_name; ?></p>
                                <p style="padding:0px;margin:0px;font-size:18px;font-weight:500;"><?php echo school_affiliation;?></p>
                    
                
                                <?php
                                $acedemic_session=$this->session->userdata('acedemic_session');
                                $acedemic_session_table='academic_session_details';
                                $get_ac_sess_data=$this->WelcomeModel->get_item_data($acedemic_session,$acedemic_session_table);
                                if($get_ac_sess_data){
                                    foreach($get_ac_sess_data as $ac_sess_data){
                                ?>
                                <p style="text-align:center;padding:0px;margin:0px;font-size:16px;font-weight:500;">Academic Year : <?php echo $ac_sess_data['year_long'];?></p>
                                <p style="text-align:center;font-size:14px;font-weight:600;padding:0px;margin:0px;">Course : <?php echo $course; echo " "; echo $subject_stream;?></p>
                                <?php
                                    }
                                }
                                ?>
                            </td>
                        </tr>
                    </table>
                    <div class="table-responsive ">
                        <table class="table table-bordered table-striped" id="student">
                            <thead>
                                <!--<tr>-->
                            
                                <!--    <th colspan="3">Acedemic Session : <?php echo $this->session->userdata('ac_year');?></th>-->
                                <!--    <th colspan="2">Class: <?php echo $course;?></th>-->
                                <!--</tr>-->
                                <tr>
                                    <th>#</th>
                                    <th>Sch. No.</th>
                                    <th>Name</th>
                                    <th>Father's Name</th>
                                    <th>Mother's Name</th>
                                    <th>Mobile No.</th>
                                    <th>D.O.B.</th>
                                    <th>Class</th>
                                    <th>Section</th>
                                </tr>
                            </thead>
                            <tbody>
                            <?php
                            $count=0;
                            $student_table='student';
                            $get_all_students=$this->WelcomeModel->get_active_data_in_alp_order_new($course_id,$acedemic_session);
                            // $get_all_students=$this->WelcomeModel->get_active_data_in_alp_order($student_table);
                            if($get_all_students){
                                foreach($get_all_students as $students){
                                    // $sid=$students['id'];
                                    // $check_student_in_acedemic_session=$this->WelcomeModel->get_student_in_acedemic_session($sid,$acedemic_session);
                                    // if($check_student_in_acedemic_session){
                                    //     foreach($check_student_in_acedemic_session as $ac_exist){
                                        
                                    //         if($ac_exist['course_id'] == $course_id){
                                            $count = $count + 1;
                            ?>
                                <tr>
                                    <td><?php echo $count;?></td>
                                    <td><?php echo $students['sch_no'];?></td>
                                    <td><?php echo $students['student_name'];?></td>
                                    <td><?php echo $students['father_name'];?></td>
                                    <td><?php echo $students['mother_name'];?></td>
                                    <td><?php echo $students['contact_no']?></td>
                                    <td><?php if($students['dob'] !="" && $students['dob'] !='0000-00-00'){ echo date('d-m-Y',strtotime($students['dob'])); }else{ echo "---"; }?></td>
                                    <td><?php echo $students['current_class']?></td>
                                    <td><?php echo $students['current_section']?></td>
                                </tr>                            
                                                                 
                                     
                            <?php
                                    //         }
                                    //     }
                                    // }
                                
                                }
                            }
                            ?>
                        
                        

                            </tbody>
                        </table>
                    </div>
            
                </div>
            </div>
        </div>
    </body>
</html>
        