<input type="hidden" id="baseUrl" value="<?php echo base_url(); ?>">
<div class="col-sm-8">
    <div class="row ">
        <div class="col-sm-12 " >
            <div class="col-sm-12">
                <nav class="text-justify">
                    <center>
                        <div class="col-sm-12">
                            <span class="clo-sm-3" title="Course Profile" style="padding: 0">
                                <span class="number badge" style="background-color: green"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></span>
                                <span class="text-left label" style="color: #000;font-size: 14px;font-weight: normal">Edit Certificate for Student With Roll Number <?php echo $certificate_data->student_roll_number; ?></span>                                
                            </span>                           
                        </div>
                    </center>
                </nav>
                <div class="col-sm-12"><br></div>
                <?php 
                    if(isset($this->session->submit_message)){
                        echo '<div class=" text-center text-success">'.$this->session->submit_message.'</div>';
                        $this->session->unset_userdata('submit_message');                        
                    }
                ?>
            </div>

            <div>
                <?php echo form_open('admin/update-permanent-certificate/'.$certificate_data->student_roll_number, 'class="form-horizontal" id="permanent_certificate_form"'); ?>
                <div class="form-group">
                    <label for="studentFirstName" class="col-sm-3 control-label">Student First Name</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control validate[required]" name="first_name" id="studentFirstName" placeholder="Student First Name" value="<?php echo (set_value('first_name') != '') ? set_value('first_name') : $person_info->person_first_name; ?>">
                    </div>
                    <div class="col-sm-6 col-sm-offset-4">
                        <span style="color: red;" id="course_name_error" ><?php echo form_error('first_name'); ?></span>
                    </div>
                </div>
                <div class="form-group">
                    <label for="studentLastName" class="col-sm-3 control-label">Student Last Name</label>
                    <div class="col-sm-6 col-sm-6">
                        <input type="text" class="form-control validate[required]" name="last_name" id="studentLastName" placeholder="Student Last Name" value="<?php echo (set_value('last_name') != '') ? set_value('last_name') : $person_info->person_last_name;  ?>">
                    </div>
                    <div class="col-sm-6 col-sm-offset-4">
                        <span style="color: red;" id="course_name_error" ><?php echo form_error('last_name'); ?></span>
                    </div>
                </div>
                <div class="form-group">
                    <label for="courseBy" class="col-sm-3 control-label">Course BY</label>
                    <div class="col-sm-6 col-sm-6">
                        <input type="text" class="form-control validate[required]" name="course_by" id="courseBy" placeholder="Course By" value="<?php echo (set_value('course_by')!='')? set_value('course_by') : $certificate_data->course_by; ?>">
                    </div>
                    <div class="col-sm-6 col-sm-offset-4">
                        <span style="color: red;" id="course_name_error" ><?php echo form_error('course_by'); ?></span>
                    </div>
                </div>

                <div class="form-group">
                    <label for="courseName" class="col-sm-3 control-label">Course Name</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control validate[required]" name="course_name" id="courseName" placeholder="Email" value="<?php echo (set_value('course_name')!='')? set_value('course_name') : $certificate_data->course_name; ?>">
                    </div>
                    <div class="col-sm-6 col-sm-offset-4">
                        <span style="color: red;" id="course_name_error" ><?php echo form_error('course_name'); ?></span>
                    </div>
                </div>

                <div class="form-group" style="padding: 0">
                    <label for="courseCompletionDate" class="col-sm-3 control-label" style="margin-right: 15px;">Course Completion Date</label>
                    <div class="input-group col-sm-6" id="datetimepicker1">
                        <input 
                            class="form-control validate[required, custom[date]]" 
                            id="courseCompletionDate" 
                            name="course_completion_date" 
                            value="<?php echo (set_value('course_completion_date'))? set_value('course_completion_date') : $certificate_data->course_completion_date; ?>" 
                            placeholder="Course Completion Date" type="text">
                        <span class="input-group-addon">
                            <span class="glyphicon glyphicon-calendar" title="Course Completion Date"></span>
                        </span>                        
                    </div>
                    <div class="col-sm-6 col-sm-offset-4">
                        <span style="color: red;" id="course_name_error" ><?php echo form_error('course_completion_date'); ?></span>
                    </div>
                    
                </div>
                <div class="form-group">
                    <label for="courseResourcePerson" class="col-sm-3 control-label">Course Resource Person</label>
                    <div class="col-sm-6">
                        <input 
                            type="text"
                            class="form-control validate[required]"
                            name="course_resource_person"
                            id="courseResourcePerson"
                            placeholder="Course Resource Person"
                            value="<?php echo (set_value('course_resource_person'))? set_value('course_resource_person') : $certificate_data->course_resource_person; ?>">
                    </div>
                    <div class="col-sm-6 col-sm-offset-4">
                        <span style="color: red;" id="course_name_error" ><?php echo form_error('course_resource_person'); ?></span>
                    </div>
                </div>                    

                <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-6">
                        <button type="submit" class="btn btn-default">Update Certificate</button>
                    </div>
                </div>
                <?php echo form_close();?>
            </div>
        </div><!-- /.row gray -->
    </div>
</div>
<script src="<?php echo base_url(); ?>back_end_resource/quiz/admin_certificate.js" type="text/javascript"></script>