<?php
$tid=$this->uri->segment('3');
$teacher_profile_data =$this->SchoolModel->teacher_profile($tid);

if($teacher_profile_data){
    foreach($teacher_profile_data as $records){ 
?>

<div class="container mt-3 mb-3 pt-3 pb-3 bg-white">
    <div class="row">
        <div class="col-sm-12">
            <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();?>school/profile">Profile</a></li>
                <li class="breadcrumb-item">Update Educational Information</li>
            </ul>
            
            <form method="post" action="#">
                <?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
                }
                ?>
                <input type="hidden" value="<?php echo $records['id'];?>" name="tid">
                <div class="form-group">
                    <label>Name : <span><?php echo form_error('name');?></span></label>
                    <input type="text" name="teacher_name" value="<?php echo $records['salutation']; echo " "; echo $records['name'];?>" class="form-control" placeholder="Your Name" readonly>
                </div>

                <div class="form-group">
                    <label>Father Name : <span><?php echo form_error('father_name');?></span></label>
                    <input type="text" name="father_name" value="<?php echo $records['father_name'];?>" class="form-control" placeholder="Father's Name" readonly>
                </div>
                <div class="form-group">
                    <label>Educational Qualifications : <span><?php echo form_error('educational_qualification_1');?></span></label>    
                    <input type="text" class="form-control" name="educational_qualification_1" id="educational_qualification_1" value="<?php echo $records['educational_qualification1'];?>" placeholder="Educational Qualification 1">
                    <label><span><?php echo form_error('educational_qualification_2');?></span></label>
                    <input type="text" class="form-control" name="educational_qualification_2" id="educational_qualification_2" value="<?php echo  $records['educational_qualification2'];?>" placeholder="Educational Qualification 2">
                    <label><span><?php echo form_error('educational_qualification_3');?></span></label>
                    <input type="text" class="form-control" name="educational_qualification_3" id="educational_qualification_3" value="<?php echo $records['educational_qualification3'];?>" placeholder="Educational Qualification 3">
                </div>

                <div class="form-group">
                    <label>Highest Academic Qualification : <span><?php echo form_error('highest_qualification');?></span></label>    
                    <select  name="highest_qualification" id="highest_qualification" class="form-control">
                        <option value="">Select</option>    
                        <option value="B.Ed."   <?php if($records['highest_qualification']=='B.Ed.'){echo "selected";}?>>B.Ed.</option>
                        <option value="M.Ed."   <?php if($records['highest_qualification']=='M.Ed.'){echo "selected";}?>>M.Ed.</option>
                    </select>
                </div>

                <div class="form-group">
                    <label>Date of Joining : <span><?php echo form_error('date_of_joining');?></span></label>
                    <input type="date" name="date_of_joining" id="date_of_joining" class="form-control" value="<?php echo $records['date_of_joining']; ?>" />
                </div>

                <div class="form-group">
                    <label>Total Teaching Experience : <span><?php echo form_error('total_teaching_experience');?></span></label>    
                    <input type="number" class="form-control"  name="total_teaching_experience" id="total_teachiing_experience" value="<?php echo $records['total_teaching_experience'];?>">
                </div>
                
                <div class="form-group">
                    <label>Designation :</label>    
                    <label><span><?php echo form_error('designation');?></span></label>
                    <input type="text" class="form-control" id="designation" value="<?php echo $records['designation'];?>" name="designation" placeholder="Designation">
                </div>

                                <div class="form-group">
                                    <label>Teaching Classes : <span><?php echo form_error('teaching_classes');?></span></label> 
                                    <select name="teaching_classes" id="teaching_classes" class="form-control">
                                        <option value="">Select</option>    
                                        <option value="ISC" <?php if($records['teaching_classes']=='ISC'){echo "selected";}?>>ISC</option>    
                                        <option value="ICSE" <?php if($records['teaching_classes']=='ICSE'){echo "selected";}?>>ICSE</option>    
                                        <option value="6-8" <?php if($records['teaching_classes']=='6-8'){echo "selected";}?>>6-8</option>    
                                        <option value="PRIMARY" <?php if($records['teaching_classes']=='PRIMARY'){echo "selected";}?>>PRIMARY</option>    
                                        <option value="PRE-PRIMARY" <?php if($records['teaching_classes']=='PRE-PRIMARY'){echo "selected";}?>>PRE-PRIMARY</option>    
                                    </select>
                                </div>

                                <div class="form-group">
                                    <label>Employment Nature  : <span><?php echo form_error('emp_nature');?></span></label>  
                                    <select name="emp_nature" id="emp_nature" class="form-control">
                                        <option value="">Select</option>
                                        <option value="Permanent" <?php if($records['employee_nature']=='Permanent'){echo "selected";}?>>Permanent</option>    
                                        <option value="Temporary" <?php if($records['employee_nature']=='Temporary'){echo "selected";}?>>Temporary</option>
                                        <option value="Contractual" <?php if($records['employee_nature']=='Contractual'){echo "selected";}?>>Contractual</option>
                                        <option value="Probation" <?php if($records['employee_nature']=='Probation'){echo "selected";}?>>Probation</option>
                                    </select>
                                </div>

                                <div class="form-group">
                                    <label>Staff Category : <span><?php echo form_error('staff_category');?></span></label>   
                                    <select name="staff_category" id="staff_category" class="form-control">
                                        <option value="">Select</option>
                                        <option value="teaching-staff" <?php if($records['staff_category']=='teaching-staff'){echo "selected";}?>>Teaching Staff</option>
                                        <option value="non-teaching-staff" <?php if($records['staff_category']=='non-teaching-staff'){echo "selected";}?>>Non Teaching Staff</option>
                                    </select>
                                </div>


                                <div class="form-group">
                                    <label>Subject Taught:</label> <br>
                                    <label><span><?php echo form_error('subject1');?></span></label>
                                    <select name="subject1" id="subject1" class="form-control">
                                        <option value="">Select Subject 1</option>
                                        <option value="English" <?php if($records['subject_taught1']=='English'){echo "selected";}?>>English</option>
                                        <option value="Hindi" <?php if($records['subject_taught1']=='Hindi'){echo "selected";}?>>Hindi</option>
                                        <option value="Maths" <?php if($records['subject_taught1']=='Maths'){echo "selected";}?>>Maths</option>
                                        <option value="Science" <?php if($records['subject_taught1']=='Science'){echo "selected";}?>>Science</option>
                                        <option value="Social-Science" <?php if($records['subject_taught1']=='Social-Science'){echo "selected";}?>>Social-Science</option>
                                        <option value="Sanskrit" <?php if($records['subject_taught1']=='Sanskrit'){echo "selected";}?>>Sanskrit</option>
                                        <option value="Art" <?php if($records['subject_taught1']=='Art'){echo "selected";}?>>Art</option>
                                        <option value="Sports" <?php if($records['subject_taught1']=='Sports'){echo "selected";}?>>Sports and Physical Education</option>
                                        <option value="Yoga" <?php if($records['subject_taught1']=='Yoga'){echo "selected";}?>>Yoga</option>
                                    </select>

                                    <label><span><?php echo form_error('subject2');?></span></label>
                                    <select name="subject2" id="subject2" class="form-control">
                                        <option value="">Select Subject 2</option>
                                        <option value="English" <?php if($records['subject_taught2']=='English'){echo "selected";}?>>English</option>
                                        <option value="Hindi" <?php if($records['subject_taught2']=='Hindi'){echo "selected";}?>>Hindi</option>
                                        <option value="Maths" <?php if($records['subject_taught2']=='Maths'){echo "selected";}?>>Maths</option>
                                        <option value="Science"  <?php if($records['subject_taught2']=='Science'){echo "selected";}?>>Science</option>
                                        <option value="Social-Science" <?php if($records['subject_taught2']=='Social-Science'){echo "selected";}?>>Social-Science</option>
                                        <option value="Sanskrit" <?php if($records['subject_taught3']=='Sanskrit'){echo "selected";}?>>Sanskrit</option>
                                        <option value="Art" <?php if($records['subject_taught3']=='Art'){echo "selected";}?>>Art</option>
                                        <option value="Sports" <?php if($records['subject_taught3']=='Sports'){echo "selected";}?>>Sports and Physical Education</option>
                                        <option value="Yoga" <?php if($records['subject_taught3']=='Yoga'){echo "selected";}?>>Yoga</option>
                                    </select>

                                    <label><span><?php echo form_error('subject3');?></span></label>
                                    <select name="subject3" id="subject3" class="form-control">
                                        <option value="">Select Subject 3</option>
                                        <option value="English" <?php if($records['subject_taught1']=='English'){echo "selected";}?>>English</option>
                                        <option value="Hindi" <?php if($records['subject_taught3']=='Hindi'){echo "selected";}?>>Hindi</option>
                                        <option value="Maths" <?php if($records['subject_taught3']=='Maths'){echo "selected";}?>>Maths</option>
                                        <option value="Science" <?php if($records['subject_taught3']=='Science'){echo "selected";}?>>Science</option>
                                        <option value="Social-Science" <?php if($records['subject_taught3']=='Social-Science'){echo "selected";}?>>Social-Science</option>
                                        <option value="Sanskrit" <?php if($records['subject_taught3']=='Sanskrit'){echo "selected";}?>>Sanskrit</option>
                                        <option value="Art" <?php if($records['subject_taught3']=='Art'){echo "selected";}?>>Art</option>
                                        <option value="Sports" <?php if($records['subject_taught3']=='Sports'){echo "selected";}?>>Sports and Physical Education</option>
                                        <option value="Yoga" <?php if($records['subject_taught3']=='Yoga'){echo "selected";}?>>Yoga</option>
                                    </select>
                                </div>
                
                <div class="form-group">
                    <button type="submit" name="update_educational_information" class="btn btn-sm btn-success">Update Contact Information</button>
                </div>
                
            </form>
        </div>
    </div>
</div>

<?php
    }
}
?>