<style>
.contact-div{background:#CFD8DC;color:#463F8B;}
.contact-us-section{box-shadow:0 0 2px white;border-radius:12px;background:#fff;}
.form-group input{border-width: 3px;font-weight: 700 }
.form-group select{border-width: 3px;font-weight: 700 }
</style>
<div class="container-fluid p-3 contact-div">
<div class="row">

<div class="col-sm-12">

<div class="contact-us-section p-3">
<h1 class="text-center">Edit Student Detail</h1>	
<form method="post" action="#">
<?php
$table='student';
$student_id=$this->uri->segment('3');
$get_student_data=$this->StudentModel->get_data_by_id($student_id,$table);
if($get_student_data){
foreach($get_student_data as $data){
?>   
<div class="form-group">
<label>Student Name <span class="text-danger"></span></label>	
<input type="text" class="form-control" name="Student_name" placeholder="Student Name" value="<?php echo $data['student_name'] ?>">
</div>

<div class="form-group">
<label>Course Name <span class="text-danger"></span></label>	
<select name="course_name" class="form-control">
	<option value="">Select</option>
<?php
$table='courses';
$school_id=$this->session->userdata('school_id');
$get_student_data=$this->StudentModel->get_data($school_id,$table);
if($get_student_data){
foreach($get_student_data as $data1){
?>
  <option value="<?php echo $data1['id']; ?>" <?php if($data['class'] == $data1['id']){echo "selected";} ?> ><?php echo $data1['course_name']; ?></option>
<?php
}
}
?>
</select>
</div>

<div class="form-group">
<label>Father Name<span class="text-danger"><?php echo form_error('father_name');?></span></label>
<input type="text" name="father_name" placeholder="Father Name" class="form-control" value="<?php echo $data['father_name'] ?>">
</div>

<div class="form-group">
<label>Student Address<span class="text-danger"><?php echo form_error('student_address');?></span></label>
<input type="text" name="student_address" placeholder="Student Address" class="form-control" value="<?php echo $data['address'] ?>">
</div>

<div class="form-group">
<label>Student Email<span class="text-danger"><?php echo form_error('student_email');?></span></label>
<input type="Email" name="student_email" placeholder="Student Email" class="form-control" value="<?php echo $data['email'] ?>">
</div>

<div class="form-group">
<label>Mobile No<span class="text-danger"><?php echo form_error('mobile_no');?></span></label>
<input type="number" name="mobile_no" placeholder="Mobile No" class="form-control" value="<?php echo $data['contact_no'] ?>">
</div>
<br>
<?php
}}
 ?>
<div class="form-group">
<input type="submit" name="submit" class="btn btn-sm btn-success" value="Submit">
</div>

</form>
</div>
    
</div>

</div>
</div>