<form name="edit_language_form" method="post" action="javascript:void(0)"
      onsubmit="return updateLanguage('<?php echo base_url() . 'super_admin_profile/update_language/' . $person_language_id . '/' . $person_info->person_id ?>')" >
    <div class="col-sm-12">  <h3 class="text-center">Update Language</h3><hr> <br></div>
    <div class="form-group col-sm-5">
        <input name="person_language" 
               class="form-control validate[required, custom[personName]] text-input" 
               id="person_language" 
               type="text" 
               placeholder="Please type Language" 
               value="<?php echo $selected_person_language->person_language; ?>"
               autofocus=""
               data-errormessage-value-missing="Language Name is required!">
        <span id="language_error" style="color:red"></span>
    </div>
    <input type="hidden" id="language_proficiency" value="<?php echo $selected_person_language->person_language_proficiency; ?>" >
    <div class="form-group col-sm-5">
        <select data-errormessage-value-missing="Language Proficiency is Required!" 
                class="form-control validate[required] text-input"   
                name="person_language_proficiency"
                id="person_language_proficiency">
            <option value=" ">Select Language Proficiency</option>
            <option value="0">No Proficiency</option>
            <option value="1">Elementary proficiency</option>
            <option value="2">Limited working proficiency</option>
            <option value="3">Professional working proficiency</option>
            <option value="4">Full professional proficiency</option>
            <option value="5">Native or bilingual proficiency</option>
        </select>
        <span id="proficiency_error" style="color:red"></span>
    </div>


    <div class="col-sm-1">
        <button class="btn btn-success" type="submit">
            <i class="fa fa-save" title="Update"></i>
        </button>
    </div>
    
    <div class="col-sm-1" onclick="cancelEditLang('<?php echo $person_info->url; ?>')">
        <a class="btn btn-success">
            <i class="fa fa-times" title="Cancel"></i>
        </a>
    </div>


    <div class="col-sm-12"><br></div>
</form>

<div class="col-sm-12 text-left gray" style="display: block">
    <?php foreach ($person_language as $l_value) { ?>
        <div class="col-sm-6 " style="padding: 5px 0 0 20px">
            <span class="col-sm-8 h4"><?php echo $l_value->person_language; ?></span>
            <span class="col-sm-4  text-right" style="padding-top: 20px">
                <a href="javascript:void(0)" id="editLangBtn<?php $l_value->person_language_id; ?>" onclick="editLanguage('<?php echo base_url() . 'super_admin_profile/edit_language_by_id/' . $l_value->person_language_id . '/' . $person_info->person_id ?>')" > <i class="fa fa-edit" title="Edit"></i></a>
                <a href="javascript:void(0)" id="deleteLang<?php echo $l_value->person_language_id; ?>" ><i class="fa fa-trash-o" title="Delete"></i></a>
            </span><br>
            <p class="col-sm-12"><?php
                switch ($l_value->person_language_proficiency) {
                    case 0:
                        echo 'No Proficiency';
                        break;
                    case 1:
                        echo 'Elementary Proficiency';
                        break;
                    case 2:
                        echo 'Limited Working Proficiency';
                        break;
                    case 3:
                        echo 'Professional Working Proficiency';
                        break;
                    case 4:
                        echo 'Full Professional Proficiency';
                        break;
                    case 5:
                        echo 'Native or Bilingual Proficiency';
                        break;
                }
                ?></p>
        </div>
        <div class="modal fade" style="" id="deleteLangModal<?php echo $id = $l_value->person_language_id; ?>" tabindex="-1" role="dialog" aria-labelledby="changeRole" aria-hidden="true">
            <?php
            $id = 'Lang'.$l_value->person_language_id;
            $message = "Are You Sure To Delete Language Details ?";
            $this->cf->view_modal($id, $message);
            ?>
        </div>
    <?php } ?>
</div>