<?php include($_SERVER['DOCUMENT_ROOT'] . "/COMPONENTS/root/path.php"); ?>
<style>
    .formfield {
        position: relative;
        box-sizing: border-box;
        float: left;
        margin: auto;
        padding: 0px;
        border: 0px;
        background: white;
        width: 100%;
    }


    .formfield>input,
    .formfield>select,
    .formfield>textarea,
    .formfield>label {
        padding: 0.8em;
        margin: 0.5em;
        width: 100%;
        background: none;
    }

    .formfield>input,
    .formfield>textarea,
    .formfield>select {
        border: 1px solid #d4d4d4;
        border-radius: 5px;
        outline: none;
    }

    .formfield>label {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        color: #6b6b6b;
        font-size: 12px;
    }

    input:focus+label,
    select:focus+label,
    textarea:focus+label,
    input:valid+label,
    textarea:valid+label,
    select:valid+label {
        color: #686868;
        font-size: 0.9em;
        width: auto;
        height: 1em;
        padding: 0px 0.5em 0px 0.5em;
        margin: 0px;
        background: white;
        transition: 0.2s ease-in-out;
        top: 0em;
        left: 2em;
        font-weight: 600px;

    }

    input:focus,
    input:valid,
    select:focus,
    select:valid,
    textarea:focus,
    textarea:valid {
        border: 2px solid #5381aa;
    }


    input:focus~label,
    input:valid~label,
    select:focus~label,
    select:valid~label,
    textarea:focus~label,
    textarea:valid~label {
        font-size: 12px;
        color: #286397;
        font-weight: 500;
        /* border: 2px solid #009688; */
    }


    input:focus~label span,
    input:valid~label span,
    select:focus~label span,
    select:valid~label span,
    textarea:focus~label span,
    textarea:valid~label span {
        color: red !important;
    }

    /* .containerr {
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
    } */

    .radio_container {
        display: flex !important;
        justify-content: space-around !important;
        align-items: center !important;
        background-color: #cecece !important;
        width: 100% !important;
        margin-top: 10px;
        height: 50px;
        border-radius: 5px;
        box-shadow: inset 0.5px 0.5px 2px 0 rgba(0, 0, 0, 0.15);
        margin-left: 7px;
    }

    .radio_container input[type="radio"] {
        appearance: none !important;
        display: none !important;
    }

    .radio-label {
        font-family: "Open Sans", sans-serif;
        font-size: 20px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: none !important;
        width: 48% !important;
        height: 40px !important;
        text-align: center;
        border-radius: 5px;
        overflow: hidden;
        transition: linear 0.3s;
        color: #6e6e6edd !important;
    }

    .radio_container input[type="radio"]:checked+label {
        background-color: #f15a2b !important;
        color: #f1f3f5 !important;
        /* font-weight: 900; */
        transition: 0.3s;
    }

    h1 {
        position: relative;
        padding: 0;
        margin: 0;
        font-family: "Raleway", sans-serif;
        font-weight: 300;
        font-size: 18px;
        color: #080808;
        -webkit-transition: all 0.4s ease 0s;
        -o-transition: all 0.4s ease 0s;
        transition: all 0.4s ease 0s;
    }

    h1 span {
        display: block;
        font-size: 0.5em;
        line-height: 0.2;
    }

    h1 em {
        font-style: normal;
        font-weight: 600;
    }

    /* === HEADING STYLE #1 === */

    .one h1 {
        text-align: center;
        text-transform: uppercase;
        padding-bottom: 2px;
    }

    .one h1:before {
        width: 28px;
        height: 5px;
        display: block;
        content: "";
        position: absolute;
        bottom: 2px;
        left: 50%;
        margin-left: -14px;
        background-color: #f15a2b;
    }

    .one h1:after {
        width: 100px;
        height: 1px;
        display: block;
        content: "";
        position: relative;
        margin-top: 10px;
        left: 50%;
        margin-left: -50px;
        background-color: #f15a2b;
    }

    /* === HEADING STYLE #2 === */

    .boutonn {
        text-transform: uppercase;
        font-weight: 500;
        color: #fff;
        border-radius: 100px;
        border: 0px;
        background-image: linear-gradient(60deg, #05579e, #05579e);
        width: 250px;
        transition: box-shadow 0.1s linear;
        height: 40px;
        margin-top: 20px;
    }

    .boutonn:hover {
        transition: box-shadow 0.1s linear;
        text-transform: uppercase;
        font-weight: 800;
        color: #fff;
        border-radius: 100px;
        border: 0px;
        background-image: linear-gradient(60deg, #05579e, #05579e);
        box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19);
        cursor: pointer;
    }

    .boutonn:active {
        text-transform: uppercase;
        font-weight: 800;
        color: #fff;
        border-radius: 100px;
        border: 0px;
        background-image: linear-gradient(60deg, #05579e, #7c4891);
        box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19);
        height: 45px;
        width: 145px;
    }

    .modal-header {
        background: linear-gradient(90deg, hsla(212, 50%, 34%, 1) 0%, hsla(215, 62%, 34%, 1) 36%, hsla(203, 92%, 37%, 1) 100%);
        background: -moz-linear-gradient(90deg, hsla(212, 50%, 34%, 1) 0%, hsla(215, 62%, 34%, 1) 36%, hsla(203, 92%, 37%, 1) 100%);
        background: -webkit-linear-gradient(90deg, hsla(212, 50%, 34%, 1) 0%, hsla(215, 62%, 34%, 1) 36%, hsla(203, 92%, 37%, 1) 100%);
        color: white;
    }

    input[type="date"]::before,
    input[type="file"]::before {
        content: attr(placeholder);
        position: absolute;
        color: #999999;

    }

    input[type="date"],
    input[type="file"] {
        color: #ffffff;
        background: url("add-file.png") no-repeat;
        text-indent: -9999px;
    }

    input[type="date"]:focus,
    input[type="date"]:valid,
    input[type="file"]:focus,
    input[type="file"]:valid {
        color: #666666;
        background: none;
        text-indent: 0px;
    }

    input[type="date"]:focus::before,
    input[type="date"]:valid::before,
    input[type="file"]:focus::before,
    input[type="file"]:valid::before {
        content: "";
    }

    .dose h1,
    .dose {
        margin-top: 8px;
        text-align: right;
        font-size: 13px;
    }


    .avatar-upload {
        position: relative;
        max-width: 210px;
        margin-left: 10px;
        margin: -5px auto;
    }

    .avatar-upload .avatar-edit {
        position: absolute;
        right: 12px;
        z-index: 1;
        top: 10px;
    }

    .avatar-upload .avatar-edit input {
        display: none;
    }

    .avatar-upload .avatar-edit input+label {
        display: inline-block;
        width: 34px;
        height: 34px;
        margin-bottom: 0;

        background: #FFFFFF;
        border: 1px solid transparent;
        -webkit-box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.12);
        box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.12);
        cursor: pointer;
        font-weight: normal;
        -webkit-transition: all .2s ease-in-out;
        transition: all .2s ease-in-out;
    }

    .avatar-upload .avatar-edit input+label:hover {
        background: #f1f1f1;
        border-color: #d6d6d6;
    }

    .avatar-upload .avatar-edit input+label:after {
        color: #757575;
        position: absolute;
        top: 10px;
        left: 0;
        right: 0;
        text-align: center;
        margin: auto;
    }

    .avatar-upload .avatar-preview {
        width: 200px;
        height: 210px;
        position: relative;
        border: 6px solid #F8F8F8;
        -webkit-box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
        box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
    }

    .avatar-upload .avatar-preview>div {
        width: 100%;
        height: 100%;

        background-size: cover;
        background-repeat: no-repeat;
        background-position: center;
    }

    @media (max-width: 1024px) {
        .mobilePad {
            padding-left: 10px !important;
        }
    }

    #addressFirst {
        height: 93px;
    }

    #tableProfile {
        border: 1px solid #ccc;
        border-collapse: collapse;
        table-layout: fixed;
        width: 100%;
        margin-left: 6px;
    }



    #tableProfile tr {
        border: 1px solid #ddd;
        padding: .15em;
    }

    #tableProfile tr:nth-child(even) {
        /* background: #f8f8f8; */
    }

    #tableProfile th,
    #tableProfile td {
        padding: .455em;
        text-align: left;
    }

    #tableProfile th {
        /* background: #999; */
        color: black;
        font-size: .85em;
        letter-spacing: .1em;
        text-transform: uppercase;
    }

    #tableProfile td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 12px !important;
        text-align: center;
    }

    #tableProfile td div {
        padding-left: 35px;
    }

    #tableProfile td:nth-child(2) {
        color: rgb(102, 102, 102) !important;
        font-weight: 200 !important;
    }

    input[type="radio"],
    input[type="checkbox"] {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        border-radius: 50%;
        width: 22px;
        height: 22px;
        border: 2px solid #999;
        transition: 0.2s all linear;
        position: relative;
    }

    input[type="radio"]:checked,
    input[type="checkbox"]:checked {
        border: 6px solid #f15a2b;
        background: white;
        outline: unset !important
            /* I added this one for Edge (chromium) support */
    }
</style>

<div class="row candidate-form">
    <div class="col-md-12  skilledUnskilled">
        <!-- bg-secondary -->
        <form method='POST' action="" id="form_addUser" enctype="multipart/form-data" autocomplete='off' validate>

            <div class="row">
                <div class="col-md-12">
                    <div class="card text-white">
                        <div class="card-header bg-secondary">
                            <h4 class="mb-0 text-white" style='font-size:14px;'>STEP 1: BASIC INFO</h4>
                        </div>
                        <div class="card-body">
                            <div class="row" style='padding-right:10px;'>

                                <div class='col-md-3'>
                                    <label style='text-align:center; font-weight:500; color:black; width:100%;'>Staff Photo <span class='required' style='color:red;'>*</span></label>
                                    <div class="avatar-upload">
                                        <div class="avatar-edit">
                                            <input type='file' name="profile_photo" id="imageUpload" accept=".png, .jpg, .jpeg" />
                                            <label for="imageUpload"><i class="bx bxs-edit" style='font-size:25px;'></i></label>
                                        </div>
                                        <div class="avatar-preview ">
                                            <div id="imagePreview" style="background-image: url(assets/images/user-image.png); background-position:center !important;">
                                            </div>
                                        </div>

                                    </div>

                                    <div style='text-align:center; margin-top:10px;'>
                                        <p style='font-size:10px;'><span style='color:black; font-weight:600;'>NOTE: </span> <span style='color:black;'>Staff Photo must be in passport size with white background.</span></p>
                                    </div>
                                </div>

                                <div class='col-md-9'>
                                    <div class='row'>


                                        <div class='col-md-12 mobilePad'>
                                            <div class="formfield">
                                                <select name="title" id="title" class="title" required>

                                                </select>
                                                <label alt="Title" for="title" placeholder="title">Title <span class='required'>*</span></label>
                                            </div>
                                        </div>

                                        <div class='col-md-4 mobilePad'>
                                            <div class="formfield">
                                                <input type="text" name="first_name" id="first_name" required>
                                                <label alt="First Name" for="first_name" placeholder="First Name">First Name <span class='required'>*</span></label>
                                            </div>
                                        </div>

                                        <div class='col-md-4 mobilePad'>
                                            <div class="formfield">
                                                <input type="text" name="middle_name" id="middle_name">
                                                <label alt="Middle Name" for="middle_name" placeholder="Middle Name">Middle Name </label>
                                            </div>
                                        </div>

                                        <div class='col-md-4 mobilePad'>
                                            <div class="formfield">
                                                <input type="text" name="last_name" id="last_name" required>
                                                <label alt="Last Name" for="last_name" placeholder="Last Name">Last Name <span class='required'>*</span></label>
                                            </div>
                                        </div>


                                        <div class='col-md-4 mobilePad'>
                                            <div class="containerr">
                                                <div class="radio_container">
                                                    <input type="radio" name="gender" value="Male" id="one" required checked>
                                                    <label class='radio-label' for="one">Male</label>
                                                    <input type="radio" name="gender" value="Female" required id="two">
                                                    <label class="radio-label" for="two">Female</label>
                                                </div>
                                            </div>
                                        </div>

                                        <div class='col-md-4 mobilePad'>
                                            <div class="formfield">
                                                <input type="date" name="dob" id="dob" required>
                                                <label alt="Date of Birth" for="dob">Date of Birth <span class='required'>*</span></label>
                                            </div>
                                        </div>

                                        <div class='col-md-4 mobilePad'>
                                            <div class="formfield">
                                                <div class="formfield">
                                                    <select name="nationality" id="nationality" class="nationality" required>
                                                        <option selected disabled value=""></option>

                                                    </select>
                                                    <label alt="Country" for="nationality">Nationality <span class='required'>*</span></label>
                                                </div>

                                            </div>
                                        </div>

                                        <div class='col-md-12 mobilePad'>
                                            <div class="formfield">
                                                <div class="formfield">
                                                    <textarea type="text" name="address" id="addressFirst" required></textarea>
                                                    <label alt="Full Address" for="addressFirst" placeholder="Full Address">Current Full Address <span class='required'>*</span></label>
                                                </div>

                                            </div>
                                        </div>
                                    </div>
                                </div>



                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-md-12">
                    <div class="card text-white">
                        <div class="card-header bg-secondary">
                            <h4 class="mb-0 text-white" style='font-size:14px;'>STEP 2: CONTACT</h4>
                        </div>
                        <div class="card-body">
                            <div class="row" style='padding-right:10px;'>



                                <div class='col-md-4 mobilePad'>
                                    <div class="formfield">
                                        <input type="text" name="phone" id="phone11" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*?)\..*/g, '$1');" required>
                                        <label alt="Telephone Number" for="phone11">Telephone Number <span class='required'>*</span></label>
                                    </div>
                                </div>


                                <div class='col-md-4 mobilePad'>
                                    <div class="formfield">
                                        <input type="text" name="whatsapp_no" id="whatsapp_no" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*?)\..*/g, '$1');" required>
                                        <label alt="Whatsapp Number" for="whatsapp_no" placeholder="Whatsapp Number">Whatsapp Number <span class='required'>*</span></label>
                                    </div>
                                </div>

                                <div class='col-md-4 mobilePad'>
                                    <div class="formfield">
                                        <input type="email" name="email" id="email11" required>
                                        <label alt="First Name" for="email11" placeholder="Email">Email <span class='required'>*</span></label>
                                    </div>
                                </div>

                            </div>
                        </div>

                    </div>


                </div>

                <div class="col-md-12">
                    <div class="card text-white">
                        <div class="card-header bg-secondary">
                            <h4 class="mb-0 text-white" style='font-size:14px;'>STEP 3: JOB DETAILS / Qualifications and Skills</h4>
                        </div>


                        <div class="card-body">
                            <div class="row" style='padding-right:10px;'>

                                <div class='col-md-6 mobilePad'>
                                    <div class="formfield">
                                        <input type="text" name="added_by" class="added_by" <?php echo "style='display:none;' readonly"; ?>>
                                        <select name="role" id="role" required>
                                            <option value=""> </option>
                                            <option value="Chief Executive Officer">Chief Executive Officer</option>
                                            <option value="Administrative Manager">Administrative Manager</option>
                                            <option value="Administrative Assistant">Administrative Assistant</option>
                                            <option value="Accounts Officer">Accounts Officer</option>
                                            <option value="Accountant">Accountant</option>
                                            <option value="Finance Manager">Finance Manager</option>
                                            <option value="Production Manager">Production Manager</option>
                                            <option value="Storekeeper">Storekeeper</option>
                                            <option value="Foreman">Foreman</option>
                                            <option value="Factory staff">Factory staff</option>
                                        </select>
                                        <label alt="Job Title / Position" for="role" placeholder="Job Title / Position">Job Title / Position <span class='required'>*</span></label>
                                    </div>
                                </div>

                                <div class='col-md-6 mobilePad'>
                                    <div class="formfield">
                                        <select name="department" id="department" required>
                                            <option value=""> </option>
                                            <option value="Administration">Administration </option>
                                            <option value="Accounts">Accounts </option>
                                            <option value="Operations">Operations</option>
                                            <option value="Warehouse / Store">Warehouse / Store</option>
                                            <option value="Factory">Factory</option>
                                        </select>
                                        <label alt="Department" for="department" placeholder="Department">Department <span class='required'>*</span></label>
                                    </div>
                                </div>

                                <div class='col-md-6 mobilePad'>
                                    <div class="formfield">
                                        <select name="employment_status" id="employment_status" required>
                                            <option value="Full Time">Full Time</option>
                                            <option value="Part Time">Part Time</option>
                                            <option value="Contract">Contract</option>
                                            <option value="Trainee">Trainee</option>
                                        </select>
                                        <label alt="Employment Status" for="employment_status" placeholder="Employment Status">Employment Status <span class='required'>*</span></label>
                                    </div>
                                </div>

                                <div class="col-md-6 mobilePad">
                                    <div class="formfield">
                                        <select name="qualification" id="qualification" class="qualification" required autofocus>

                                        </select>
                                        <label alt="What is your highest level of Education?" for="qualification">Highest Level Of Education <span class='required'>*</span></label>
                                    </div>
                                </div>

                                <div class="col-md-12 moreJobsAction" style='text-align:right;'>
                                    <a href="#" class="addMoreJobs"> Add More Documents <i class="fa fa-plus"></i></a>
                                </div>
                                <div class="col-md-12">
                                    <div class="row moreJobs">
                                        <div class="col-md-6 experienceYears mobilePad">
                                            <div class="formfield">
                                                <select name="document_type[]" id="document_type" style="height:45px;">

                                                </select>
                                                <label alt="Document Type" for="document_type">Select Document Type</label>
                                            </div>
                                        </div>

                                        <div class="col-md-6 experienceYears mobilePad">
                                            <div class="formfield">
                                                <input type="file" name="attachment[]" id="cv" accept=".png, .jpg, .jpeg, .pdf, .doc, .docx">
                                                <label alt="Upload selected document" for="cv">Upload selected document</label>
                                            </div>
                                        </div>


                                        <div class="col-md-6 experienceYears mobilePad">
                                            <div class="formfield">
                                                <input type="date" name="start_date[]" id="start_date">
                                                <label alt="Start Date" for="start_date">Start Date</label>
                                            </div>
                                        </div>

                                        <div class="col-md-6 experienceYears mobilePad">
                                            <div class="formfield">
                                                <input type="date" name="end_date[]" id="end_date">
                                                <label alt="End Date" for="end_date">End Date</label>
                                            </div>
                                        </div>
                                    </div>
                                </div>



                                <div class="col-md-12 mobilePad dose" style='text-align:left;'>
                                    <h1>Relevant Skills and Experience :</h1>
                                </div>
                                <div class="col-md-3 mobilePad">
                                    <div class="formfield">
                                        <input type="text" name="skill_experience[]" id="skill_experience">
                                        <label alt="Skill / Expereience 1" for="skill_experience">Skill / Expereience 1</label>
                                    </div>
                                </div>
                                <div class="col-md-3 mobilePad">
                                    <div class="formfield">
                                        <input type="text" name="skill_experience[]" id="skill_experience1">
                                        <label alt="Skill / Expereience 2" for="skill_experience1">Skill / Expereience 2</label>
                                    </div>
                                </div>


                                <div class="col-md-3 mobilePad">
                                    <div class="formfield">
                                        <div class="formfield">
                                            <input type="text" name="skill_experience[]" id="skill_experience2">
                                            <label alt="Skill / Expereience 2" for="skill_experience2">Skill / Expereience 3</label>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-3 mobilePad">
                                    <div class="formfield">
                                        <div class="formfield">
                                            <input type="text" name="skill_experience[]" id="skill_experience3">
                                            <label alt="Skill / Expereience 2" for="skill_experience3">Skill / Expereience 4</label>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>


                    </div>
                </div>

                <div class="col-md-12">
                    <div class="card text-white">
                        <div class="card-header bg-secondary">
                            <h4 class="mb-0 text-white" style='font-size:14px;'>STEP 4: WORK HISTORY / PREVIOUS EMPLOYMENT DETAILS</h4>
                        </div>
                        <div class="card-body">
                            <div class="row" style='padding-right:10px;'>

                                <div class="col-md-1 mobilePad dose">
                                    <h1>Job 1:</h1>
                                </div>
                                <div class="col-md-3 mobilePad">
                                    <div class="formfield">
                                        <input type="date" name="date_of_employment_from[]" id="date">
                                        <label alt="Date Of Emplyment (From)" for="date">Date Of Emplyment (From)</label>
                                    </div>
                                </div>

                                <div class="col-md-3 mobilePad">
                                    <div class="formfield">
                                        <input type="date" name="date_of_employment_to[]" id="date1">
                                        <label alt="Date Of Emplyment (To)" for="date1">Date Of Emplyment (To)</label>
                                    </div>
                                </div>

                                <div class="col-md-5 mobilePad">
                                    <div class="formfield">
                                        <input type="text" name="job_roles_responsibilities[]" id="job_roles_responsibilities">
                                        <label alt="Job Roles / Responsibilities" for="job_roles_responsibilities">Job Roles / Responsibilities</label>
                                    </div>
                                </div>

                                <div class="col-md-1 mobilePad dose">
                                    <h1>Job 2:</h1>
                                </div>
                                <div class="col-md-3 mobilePad">
                                    <div class="formfield">
                                        <input type="date" name="date_of_employment_from[]" id="date2">
                                        <label alt="Date Of Emplyment (From)" for="date2">Date Of Emplyment (From)</label>
                                    </div>
                                </div>

                                <div class="col-md-3 mobilePad">
                                    <div class="formfield">
                                        <input type="date" name="date_of_employment_to[]" id="date3">
                                        <label alt="Date Of Emplyment (To)" for="date3">Date Of Emplyment (To)</label>
                                    </div>
                                </div>

                                <div class="col-md-5 mobilePad">
                                    <div class="formfield">
                                        <input type="text" name="job_roles_responsibilities[]" id="job_roles_responsibilities1">
                                        <label alt="Job Roles / Responsibilities" for="job_roles_responsibilities1">Job Roles / Responsibilities</label>
                                    </div>
                                </div>


                                <div class="col-md-1 mobilePad dose">
                                    <h1>Job 3:</h1>
                                </div>
                                <div class="col-md-3 mobilePad">
                                    <div class="formfield">
                                        <input type="date" name="date_of_employment_from[]" id="date4">
                                        <label alt="Date Of Emplyment (From)" for="date4">Date Of Emplyment (From)</label>
                                    </div>
                                </div>

                                <div class="col-md-3 mobilePad">
                                    <div class="formfield">
                                        <input type="date" name="date_of_employment_to[]" id="date5">
                                        <label alt="Date Of Emplyment (To)" for="date5">Date Of Emplyment (To)</label>
                                    </div>
                                </div>

                                <div class="col-md-5 mobilePad">
                                    <div class="formfield">
                                        <input type="text" name="job_roles_responsibilities[]" id="job_roles_responsibilities2">
                                        <label alt="Job Roles / Responsibilities" for="job_roles_responsibilities2">Job Roles / Responsibilities</label>
                                    </div>
                                </div>


                                <div class="col-md-1 mobilePad dose">
                                    <h1>Job 4:</h1>
                                </div>
                                <div class="col-md-3 mobilePad">
                                    <div class="formfield">
                                        <input type="date" name="date_of_employment_from[]" id="date6">
                                        <label alt="Date Of Emplyment (From)" for="date6">Date Of Emplyment (From)</label>
                                    </div>
                                </div>

                                <div class="col-md-3 mobilePad">
                                    <div class="formfield">
                                        <input type="date" name="date_of_employment_to[]" id="date7">
                                        <label alt="Date Of Emplyment (To)" for="date7">Date Of Emplyment (To)</label>
                                    </div>
                                </div>

                                <div class="col-md-5 mobilePad">
                                    <div class="formfield">
                                        <input type="text" name="job_roles_responsibilities[]" id="job_roles_responsibilities3">
                                        <label alt="Job Roles / Responsibilities" for="job_roles_responsibilities3">Job Roles / Responsibilities</label>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>


                </div>

                <div class="col-md-12">
                    <div class="card text-white">
                        <div class="card-header bg-secondary">
                            <h4 class="mb-0 text-white" style='font-size:14px;'>STEP 5: PAYROLL / COMPENSATION & HEALTH / SAFETY</h4>
                        </div>
                        <div class="card-body">
                            <div class="row" style='padding-right:10px;'>

                                <div class='col-md-6 mobilePad mode_of_paymentMain'>
                                    <div class="formfield">
                                        <select name="mode_of_payment" id="mode_of_payment" class="mode_of_payment" required>
                                            <option value=""></option>
                                            <option value="Mobile Money">Mobile Money</option>
                                            <option value="Bank Account">Bank Account</option>
                                        </select>
                                        <label alt="Mode of Payment" for="mode_of_payment" placeholder="First Name">Means of Remuneration <span class='required'>*</span></label>
                                    </div>
                                </div>

                                <div class='col-md-4 mobilePad bank_account_detailsMain' style='display:none;'>
                                    <div class="formfield">
                                        <select name="bank_account_details" id="bank_account_details" class="bank_account_details" required>

                                        </select>
                                        <label alt="Bank Account Details" for="bank_account_details" placeholder="First Name">Bank Name <span class='required'>*</span></label>
                                    </div>
                                </div>

                                <div class='col-md-4 mobilePad bank_account_numberMain' style='display:none;'>
                                    <div class="formfield">
                                        <input type="text" name="bank_account_number" id="bank_account_number" required>
                                        <label alt="Bank Account Details" for="bank_account_number" placeholder="First Name">Account Number <span class='required'>*</span></label>
                                    </div>
                                </div>

                                <div class='col-md-6 mobilePad salary_wage_informationMain'>
                                    <div class="formfield">
                                        <input type="number" name="salary_wage_information" id="salary_wage_information" pattern='[0-9]+([.][0.00-9.00]+)' step='0.01' required>
                                        <label alt="Salary / Wage Information" for="salary_wage_information" placeholder="First Name">Take Home (Gross) <span class='required'>*</span></label>
                                    </div>
                                </div>

                                <div class='col-md-3 mobilePad'>
                                    <div class="formfield">
                                        <input type="text" name="ssnit_number" id="ssnit_number" required>
                                        <label alt="SSNIT Number" for="ssnit_number" placeholder="SSNIT Number">SSNIT Number </label>
                                    </div>
                                </div>

                                <div class='col-md-3 mobilePad'>
                                    <div class="formfield">
                                        <input type="text" name="tin_number" id="ssnit_number">
                                        <label alt="TIN Number" for="tin_number" placeholder="SSNIT Number">TIN Number </label>
                                    </div>
                                </div>

                                <div class='col-md-3 mobilePad'>
                                    <div class="formfield">
                                        <input type="text" name="emergency_phone" id="emergency_phone" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*?)\..*/g, '$1');" required>
                                        <label alt="Telephone Number" for="emergency_phone">Emergency Contact <span class='required'>*</span></label>
                                    </div>
                                </div>

                                <div class='col-md-3 mobilePad'>
                                    <div class="formfield">
                                        <select name="safety_training_completion" id="safety_training_completion" class="safety_training_completion" required>
                                            <option value=""></option>
                                            <option value="Yes">Yes</option>
                                            <option value="No">No</option>
                                        </select>
                                        <label alt="Safety Training Completion" for="safety_training_completion" placeholder="Safety Training Completion">Safety Training Completion <span class='required'>*</span></label>
                                    </div>
                                </div>

                                <div class='col-md-12 mobilePad'>
                                    <div class="formfield">
                                        <div class="formfield">
                                            <textarea type="text" name="medical_conditions_allergies" id="medical_conditions_allergies" required></textarea>
                                            <label alt="Medical Conditions / Allergies" for="medical_conditions_allergies" placeholder="Medical Conditions / Allergies">Medical Conditions / Allergies <span class='required'>*</span></label>
                                        </div>

                                    </div>
                                </div>

                                <div class="col-md-12 alert alert-success" role="alert" style='display:none;'>
                                    <strong>Success - </strong> Please access you portal by logging in with the credentials below: <br>
                                    <strong> Username:</strong> <span class='username'></span><br>
                                    <strong>Password:</strong> <span class='password'></span><br>
                                </div>

                                <div class='col-md-12' style='text-align:center;'>
                                    <button type="submit" data-form-name="form_addUser" data-endpoint="/users/create.php" class="btn btn-dark addUser"><span class='submitLoader'>Save</span></button>
                                </div>


                            </div>

                        </div>
                    </div>
                </div>
            </div>



        </form>
    </div>
</div>

<script>
    $("#imageUpload").change(function() {
        function readURL(input) {
            if (input.files && input.files[0]) {
                var reader = new FileReader();
                reader.onload = function(e) {
                    $('#imagePreview').css('background-image', 'url(' + e.target.result + ')');
                    $('#imagePreview').hide();
                    $('#imagePreview').fadeIn(650);
                }
                reader.readAsDataURL(input.files[0]);
            }
        }
        readURL(this);
    });

    $("#mode_of_payment").change(function() {
        var meansOfPayment = $(this).val();
        $(".mode_of_paymentMain,.salary_wage_informationMain").removeClass("col-md-6");
        $(".mode_of_paymentMain,.salary_wage_informationMain").addClass("col-md-2");
        $(".bank_account_detailsMain,.bank_account_numberMain").show();
        if (meansOfPayment == "Mobile Money") {
            $(".bank_account_detailsMain label").html("Select Momo Finetech <span class='required'>*</span>");
            $(".bank_account_numberMain label").html("Mobile Money Number <span class='required'>*</span>");
            $(".bank_account_details").append('<option value="" selected></option>');
            $(".bank_account_details").append('<option value="MTN Mobile Money">MTN Mobile Money</option>');
            $(".bank_account_details").append('<option value="Vodafone Cash">Vodafone Cash</option>');
            $(".bank_account_details").append('<option value="Airtel Tigo Cash">Airtel Tigo Cash</option>');
        } else {
            $(".bank_account_details").append('<option value="" selected></option>');
            $.get(domain_api + "/remuneration-account-details/remuneration-account-details.php?means=" + encodeURIComponent(meansOfPayment) + "", function(data) {
                var results = JSON.parse(data);
                $.each(results.data, function(key, value) {
                    $(".bank_account_details").append("<option value='" + value.BankName + "'>" + value.BankName + "</option>");
                });
            });
            $(".bank_account_detailsMain label").html("Select Bank <span class='required'>*</span>");
            $(".bank_account_numberMain label").html("Bank Account Number <span class='required'>*</span>");
        }
    });


    $(".addUser").on("click", function() {
        var form_name = $(this).attr("data-form-name");
        var endpoint = $(this).attr("data-endpoint");
        $("#" + form_name).submit(function(e) {
            $.ajax({
                url: domain_api + endpoint,
                type: "POST",
                data: new FormData(this),
                contentType: false,
                processData: false,
                beforeSend: function() {
                    $(".addUser").attr("disabled", "disabled");
                    $(".submitLoader").html("<i class='fa fa-spinner fa-spin'></i>")
                },
                success: function(data) {
                    // alert(data.code);
                    $(".submitLoader").html("Save");
                    if (data.code == 200) {
                        $("#" + form_name)[0].reset();
                        swal("Succes!", data.message, "success");
                        $(".username").html(data.tempUsername);
                        $(".password").html(data.tempPassword);
                        $(".alert-success").fadeIn();
                    } else {
                        swal("Oops!", data.message, "error");
                    }
                    $(".addUser").attr("disabled", false);
                },
                error: function(request, error) {
                    $(".submitLoader").html("Save");
                    swal("Oops!", "Saving was not successful, you should try again!", "error");
                },
            });
            e.preventDefault();
        });
        $(this).off();
    });

    $(".added_by").val(token);

    $(".title").empty();
    $(".title").append('<option value="" selected></option>');
    $.get(domain_api + "/other-configs/configs.php", function(data) {
        var results = data;
        $.each(results.data.titles, function(key, value) {
            $(".title").append("<option value='" + value + "'>" + value + "</option>");
        });
    });

    $(".nationality").empty();
    $(".nationality").append('<option value="" selected></option>');
    $.get(domain_api + "/other-configs/configs.php", function(data) {
        var results = data;
        $.each(results.data.countries, function(key, value) {
            $(".nationality").append("<option value='" + value + "'>" + value + "</option>");
        });
    });

    $("#document_type").empty();
    $("#document_type").append("<option value=''></option>");
    $.get(domain_api + "/documents/document-types.php", function(data) {
        var results = data;
        $.each(results.data, function(key, value) {
            $("#document_type").append("<option value='" + value.name + "'>" + value.name + "</option>");
        });
    });


    $(".addMoreJobs").off().on("click", function() {
        $(".moreJobs").append(
            '<div class="col-md-12 rowW" style="margin-top:20px;">' +
            '<div class="row">' +
            '<div class="col-md-12"> <a href="#" class="removeJobs" style="float:left; color:red;"> Remove <i class="fa fa-trash"></i></a></div>' +

            '<div class="col-md-6 experienceYears mobilePad" ><div class="formfield"><select name="document_type[]" id="document_type" class="document_type" style="height:45px;"></select><label alt="Document Type" for="document_type">Select Document Type <span class="required">*</span></label></div></div>' +

            '<div class="col-md-6 experienceYears mobilePad" ><div class="formfield"><input type="file" name="attachment[]" id="cv" accept=".png, .jpg, .jpeg, .pdf, .doc, .docx"><label alt="Upload selected document" for="cv">Upload selected document <span class="required">*</span></label></div></div>' +

            '<div class="col-md-6 experienceYears mobilePad" ><div class="formfield"> <input type="date" name="start_date[]" id="start_date"><label alt="Start Date" for="start_date">Start Date <span class="required">*</span></label></div></div>' +

            '<div class="col-md-6 experienceYears mobilePad" ><div class="formfield"><input type="date" name="end_date[]" id="end_date"><label alt="End Date" for="end_date">End Date <span class="required">*</span></label></div></div>' +
            '</div>' +
            '</div>'
        )

        $(".document_type").empty();
        $(".document_type").append("<option value=''></option>");
        $.get(domain_api + "/documents/document-types.php", function(data) {
            var results = data;
            $.each(results.data, function(key, value) {
                $(".document_type").append("<option value='" + value.name + "'>" + value.name + "</option>");
            });
        });

    });

    $(document).on('click', '.removeJobs', function() {
        $(this).closest(".rowW").remove();
    });


    $(".qualification").empty();
    $(".qualification").append('<option value="" selected></option>');
    $.get(domain_api + "/other-configs/configs.php", function(data) {
        var results = data;
        $.each(results.data.qualifications, function(key, value) {
            $(".qualification").append("<option value='" + value + "'>" + value + "</option>");
        });
    });

    $(".job").empty();
    $(".job").append('<option value="" selected></option>');
    $.get(domain_api + "/other-configs/configs.php", function(data) {
        var results = data;

        $.each(results.data.jobs, function(key, value) {
            $(".job").append("<option value='" + value + "'>" + value + "</option>");
        });
    });
</script>

<script>
    sessionStorage.setItem('UserType', domain + '/COMPONENTS/super-admin/index.php');
    sessionStorage.setItem('ActivePage', domain + '/COMPONENTS/super-admin/add-staff-user.php');
</script>
<script src="<?php echo $website_name; ?>/assets/libs/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="<?php echo $website_name; ?>/dist/js/pages/datatable/datatable-basic.init.js"></script>
<script src="<?php echo $website_name; ?>/dist/js/pages/dashboards/dashboard1.min.js"></script>