<style>
    h1{
        font-size:26px;
        text-align:center;
    }
    
    .w-50{
        width:50%;
        float:left;
        padding:20px;
        display:inline-block;
    }
    tr th,tr td{
        text-align:center;
    }
    
    form{
        display:inline-block;
        width:100%;
        
    }
</style>
<?php
$acedemic_session=$this->session->userdata('acedemic_session');
?>
<div class="container-fluid mt-3 mb-3 bg-white">
    <div class="row">
        <div class="col-sm-12 pt-3 pb-3">
            
            <ul class="breadcrumb">
                <li class="breadcrumb-item">
                    <a href="<?php echo base_url(); ?>Welcome">Home</a>
                </li>
                <li class="breadcrumb-item">
                    <a href="<?php echo base_url(); ?>Examination/all_classes">All Courses</a>
                </li>
                <li class="breadcrumb-item">Admit Card</li>
            </ul>
            
            <div class="p-3">
                <form method="post" action="#">
                    <h1>Generate Admit Card</h1><hr>
                    <?php
                    if($success){
                    ?>
                    <div class="alert alert-success"><?php echo $success; ?></div>
                    <?php
                    }
                    
                    if($error){
                    ?>
                    <div class="alert alert-danger"><?php echo $error; ?></div>
                    <?php
                    }
                    ?>
                    
                    <div class="form-group w-50">
                    <label>Exam Title</label>
                    <select class="form-control" name="exam_id">
                        <?php
                        $count=0;
                        $table="exam_list";
                        
                        $get_list_data=$this->NewExamModel->get_exams($acedemic_session,$table);
                        if($get_list_data){
                            foreach($get_list_data as $list_data){
                                $count=$count + 1;
                                $status=$list_data['status'];
                        ?>
                        <option value="<?php echo $list_data['id']; ?>"><?php echo $list_data['exam_title']; ?></option>
                        <?php
                            }
                        }
                        ?>    
                    </select>
                    </div>
                    
                    <div class="form-group w-50">
                        <?php
                        $y1=$this->session->userdata('y1');
                        $y2=$this->session->userdata('y2');
                        ?>
                        <label>Acedemic Session</label>
                        <select class="form-control" name="acedemic_session">
                            <option value="<?php echo $acedemic_session; ?>"><?php echo $y1."-".$y2; ?></option>
                        </select>
                        <input type="hidden" name="y1" value="<?php echo $y1; ?>">
                        <input type="hidden" name="y2" value="<?php echo $y2; ?>">
                    </div>
                    
                    <div class="form-group w-50">
                        <label>Issue Date</label>
                        <input type="date" name="issue_date" class="form-control" placeholder="Exam Title">
                    </div>
                    
                    <div class="form-group w-50">
                        <label>End Date</label>
                        <input type="date" name="end_date" class="form-control" placeholder="Exam Title">
                    </div>
                    
                    <div class="form-group">
                        <?php
                        $table="courses";
                        $all_courses=$this->NewExamModel->get_data($table);
                        if($all_courses){
                            foreach($all_courses as $courses){
                        ?>
                        <label style="width:50%;float:left;padding-left:20px;"><input type="checkbox" name="course[]" value="<?php echo $courses['id']; ?>">&nbsp;<?php 
                            if($courses['subject_stream'] !=""){ echo $courses['course']."-".$courses['subject_stream'];
                            }else{
                                echo $courses['course'];
                            }
                            ?></label>
                        <?php
                            }
                        }
                        ?>
                    </div>
                    <br><br>
                    <div class="form-group" style="width:100%;display:inline-block;">
                        <button type="submit" name="generate_admit_card" class="btn btn-sm btn-success">Submit</button>
                    </div>
                </form>
            </div>
            
            
        </div>
    </div>
</div>