<div class="container-fluid mt-3 mb-3">
<div class="row">
<div class="col-sm-12">
<h5 class="text-success font-weight-bold mt-3">Exam Remark</h5>
<form method="post">
<?php 
if($success){
?>
<div class="alert alert-success" role="alert">
<?php echo $success;?>
</div>
<?php
}

?>
<?php 
$sid=$this->uri->segment('3');
$get_remarks_data=$this->ExamModel->get_student_remark($sid);
if($get_remarks_data){
foreach($get_remarks_data as $remarks_data){
if($remarks_data['quote_for']=='yearly'){
?>
<label><?php echo $remarks_data['quote_for'];?></label>
<input type="text" class="form-control" value="<?php echo $remarks_data['quote']; ?>" readonly >
<?php
}
}
}
?>
<div class="form-group">
<input type="hidden" name="sid" value="<?php echo $sid; ?>" >
</div>

<div class="form-group">
<label>Select Exam Mode</label>
<select class="form-control" name="exam_type">
<!--<option value="half_yearly">Half Yearly </option>-->
<option value="yearly">Yearly Exam</option>
</select>
</div>

<!--<div class="form-group">-->
<!--<input type="text" class="form-control" name="remark_quote" placeholder="Enter Remark">-->
<!--</div>-->

<div class="form-group">
<select name="remark_quote" class="form-control">
<option value="Promoted to class LKG">Promoted to class LKG</option>
<option value="Promoted to class UKG">Promoted to class UKG</option>
<option value="Promoted to class 1">Promoted to class 1</option>
<option value="Promoted to class 2">Promoted to class 2</option>
<option value="Promoted to class 3">Promoted to class 3</option>
<option value="Promoted to class 4">Promoted to class 4</option>
<option value="Promoted to class 5">Promoted to class 5</option>
<option value="Promoted to class 6">Promoted to class 6</option>
<option value="Promoted to class 7">Promoted to class 7</option>
<option value="Promoted to class 8">Promoted to class 8</option>
<option value="Promoted to class 9">Promoted to class 9</option>
<option value="Promoted to class 10">Promoted to class 10</option>
</select>
</div>

<div class="form-group">
<input type="submit" class="btn btn-success btn-sm" value="Update remark" name="add_remark">
</div>


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



<?php 
$eclass='';
$get_student_data=$this->ExamModel->get_student_data($sid);
if($get_student_data){
foreach($get_student_data as $student_data){
$eclass=$student_data['class'];
}
}
$working_days=0;
$get_working_days_data=$this->ExamModel->get_course_data($eclass);
if($get_working_days_data){
foreach($get_working_days_data as $working_days_data){
$working_days=$working_days + $working_days_data['annual_working_days'];
}
}


$get_student_result_data=$this->ExamModel->get_exam_result_data($sid);
$present_days=0;
if($get_student_result_data){
foreach($get_student_result_data as $result_data){
$present_days=$present_days + $result_data['annual_attendance'];
}
}

?>

<div class="container-fluid mt-3 mb-3">
<div class="row">
<div class="col-sm-12">

<form method="post">
<h5>Attendance</h5>
<div class="form-group">
<label>Working Days</label>
<input type="hidden" name="sid" value="<?php echo $sid;?>">
<input type="hidden" class="form-control" name="eclass" value="<?php echo $eclass; ?>">

<input type="text" class="form-control" name="working_days" value="<?php echo $working_days;?>" readonly>
</div>
<div class="form-group">
<label>Present Days</label>
<?php
if($present_days !=0){ 
?>
<input type="number" class="form-control" name="" value="<?php echo $present_days; ?>" readonly>
<?php 
} 
?>
<input type="number" class="form-control" name="present_days" placeholder="Attendance">
</div>

<input type="submit" class="btn btn-sm btn-success" value="Update Attendance" name="update_attendance"> 

</form>

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