<?php
$tid=$this->uri->segment('3');
$class=$this->uri->segment('4');
$section=$this->uri->segment('5');
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Class-<?php echo $class."-".$section; ?></title>
        <style>
            .w-100{width:100%;}
            html{padding:0px;margin:0px;}
            body{padding:15px;margin:0px;font-size:15px;}
            table{border:2px solid;border-collapse:collapse;}
            
            tr td,tr th{border:1px solid;border-collapse:collapse;}
        </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:12px;
                text-align:center;
            }

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

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

            #student th {
                padding-top: 8px;
                padding-bottom: 8px;
                text-align: center;
                background-color: #EAEDED;
                /*color: white;*/
                font-size:13px;
                
            }
        </style>
    </head>
    <body>
        <div class="">
            <table class="table table-bordered table-striped" id="student">
                <thead>
                    <tr>
                        <th colspan="8">SJEC <?php echo "Class : ".$class."-".$section; ?></th>
                    </tr>
                    <tr>
                        <th>#</th>
                        <th>Sch. No.</th>
                        <th>Student Name</th>
                        <th>Father's Name</th>
                        <th>Mother's Name</th>
                        <th>D.O.B.</th>
                        <th>Contact No.</th>
                        <th>Alt. No.</th>
                    </tr>    
                </thead>    
                <tbody>
                <?php 
                $acedemic_session=$this->session->userdata('acedemic_session');
                $all_students=$this->WelcomeModel->get_students_ac_session_by_class($acedemic_session,$class,$section);
                $count=0;
                if($all_students){
                    foreach($all_students as $data){
                        $student_table='student';
                        $get_student_data=$this->WelcomeModel->get_item_data($data['sid'],$student_table);
                        if($get_student_data ){
                            foreach($get_student_data as $students){
                                if($students['status'] ==1){
                                    $count++;    
                                ?>
                    <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 date('d-m-Y',strtotime($students['dob'])); ?></td>
                        <td><?php echo $students['contact_no']; ?></td>
                        <td><?php echo $students['alternate_no']; ?></td>
                    </tr>


                <?php
                                }
    
                            }    
                        }
                    }
                }
    
                ?>    
                </tbody>
            </table>
         
        </div>

  
    </body>
</html>    