<style>
    .success {background:#4c0870 !important}
    .datepicker thead tr .dow{color:#4c0870 !important}
    .datepicker thead tr .datepicker-switch {color:#4c0870 !important}
    .datepicker thead tr .next:before, .datepicker thead tr .prev:before {color:#4c0870 !important}
    .datepicker table tr td.active.active{background:#4c0870 !important}
    .datepicker table tr td.day:hover {background:#4c0870 !important ;color:#fff}
    .profile-pic {
        text-align: center;
        border-radius: 100%;
        -moz-border-radius: 100%;
        -webkit-border-radius: 100%;
        width: 210px;
        height: 210px;
        border: 5px solid #4c0870;
        overflow: hidden;
        margin: 0 auto;
        background: #fafafa;
    }
    .profile-pic img {
        width: 188px;
        height: 188px;
        margin-top: 6px;
        border-radius: 100%;
        -moz-border-radius: 100%;
        -webkit-border-radius: 100%;
        overflow: hidden;
        -webkit-transition: all .3s ease-in-out;
        -moz-transition: all .3s ease-in-out;
        transition: all .3s ease-in-out;
    }
    #UploadCVButton{
        width:25%;
        overflow:hidden;
        position:relative;
    }
    #UploadProfileButton{
        /*margin-left:128px;
        margin-top:10px;*/
        margin:10px auto;
        background-color:#4c0870 !important;
        color:#fff;
        width:auto;
        display:block;
    }
    #UploadProfileButton > input,#UploadCVButton > input{
        position:absolute;
        left:0px;
        top:0px;
        width:100%;
        height:100%;
        opacity:0.01;
        cursor:pointer;
    }
    .labelText{
        font-size: 12px !important;
        margin-bottom: 0px !important;
    }
    form .row [class*='col-']:first-child {
        padding-left: 0px !important;
    }
</style>
<script src="<?php echo THEME_PATH; ?>plugins/jquery-validation/js/jquery.validate.min.js"></script>
<!--
<script type="text/javascript" src="< ?php echo THEME_PATH; ?>plugins/bootstrap-tag/bootstrap-tagsinput.min.js"></script>
<link href="< ?php echo THEME_PATH; ?>plugins/bootstrap-tag/bootstrap-tagsinput.css" rel="stylesheet" type="text/css"/>
-->
<div class="modal fade stick-up " id="Add_Employee" tabindex="-1" role="dialog" aria-hidden="true">
    <?php echo Forms::ModalLoader('EmployeeIsBusy') ?>
    <div class="modal-dialog ">
        <div class="modal-content">
            <div class="modal-header clearfix text-left">
                <button type="button" class="close" data-dismiss="modal" id="CloseAddEmployeeModal" aria-hidden="true"><i class="pg-close fs-14"></i></button>
                <h5 class="bold"> <?php print CommonLanguage::getMessage('new_employee'); ?></h5>
            </div>
            <div class="modal-body">
                <div id="EmployeeValidationAlert"></div>
                <form id="Employee_Form" method="POST" onsubmit="return false">
                    <div class="col-md-12">
                        <div class="panel panel-transparent ">
                            <ul class="nav nav-tabs nav-tabs-fillup">
                                <li class="active">
                                    <a data-toggle="tab" href="#slide1"><span><?php print CommonLanguage::getMessage('general_info'); ?></span></a>
                                </li>
                                <li>
                                    <a data-toggle="tab" href="#slide2"><span><?php print CommonLanguage::getMessage('contact_info'); ?></span></a>
                                </li>
                                <li>
                                    <a data-toggle="tab" href="#slide4"><span><?php print CommonLanguage::getMessage('hr_info'); ?></span></a>
                                </li>
                                <li>
                                    <a data-toggle="tab" href="#slide7"><span><?php print CommonLanguage::getMessage('absence_info'); ?></span></a>
                                </li>
                                <li>
                                    <a data-toggle="tab" href="#slide5"><span><?php print CommonLanguage::getMessage('hr_info1'); ?></span></a>
                                </li>
                                <li>
                                    <a data-toggle="tab" href="#slide6"><span><?php print CommonLanguage::getMessage('emp_bank_info'); ?></span></a>
                                </li>

                            </ul>
                            <div class="tab-content">
                                <div class="tab-pane slide-left active" id="slide1" style="height:470px;">
                                    <div class="row ">
                                        <div class="col-md-4 profile-col">
                                            <div class="profile-pic">
                                                <div class="profile-border">
                                                    <img id="CurProfilePhoto" src="<?php echo SITE_LINK; ?>img/profiles/avatar.jpg" alt="">
                                                </div>
                                            </div>
                                            <label class="btn btn-default" id="UploadProfileButton"><?php print CommonLanguage::getMessage('Upload'); ?><input type="file" data-target="#CurProfilePhoto" onchange="window.NewEmployeeCurrentFileUploadadd = event.target.files;ValidateForNewEmployeePhoto(this, 'Picture')" name="image_employee_File" value="Upload"></label>
                                        </div>
                                        <div class="col-md-8">
                                            <div class="col-md-12" style="margin:10px; margin-left:17px">
                                                <div class="col-md-4 form-group">
                                                    <label><?php print CommonLanguage::getMessage('first_name'); ?></label><span class="red-star">*</span>
                                                    <div class="input-group  ">
                                                        <span class="input-group-addon success ">
                                                            <i class="fa fa-user-md"></i>
                                                        </span>
                                                        <input type="hidden"  id="Employee_ID" name="Employee_ID" class="form-control " >
                                                        <input type="text" placeholder="<?php print CommonLanguage::getMessage('first_name'); ?>" id="Employee_FirstName" name="Employee_FirstName" class="form-control "  required>
                                                    </div>
                                                </div>
                                                <div class="col-md-4 form-group">
                                                    <label><?php print CommonLanguage::getMessage('middle_name'); ?></label>
                                                    <div class="input-group ">
                                                        <span class="input-group-addon success ">
                                                            <i class="fa fa-user-md"></i>
                                                        </span>
                                                        <input type="text" placeholder="  <?php print CommonLanguage::getMessage('middle_name'); ?>" id="Employee_MiddleName" name="Employee_MiddleName" class="form-control " >
                                                    </div>
                                                </div>
                                                <div class="col-md-4 form-group">
                                                    <label><?php print CommonLanguage::getMessage('last_name'); ?></label><span class="red-star">*</span>
                                                    <div class="input-group ">
                                                        <span class="input-group-addon success ">
                                                            <i class="fa fa-user-md"></i>
                                                        </span>
                                                        <input type="text" placeholder=" <?php print CommonLanguage::getMessage('last_name'); ?>" id="Employee_LastName" name="Employee_LastName" class="form-control " required >
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-12 " style="margin:10px;">
                                                <div class="col-md-4 form-group">
                                                    <label><?php print CommonLanguage::getMessage('second_lang_name'); ?></label>
                                                    <div class="input-group ">
                                                        <span class="input-group-addon success ">
                                                            <i class="fa fa-user-md"></i>
                                                        </span>
                                                        <input type="text" placeholder=" <?php print CommonLanguage::getMessage('second_lang_name'); ?>" id="second_lang_name" name="second_lang_name" class="form-control "  >
                                                    </div>
                                                </div>
                                                <div class="col-md-4 form-group">
                                                    <label><?php echo CommonLanguage::getMessage('dob') ?></label><span class="red-star">*</span>
                                                    <div class="input-group ">
                                                        <span class="input-group-addon success ">
                                                            <i class="fa fa-calendar"></i>
                                                        </span>
                                                        <input  id="Employee_DOB" name="Employee_DOB" Placeholder="<?php print CommonLanguage::getMessage('dob'); ?>" autocomplete="off" class="form-control "/>
                                                    </div>
                                                </div>
                                                <div class="col-md-4 form-group">
                                                    <label><?php print CommonLanguage::getMessage('record_number'); ?></label>
                                                    <div class="input-group ">
                                                        <span class="input-group-addon success ">
                                                            <i class="fa fa-file"></i>
                                                        </span>
                                                        <input  id="Employee_RecordNumber" name="Employee_RecordNumber" Placeholder="<?php print CommonLanguage::getMessage('record_number'); ?>" class="form-control " autocomplete="off"  />
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-12" style="margin:10px;">
                                                <div class="col-md-4 form-group">
                                                    <label><?php echo CommonLanguage::getMessage('blood_group') ?></label>
                                                    <div class="input-group m-b "><span class="input-group-btn">
                                                            <button type="button" class="btn btn-success" style="width:0 " ><i class="fa fa-medkit"style="color:#fff;margin-left:-7px"></i> </button> </span>
                                                        <select  id="Employee_BloodGroup" name="Employee_BloodGroup" class="full-width BloodGroup" data-init-plugin="select2">
                                                            <option value=""><?php print CommonLanguage::getMessage('select_blood_group'); ?></option>
                                                            <optgroup label="<?php print CommonLanguage::getMessage('positive'); ?>">
                                                                <option value="2">A+</option>
                                                                <option value="4">B+</option>
                                                                <option value="5">AB+</option>
                                                                <option value="7">O+</option>
                                                            </optgroup>
                                                            <optgroup label="<?php print CommonLanguage::getMessage('negative'); ?>">
                                                                <option value="1">A-</option>
                                                                <option value="3">B-</option>
                                                                <option value="6">AB-</option>
                                                                <option value="8">O-</option>
                                                            </optgroup>
                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="col-md-4 form-group">
                                                    <label><?php print CommonLanguage::getMessage('nationality'); ?></label><span class="red-star">*</span>
                                                    <div class="input-group ">
                                                        <span class="input-group-addon success ">
                                                            <i class="fa fa-flag"></i>
                                                        </span>
                                                        <select  id="Employee_Nationality" name="Employee_Nationality" class="full-width Employee_Nationality" required data-init-plugin="select2">
                                                            <option value=""><?php print CommonLanguage::getMessage('select'); ?></option>
                                                            <?php foreach ($employee_nationality as $nationality) { ?>
                                                                <option value="<?php echo $nationality['Nationality_ID'] ?>"><?php echo ($nationality['Nationality_Name']) ?></option>
                                                            <?php } ?>
                                                            <option value='more'><?php echo CommonLanguage::getMessage('More') ?></option>
                                                        </select>
                                                    </div>
                                                </div>
                                                <div class="col-md-4 form-group">
                                                    <label><?php echo CommonLanguage::getMessage('employee_type') ?></label>
                                                    <select id="IS_Employee" name="IS_Employee" class="full-width" data-init-plugin="select2">
                                                        <option value="1"><?php print CommonLanguage::getMessage('IS_Employee'); ?></option>
                                                        <option value="0"><?php print CommonLanguage::getMessage('not_IS_Employee'); ?></option>
                                                        <option value="2"><?php print CommonLanguage::getMessage('sign_emp'); ?></option>
                                                        <option value="3"><?php print CommonLanguage::getMessage('temp_emp'); ?></option>
                                                        <option value="5"><?php print CommonLanguage::getMessage('daily_emp'); ?></option>
                                                        <option value="4"><?php print CommonLanguage::getMessage('retired_emp'); ?></option>
                                                    </select>
                                                    <!--                                                    <div class="radio radio-success">
                                                                                                            <input type="radio" checked="checked" value="1"  name="IS_Employee"  id="IS_Employee">
                                                                                                            <label for="IS_Employee"><?php print CommonLanguage::getMessage('IS_Employee'); ?></label>
                                                                                                            <input type="radio"   value="0" name="IS_Employee"  id="not_IS_Employee">
                                                                                                            <label for="not_IS_Employee"> <?php print CommonLanguage::getMessage('not_IS_Employee'); ?></label>
                                                                                                            <input type="radio"   value="2" name="IS_Employee"  id="sign_emp">
                                                                                                            <label for="sign_emp"><?php print CommonLanguage::getMessage('sign_emp'); ?> 	</label>
                                                                                                            <input type="radio"  value="3" name="IS_Employee"  id="temp_emp">
                                                                                                            <label for="temp_emp"><?php print CommonLanguage::getMessage('temp_emp'); ?> 	</label>
                                                                                                            <input type="radio"  value="5" name="IS_Employee"  id="daily_emp">
                                                                                                            <label for="daily_emp"><?php print CommonLanguage::getMessage('daily_emp'); ?> 	</label>
                                                                                                            <input type="radio"  value="4" name="IS_Employee"  id="retired_emp">
                                                                                                            <label for="retired_emp"><?php print CommonLanguage::getMessage('retired_emp'); ?> 	</label>
                                                                                                        </div>-->
                                                </div>
                                            </div>

                                            <div class="col-md-12" style="margin:10px;">
                                                <div class="col-md-1 form-group" style="display:grid;">
                                                    <label><?php echo CommonLanguage::getMessage('nssf') ?></label>
                                                    <input type="checkbox" id="is_nssf" name="is_nssf"/>
                                                </div>

                                                <div class="col-md-3 form-group nssf-div hidden">
                                                    <label><?php print CommonLanguage::getMessage('social_security'); ?></label><span class="nssf-star red-star hidden">*</span>
                                                    <div class="input-group ">
                                                        <span class="input-group-addon success ">
                                                            <i class="fa fa-file"></i>
                                                        </span>
                                                        <input  id="Employee_SocialSecurity" name="Employee_SocialSecurity" Placeholder="<?php print CommonLanguage::getMessage('social_security'); ?>" class="form-control "  />
                                                    </div>
                                                </div>
                                                <div class="col-md-4 form-group nssf-div hidden">
                                                    <label><?php print CommonLanguage::getMessage('social_security_date'); ?></label><span class=" nssf-star red-star hidden">*</span>
                                                    <div class="input-group ">
                                                        <span class="input-group-addon success ">
                                                            <i class="fa fa-file"></i>
                                                        </span>
                                                        <input  id="Employee_SocialSecurity_Date" name="Employee_SocialSecurity_Date" Placeholder="<?php print CommonLanguage::getMessage('social_security_date'); ?>" class="form-control "  />
                                                    </div>
                                                </div>
                                                <div class="col-md-4 form-group nssf-div hidden">
                                                    <label><?php print CommonLanguage::getMessage('nssf_salary') . ' ' . smc_session()['local_currency_symbol']; ?></label>&nbsp;<i class="fa fa-info-circle" title="<?php echo CommonLanguage::getMessage('nssf_salary_msg') ?>"></i>
                                                    <div class="input-group ">
                                                        <span class="input-group-addon success ">
                                                            <i class="fa fa-file"></i>
                                                        </span>
                                                        <input  id="nssf_salary" name="nssf_salary" Placeholder="<?php print CommonLanguage::getMessage('nssf_salary'); ?>" class="form-control"  />
                                                    </div>
                                                </div>

                                            </div>
                                            <div class="col-md-12" style="margin:10px;">
                                                <div class="col-md-4 form-group nssf-div hidden" style="display:grid;">
                                                    <label><?php echo CommonLanguage::getMessage('stop_housing_payroll') ?></label>
                                                    <input type="checkbox" id="stop_housing_payroll" name="stop_housing_payroll"/>
                                                </div>
                                            </div>
                                            <div class="col-md-12" style="margin:10px;">
                                                <div class="col-md-4 ">
                                                    <div class="radio radio-success " id="Gender">
                                                        <input type="radio" value="1"  name="Employee_Gender"  id="Male">
                                                        <label for="Male"><?php print CommonLanguage::getMessage('male'); ?></label>
                                                        <input type="radio" checked="checked" value="2" name="Employee_Gender"  id="Female">
                                                        <label for="Female"><?php print CommonLanguage::getMessage('female'); ?></label>
                                                    </div>
                                                </div>
                                                <div class="col-md-4 hidden">
                                                    <div class="radio radio-success " id="Employee_IsSmoker">
                                                        <input type="radio" value="1" name="Employee_IsSmoker"  id="Smoker">
                                                        <label for="Smoker"> <?php print CommonLanguage::getMessage('smoke'); ?></label><br/>
                                                        <input type="radio" checked="checked" value="0" name="Employee_IsSmoker"  id="NoSmoker">
                                                        <label for="NoSmoker"><?php print CommonLanguage::getMessage('not_smoke'); ?></label>
                                                    </div>
                                                </div>
                                                <div class="col-md-4">
                                                    <div class="radio radio-success " id="Merital_Status_ID">
                                                        <input type="radio" checked="checked" value="1" name="Merital_Status_ID"  id="Single">
                                                        <label for="Single"> <?php print CommonLanguage::getMessage('single'); ?></label><br/>
                                                        <input type="radio"  value="2" name="Merital_Status_ID"  id="Married">
                                                        <label for="Married"><?php print CommonLanguage::getMessage('married'); ?></label><br/>
                                                        <input type="radio" value="3" name="Merital_Status_ID"  id="Divorced">
                                                        <label for="Divorced"><?php print CommonLanguage::getMessage('divorced'); ?> </label><br/>
                                                        <input type="radio"  value="4" name="Merital_Status_ID"  id="Widow">
                                                        <label for="Widow"><?php print CommonLanguage::getMessage('widow'); ?></label>
                                                    </div>
                                                </div>

                                            </div>
                                            <!--                                            <div class="col-md-12 " style="margin:10px;" id="IS_Employee">
<div class="col-md-4">
<div class="radio radio-success">
<input type="radio" value="1"  name="IS_Employee"  id="MilitaryService">
<label for="MilitaryService">< ?php print CommonLanguage::getMessage('IS_Employee'); ?></label>
<input type="radio" checked="checked"  value="0" name="IS_Employee"  id="NOMilitaryService">
<label for="NOMilitaryService"> < ?php print CommonLanguage::getMessage('not_IS_Employee'); ?>< ?php print CommonLanguage::getMessage(''); ?>	</label>
<label for="NOMilitaryService">< ?php print CommonLanguage::getMessage('not_IS_Employee'); ?> 	</label>
<input type="radio" checked="checked"  value="0" name="IS_Employee"  id="NOMilitaryService2">
<label for="NOMilitaryService2">< ?php print CommonLanguage::getMessage('not_IS_Employee'); ?> 	</label>
<input type="radio" checked="checked"  value="0" name="IS_Employee"  id="NOMilitaryService1">
<label for="NOMilitaryService1">< ?php print CommonLanguage::getMessage('not_IS_Employee'); ?> 	</label>
</div>
</div>
</div>-->
                                        </div>
                                    </div>
                                </div>
                                <div class="tab-pane slide-left" id="slide2">
                                    <div class="row">
                                        <div class="col-md-12" style="margin:10px;margin-left:17px">
                                            <div class="col-md-6 form-group">
                                                <div ><label class="labelText "><?php print CommonLanguage::getMessage('Email'); ?></label></div>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success">
                                                        <i class="fa fa-envelope"></i>
                                                    </span>
                                                    <input type="email" placeholder="<?php print CommonLanguage::getMessage('Email'); ?>" id="Employee_Email" name="Employee_Email" class="form-control " >
                                                </div>
                                            </div>
                                            <div class="col-md-6 form-group">
                                                <div ><label class="labelText"><?php print CommonLanguage::getMessage('street_address'); ?> </label></div>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success">
                                                        <i class="fa fa-street-view"></i>
                                                    </span>
                                                    <input type="text" placeholder=" <?php print CommonLanguage::getMessage('street_address'); ?>" id="Employee_StreetAddress1" name="Employee_StreetAddress1" class="form-control "  >
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-12" style="margin:10px;">
                                            <div class="col-md-6 form-group">
                                                <div ><label class="labelText"><?php print CommonLanguage::getMessage('country'); ?></label></div>
                                                <div class="input-group "><span class="input-group-btn">
                                                        <button type="button" class="btn btn-success"style=" width:0;"><i class="fa fa-globe" style="color:#fff;margin-left:-4px"></i> </button> </span>
                                                    <input type="hidden" id="Employee_Country" name="Employee_Country" value="<?php echo smc_session()['default_setting']['default_country_id'] ?>" data-select-name="<?php echo smc_session()['default_country']['Country_Name'] ?>" class="full-width"/>
<!--                                                    <select id="Employee_Country" connect-with-city="#Employee_City" name="Employee_Country" class="full-width " data-init-plugin="select2">
                                                    <?php foreach ($employee_country as $country): ?>
                                                                                                                                                    <option <?php echo $country['Country_ID'] == smc_session()['default_setting']['default_country_id'] ? 'selected' : '' ?> value="<?php echo $country['Country_ID']; ?>"><?php echo $country['Country_Name']; ?></option>
                                                    <?php endforeach; ?>
                                                </select>-->
                                                </div>
                                            </div>
                                            <div class="col-md-6 form-group">
                                                <div ><label class="labelText"><?php print CommonLanguage::getMessage('city'); ?></label></div>
                                                <div class="input-group "><span class="input-group-btn">
                                                        <button type="button" class="btn btn-success"style=" width:0;"><i class="fa fa-map-marker" style="color:#fff;margin-left:-4px"></i> </button> </span>
                                                    <input type="hidden" id="Employee_City" name="Employee_City" value="<?php echo smc_session()['default_setting']['default_city_id'] ?>" data-select-name="<?php echo smc_session()['default_city']['Name'] ?>" class="full-width"/>

<!--                                                    <select id="Employee_City" name="Employee_City" class="full-width City" data-init-plugin="select2">
                                                    </select>-->
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-12" style="margin:10px;">
                                            <div class="col-md-6 form-group">
                                                <div ><label class="labelText"><?php print CommonLanguage::getMessage('home_phone'); ?></label></div>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-phone"></i>
                                                    </span>
                                                    <input type="text" placeholder="<?php print CommonLanguage::getMessage('home_phone'); ?>" id="Employee_HomePhone" name="Employee_HomePhone" class="form-control " >
                                                </div>
                                            </div>
                                            <div class="col-md-6 form-group">
                                                <div ><label class="labelText"><?php print CommonLanguage::getMessage('mobile_phone'); ?></label></div>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success">
                                                        <i class="fa fa-mobile fa-lg"></i>
                                                    </span>
                                                    <input type="text" placeholder="<?php print CommonLanguage::getMessage('mobile_phone'); ?>" id="Employee_MobilePhone" name="Employee_MobilePhone" class="form-control " >
                                                </div>
                                            </div>
                                            <!--
                                            -->
                                        </div>
                                    </div>
                                </div>
                                <div class="tab-pane slide-left" id="slide4">
                                    <div class="row">
                                        <div class="col-md-12" style="margin:10px;">
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('start_date'); ?></label><span class="red-star">*</span>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-calendar-o"></i>
                                                    </span>
                                                    <input id="Employee_StartDate" name="Employee_StartDate" Placeholder="<?php print CommonLanguage::getMessage('start_date'); ?>" class="form-control StartDate" autocomplete="off" required />
                                                </div>
                                            </div>
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('leave_date'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-calendar-o"></i>
                                                    </span>
                                                    <input id="leave_date" name="leave_date" Placeholder="<?php print CommonLanguage::getMessage('leave_date'); ?>" autocomplete="off" class="form-control leave_date"  />
                                                </div>
                                            </div>
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('department'); ?></label><span class="red-star">*</span>
                                                <div class="input-group m-b"><span class="input-group-btn">
                                                        <button type="button" class="btn btn-success " style=" width:0;"><i class="fa fa-certificate" style="color:#fff;margin-left:-4px"></i> </button> </span>
                                                    <input class="Branch_ID full-width" id="Branch_ID" name="Branch_ID" type="hidden" required/>
                                                </div>
                                            </div>

                                        </div>
                                        <div class="col-md-12" style="margin:10px;">
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('employee_level'); ?></label>
                                                <div class="input-group m-b"><span class="input-group-btn">
                                                        <button type="button" class="btn btn-success " style=" width:0;"><i class="fa fa-certificate" style="color:#fff;margin-left:-4px"></i> </button> </span>
                                                    <select class="employee_level full-width " id="employee_level" name="employee_level" data-init-plugin="select2"  >
                                                        <option value="0"><?php echo CommonLanguage::getMessage('normal') ?></option>
                                                        <option value="1"><?php echo CommonLanguage::getMessage('manager') ?></option>
                                                        <option value="2"><?php echo CommonLanguage::getMessage('supervisor') ?></option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('job'); ?></label><span class="red-star">*</span><span class="fa fa-plus-circle m-l-5 openFrame" data-src="HRM/viewJobs?is_pop=1" style="color:#4c0870;cursor:pointer"></span>
                                                <div class="input-group m-b required"><span class="input-group-btn">
                                                        <button type="button" class="btn btn-success " style=" width:0;"><i class="fa fa-certificate " style="color:#fff;margin-left:-4px"></i> </button> </span>
                                                    <input type="hidden" id="job_id" name="job_id" class="full-width" required/>
                                                    <!--                                                     <input class="Paygrade_ID full-width" id="Paygrade_ID" name="Paygrade_ID" type="hidden"/>-->
                                                    <!--                                                    <select  id="Paygrade_ID" name="Paygrade_ID" class="full-width  Paygrade_ID" required data-init-plugin="select2">
<option value=''><?php print CommonLanguage::getMessage('select_job'); ?></option>
                                                    <?php
                                                    foreach ($details_paygrade as $Jobs) {
                                                        for ($j = 0; $j < count($Jobs['details']); $j++) {
                                                            $paygrade = $Jobs['details'][$j];
                                                            ?>
                                                                                                                                                                                                                                                                                                                                <option value="<?php echo $paygrade['Paygrade_ID'] ?>"><?php echo $Jobs['Job_Name'] . ' &raquo; ' . $paygrade['Paygrade_Name'] . ' : ' . $paygrade['Paygrade_Value'] . ' ' . $paygrade['Currency_Symbol'] ?></option>
                                                            <?php
                                                        }
                                                    }
                                                    ?>
</select>-->
                                                </div>
                                            </div>
                                            <div class="col-md-4">
                                                <div class="form-group">
                                                    <label><?php print CommonLanguage::getMessage('shift'); ?></label><span class="red-star">*</span><span class="fa fa-plus-circle m-l-5 openFrame" data-src="HRM/addShift?is_pop=1" style="color:#4c0870;cursor:pointer"></span>
                                                    <div class="input-group m-b"><span class="input-group-btn">
                                                            <button type="button" class="btn btn-success" style="width:0 " ><i class="fa fa-user"style="color:#fff;margin-left:-7px"></i> </button> </span>
                                                        <input class="Shift_ID full-width" id="Shift_ID" name="Shift_ID" type="hidden" required/>
                                                    </div>
                                                </div>
                                            </div>

                                        </div>
                                        <div class="col-md-12" style="margin:10px;">
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('work_id'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success">
                                                        <i class="fa fa-sort-numeric-asc"></i>
                                                    </span>
                                                    <input type="text" value="<?php echo $Max_Work_ID ?>" placeholder="<?php print CommonLanguage::getMessage('work_id'); ?>" id="Employee_Work_ID" name="Employee_Work_ID" class="form-control " >
                                                </div>
                                            </div>
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('location'); ?></label><span class="fa fa-plus-circle m-l-5 openFrame" data-src="HRM/emp_locations?is_pop=1" style="color:#4c0870;cursor:pointer"></span>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-flag"></i>
                                                    </span>
                                                    <select  id="Employee_Location" name="Employee_Location" class="full-width Employee_Location"   data-init-plugin="select2">
                                                        <option value=""><?php print CommonLanguage::getMessage('select'); ?></option>
                                                        <?php foreach ($Employee_Location as $Employee_Location) { ?>
                                                            <option value="<?php echo $Employee_Location['Location_ID'] ?>"><?php echo $Employee_Location['Location_Name'] ?></option>
                                                        <?php } ?>
                                                        <option value='more'><?php echo CommonLanguage::getMessage('More') ?></option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('emp_major'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-briefcase"></i>
                                                    </span>
                                                    <input id="Employee_Major" name="Employee_Major" Placeholder="<?php print CommonLanguage::getMessage('emp_major'); ?>" class="form-control" />
                                                </div>
                                            </div>

                                        </div>
                                        <div class="col-md-12 " style="margin-left:5px">
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('emp_edu'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-graduation-cap"></i>
                                                    </span>
                                                    <input id="Employee_Education" name="Employee_Education" Placeholder="<?php print CommonLanguage::getMessage('emp_edu'); ?>" class="form-control" />
                                                </div>
                                            </div>



                                        </div>
                                        <!--                                        <div class="col-md-12" style="margin-left:5px">
                                                                                                      
                                        
                                        
                                                                                </div>-->
                                        <div class="col-md-12" style="margin-left:5px">
                                            <div class="col-md-4   form-group <?php echo $permissions->hasPermission('change_fingerprint_code') ? '' : 'hidden' ?>">
                                                <label><?php print CommonLanguage::getMessage('fingerprint_code'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-bars"></i>
                                                    </span>
                                                    <input id="fingerprint_code" name="fingerprint_code" Placeholder="<?php print CommonLanguage::getMessage('fingerprint_code'); ?>" class="form-control" />
                                                </div>
                                            </div>
                                            <div class="col-md-4   form-group ">
                                                <label><?php print CommonLanguage::getMessage('shift_note'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-bars"></i>
                                                    </span>
                                                    <input id="shift_note" name="shift_note" Placeholder="<?php print CommonLanguage::getMessage('shift_note'); ?>" class="form-control" />
                                                </div>
                                            </div>
                                            <div class="col-md-4   form-group ">
                                                <label><?php print CommonLanguage::getMessage('location_address'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-bars"></i>
                                                    </span>
                                                    <input id="location_address" name="location_address" Placeholder="<?php print CommonLanguage::getMessage('location_address'); ?>" class="form-control" />
                                                </div>
                                            </div>

                                        </div>
                                        <div class="col-md-12" style="margin-left:5px">
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('problems'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-heart"></i>
                                                    </span>
                                                    <textarea placeholder="<?php print CommonLanguage::getMessage('problems'); ?>" id="Employee_Problem" name="Employee_Problem" class="form-control " ></textarea>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-12" style="margin-left:5px">
                                            <hr>
                                        </div>
                                        <div class="col-md-12" style="margin-left:5px">
                                            <div class="col-md-4 form-group ">
                                                <label><?php print CommonLanguage::getMessage('salary_periods'); ?></label><span class="red-star">*</span>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-cutlery"></i>
                                                    </span>
                                                    <input id="period_id" name="period_id"  class="full-width" required />
                                                </div>
                                            </div>
                                            <div class="col-md-4 form-group " style="display: grid;">
                                                <label><?php print CommonLanguage::getMessage('early_payroll'); ?></label>

                                                <input id="early_payroll" name="early_payroll"  type="checkbox" />
                                            </div>
                                        </div>
                                        <div class="col-md-12" style="margin-left:5px">
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('basic_salary'); ?></label>&nbsp;<i class="fa fa-info-circle" title="<?php echo CommonLanguage::getMessage('basic_salary_msg') ?>"></i>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-graduation-cap"></i>
                                                    </span>
                                                    <input id="basic_salary" name="basic_salary" Placeholder="<?php print CommonLanguage::getMessage('basic_salary'); ?>" class="form-control" />
                                                </div>
                                            </div>
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('currency'); ?></label>
                                                <div id="CurrencyIDContainer" class=" " >
                                                    <div class="form-group form-material floating ">
                                                        <div class="input-group-btn DropDownForForms Closable" id="CurrencyDropDown" data-symbol="<?php echo smc_session()['local_currency_symbol']; ?>">
                                                            <button type="button" class="btn btn-success btn-block dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                                                                <span><strong class="basic-cur-div"><?php echo smc_session()['local_currency_name'] . ' - ' . smc_session()['local_currency_symbol'] ?></strong></span>
                                                                <input type="hidden"  value="<?php echo smc_session()['local_currency'] ?>" class="form-control ignore" onkeyup="return false" onkeydown="return false" id="basic_salary_currency"/>
                                                            </button>
                                                            <ul class="dropdown-menu">
                                                                <?php echo $CurList ?>
                                                                <li class="divider"></li>
                                                                <li><a class="LoadMore">More..</a></li>
                                                            </ul>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('paygrade'); ?></label>
                                                <div class="input-group m-b "><span class="input-group-btn">
                                                        <button type="button" class="btn btn-success " style=" width:0;"><i class="fa fa-certificate " style="color:#fff;margin-left:-4px"></i> </button> </span>
                                                    <input type="hidden" id="Paygrade_ID" name="Paygrade_ID" class="full-width"/>
                                                </div>
                                            </div>
                                        </div>
                                        <!--                                        <div class="col-md-12" style="margin-left:5px" >
<div class="col-md-4 form-group">
<label><?php print CommonLanguage::getMessage('payment_period'); ?></label><span class="red-star">*</span>
<div class="input-group ">
<span class="input-group-addon success ">
<i class="fa fa-plug    "></i>
</span>
<select id="pay_period" name="pay_period" class="full-width" data-init-plugin="select2" required>
<option value=""><?php echo CommonLanguage::getMessage('select') ?></option>
<option value="0"><?php echo CommonLanguage::getMessage('weekly') ?></option>
<option value="1"><?php echo CommonLanguage::getMessage('monthly') ?></option>
</select>
</div>
</div> 
<div class="col-md-4 form-group">
<label><?php print CommonLanguage::getMessage('unit_time'); ?></label><span class="red-star">*</span>
<div class="input-group ">
<span class="input-group-addon success ">
<i class="fa fa-plug    "></i>
</span>
<select id="unit_time" name="unit_time" class="full-width" data-init-plugin="select2" required>
<option value=""><?php echo CommonLanguage::getMessage('select') ?></option>
<option value="0"><?php echo CommonLanguage::getMessage('hour') ?></option>
<option value="1"><?php echo CommonLanguage::getMessage('month') ?></option>
</select>
</div>
</div> 
<div class="col-md-4 form-group">
<label><?php print CommonLanguage::getMessage('formula'); ?></label><span class="red-star">*</span>
<div class="input-group ">
<span class="input-group-addon success ">
<i class="fa fa-plug    "></i>
</span>
<input type="hidden" id="formula_id" name="formula_id" class="full-width" value="<?php echo $default_formula['formula_id'] ?>" data-select-name="<?php echo $default_formula['formula_name'] ?>"  required/>
</div>
</div> 
</div>-->
                                        <div class="col-md-12" style="margin-left:5px" >
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('phone_recharge'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-plug    "></i>
                                                    </span>
                                                    <input id="Employee_Phone_Recharge" name="Employee_Phone_Recharge" Placeholder="<?php print CommonLanguage::getMessage('phone_recharge'); ?>" class="form-control" />
                                                </div>
                                            </div>
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('other_charges'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-subway"></i>
                                                    </span>
                                                    <input id="other_charges" name="other_charges" Placeholder="<?php print CommonLanguage::getMessage('other_charges'); ?>" class="form-control other_charges" />
                                                </div>
                                            </div>
                                            <div class="col-md-4 form-group ">
                                                <label><?php print CommonLanguage::getMessage('lunch'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-cutlery"></i>
                                                    </span>
                                                    <input id="Employee_Lunch" name="Employee_Lunch" value="0" Placeholder="<?php print CommonLanguage::getMessage('lunch'); ?>" class="form-control" />
                                                </div>
                                            </div>
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('transportation'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-subway"></i>
                                                    </span>
                                                    <input id="Employee_Transportation" name="Employee_Transportation" Placeholder="<?php print CommonLanguage::getMessage('transportation'); ?>" class="form-control Transportation" />
                                                </div>
                                            </div>
                                            <div class="col-md-4 form-group">
                                                <label><?php print CommonLanguage::getMessage('trans_period'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-subway"></i>
                                                    </span>
                                                    <select id="trans_unit_time" name="trans_unit_time"  class="full-width trans_unit_time" data-init-plugin="select2">
                                                        <option value="0"><?php echo CommonLanguage::getMessage('month') ?></option>
                                                        <option value="1"><?php echo CommonLanguage::getMessage('day') ?></option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-md-4 form-group ">
                                                <label><?php print CommonLanguage::getMessage('emp_charge1'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-cutlery"></i>
                                                    </span>
                                                    <input id="emp_charge1" name="emp_charge1" value="0" Placeholder="<?php print CommonLanguage::getMessage('emp_charge1'); ?>" class="form-control" />
                                                </div>
                                            </div>

                                            <div class="col-md-4 form-group ">
                                                <label><?php print CommonLanguage::getMessage('emp_charge2'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-cutlery"></i>
                                                    </span>
                                                    <input id="emp_charge2" name="emp_charge2" value="0" Placeholder="<?php print CommonLanguage::getMessage('emp_charge2'); ?>" class="form-control" />
                                                </div>
                                            </div>

                                            <div class="col-md-4 form-group ">
                                                <label><?php print CommonLanguage::getMessage('emp_charge3'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-cutlery"></i>
                                                    </span>
                                                    <input id="emp_charge3" name="emp_charge3" value="0" Placeholder="<?php print CommonLanguage::getMessage('emp_charge3'); ?>" class="form-control" />
                                                </div>
                                            </div>

                                            <div class="col-md-4 form-group ">
                                                <label><?php print CommonLanguage::getMessage('emp_charge4'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-cutlery"></i>
                                                    </span>
                                                    <input id="emp_charge4" name="emp_charge4" value="0" Placeholder="<?php print CommonLanguage::getMessage('emp_charge4'); ?>" class="form-control" />
                                                </div>
                                            </div>

                                        </div>
                                        <div class="col-md-12" style="margin-left:5px">
                                            <div class="col-md-4 form-group hidden">
                                                <label><?php print CommonLanguage::getMessage('housing'); ?></label>
                                                <div class="input-group ">
                                                    <span class="input-group-addon success ">
                                                        <i class="fa fa-home"></i>
                                                    </span>
                                                    <input id="Employee_Allownace" value="0" name="Employee_Allownace" Placeholder="<?php print CommonLanguage::getMessage('housing'); ?>" class="form-control Allownace" />
                                                </div>
                                            </div>
                                        </div>
                                        <br>
                                        <br>
                                        <br>
                                    </div>
                                </div>
                                <div class="tab-pane slide-left" id="slide5" style="height:300px">
                                    <div class="row">
                                        <div class="col-md-4 form-group">
                                            <label><?php print CommonLanguage::getMessage('Employee_Wife_Name'); ?></label>
                                            <div class="input-group ">
                                                <span class="input-group-addon success ">
                                                    <i class="fa fa-user"></i>
                                                </span>
                                                <input type="text"  placeholder="<?php print CommonLanguage::getMessage('Employee_Wife_Name'); ?>" id="Employee_Wife_Name" name="Employee_Wife_Name" class="form-control " >
                                            </div>
                                        </div>
                                        <div class="col-md-4 form-group">
                                            <label><?php print CommonLanguage::getMessage('dob'); ?></label>
                                            <div class="input-group ">
                                                <span class="input-group-addon success ">
                                                    <i class="fa fa-user"></i>
                                                </span>
                                                <input type="text"  placeholder="<?php print CommonLanguage::getMessage('dob'); ?>" id="Employee_Wife_DOB" name="Employee_Wife_DOB"  autocomplete="off" class="form-control " >
                                            </div>
                                        </div>
                                        <div class="col-md-4 form-group">
                                            <label><?php print CommonLanguage::getMessage('dob_address'); ?></label>
                                            <div class="input-group ">
                                                <span class="input-group-addon success ">
                                                    <i class="fa fa-location-arrow"></i>
                                                </span>
                                                <input type="text"  placeholder="<?php print CommonLanguage::getMessage('dob_address'); ?>" id="Employee_Wife_Address" name="Employee_Wife_Address" class="form-control " autocomplete="off">
                                            </div>
                                        </div>
                                        <div class="col-md-4 form-group">
                                            <label><?php print CommonLanguage::getMessage('Phone'); ?></label>
                                            <div class="input-group ">
                                                <span class="input-group-addon success ">
                                                    <i class="fa fa-phone"></i>
                                                </span>
                                                <input type="text"  placeholder="<?php print CommonLanguage::getMessage('Phone'); ?>" id="Employee_Wife_Phone" name="Employee_Wife_Phone" class="form-control " autocomplete="off" >
                                            </div>
                                        </div>
                                        <div class="col-md-4 form-group">
                                            <label><?php print CommonLanguage::getMessage('work_address'); ?></label>
                                            <div class="input-group ">
                                                <span class="input-group-addon success ">
                                                    <i class="fa fa-map"></i>
                                                </span>
                                                <input type='text' placeholder="<?php print CommonLanguage::getMessage('work_address'); ?>" id="Employee_Wife_Work" name="Employee_Wife_Work" class="form-control " autocomplete="off"/>
                                            </div>
                                        </div>
                                        <div class="col-md-4 form-group">
                                            <label><?php print CommonLanguage::getMessage('nationality'); ?></label>
                                            <div class="input-group ">
                                                <span class="input-group-addon success ">
                                                    <i class="fa fa-flag"></i>
                                                </span>
                                                <select  id="Employee_Wife_Nationality" name="Employee_Wife_Nationality" class="full-width Employee_Wife_Nationality" data-init-plugin="select2">
                                                    <option value=""><?php print CommonLanguage::getMessage('select'); ?></option>
                                                    <?php foreach ($employee_nationality as $nationality) { ?>
                                                        <option value="<?php echo $nationality['Nationality_ID'] ?>"><?php echo ($nationality['Nationality_Name']) ?></option>
                                                    <?php } ?>
                                                    <option value='more'><?php echo CommonLanguage::getMessage('More') ?></option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-md-4 form-group">
                                            <div class="radio radio-success" id="Wife_Works">
                                                <input type="radio" checked="" value="1"  name="Wife_Works" id="Wife_Work">
                                                <label for="Wife_Work"><?php print CommonLanguage::getMessage('wife_works'); ?> </label>
                                                <input type="radio"  value="0" name="Wife_Works"  id="Wife_notWorks" >
                                                <label for="Wife_notWorks"><?php print CommonLanguage::getMessage('no_wife_works'); ?></label>
                                                <input type="radio"  value="2" name="Wife_Works"  id="Other" >
                                                <label for="Other"><?php print CommonLanguage::getMessage('others'); ?> </label>
                                            </div>
                                        </div>
                                        <div class="col-md-4 form-group">
                                            <div class="radio radio-success" id="Employee_Wife_SSNF">
                                                <input type="radio" checked="" value="1"  name="Employee_Wife_SSNF" id="Wife_SSNF">
                                                <label for="Wife_SSNF"><?php print CommonLanguage::getMessage('Wife_SSNF'); ?> </label>
                                                <input type="radio"  value="0" name="Employee_Wife_SSNF"  id="Wife_notSSNF" >
                                                <label for="Wife_notSSNF"><?php print CommonLanguage::getMessage('Wife_notSSNF'); ?> </label>
                                            </div>
                                        </div>
                                        <div class="col-md-4 form-group">
                                            <label><?php print CommonLanguage::getMessage('problems'); ?></label>
                                            <div class="input-group ">
                                                <span class="input-group-addon success ">
                                                    <i class="fa fa-heart"></i>
                                                </span>
                                                <textarea placeholder="<?php print CommonLanguage::getMessage('problems'); ?>" id="Employee_Wife_Problem" name="Employee_Wife_Problem" class="form-control " ></textarea>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="tab-pane slide-left" id="slide6" style="height:300px">
                                    <div class="row">
                                        <div class="col-md-4 form-group">
                                            <label><?php print CommonLanguage::getMessage('bank_name'); ?></label>
                                            <div class="input-group ">
                                                <span class="input-group-addon success ">
                                                    <i class="fa fa-user"></i>
                                                </span>
                                                <input type="hidden"  placeholder="<?php print CommonLanguage::getMessage('bank_name'); ?>" id="bank_id" name="bank_id" class="full-width " >
                                            </div>
                                        </div>
                                        <div class="col-md-4 form-group">
                                            <label><?php print CommonLanguage::getMessage('bank_account'); ?></label>
                                            <div class="input-group ">
                                                <span class="input-group-addon success ">
                                                    <i class="fa fa-user"></i>
                                                </span>
                                                <input type="text"  placeholder="<?php print CommonLanguage::getMessage('bank_account'); ?>" id="bank_account" name="bank_account" class="form-control " >
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="tab-pane slide-left" id="slide7" style="height:300px">
                                    <div class="row">
                                        <div class="col-md-4 form-group  <?php echo smc_session()['default_setting']['activate_dynamic_accrued_days'] == 1 ? '' : 'hidden' ?>">
                                            <label><?php print CommonLanguage::getMessage('previous_days_nb'); ?></label>
                                            <div class="input-group ">
                                                <span class="input-group-addon success ">
                                                    <i class="fa fa-bars"></i>
                                                </span>
                                                <input id="previous_days_nb" name="previous_days_nb" <?php echo $permissions->hasPermission('change_previous_days') ? '' : 'readonly' ?> Placeholder="<?php print CommonLanguage::getMessage('previous_days_nb'); ?>" class="form-control" />
                                            </div>
                                        </div>


                                        <div class="col-md-4 form-group  <?php echo smc_session()['default_setting']['activate_dynamic_accrued_days'] == 1 ? '' : 'hidden' ?>">
                                            <label><?php print CommonLanguage::getMessage('leave_days_nb'); ?></label>
                                            <div class="input-group ">
                                                <span class="input-group-addon success ">
                                                    <i class="fa fa-bars"></i>
                                                </span>
                                                <input id="leave_days_nb" name="leave_days_nb" Placeholder="<?php print CommonLanguage::getMessage('leave_days_nb'); ?>" value="<?php echo smc_session()['default_setting']['activate_dynamic_accrued_days'] == 1 ? smc_session()['default_setting']['default_nb_leave'] : 0 ?>" class="form-control" />
                                            </div>
                                        </div>
                                        <div class="col-md-4 form-group  <?php echo smc_session()['default_setting']['activate_dynamic_accrued_days'] == 1 ? '' : 'hidden' ?>">
                                            <label><?php print CommonLanguage::getMessage('remaining_days'); ?></label>
                                            <div class="input-group ">
                                                <span class="input-group-addon success ">
                                                    <i class="fa fa-bars"></i>
                                                </span>
                                                <input id="remaining_days" name="remaining_days" readonly Placeholder="<?php print CommonLanguage::getMessage('remaining_days'); ?>" class="form-control" />
                                            </div>
                                        </div>
                                        <div class="col-md-4 form-group <?php echo ($permissions->hasPermission('change_holidays_nb') && smc_session()['default_setting']['activate_dynamic_accrued_days'] == 1 ) ? '' : 'hidden' ?> " style="display:grid;">
                                            <label><?php echo CommonLanguage::getMessage('holiday_is_fixed') ?>&nbsp;<i class="fa fa-info-circle" title="<?php echo CommonLanguage::getMessage('fixed_holiday_msg') ?>"></i></label>
                                            <input type="checkbox" id="holiday_is_fixed" name="holiday_is_fixed"/>
                                        </div>
                                        <div class="col-md-4 holiday_nb_div hidden form-group <?php echo ($permissions->hasPermission('change_holidays_nb') && smc_session()['default_setting']['activate_dynamic_accrued_days'] == 1 ) ? '' : 'hidden' ?>  ">
                                            <label><?php print CommonLanguage::getMessage('holiday_nb'); ?></label>
                                            <div class="input-group ">
                                                <span class="input-group-addon success ">
                                                    <i class="fa fa-bars"></i>
                                                </span>
                                                <input id="holiday_nb" name="holiday_nb" Placeholder="<?php print CommonLanguage::getMessage('holiday_nb'); ?>" class="form-control" />
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" >
                                        <div class="col-md-12">
                                            <div class="col-md-3">
                                                <label><?php echo CommonLanguage::getMessage('absence_type') ?></label>
                                                <select id="absence_type" name="absence_type" class="full-width" data-init-plugin="select2">
                                                    <option value="1" <?php echo smc_session()['default_setting']['employee_default_absence_setting'] == 1 ? 'selected' : '' ?>><?php echo CommonLanguage::getMessage('absence_setting') ?></option>
                                                    <option value="2" <?php echo smc_session()['default_setting']['employee_default_absence_setting'] == 2 ? 'selected' : '' ?>><?php echo CommonLanguage::getMessage('manual') ?></option>
                                                    <option value="3" <?php echo smc_session()['default_setting']['employee_default_absence_setting'] == 3 ? 'selected' : '' ?>><?php echo CommonLanguage::getMessage('job') ?></option>
                                                </select>
                                            </div>
                                            <!--                                            <div class="col-md-3">
                                                                                            <button id="toggle_absence" class="btn btn-success"><?php echo CommonLanguage::getMessage('manage_absence') ?></button>
                                                                                        </div>-->
                                        </div>
                                        <div id="absences" class="">
                                            <div class="col-md-12 form-group">
                                                <div class="col-md-3">
                                                    <label><?php echo CommonLanguage::getMessage('absence_reason_name') ?></label>
                                                </div>
                                                <div class="col-md-6">
                                                    <label><?php echo CommonLanguage::getMessage('days_nb') ?></label>
                                                </div>
                                            </div>
                                            <div class="col-md-12 abs-row m-b-10 form-group">
                                                <div class="col-md-3">
                                                    <label class="reason_name "><span class="reason_title"></span>&nbsp;<span class="fa fa-info-circle reason_hint" title="<?php echo CommonLanguage::getMessage('fixed_holiday_msg') ?>"></span></label>
                                                </div>
                                                <div class="col-md-6">
                                                    <input type="number"  class="nb_days form-control" min="0"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <div class="pull-right">
                    <button class="btn btn-default" data-dismiss="modal" id="CloseEmployee" ><?php print CommonLanguage::getMessage('Close'); ?></button>
                    <button class="btn btn-success" id="SubmitEmployee"><?php print CommonLanguage::getMessage('Save'); ?></button>
                </div>
            </div>
            <?php echo Forms::ModalLoader('employeeLoader'); ?>
        </div>
    </div>
</div>
<div class="modal fade" id="confirm_period_modal" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <div id="delete_alert"></div>
                <h4 class="modal-title"><?php print CommonLanguage::getMessage('confirm') ?></h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-12 m-t-10">
                        <strong><?php print CommonLanguage::getMessage('change_basic_salary_alert') ?>&nbsp;<span id="inv_nb" class="bold red-star"></span></strong>
                        <p><?php print CommonLanguage::getMessage('proceed') ?> ?</p>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><?php print CommonLanguage::getMessage('Close') ?></button>
                <button type="button" class="btn btn-danger width-auto" id="confirm_period"><?php print CommonLanguage::getMessage('proceed') ?></button>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var Submitted_Successfully = <?php echo json_encode(CommonLanguage::getMessage('Submitted_Successfully')); ?>,
            Required_Fields = <?php echo json_encode(CommonLanguage::getMessage('Required_Fields')); ?>,
            salary_is_required = <?php echo json_encode(CommonLanguage::getMessage('salary_is_required')); ?>,
            Failed_Submit = <?php echo json_encode(CommonLanguage::getMessage('Failed_Submit')); ?>,
            country_id = <?php echo json_encode(smc_session()['default_setting']['default_country_id']) ?>,
            city_id = <?php echo json_encode(smc_session()['default_setting']['default_city_id']) ?>,
            city_name = <?php echo json_encode(smc_session()['default_city']['Name']) ?>,
            country_name = <?php echo json_encode(smc_session()['default_country']['Country_Name']) ?>;
    $(document).ready(function () {
        new Switchery($("#is_nssf").get(0), {color: $.Pages.getColor("success")});
        new Switchery($("#stop_housing_payroll").get(0), {color: $.Pages.getColor("success")});
        new Switchery($("#holiday_is_fixed").get(0), {color: $.Pages.getColor("success")});
        new Switchery($("#early_payroll").get(0), {color: $.Pages.getColor("success")});
        //        /jobSearch
        build_select2($("#job_id"), 'xhr/jobSearch')
        build_select2($("#Paygrade_ID"), 'xhr/paygradeSearch?job_id=' + $("#job_id").val())
        build_select2($("#period_id"), "xhr/CommonSearch?col_id=period_id&col_name=period_name&table=tbl_hrm_basic_salary_periods")
        build_select2($("#bank_id"), "HRMAjax/searchBanks")
//        $("#Employee_City").val(default_city_id).select2()
        build_select2($("#Employee_Country"), "xhr/CommonSearch?col_id=Country_ID&col_name=Country_Name&table=tbl_all_countries");
        build_select2($("#Employee_City"), "xhr/searchCity?Country_ID=" + $("#Employee_Country").val());

        apply_autocomplete($("#shift_note"), 'xhr/search_shift_note', function (event, ui, who) {
            who.val(ui.item.shift_note);
        });
        apply_autocomplete($("#location_address"), 'xhr/search_location_address', function (event, ui, who) {
            who.val(ui.item.location_address);
        });
        build_absences()
        $("#absence_type").on("change", function () {
            build_absences()
        })
        $("#job_id").on("change", function () {
            $("#Paygrade_ID").val("").attr("data-select-name", "")
            build_select2($("#Paygrade_ID"), 'xhr/paygradeSearch?job_id=' + $("#job_id").val())
            if ($("#absence_type").val() == 3) {
                build_absences()
            }
        })
        $("#holiday_is_fixed").on("change", function () {
            if ($(this).is(":checked")) {
                $(".holiday_nb_div").removeClass("hidden")
            } else {
                $(".holiday_nb_div").addClass("hidden")
            }
        })
        $("#is_nssf").on("change", function () {
            if ($(this).is(":checked")) {
                $(".nssf-div").removeClass("hidden")
                $(".nssf-div input").not('#nssf_salary').not('#stop_housing_payroll').attr("required", "required")
                $(".nssf-star").removeClass("hidden")
            } else {
                $(".nssf-div").addClass("hidden")
                $(".nssf-div input").removeAttr("required").val("")
                $(".nssf-star").addClass("hidden")
            }
        })
        $('#Add_Employee').on('shown.bs.modal', function () {
            if ($('#Employee_Work_ID').val() == '') {
                $.ajax({
                    url: 'HRMAjax/returnWrkIDEmployee',
                    complete: function (v, v1) {
                        $('#Employee_Work_ID').val(v.responseText);
                    }
                });
            }
            if ($("#is_nssf").is(":checked")) {
                $("#is_nssf").trigger("click")
            }
            if ($("#stop_housing_payroll").is(":checked")) {
                $("#stop_housing_payroll").trigger("click")
            }
            $("#Employee_SocialSecurity,#Employee_SocialSecurity_Date,#nssf_salary").val("")
            $('#Employee_Country').val(country_id).attr('data-select-name', country_name).trigger('change');
            $('#Employee_City').val(city_id).attr('data-select-name', city_name).trigger('change');

        });
        $("#Employee_Location").on("change", function () {
            var val = $(this).val();
            if (val === "more") {
                $("#Employee_Location").removeAttr('selected').find('option:first').attr('selected', 'selected');
                $("#add_Employee_Location").modal('show');
            }
        });
        $("#Employee_Nationality,#Employee_Wife_Nationality").on("change", function () {
            var val = $(this).val();
            if (val === "more") {
                $("#Employee_Nationality,#Employee_Wife_Nationality").removeAttr('selected').find('option:first').attr('selected', 'selected');
                $("#add_Employee_Nationality").modal('show')
            }
        });
        $('select[name=IS_Employee]').on('change', function () {
            var is_emp = ($(this).val());
            if (is_emp != 1) {
                $('#Employee_SocialSecurity,#Employee_SocialSecurity_Date').attr('readonly', true);
                $('#Employee_SocialSecurity,#Employee_SocialSecurity_Date').attr('required', false);
                $('#Employee_SocialSecurity').val(0);
                $('#nssf_salary').val('');
            } else {
                $('#Employee_SocialSecurity,#Employee_SocialSecurity_Date').attr('readonly', false);
                $('#Employee_SocialSecurity,#Employee_SocialSecurity_Date').attr('required', true);
                $('#Employee_SocialSecurity,#Employee_SocialSecurity_Date').val('');
                $('#nssf_salary').val('');
            }
        });
        build_select2($('.Shift_ID'), 'xhr/searchshift');
        build_select2($('.Branch_ID'), 'HRMAjax/searchDepartment');
        $('#Employee_DOB,#Employee_StartDate,#leave_date,#Employee_SocialSecurity_Date,#Employee_Wife_DOB').datetimepicker({format: 'YYYY-MM-DD', useCurrent: false, extraFormats: ['DD-MM-YYYY']});
        $("#SubmitEmployee").on("click", function () {
            var IsValidated = true;
//            if ($('#Employee_SocialSecurity').val() == 0) {
//                $('#Employee_SocialSecurity_Date').removeAttr('required');
//            } else {
//                $('#Employee_SocialSecurity_Date').attr('required', true);
//            }
            $("#Employee_Form").validate();
            if (!$("#Employee_Form").find("input").blur().end().valid()) {
                $("#EmployeeValidationAlert").attr("class", "alert alert-danger").show().html(Required_Fields);
                $("#Edit_Employee").scrollTop(0)
                return;
            }
            if ($("#Paygrade_ID").val() == '' && ($("#basic_salary").val() == '' || $("#basic_salary").val() == 0)) {
                $("#EmployeeValidationAlert").attr("class", "alert alert-danger").show().html(salary_is_required);
                $("#Edit_Employee").scrollTop(0)
                return;
            }
            if (!IsValidated)
                return;
            $("#EmployeeIsBusy").removeClass('hidden');
            var Data = new FormData(document.getElementById("Employee_Form"));
            Data.append("is_actual", is_actual)
            Data.append("basic_salary_currency", $("#basic_salary_currency").val())
            var absences = [];
            $(".abs-row").each(function (e) {
                var me = $(this);
                absences.push({
                    absence_reason_id: me.attr("data-id"),
                    nb_days: me.find("input.nb_days").val()
                })
            })
            Data.append("absences", JSON.stringify(absences))

            $.ajax({
                url: "HRMAjax/addEmployee",
                type: "POST",
                data: Data,
                processData: false,
                contentType: false,
                complete: function (v, vv) {
                    if (vv = "success" && v.responseText == 'ok') {
                        $("#EmployeeValidationAlert").attr("class", "alert alert-success").empty().html(Submitted_Successfully);
                        RebuildDataTable(title, [0, 1, 2, 3, 4, 5], 'HRMAjax/viewEmployeesRequest', {is_actual: is_actual, dep_id: $('input.department_id').val(), emp_type: $('#employee_type_filter').val()});
                        setTimeout(function () {
                            $("#Add_Employee").modal('hide');
                            $("#EmployeeValidationAlert").addClass('hidden');
                            var validate = $("#Employee_Form").validate();
                            validate.resetForm();
                        }, 1500);
                    } else {
                        $("#EmployeeValidationAlert").attr("class", "alert alert-danger").empty().html(v.responseText);
                    }
                    $("#EmployeeIsBusy").addClass('hidden');
                }
            });
            // var validate = $("#Employee_Form").validate();
            //                                                                validate.resetForm();
            //                                                                $("#Add_Employee input").val("");
        });
        //#CloseEmployee,#CloseAddEmployeeModal
        $("#Add_Employee").on("hidden.bs.modal", function () {
            //            $("#Add_Employee").modal("hide");
            $("#NewEmployeeUploadImagePreview").hide().attr("src", "");
            $("#NewEmployeeNoPreviewFileUploadIcon").show();
            $("#EmployeeValidationAlert").addClass('hidden');
            $("#Employee_Form input:not(#basic_salary_currency)").val("")
            //            var validate = $("#Employee_Form").validate();
            //            validate.resetForm();
        });
        $("#period_id").on("change", function () {
            $("#confirm_period_modal").modal("show")
        })
        $("#confirm_period").on("click", function () {
            $.ajax({
                url: "HRMAjax/get_salary_periods_by_id",
                method: "GET",
                dataType: 'json',
                data: {id: $("#period_id").val()},
                complete: function (v1, v2) {
                    if (v2 == "success") {
                        var data = v1.responseJSON;
                        $("#basic_salary").val(data['basic_salary'])
                        $("#basic_salary_currency").val(data['Currency_ID'])
                        $(".basic-cur-div").html(data['Currency_Name'] + ' - ' + data['Currency_Code'])
                        $("#confirm_period_modal").modal("hide")
                    }
                }
            })
        })
    });
    function ValidateForNewEmployeePhoto(input) {
        var FileUploadError = '';
        if (input.files && input.files[0]) {
            var FileName = $.trim(input.files[0].name)
            var FileType = FileName.substring(FileName.lastIndexOf("."));
            var FileSizeKB = input.files[0].size / 1024;
            if (FileType) {
                FileType = FileType.toLowerCase();
                var allowedExtensions = ['.jpg', '.png'];
                var maxAllowedSizeKB = 50;
                FileType = FileType.toLowerCase();
                if (allowedExtensions.indexOf(FileType) == -1)
                    FileUploadError = 'File Extension (' + FileType + ') not Supported<br/>Supported Extensions: ' + allowedExtensions.join();
                else if (FileSizeKB > maxAllowedSizeKB)
                    FileUploadError = 'File Size Exceed (' + maxAllowedSizeKB + ' KB)';
            }
            $("#NewEmployeeNoPreview").hide()
            $("#NewEmployeeFilewarning2").remove()
            if (FileUploadError != '') {
                $("#NewEmployeeNoPreview").show()
                $("<span id='NewEmployeeFilewarning2' style='color:#f00;display: block;text-align: center;white-space: normal;'>" + FileUploadError + "</span>").insertAfter($(input))
                return false;
            } else {
                $("#CurProfilePhoto").hide()
                var reader = new FileReader();
                reader.onload = function (e) {
                    $("#CurProfilePhoto").attr('src', e.target.result).show();
                }
                reader.readAsDataURL(input.files[0]);
                return true;
            }
        }
        return false;
    }

    function build_absences() {
        var type = $("#absence_type").val(),
                type_id = type == 3 ? $("#job_id").val() : '';
        var data = {
            type: type,
            type_id: type_id
        };
        $(".abs-row:eq(0) input").val("").attr("data-id", 0)
        $(".abs-row:gt(0)").remove()
        $.ajax({
            url: 'HRMAjax/get_absence_by_type',
            data: data,
            dataType: 'json',
            complete: function (v1, v2) {
                if (v2 == 'success') {
                    var data = v1.responseJSON;
                    $.each(data, function (indx, row) {
                        if (indx == 0) {
                            $(".abs-row:eq(0)").attr("data-id", row['Absence_Reason_ID'])
                            $(".reason_title").text(row['Absence_Reason_Name'])
                            if (row['is_holiday'] == 1)
                                $(".reason_hint").removeClass('hidden')
                            else
                                $(".reason_hint").addClass('hidden')
                            //
                            $("input.nb_days").val(row['nb_days'])
                            if (type != 2)
                                $("input.nb_days").prop("readonly", true)
                            else
                                $("input.nb_days").prop("readonly", false)
                        } else {
                            var cloned_row = $(".abs-row:eq(0)").clone();
                            $(".reason_title", cloned_row).text(row['Absence_Reason_Name'])
                            if (row['is_holiday'] == 1)
                                $(".reason_hint", cloned_row).removeClass('hidden')
                            else
                                $(".reason_hint", cloned_row).addClass('hidden')
                            //
                            $("input.nb_days", cloned_row).val(row['nb_days'])
                            cloned_row.attr("data-id", row['Absence_Reason_ID'])
                            cloned_row.appendTo($("#absences"))
                            if (type != 2)
                                $("input.nb_days", cloned_row).prop("readonly", true)
                            else
                                $("input.nb_days", cloned_row).prop("readonly", false)


                        }
                    })
                }
            }
        })
    }
</script>
