<div class="col-sm-12 gray">
    <h3 class="text-center">Add Work Experience</h3><hr>
    <div class="col-sm-12">
        <div class="row gray_ttc">
            <div class="col-sm-12 ">
                <div class="col-sm-12">
                    <form id="formID4" name="add_work_experience" method="post" action="<?php echo base_url() ?>super_admin_profile/add_work_experience/<?php echo $person_info->url; ?>">
                        <div class="col-sm-12 ">
                            <div class="col-sm-12"><br> <br></div>
                            <div class="form-group col-sm-12">
                                <input type="hidden" name="person_id" id="person_id" value="<?php echo $person_info->person_id; ?>">
                                <div class="input-group">
                                    <input type="text" 
                                           class="form-control validate[required] text-input" 
                                           placeholder="Please Type Company Name"
                                           name="company_name"
                                           value="<?php echo set_value('company_name'); ?>"
                                           aria-describedby="basic-addon1"
                                           data-errormessage-value-missing="Company Name is required!" >
                                    <span class="input-group-addon" id="basic-addon1"><i class="fa fa-briefcase"></i></span>
                                </div>
                                <span style="color:red"><?php echo form_error('company_name'); ?></span>
                            </div>
                            <div class="col-sm-12"><br> </div>
                            <div class="form-group col-sm-6">
                                <div class="input-group">
                                    <input type="text" 
                                           class="form-control validate[required, custom[Designation], custom[Designation_length]] text-input" 
                                           placeholder="Please Type Your Designation" 
                                           aria-describedby="basic-addon1"
                                           name="designation"
                                           value="<?php echo set_value('designation'); ?>"
                                           data-errormessage-value-missing="Designation is required!" >
                                    <span class="input-group-addon" id="basic-addon1"><i class="fa fa-user"></i></span>
                                </div>
                                <span style="color:red"><?php echo form_error('designation'); ?></span>
                            </div>
                            <div class="form-group col-sm-6">
                                <div class="input-group">
                                    <input type="text" 
                                           class="form-control validate[required, custom[url]] text-input" 
                                           placeholder="Please Type Your Company Website URL" 
                                           name="company_website_url"
                                           value="<?php echo set_value('company_website_url'); ?>"
                                           aria-describedby="basic-addon1"
                                           data-errormessage-value-missing="Company Website URL is required!" >
                                    <span class="input-group-addon" id="basic-addon1"><i class="fa fa-link"></i></span>
                                </div>
                                <span style="color:red"><?php echo form_error('company_website_url'); ?></span>
                            </div>
                            <div class="col-sm-12"><br></div>

                            <div class="form-group col-sm-12">
                                <div class="form-group">
                                    <textarea name="company_address" id="company_address" 
                                              data-errormessage-value-missing="Company  Address is required!"
                                              class="form-control col-sm-4 validate[required] text-input" 
                                              placeholder="Please Type Your Company  Address"><?php echo set_value('company_address'); ?></textarea>
                                    <span style="color: red;"><?php echo form_error('company_address'); ?></span>
                                </div>
                            </div>
                            <div class="col-sm-12"><br> </div>

                            <div class="form-group col-sm-12">
                                <div class="form-group">
                                    <textarea name="job_responsibility_details" id="job_responsibility_details" 
                                              data-errormessage-value-missing="Job Responsibility is required!"
                                              class="form-control col-sm-4 validate[required] text-input" 
                                              placeholder="Please Type Your Job Responsibility"><?php echo set_value('job_responsibility_details'); ?></textarea>
                                    <span style="color: red;"><?php echo form_error('job_responsibility_details'); ?></span>
                                </div>
                            </div>
                            <div class="col-sm-12"><br> </div>
                            <div class="form-group col-sm-6">
                                <div class='input-group' id='datetimepicker5'>
                                    <input type='text' 
                                           data-errormessage-value-missing="Job Start Date is Required!" 
                                           class="form-control validate[required,custom[maxdate]] text-input"
                                           id="start_time_period"
                                           name="job_start_date"
                                           value="<?php echo set_value('job_start_date'); ?>"
                                           placeholder=" Start date"/>
                                    <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-calendar"></span><br>
                                    </span>
                                </div>
                                <span style="color:red"><?php echo form_error('job_start_date'); ?></span>
                            </div>

                            <script type="text/javascript">
                                $(function () {
                                    $('#datetimepicker5').datetimepicker({
                                        viewMode: 'years',
                                        format: 'DD/MM/YYYY'

                                    });
                                });
                            </script>

                            <div class="form-group col-sm-6">
                                <label for="work_current_here" class="col-sm-6">Work Currently Here  :  &nbsp;&nbsp;</label>
                                <div class="radio radio-success col-sm-6 margin-zero" id="status">
                                    <input type="radio" 
                                           onclick="WorkStatus(this.value)" 
                                           name="work_currently_here" 
                                           id="yes" 
                                           value="1">
                                    <label for="yes">Yes</label>
                                    <span style="margin-right: 30px"></span>
                                    <input type="radio" 
                                           onclick="WorkStatus(this.value)" 
                                           name="work_currently_here" 
                                           id="no" 
                                           value="2">
                                    <label for="no">No</label>
                                </div>
                            </div>

                            <script>
                                function WorkStatus(GivenText) {
                                    var workEndDate = document.getElementById('workEndDate');
                                    if (GivenText == 2) {
                                        workEndDate.setAttribute('style', 'display:block');
                                    }
                                    else {
                                        workEndDate.setAttribute('style', 'display:none');
                                    }
                                }
                            </script>
                            <div class="col-sm-12"><br> </div>
                            <div class="form-group col-sm-6" id="workEndDate" style="display: none">
                                <div class='input-group' id='datetimepicker6'>
                                    <input type='text' 
                                           data-errormessage-value-missing="Person Birth Date is Required!" 
                                           class="form-control validate[required, custom[eduStartTime], custom[maxdate]] text-input"
                                           id="end_time_period"
                                           name="job_end_date"
                                           value="<?php echo set_value('job_end_date'); ?>"
                                           placeholder="Finished date"/>
                                    <span class="input-group-addon">
                                        <span class="glyphicon glyphicon-calendar"></span><br>
                                    </span>
                                </div>
                                <span style="color:red"><?php echo form_error('job_end_date'); ?></span>
                            </div>
                            <script type="text/javascript">
                                $(function () {
                                    $('#datetimepicker6').datetimepicker({
                                        viewMode: 'years',
                                        format: 'DD/MM/YYYY'

                                    });
                                });
                            </script>
                            <div class="form-group col-sm-6">
                                <select class="form-control validate[required]" 
                                        id="account-type" 
                                        name="person_work_view_status"
                                        onchange="otherCategory(this.value)"
                                        data-errormessage-value-missing="Who can see my Education details is required!">
                                    <option value=""> -Who can see my Education details- </option>
                                    <option value="1">Public</option>
                                    <option value="2">Talha Training User</option>
                                    <option value="3">Link</option>
                                    <option value="6">Only Me</option>
                                </select>
                                <span style="color:red;"><?php echo form_error('person_work_view_status'); ?></span>
                            </div>
                            <div class="col-sm-12"><br><br></div>
                            <div class="form-group col-sm-4">
                                <input type="submit" class="green-btn btn btn-default" value="Add Work Experience ">
                            </div>
                            <!--                            <div class="form-group col-sm-4">
                                                            <a href="<?php // echo base_url()   ?>index.php/welcome/selected_user_details"> <span class="green-btn btn btn-default">Cancel </span></a><br/><br/>
                                                        </div>-->
                        </div>
                    </form>
                </div>
            </div>
        </div> 
    </div>
</div>
<script type="text/javascript">
    document.forms['add_work_experience'].elements['person_work_view_status'].value = '<?php echo set_value('person_work_view_status'); ?>';
    document.forms['add_work_experience'].elements['work_currently_here'].value = '<?php echo set_value('work_currently_here'); ?>';
    WorkStatus('<?php echo set_value('work_currently_here'); ?>');
</script>