<?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>
        <title>Bar Code List</title>
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link href="https://fonts.googleapis.com/css2?family=Inconsolata:wght@200;300;400;500;600;700&display=swap" rel="stylesheet"> 

        <style >
            html{padding:0px;margin:0px;}
            body{padding:0px;margin:0px;
                font-family: 'Inconsolata', monospace; 
            }
            .barcode-list {
                width:100%;
            }
             /*.student-name{padding:0px;margin:0px;text-align:center;line-height:12px;font-size:8px !important;}*/
            .barcode-list-item p img{width:100%;height:50px;}
            .barcode-data{width:100%;height:auto;}
            .barcode-data tr{width:100%;padding:0px;margin:0px;height:8% !important;}
            .barcode-data tr th{text-align:center;}
            .barcode-data tr td{width:20%;padding:0px;margin:0px;height:75px;border:1px dotted red;border-collapse:collapse !important;}
            .barcode-data tr td p{width:100%;padding:0px;margin:0px;font-size:7px;text-align:center;}
        </style>
    </head>
    <body>
        
        <div class="barcode-list">
        <table class="barcode-data">
            <tr>
                <th colspan="4" style="text-align:center !important;"><?php echo $course." ".$subject_stream; ?></th>
            </tr>
                
        <?php
        $count=0;
        $student_table='student';
        $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;
                            $break_item=$count % 5;
                            
                        ?>
                        <tr>
                            <td>
                                <p class="student-name"><?php echo $students['student_name']; ?></p>
                                <p class="student-image"><img src="<?php echo base_url()."barcode/".$students['barcode']; ?>"></p>
                            </td>
                            <td>
                                <p class="student-name"><?php echo $students['student_name']; ?></p>
                                <p class="student-image"><img src="<?php echo base_url()."barcode/".$students['barcode']; ?>"></p>
                            </td>
                            <td>
                                <p class="student-name"><?php echo $students['student_name']; ?></p>
                                <p class="student-image"><img src="<?php echo base_url()."barcode/".$students['barcode']; ?>"></p>
                            </td>
                            <td>
                                <p class="student-name"><?php echo $students['student_name']; ?></p>
                                <p class="student-image"><img src="<?php echo base_url()."barcode/".$students['barcode']; ?>"></p>
                            </td>
                            <td>
                                <p class="student-name"><?php echo $students['student_name']; ?></p>
                                <p class="student-image"><img src="<?php echo base_url()."barcode/".$students['barcode']; ?>"></p>
                            </td>
                        </tr>
                        <?php
                       
                        
                          
        
                        }
                    }
                }
            }
        }
        ?>
                <tr>
                    <th colspan="4" ><p style="text-align:center !important;">** Count : <?php echo $count; ?> End Of Document  **</p></th>
                </tr>
                
            </table>
        
        </div>                
   </body>
</html>                        

               