<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <div class="">
        <a href="<?php echo base_url(); ?>super_admin">Dashboard </a>->>
        <a href="<?php echo base_url(); ?>super_admin/user_list/<?php echo $role_name . '/' . $this->session->userdata('role_id'); ?>"><?php echo $role_name; ?> List</a>->>
        <a href="<?php echo base_url(); ?>super_admin/view_detail/<?php echo $role_name . '/' . $person_id; ?>"><?php echo $role_name; ?> Detail</a>->>
        <a href="<?php echo base_url(); ?>super_admin_profile/work_details/<?php echo $role_name . '/' . $person_id; ?>"><?php echo $role_name; ?><span> Work Experience->></span></a>
        <span>Edit Work Details</span>
    </div>
    <p>
        <?php
        $message = $this->session->userdata('message');
        $this->session->unset_userdata('message');
        if ($message) {
            echo $message;
        }
        ?>
    </p>

    <div class="table-responsive col-sm-8" id="work_form">

        <h1 class="page-header">Add Work Experience </h1>
        <form class="cmxform" id="formID2" action="<?php echo base_url(); ?>super_admin_profile/edit_work_information/<?php echo $role_name . '/' . $person_id . '/' . $work_detail_id; ?>" method="post" name="edit_work_details" enctype="multipart/form-data" >
            <input type="hidden" name="person_id" id="person_id" value="<?php echo $person_id ?>">
            <div class="form-group col-sm-12">
                <div class="form-group col-sm-8">
                    <label for="company_name">Company  Name</label><span class="required"> * </span>
                    <input  type="text" 
                            data-errormessage-value-missing="Company  Name is required!" 
                            class="form-control validate[required]" 
                            id="company_name" name="company_name" 
                            value="<?php
                            if (set_value('company_name')) {
                                echo set_value('company_name');
                            } else {
                                echo $person_work_info->company_name;
                            }
                            ?>" placeholder="Enter Company name" >
                </div>
                <div class="form-group col-sm-8" style="color: red"><?php echo form_error('company_name'); ?>  </div>

                <div class="form-group col-sm-8">
                    <label for="designation">Designation</label><span class="required"> * </span>
                    <input type="text" 
                           data-errormessage-value-missing="Designation is required!" 
                           class="form-control validate[required]" 
                           id="designation" name="designation" 
                           value="<?php
                           if (set_value('designation')) {
                               echo set_value('designation');
                           } else {
                               echo $person_work_info->designation;
                           }
                           ?>" placeholder="Enter Designation" >
                </div>
                <div class="form-group col-sm-8" style="color: red"><?php echo form_error('designation'); ?>  </div>

                <div class="form-group col-sm-8">
                    <label for="company_address">Company Address </label><span class="required"> * </span>
                    <textarea name="company_address" data-errormessage-value-missing="Company Address is required!" class="form-control validate[required]" ><?php
                        if (set_value('company_address')) {
                            echo set_value('company_address');
                        } else {
                            echo $person_work_info->company_address;
                        }
                        ?></textarea>
                </div>
                <div class="form-group col-sm-8" style="color: red"><?php echo form_error('company_address'); ?>  </div>

                <div class="form-group col-sm-8">
                    <label for="company_website_url">Company Website URL</label><span class="required"> * </span>
                    <input type="text" 
                           data-errormessage-value-missing="Company  Website URL is required!" 
                           class="form-control validate[required], custom[url]" 
                           id="company_website_url" name="company_website_url" 
                           value="<?php
                           if (set_value('company_website_url')) {
                               echo set_value('company_website_url');
                           } else {
                               echo $person_work_info->company_website_url;
                           }
                           ?>" placeholder="Enter company website url" >
                </div>
                <div class="form-group col-sm-8" style="color: red"><?php echo form_error('company_website_url'); ?>  </div>

                <div class="form-group col-sm-8">
                    <label for="job_start_date">Job Start Date</label><span class="required"> * </span>
                    <input type="date" 
                           data-errormessage-value-missing="Job Start Date is required!" 
                           class="form-control validate[required]" 
                           id="job_start_date" name="job_start_date" 
                           value="<?php
                           if (set_value('job_start_date')) {
                               echo set_value('job_start_date');
                           } else {
                               echo $person_work_info->job_start_date;
                           }
                           ?>" >
                </div>
                <div class="form-group col-sm-8" style="color: red"><?php echo form_error('job_start_date'); ?>  </div>

                <div class="form-group col-sm-8">
                    <label for="job_end_date">Job End Date</label><span class="required"> * </span>
                    <input type="date" 
                           data-errormessage-value-missing="Job End Date is required!" 
                           class="form-control validate[required]" 
                           id="end_time_period" name="job_end_date" 
                           value="<?php
                           if (set_value('job_end_date')) {
                               echo set_value('job_end_date');
                           } else {
                               echo $person_work_info->job_end_date;
                           }
                           ?>">
                </div>
                <div class="form-group col-sm-8" style="color: red"><?php echo form_error('job_end_date'); ?>  </div>

                <div class="form-group col-sm-8">
                    <label for="work_currently_here">Work Currently Here</label><span class="required"> * </span><br>
                    <input data-errormessage-value-missing="Work Currently Here is required!" 
                           class="validate[required]" type="radio" 
                           name="work_currently_here" id="status" value="1"  />Yes
                    <input data-errormessage-value-missing="Work Currently Here is required!" 
                           class="validate[required]" type="radio" 
                           name="work_currently_here" id="status" value="0" />No
                </div>
                <div class="form-group col-sm-8" style="color: red"><?php echo form_error('work_currently_here'); ?>  </div>

                <div class="form-group col-sm-8">
                    <label for="job_responsibility_details">Job Responsibility  </label>
                    <textarea name="job_responsibility_details" class="form-control" ><?php
                        if (set_value('job_responsibility_details')) {
                            echo set_value('job_responsibility_details');
                        } else {
                            echo $person_work_info->job_responsibility_details;
                        }
                        ?></textarea>
                </div>
                <div class="form-group col-sm-8" style="color: red"><?php echo form_error('job_responsibility_details'); ?>  </div>

                <div class="form-group col-sm-8">
                    <label for="person_work_view_status">Work Experience View Status</label><span class="required"> * </span>
                    <select data-errormessage-value-missing="Who can see my Education details is required!" 
                            class="form-control validate[required]" 
                            id="person_work_view_status"  name="person_work_view_status" >
                        <option value="">--Select User--</option>
                        <option value="1">Public</option>
                        <option value="2">Talha Training User</option>
                        <option value="3">My Link</option>
                        <option value="4">Only Me</option>
                    </select>
                </div>
                <div class="form-group col-sm-8">
                    <label for="work_details_status">Work Experience Status </label><span class="required"> * </span>
                    <select data-errormessage-value-missing="Education Status is required!" 
                            class="form-control validate[required]" 
                            id="work_details_status"  name="work_details_status" >
                        <option value="">--Select User--</option>
                        <option value="1">Active</option>
                        <option value="0">Inactive</option>
                        <option value="2">Archive</option>
                    </select>
                </div>
                <div class="form-group col-sm-8" style="color: red"><?php echo form_error('person_education_view_status'); ?>  </div>

            </div>


            <div class="checkbox col-sm-6" >
                <button type="submit" id="submit" class="btn btn-default">Submit</button>
                <button type="reset" class="btn btn-default">Reset</button>
            </div>
        </form>
    </div>

    <div class="table-responsive col-sm-8">

    </div>

</div>
</div>


<script type="text/javascript">
    document.forms['edit_work_details'].elements['work_currently_here'].value = '<?php
                        if (set_value('work_currently_here')) {
                            echo set_value('work_currently_here');
                        } else {
                            echo $person_work_info->work_currently_here;
                        }
                        ?>';

    document.forms['edit_work_details'].elements['person_work_view_status'].value = '<?php
                        if (set_value('person_work_view_status')) {
                            echo set_value('person_work_view_status');
                        } else {
                            echo $person_work_info->person_work_view_status;
                        }
                        ?>';

    document.forms['edit_work_details'].elements['work_details_status'].value = '<?php
                        if (set_value('work_details_status')) {
                            echo set_value('work_details_status');
                        } else {
                            echo $person_work_info->work_details_status;
                        }
                        ?>';

    document.forms['edit_work_details'].elements['user_role_id'].value = '<?php echo set_value('user_role_id'); ?>';
    document.forms['edit_work_details'].elements['status'].value = '<?php echo set_value('status'); ?>';
</script>