<style>
    .form-outer{
        display:inline-block;
        width:100%;
    }
    
    .w-20{
        float:left;
        padding:10px;
        width:20%;
    }
    
    .w-25{
        float:left;
        padding:10px 10px 0px 10px;
        width:25%;
        height:90px;
    }
    
    .form-group{
        margin-bottom:0px !important;
    }
</style>

<?php 
$academic_session=$this->session->userdata("acedemic_session");
$y1=$this->session->userdata("y1");
$y2=$this->session->userdata("y2");
?>
<div class="container-fluid 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(); ?>ExamManagement/exam_head_master">Exam Head Master</a></li>
                <li class="breadcrumb-item">Add Exam Head</li>
            </ul>
            
            <div class="form-outer">
                <form method="post" action="#">
                    <h1 class="main-heading text-center">Add Exam Head</h1><hr>
                    <div class="w-100">
                        <?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>
                    <div class="form-group w-25">
                        <label>Academic Session</label>
                        <!--<select class="form-control" name="academic_session" required>-->
                        <!--    <option value="<?php echo $academic_session; ?>"><?php echo $y1."-".$y2; ?></option>-->
                        <!--</select>-->
                        <?php // echo $academic_session; ?>
                        <select class="form-control" name="academic_session" required>
                            <option value="">--- Select Academic Session ---</option>
                            <?php
                            $ac_sess_table="academic_session_details";
                            $all_academic_sessions=$this->ExamManagementModel->get_data($ac_sess_table);
                            if($all_academic_sessions){
                                foreach($all_academic_sessions as $ac_sess){
                            ?>
                            <option value="<?php echo $ac_sess['id']; ?>"  <?php if($ac_sess['id'] == $academic_session){ echo 'selected'; } ?>><?php echo $ac_sess['year_long']; ?></option>
                            <?php
                                }
                            }
                            ?>
                        </select>
                    </div>
                    
                    <div class="form-group w-25">
                        <label>Class</label>
                        <select class="form-control" name="class" required>
                            <option value="">--- Select Class ---</option>
                            <?php
                            $courses_table="courses";
                            $all_classes=$this->NewFeeModel->get_class_list($courses_table);
                            if($all_classes){
                                foreach($all_classes as $courses){
                            ?>
                            <option value="<?php echo $courses['course']; ?>"><?php echo $courses['course']; ?></option>
                            <?php
                                }
                            }
                            ?>
                        </select>
                    </div>
                    
                    <div class="for-group w-25">
                        <label>Exam Head</label>
                        <input type="text" name="exam_head" class="form-control" placeholder="Exam Head" required>
                    </div>
                    
                    <div class="for-group w-25">
                        <label>Exam Head Order</label>
                        <input type="number" name="exam_head_order" class="form-control" placeholder="Exam Head Order" min="1" required>
                    </div>
                    
                    
                    
                    
                    <div class="form-group w-25">
                        <label>MM</label>
                        <input type="number" class="form-control" name="max_marks" placeholder="Max Marks" >
                    </div>
                    <div class="form-group w-25">
                        <label>Status</label>
                        <select class="form-control" name="status" required>
                            <option value="">--- Status ---</option>
                            <option value="active" selected>Active</option>
                            <option value="inactive">Inactive</option>
                        </select>
                    </div>
                    <div class="form-group w-25">
                        <label>Exam Mode</label>
                        <select class="form-control" name="exam_id" required>
                            <option value="">--- Exam Mode ---</option>
                            <?php
                            $exams_table="all_exams";
                            $academic_session=$this->session->userdata("acedemic_session");
                            $all_exams=$this->ExamManagementModel->get_exams($academic_session,$exams_table);
                            if($all_exams){
                                foreach($all_exams as $exams){
                            ?>
                            <option value="<?php echo $exams['id']; ?>"><?php echo $exams['exam_title']; ?></option>
                            <?php
                                }
                            }
                            ?>
                        </select>
                    </div>
                    
                    <div class="form-group w-25">
                        <label>Freeze</label>
                        <select class="form-control" name="freeze_status" required>
                            <option value="">--- Select Freeze Status ---</option>
                            <option value="Yes">Yes</option>
                            <option value="No" selected>No</option>
                        </select>
                    </div>
                    
                    
                    
                    <div class="form-group w-25">
                        <!--<label>&nbsp;</label><br>-->
                        <button class="btn btn-sm btn-success" name="add_exam_head" type="submit">Submit</button>
                    </div>
                    
                    
                    <!--id 	 	subject 	status 	created_at 	created_by 	updated_at 	updated_by 	-->
                </form>
            </div>
            
            
        </div>
    </div>
</div>