
<?php
require_once($_SERVER['DOCUMENT_ROOT']."/hrm/config/config.php");
require_once($_SERVER['DOCUMENT_ROOT']."/hrm/base/recruit.php");
require_once($_SERVER['DOCUMENT_ROOT']."/hrm/config/mail.php");

if(!isset($_SESSION['candidate'])){
  echo '<script type="text/javascript">
  location.replace("/hrm/views/candidate/login.php"); </script>';
  
}
if(isset($_POST['award'])){
  setAward($_SESSION['candidate'],$_POST['title'],$_POST['body'],$_POST['class'],$_POST['date']);
  $succcess = "PROFILE UPDATED SUCCESSFULLY";

 
 $_SESSION['state'] = "exp";
}

if(isset($_POST['bio'])){

  //echo"<script>alert('demo1')</script";

     updateBio($_POST['name'], $_POST['email'], $_POST['tell'], $_POST['idNo'], $_POST['nationality'], $_POST['county'], $_POST['disabilty'], $_POST['gender'], $_POST['dob'], $_SESSION['candidate'], $_POST['division'], $_POST['location'], $_POST['sublocation'], $_POST['village'],$_POST['licence'], $_POST['profession'], $_POST['code']);
  $succcess = $_POST['name'];
 // echo 'alert("profile Updated Successfully");';

  $succcess = "PROFILE UPDATED SUCCESSFULLY";

 //header("Refresh:0");
$_SESSION['state'] = "acc";
}

if(isset($_SESSION['candidate']) && $_SESSION['candidate']!=null){
  //echo"0000000";
  

    $candidate = getCanditateById($_SESSION['candidate']);
    $name = $candidate['fullname'];
    $email = $candidate['email'];
    $tell = $candidate['tell'];
    $idNo = $candidate['idNo'];
    $nationality = $candidate['nationality'];
    $county = $candidate['county'];
    $disabilty = $candidate['disability'];
    $gender = $candidate['gender'];
    $dob = $candidate['dob'];
    $division = $candidate['division'];
    $location = $candidate['location'];
    $subLocation = $candidate['subLocation'];
    $village = $candidate['village'];
    $drivingLicence = $candidate['drivingLicence'];
    $attachments = $candidate['image'];
    $profession = $candidate['profession'];
    $code = $candidate['code'];
    //echo $attachments;
}else{

  echo '<script type="text/javascript">
location.replace("/hrm/views/candidate/login.php"); </script>';

//header("location: /hrm/views/candidate/login.php", TRUE,301);
  //header( "refresh:5;url=/hrm/views/candidate/login.php" );
  exit();
}
if(isset($_POST['pic'])){
  $codec = rand(10000,100000);
  $image= attachments($codec);
  updatePic($image,$_SESSION['candidate']);
  header("Refresh:0");

}
if(isset($_POST['prof'])){

  setProf($_SESSION['candidate'], $_POST['institution'], $_POST['level'], $_POST['certification'], $_POST['from'], $_POST['Mno']);

  $succcess = "PROFILE UPDATED SUCCESSFULLY";
  // header("Refresh:0"); echo"<script>btn('btn2', 'accademic')</script>";
  $_SESSION['state'] = "acc";

}


if(isset($_POST['acc'])){
    //echo "nimefikiwa";
    setAcc($_SESSION['candidate'], $_POST['institution'], $_POST['level'], $_POST['program'], $_POST['from'], $_POST['to'], $_POST['score']);
   // echo 'alert("profile Updated Successfully");';
   $succcess = "PROFILE UPDATED SUCCESSFULLY";
  // header("Refresh:0"); echo"<script>btn('btn2', 'accademic')</script>";
  $_SESSION['state'] = "acc";
  //header("Refresh:0");
}
if(isset($_POST['exp'])){
    setExp($_SESSION['candidate'], $_POST['employer'],$_POST['position'], $_POST['roles'], $_POST['from'], $_POST['to']);
   // echo 'alert("profile Updated Successfully");';
   $succcess = "PROFILE UPDATED SUCCESSFULLY";
  

 
 $_SESSION['state'] = "exp";
 //header("Refresh:0");
}
if(isset($_POST['final'])){
  $attachments = "null";
    setFinal($_SESSION['candidate'], $_SESSION['jobID'], $_POST['cleter'], $_POST['salary'], $_POST['availability'], $attachments);
    $succcess = "JOB SUBMITTED SUCCESSFUL";
   // header("Refresh:0");

  
   $_SESSION['state'] = "final";
}

if(isset($_POST['ref'])){
  setReferee($_POST['fullname'],$_POST['email'],$_POST['tell'],$_POST['organisation'], $_SESSION['candidate']);
  $succcess = "PROFILE UPDATED SUCCESSFULLY";
 // header("Refresh:0");
 

 $_SESSION['state'] = "ref";

}


?>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">
  <link href="logo.png" rel="icon">
  <title>HRM - My Profile</title>
  <link href="/hrm/views/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
  <link href="/hrm/views/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
  <link href="/hrm/views/css/ruang-admin.min.css" rel="stylesheet">
  <link href="/hrm/views/vendor/select2/dist/css/select2.min.css" rel="stylesheet" type="text/css">
</head>


<body id="page-top">
  <div id="wrapper">
    <!-- Sidebar -->
    <?php
      include( $_SERVER['DOCUMENT_ROOT'].'/hrm/views/candidate/sidebar.php');
    ?>
    <!-- Sidebar -->
    <div id="content-wrapper" class="d-flex flex-column">
      <div id="content">
        <!-- TopBar -->
        <?php
          include($_SERVER['DOCUMENT_ROOT'].'/hrm/views/candidate/topbar.php');
        ?>
        <!-- Topbar -->

        <!-- Container Fluid-->
        <div class="container-fluid" id="container-wrapper">
          <div class="d-sm-flex align-items-center justify-content-between mb-4">
            <h1 class="h3 mb-0 text-gray-800">My Profile</h1>
            <ol class="breadcrumb">
              <li class="breadcrumb-item"><a href="./">Home</a></li>
              <li class="breadcrumb-item active" aria-current="page">Dashboard</li>
            </ol>
          </div>

          <?php
            errorsP($errors);
            success($succcess);

          ?>

          <div class="row ">
            <!-- top card -->
            <!-- <div class="col-xl-12 mb-4 d-flex justify-content-center "> -->
              
                  
                    <div class="col-xl-2 col-md-6 mb-4">
                      <button class="btn btn-primary btn-block" onclick="btn('btn1', 'bio')" id="btn1">Bio Profile</button>
                    </div>  
                    <div class="col-xl-2 col-md-6 mb-4">
                      <button class="btn btn-primary btn-block" onclick="btn('btn2', 'accademic')" id="btn2">Academic/Profesional</button>
                    </div>  

                    <div class="col-xl-2 col-md-6 mb-4">
                      <button class="btn btn-primary btn-block" onclick="btn('btn3', 'experience')" id="btn3">Experience</button>
                    </div>  
                    <div class="col-xl-2 col-md-6 mb-4">
                      <button class="btn btn-primary btn-block" onclick="btn('btn5', 'cv')" id="btn5">Preferences</button>
                    </div>  
                    <div class="col-xl-2 col-md-6 mb-4">
                      <button class="btn btn-primary btn-block" onclick="btn('btn4', 'final')" id="btn4">Forwarding Notes</button>
                    </div>  
                  

                  <!-- </div> -->
                    
            </div>
          <!-- end of top card -->
         


        <div class="card col-xl-12 col-md-12 mb-12 p-3" id="bio">
          <div class="col-xl-12 mb-4 d-flex justify-content-between ">
        <h4>Bio Infomation</h4> 
            <button class="btn btn-danger btn-block " style="width: 100px;" onclick="enable()"> EDIT</button>
          </div>        
          <hr>
          <div class="d-flex justify-content-start">
          <div class=" " style="border-style:solid; margin: 10px; width: 184px; height: 184px;">
                    <img src="<?php echo $attachments ;?>"  alt="add photo" style="width: 180px; height: 180px; padding: 2px;"/>
                   
              </div>
              <i class="fa fa-edit" style="margin-top: 5px" onclick="photo()"></i>
          </div>
                    <form method="POST" action="" enctype="multipart/form-data" style="display: none" id="photo">
                    <div class="form-group col-lg-2 mb-4 " >
                            
                            <input type="file" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                            placeholder="upload photo" name = "attach1" >
                            <button type="submit" class="form-control" name="pic" style="margin-top: 25px">SAVE</button>
                        </div>
                    </form>
                   
          <hr>
               <form action="" method="POST" class = "row">
                <!-- <div style="display: flex;"> -->
                    <div class="form-group col-lg-4 mb-4">
                      <label>Full Name</label>
                      <input type="text" class="form-control" id="exampleInputLastName"
                       placeholder="" name="name" value="<?php echo $name; ?>" required >
                    </div>
                    
                   
                    <div class="form-group col-lg-3 mb-4">
                      <label>Email</label>
                      <input type="text" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                        placeholder="" name = "email" value="<?php echo $email; ?>" required  id="c1">
                    </div>

                    <div class="form-group col-lg-2 mb-4">
                      <label>Code</label>
                      <select name="code" class="form-control" id="channel" >
                      <?php
                            if(isset($code)){
                              echo  '<option value="'.$code.'">'.$code.'</option>';
                            }
                          ?>
                      
                          <option data-countryCode="KE" value="254">Kenya (+254)</option>
                         <option data-countryCode="DZ" value="213">Algeria (+213)</option>
                          <option data-countryCode="AD" value="376">Andorra (+376)</option>
                          <option data-countryCode="AO" value="244">Angola (+244)</option>
                          <option data-countryCode="AI" value="1264">Anguilla (+1264)</option>
                          <option data-countryCode="AG" value="1268">Antigua &amp; Barbuda (+1268)</option>
                          <option data-countryCode="AR" value="54">Argentina (+54)</option>
                          <option data-countryCode="AM" value="374">Armenia (+374)</option>
                          <option data-countryCode="AW" value="297">Aruba (+297)</option>
                          <option data-countryCode="AU" value="61">Australia (+61)</option>
                          <option data-countryCode="AT" value="43">Austria (+43)</option>
                          <option data-countryCode="AZ" value="994">Azerbaijan (+994)</option>
                          <option data-countryCode="BS" value="1242">Bahamas (+1242)</option>
                          <option data-countryCode="BH" value="973">Bahrain (+973)</option>
                          <option data-countryCode="BD" value="880">Bangladesh (+880)</option>
                          <option data-countryCode="BB" value="1246">Barbados (+1246)</option>
                          <option data-countryCode="BY" value="375">Belarus (+375)</option>
                          <option data-countryCode="BE" value="32">Belgium (+32)</option>
                          <option data-countryCode="BZ" value="501">Belize (+501)</option>
                          <option data-countryCode="BJ" value="229">Benin (+229)</option>
                          <option data-countryCode="BM" value="1441">Bermuda (+1441)</option>
                          <option data-countryCode="BT" value="975">Bhutan (+975)</option>
                          <option data-countryCode="BO" value="591">Bolivia (+591)</option>
                          <option data-countryCode="BA" value="387">Bosnia Herzegovina (+387)</option>
                          <option data-countryCode="BW" value="267">Botswana (+267)</option>
                          <option data-countryCode="BR" value="55">Brazil (+55)</option>
                          <option data-countryCode="BN" value="673">Brunei (+673)</option>
                          <option data-countryCode="BG" value="359">Bulgaria (+359)</option>
                          <option data-countryCode="BF" value="226">Burkina Faso (+226)</option>
                          <option data-countryCode="BI" value="257">Burundi (+257)</option>
                          <option data-countryCode="KH" value="855">Cambodia (+855)</option>
                          <option data-countryCode="CM" value="237">Cameroon (+237)</option>
                          <option data-countryCode="CA" value="1">Canada (+1)</option>
                          <option data-countryCode="CV" value="238">Cape Verde Islands (+238)</option>
                          <option data-countryCode="KY" value="1345">Cayman Islands (+1345)</option>
                          <option data-countryCode="CF" value="236">Central African Republic (+236)</option>
                          <option data-countryCode="CL" value="56">Chile (+56)</option>
                          <option data-countryCode="CN" value="86">China (+86)</option>
                          <option data-countryCode="CO" value="57">Colombia (+57)</option>
                          <option data-countryCode="KM" value="269">Comoros (+269)</option>
                          <option data-countryCode="CG" value="242">Congo (+242)</option>
                          <option data-countryCode="CK" value="682">Cook Islands (+682)</option>
                          <option data-countryCode="CR" value="506">Costa Rica (+506)</option>
                          <option data-countryCode="HR" value="385">Croatia (+385)</option>
                          <option data-countryCode="CU" value="53">Cuba (+53)</option>
                          <option data-countryCode="CY" value="90392">Cyprus North (+90392)</option>
                          <option data-countryCode="CY" value="357">Cyprus South (+357)</option>
                          <option data-countryCode="CZ" value="42">Czech Republic (+42)</option>
                          <option data-countryCode="DK" value="45">Denmark (+45)</option>
                          <option data-countryCode="DJ" value="253">Djibouti (+253)</option>
                          <option data-countryCode="DM" value="1809">Dominica (+1809)</option>
                          <option data-countryCode="DO" value="1809">Dominican Republic (+1809)</option>
                          <option data-countryCode="EC" value="593">Ecuador (+593)</option>
                          <option data-countryCode="EG" value="20">Egypt (+20)</option>
                          <option data-countryCode="SV" value="503">El Salvador (+503)</option>
                          <option data-countryCode="GQ" value="240">Equatorial Guinea (+240)</option>
                          <option data-countryCode="ER" value="291">Eritrea (+291)</option>
                          <option data-countryCode="EE" value="372">Estonia (+372)</option>
                          <option data-countryCode="ET" value="251">Ethiopia (+251)</option>
                          <option data-countryCode="FK" value="500">Falkland Islands (+500)</option>
                          <option data-countryCode="FO" value="298">Faroe Islands (+298)</option>
                          <option data-countryCode="FJ" value="679">Fiji (+679)</option>
                          <option data-countryCode="FI" value="358">Finland (+358)</option>
                          <option data-countryCode="FR" value="33">France (+33)</option>
                          <option data-countryCode="GF" value="594">French Guiana (+594)</option>
                          <option data-countryCode="PF" value="689">French Polynesia (+689)</option>
                          <option data-countryCode="GA" value="241">Gabon (+241)</option>
                          <option data-countryCode="GM" value="220">Gambia (+220)</option>
                          <option data-countryCode="GE" value="7880">Georgia (+7880)</option>
                          <option data-countryCode="DE" value="49">Germany (+49)</option>
                          <option data-countryCode="GH" value="233">Ghana (+233)</option>
                          <option data-countryCode="GI" value="350">Gibraltar (+350)</option>
                          <option data-countryCode="GR" value="30">Greece (+30)</option>
                          <option data-countryCode="GL" value="299">Greenland (+299)</option>
                          <option data-countryCode="GD" value="1473">Grenada (+1473)</option>
                          <option data-countryCode="GP" value="590">Guadeloupe (+590)</option>
                          <option data-countryCode="GU" value="671">Guam (+671)</option>
                          <option data-countryCode="GT" value="502">Guatemala (+502)</option>
                          <option data-countryCode="GN" value="224">Guinea (+224)</option>
                          <option data-countryCode="GW" value="245">Guinea - Bissau (+245)</option>
                          <option data-countryCode="GY" value="592">Guyana (+592)</option>
                          <option data-countryCode="HT" value="509">Haiti (+509)</option>
                          <option data-countryCode="HN" value="504">Honduras (+504)</option>
                          <option data-countryCode="HK" value="852">Hong Kong (+852)</option>
                          <option data-countryCode="HU" value="36">Hungary (+36)</option>
                          <option data-countryCode="IS" value="354">Iceland (+354)</option>
                          <option data-countryCode="IN" value="91">India (+91)</option>
                          <option data-countryCode="ID" value="62">Indonesia (+62)</option>
                          <option data-countryCode="IR" value="98">Iran (+98)</option>
                          <option data-countryCode="IQ" value="964">Iraq (+964)</option>
                          <option data-countryCode="IE" value="353">Ireland (+353)</option>
                          <option data-countryCode="IL" value="972">Israel (+972)</option>
                          <option data-countryCode="IT" value="39">Italy (+39)</option>
                          <option data-countryCode="JM" value="1876">Jamaica (+1876)</option>
                          <option data-countryCode="JP" value="81">Japan (+81)</option>
                          <option data-countryCode="JO" value="962">Jordan (+962)</option>
                          <option data-countryCode="KZ" value="7">Kazakhstan (+7)</option>
                          
                          <option data-countryCode="KI" value="686">Kiribati (+686)</option>
                          <option data-countryCode="KP" value="850">Korea North (+850)</option>
                          <option data-countryCode="KR" value="82">Korea South (+82)</option>
                          <option data-countryCode="KW" value="965">Kuwait (+965)</option>
                          <option data-countryCode="KG" value="996">Kyrgyzstan (+996)</option>
                          <option data-countryCode="LA" value="856">Laos (+856)</option>
                          <option data-countryCode="LV" value="371">Latvia (+371)</option>
                          <option data-countryCode="LB" value="961">Lebanon (+961)</option>
                          <option data-countryCode="LS" value="266">Lesotho (+266)</option>
                          <option data-countryCode="LR" value="231">Liberia (+231)</option>
                          <option data-countryCode="LY" value="218">Libya (+218)</option>
                          <option data-countryCode="LI" value="417">Liechtenstein (+417)</option>
                          <option data-countryCode="LT" value="370">Lithuania (+370)</option>
                          <option data-countryCode="LU" value="352">Luxembourg (+352)</option>
                          <option data-countryCode="MO" value="853">Macao (+853)</option>
                          <option data-countryCode="MK" value="389">Macedonia (+389)</option>
                          <option data-countryCode="MG" value="261">Madagascar (+261)</option>
                          <option data-countryCode="MW" value="265">Malawi (+265)</option>
                          <option data-countryCode="MY" value="60">Malaysia (+60)</option>
                          <option data-countryCode="MV" value="960">Maldives (+960)</option>
                          <option data-countryCode="ML" value="223">Mali (+223)</option>
                          <option data-countryCode="MT" value="356">Malta (+356)</option>
                          <option data-countryCode="MH" value="692">Marshall Islands (+692)</option>
                          <option data-countryCode="MQ" value="596">Martinique (+596)</option>
                          <option data-countryCode="MR" value="222">Mauritania (+222)</option>
                          <option data-countryCode="YT" value="269">Mayotte (+269)</option>
                          <option data-countryCode="MX" value="52">Mexico (+52)</option>
                          <option data-countryCode="FM" value="691">Micronesia (+691)</option>
                          <option data-countryCode="MD" value="373">Moldova (+373)</option>
                          <option data-countryCode="MC" value="377">Monaco (+377)</option>
                          <option data-countryCode="MN" value="976">Mongolia (+976)</option>
                          <option data-countryCode="MS" value="1664">Montserrat (+1664)</option>
                          <option data-countryCode="MA" value="212">Morocco (+212)</option>
                          <option data-countryCode="MZ" value="258">Mozambique (+258)</option>
                          <option data-countryCode="MN" value="95">Myanmar (+95)</option>
                          <option data-countryCode="NA" value="264">Namibia (+264)</option>
                          <option data-countryCode="NR" value="674">Nauru (+674)</option>
                          <option data-countryCode="NP" value="977">Nepal (+977)</option>
                          <option data-countryCode="NL" value="31">Netherlands (+31)</option>
                          <option data-countryCode="NC" value="687">New Caledonia (+687)</option>
                          <option data-countryCode="NZ" value="64">New Zealand (+64)</option>
                          <option data-countryCode="NI" value="505">Nicaragua (+505)</option>
                          <option data-countryCode="NE" value="227">Niger (+227)</option>
                          <option data-countryCode="NG" value="234">Nigeria (+234)</option>
                          <option data-countryCode="NU" value="683">Niue (+683)</option>
                          <option data-countryCode="NF" value="672">Norfolk Islands (+672)</option>
                          <option data-countryCode="NP" value="670">Northern Marianas (+670)</option>
                          <option data-countryCode="NO" value="47">Norway (+47)</option>
                          <option data-countryCode="OM" value="968">Oman (+968)</option>
                          <option data-countryCode="PW" value="680">Palau (+680)</option>
                          <option data-countryCode="PA" value="507">Panama (+507)</option>
                          <option data-countryCode="PG" value="675">Papua New Guinea (+675)</option>
                          <option data-countryCode="PY" value="595">Paraguay (+595)</option>
                          <option data-countryCode="PE" value="51">Peru (+51)</option>
                          <option data-countryCode="PH" value="63">Philippines (+63)</option>
                          <option data-countryCode="PL" value="48">Poland (+48)</option>
                          <option data-countryCode="PT" value="351">Portugal (+351)</option>
                          <option data-countryCode="PR" value="1787">Puerto Rico (+1787)</option>
                          <option data-countryCode="QA" value="974">Qatar (+974)</option>
                          <option data-countryCode="RE" value="262">Reunion (+262)</option>
                          <option data-countryCode="RO" value="40">Romania (+40)</option>
                          <option data-countryCode="RU" value="7">Russia (+7)</option>
                          <option data-countryCode="RW" value="250">Rwanda (+250)</option>
                          <option data-countryCode="SM" value="378">San Marino (+378)</option>
                          <option data-countryCode="ST" value="239">Sao Tome &amp; Principe (+239)</option>
                          <option data-countryCode="SA" value="966">Saudi Arabia (+966)</option>
                          <option data-countryCode="SN" value="221">Senegal (+221)</option>
                          <option data-countryCode="CS" value="381">Serbia (+381)</option>
                          <option data-countryCode="SC" value="248">Seychelles (+248)</option>
                          <option data-countryCode="SL" value="232">Sierra Leone (+232)</option>
                          <option data-countryCode="SG" value="65">Singapore (+65)</option>
                          <option data-countryCode="SK" value="421">Slovak Republic (+421)</option>
                          <option data-countryCode="SI" value="386">Slovenia (+386)</option>
                          <option data-countryCode="SB" value="677">Solomon Islands (+677)</option>
                          <option data-countryCode="SO" value="252">Somalia (+252)</option>
                          <option data-countryCode="ZA" value="27">South Africa (+27)</option>
                          <option data-countryCode="ES" value="34">Spain (+34)</option>
                          <option data-countryCode="LK" value="94">Sri Lanka (+94)</option>
                          <option data-countryCode="SH" value="290">St. Helena (+290)</option>
                          <option data-countryCode="KN" value="1869">St. Kitts (+1869)</option>
                          <option data-countryCode="SC" value="1758">St. Lucia (+1758)</option>
                          <option data-countryCode="SD" value="249">Sudan (+249)</option>
                          <option data-countryCode="SR" value="597">Suriname (+597)</option>
                          <option data-countryCode="SZ" value="268">Swaziland (+268)</option>
                          <option data-countryCode="SE" value="46">Sweden (+46)</option>
                          <option data-countryCode="CH" value="41">Switzerland (+41)</option>
                          <option data-countryCode="SI" value="963">Syria (+963)</option>
                          <option data-countryCode="TW" value="886">Taiwan (+886)</option>
                          <option data-countryCode="TJ" value="7">Tajikstan (+7)</option>
                          <option data-countryCode="TH" value="66">Thailand (+66)</option>
                          <option data-countryCode="TG" value="228">Togo (+228)</option>
                          <option data-countryCode="TO" value="676">Tonga (+676)</option>
                          <option data-countryCode="TT" value="1868">Trinidad &amp; Tobago (+1868)</option>
                          <option data-countryCode="TN" value="216">Tunisia (+216)</option>
                          <option data-countryCode="TR" value="90">Turkey (+90)</option>
                          <option data-countryCode="TM" value="7">Turkmenistan (+7)</option>
                          <option data-countryCode="TM" value="993">Turkmenistan (+993)</option>
                          <option data-countryCode="TC" value="1649">Turks &amp; Caicos Islands (+1649)</option>
                          <option data-countryCode="TV" value="688">Tuvalu (+688)</option>
                          <option data-countryCode="UG" value="256">Uganda (+256)</option>
                          <!-- <option data-countryCode="GB" value="44">UK (+44)</option> -->
                          <option data-countryCode="UA" value="380">Ukraine (+380)</option>
                          <option data-countryCode="AE" value="971">United Arab Emirates (+971)</option>
                          <option data-countryCode="UY" value="598">Uruguay (+598)</option>
                          <!-- <option data-countryCode="US" value="1">USA (+1)</option> -->
                          <option data-countryCode="UZ" value="7">Uzbekistan (+7)</option>
                          <option data-countryCode="VU" value="678">Vanuatu (+678)</option>
                          <option data-countryCode="VA" value="379">Vatican City (+379)</option>
                          <option data-countryCode="VE" value="58">Venezuela (+58)</option>
                          <option data-countryCode="VN" value="84">Vietnam (+84)</option>
                          <option data-countryCode="VG" value="84">Virgin Islands - British (+1284)</option>
                          <option data-countryCode="VI" value="84">Virgin Islands - US (+1340)</option>
                          <option data-countryCode="WF" value="681">Wallis &amp; Futuna (+681)</option>
                          <option data-countryCode="YE" value="969">Yemen (North)(+969)</option>
                          <option data-countryCode="YE" value="967">Yemen (South)(+967)</option>
                          <option data-countryCode="ZM" value="260">Zambia (+260)</option>
                          <option data-countryCode="ZW" value="263">Zimbabwe (+263)</option>
                                              
                        </select>
                    </div>

                    <div class="form-group col-lg-3 mb-4">
                      <label>Telephone</label>
                      <input type="number" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                        placeholder="" id="c2" name = "tell" value="<?php echo $tell; ?>" required  >
                    </div>
                    
                    <div class="form-group col-lg-3 mb-4">
                      <label>Date of birth</label>
                      <input type="date" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                        placeholder="" name = "dob" value="<?php echo $dob; ?>" required  id="c3">
                    </div>

                    <div class="form-group col-lg-3 mb-4">
                      <label>Nationality</label>
                      <input type="text" class="form-control" id="su" aria-describedby="emailHelp"
                        placeholder=""  name = "nationality" value="<?php echo $nationality; ?>" required  id="c4">
                    </div>

                    <div class="form-group col-lg-3 mb-4">
                      <label>Profession</label>
                      <select name="profession" class="select2-single-placeholder form-control" id="select2Single" oninput="sSustomer()">
                      <?php
                            if(isset($profession)){
                              echo  '<option value="'.$profession.'">'.$profession.'</option>';
                            }
                          ?>
                      <option value="choose">Choose</option>
                        <option value="Accountant">Accountant</option>
                        <option value="Actuarial analyst">Actuarial analyst</option>
                        <option value="Administrator">Administrator</option>
                        <option value="Architect">Architect</option>
                        <option value="Artist">Artist</option>
                        <option value="Auditor">Auditor</option>
                        <option value="Cardiologist">Cardiologist</option>
                        <option value="Carpenter">Carpenter</option>
                        <option value="Cashier">Cashier</option>
                        <option value="Civil Engineer">Civil Engineer</option>
                        <option value="Clinical Social Worker">Clinical Social Worker</option>
                        <option value="Coach">Coach</option>
                        <option value="Compliance Officer">Compliance Officer</option>
                        <option value="Computer Programmer">Computer Programmer</option>
                        <option value="Computer Systems Analyst">Computer Systems Analyst</option>
                        <option value="Construction Manager">Construction Manager</option>
                        <option value="Cook">Cook</option>
                        <option value="Cost Estimator">Cost Estimator</option>
                        <option value="Counselor">Counselor</option>
                        <option value="Customer Service Representative">Customer Service Representative</option>
                        <option value="Database Administrator">Database Administrator</option>
                        <option value="Dental Hygienist">Dental Hygienist</option>
                        <option value="Dentist">Dentist</option>
                        <option value="Driver">Driver</option>
                        <option value="Economist">Economist</option>
                        <option value="Electrician">Electrician</option>
                        <option value="Epidemiologist">Epidemiologist</option>
                        <option value="Event Planner">Event Planner</option>
                        <option value="Fabricator">Fabricator</option>
                        <option value="Financial Advisor/ Specialist">Financial Advisor/ Specialist</option>
                        <option value="Financial Analyst">Financial Analyst</option>
                        <option value="Financial Manager">Financial Manager</option>
                        <option value="Hairdresser/Salonist">Hairdresser/Salonist</option>
                        <option value="Human Resource Consultant/Specialist">Human Resource Consultant/Specialist</option>
                        <option value="Insurance Agent">Insurance Agent</option>
                        <option value="Interpreter & Translator">Interpreter & Translator</option>
                        <option value="IT Specialist">IT Specialist</option>
                        <option value="    Journalist">    Journalist</option>
                        <option value="Laboratory Technician">Laboratory Technician</option>
                        <option value="Landscaper & Groundskeeper">Landscaper & Groundskeeper</option>
                        <option value="Lawyer">Lawyer</option>
                        <option value="Lecturer">Lecturer</option>
                        <option value="  Librarian">  Librarian</option>
                        <option value="Loan Officer">Loan Officer</option>
                        <option value="Maid & Housekeeper">Maid & Housekeeper</option>
                        <option value="Management Analyst">Management Analyst</option>
                        <option value="Management Specialist/Consultant">Management Specialist/Consultant</option>
                        <option value="Market Research Analyst">Market Research Analyst</option>
                        <option value="Marketer">Marketer</option>
                        <option value="Mason">Mason</option>
                        <option value="Mechanic">Mechanic</option>
                        <option value="Mechanical Engineer">Mechanical Engineer</option>
                        <option value="Medical Assistant">Medical Assistant</option>
                        <option value="Nurse">Nurse</option>
                        <option value="Operations Manager/Specialist">Operations Manager/Specialist</option>
                        <option value="Painter">Painter</option>
                        <option value="Paralegal">Paralegal</option>
                        <option value="Paramedic">Paramedic</option>
                        <option value="Pathologist">Pathologist</option>
                        <option value="Pharmacist">Pharmacist</option>
                        <option value="Physical Therapist">Physical Therapist</option>
                        <option value="Physical Therapist Assistant">Physical Therapist Assistant</option>
                        <option value="Physician">Physician</option>
                        <option value="Plumber">Plumber</option>
                        <option value="Private Security Expert">Private Security Expert</option>
                        <option value="Psychologist">Psychologist</option>
                        <option value="Public Relations Specialist">Public Relations Specialist</option>
                        <option value="Radiologist">Radiologist</option>
                        <option value="Real Estate Agent">Real Estate Agent</option>
                        <option value="Receptionist">Receptionist</option>
                        <option value="Registered Nurse">Registered Nurse</option>
                        <option value="Sales Manager">Sales Manager</option>
                        <option value="Sales Representative">Sales Representative</option>
                        <option value="Secretary">Secretary</option>
                        <option value="Security Guard">Security Guard</option>
                        <option value="Software Developer">Software Developer</option>
                        <option value="Software Developer">Software Developer</option>
                        <option value="  Surgeon">  Surgeon</option>
                        <option value="Teacher">Teacher</option>
                        <option value="Therapist">Therapist</option>
                        <option value="Trainer">Trainer</option>
                        <option value="Tuitor">Tuitor</option>
                        <option value="Veterinary ">Veterinary </option>
                        <option value="Web Developer">Web Developer</option>
                        <option value="other">Other</option>
                      </select>
                    </div>

                    <div class="form-group col-lg-3 mb-4" id="customer" style="display: none">
                      <label>Specify</label>
                      <input type="text" class="form-control"  aria-describedby="emailHelp"
                        placeholder=""  name = "profession1" value=""  id="c4">
                    </div>

                    <div class="form-group col-lg-3 mb-4">
                      <label>County Of Origin</label>
                      <select name="county" class="form-control" id="channel" >
                      <?php
                            if(isset($county)){
                              echo  '<option value="'.$county.'">'.$county.'</option>';
                            }
                          ?>
                         <option value="baringo">Baringo</option>
                          <option value="bomet">Bomet</option>
                          <option value="bungoma">Bungoma</option>
                          <option value="busia">Busia</option>
                          <option value="elgeyo marakwet">Elgeyo Marakwet</option>
                          <option value="embu">Embu</option>
                          <option value="garissa">Garissa</option>
                          <option value="homa bay">Homa Bay</option>
                          <option value="isiolo">Isiolo</option>
                          <option value="kajiado">Kajiado</option>
                          <option value="kakamega">Kakamega</option>
                          <option value="kericho">Kericho</option>
                          <option value="kiambu">Kiambu</option>
                          <option value="kilifi">Kilifi</option>
                          <option value="kirinyaga">Kirinyaga</option>
                          <option value="kisii">Kisii</option>
                          <option value="kisumu">Kisumu</option>
                          <option value="kitui">Kitui</option>
                          <option value="kwale">Kwale</option>
                          <option value="laikipia">Laikipia</option>
                          <option value="lamu">Lamu</option>
                          <option value="machakos">Machakos</option>
                          <option value="makueni">Makueni</option>
                          <option value="mandera">Mandera</option>
                          <option value="meru">Meru</option>
                          <option value="migori">Migori</option>
                          <option value="marsabit">Marsabit</option>
                          <option value="mombasa">Mombasa</option>
                          <option value="muranga">Muranga</option>
                          <option value="nairobi">Nairobi</option>
                          <option value="nakuru">Nakuru</option>
                          <option value="nandi">Nandi</option>
                          <option value="narok">Narok</option>
                          <option value="nyamira">Nyamira</option>
                          <option value="nyandarua">Nyandarua</option>
                          <option value="nyeri">Nyeri</option>
                          <option value="samburu">Samburu</option>
                          <option value="siaya">Siaya</option>
                          <option value="taita taveta">Taita Taveta</option>
                          <option value="tana river">Tana River</option>
                          <option value="tharaka nithi">Tharaka Nithi</option>
                          <option value="trans nzoia">Trans Nzoia</option>
                          <option value="turkana">Turkana</option>
                          <option value="uasin gishu">Uasin Gishu</option>
                          <option value="vihiga">Vihiga</option>
                          <option value="wajir">Wajir</option>
                          <option value="pokot">West Pokot</option>
                      </select>


                    </div>

                    <div class="form-group col-lg-3 mb-4">
                      <label>Division</label>
                      <input type="text" class="form-control" id="su" aria-describedby="emailHelp"
                        placeholder=""  name = "division" value="<?php echo $division; ?>" required id="c6">
                    </div>

                    <div class="form-group col-lg-3 mb-4">
                      <label>Location</label>
                      <input type="text" class="form-control" id="su" aria-describedby="emailHelp"
                        placeholder=""  name = "location" value="<?php echo $location; ?>" required id="c7">
                    </div>

                    <div class="form-group col-lg-3 mb-4">
                      <label>Sublocation</label>
                      <input type="text" class="form-control" id="su" aria-describedby="emailHelp"
                        placeholder=""  name = "sublocation" value="<?php echo $subLocation; ?>" required id="c8">
                    </div>

                    <div class="form-group col-lg-3 mb-4">
                      <label>Village</label>
                      <input type="text" class="form-control" id="su" aria-describedby="emailHelp"
                        placeholder=""  name = "village" value="<?php echo $village; ?>" required id="c9">
                    </div>


                    <div class="form-group col-lg-2 mb-4">
                      <label>Gender</label>
                      <select name="gender" class="form-control"   id="c10">
                          <?php
                            if(isset($gender)){
                              echo  '<option value="'.$gender.'">'.$gender.'</option>';
                            }
                          ?>
                         <option value="male">Male</option>
                          <option value="female">Female</option>
                        </select>
                    </div>
                    <div class="form-group col-lg-3 mb-4">
                      <label>Are You Living With Disability?</label>
                      <select name="disabilty" class="form-control" id="channel" >
                      <?php
                            if(isset($disabilty)){
                              echo  '<option value="'.$disabilty.'">'.$disabilty.'</option>';
                            }
                          ?>
                        <option value="no">No</option>
                         <option value="yes">Yes</option>
                         
                        </select>
                    </div>

                    <div class="form-group col-lg-2">
                      <label>ID/Passport No.</label>
                      <input type="text" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                        placeholder="" name = "idNo" value="<?php echo $idNo; ?>" required  id="c11">
                    </div>

                    <div class="form-group col-lg-4">
                      <label>Do you have a Driving License?</label>
                      <select name="licence" class="form-control" id="channel"  id="c2">
                      <?php
                            if(isset($drivingLicence)){
                              echo  '<option value="'.$drivingLicence.'">'.$drivingLicence.'</option>';
                            }
                          ?>
                        <option value="No">No</option>
                         <option value="yes">Yes</option>
                         
                        </select>
                    </div>

                   

                    <!-- </div> -->

                    
                    <div class="col-xl-12 mb-4 d-flex justify-content-between">
                    <div class="form-group col-lg-3" >
                      <button type="submit" class="btn btn-primary btn-block" name="bio" style="margin-top: 25px; display:block" id="save" onclick="btn('btn2', 'accademic')">NEXT</button>
                    </div>
                    <div class="form-group col-lg-3" style="display: none">
                      <button type="button" class="btn btn-primary btn-block" name="bio" style="margin-top: 25px" onclick="btn('btn2', 'accademic')">NEXT</button>
                    </div>
                    </div>
                    <hr> 
                </form>
                </div>
        </div>

       

                <!-- tab 2 -->
            <div  style="display: none;" id="accademic">

                 <!-- Datatables -->
              <div class="col-lg-12">
              <div class="card col-xl-12 col-md-12 mb-4 p-3">
                <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
                  <h6 class="m-0 font-weight-bold text-primary">Academic</h6>
                </div>

                <!-- inputs -->

                <div class="form-group col-lg-4" style = "align-items:right" id="add">
                      <button type="button" class="btn btn-primary btn-block" name="add"  onclick="add()">+ ADD</button>
                    </div>
              <div id="form1" style="display:none">
                <form action="" method="POST" class = "row" >
                <!-- <div style="display: flex;"> -->
                    <div class="form-group col-lg-4 mb-4">
                      <label>Institution</label>
                      <input type="text" class="form-control" id="exampleInputLastName"
                       placeholder="" name="institution">
                    </div>
                    
                   
                    <div class="form-group col-lg-4 mb-4">
                      <label>Level</label>
                      <select name="level" class="form-control" id="channel" >
                         <option value="certificate">certificate</option>
                          <option value="diploma">diploma</option>
                          <option value="bachelor">bachelor</option>
                          <option value="masters">master</option>
                          <option value="phd">phd</option>
                        </select>
                    </div>

                    <div class="form-group col-lg-4 mb-4">
                      <label>Program</label>
                      <input type="text" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                        placeholder="" name = "program" >
                    </div>
                    
                    <div class="form-group col-lg-4 mb-4">
                      <label>Start Date</label>
                      <input type="date" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                        placeholder="" name = "from" >
                    </div>

                    <div class="form-group col-lg-4 mb-4">
                      <label>End Date</label>
                      <input type="date" class="form-control" id="su" aria-describedby="emailHelp"
                        placeholder=""  name = "to" >
                    </div>

                    <div class="form-group col-lg-4 mb-4">
                      <label>Score</label>
                      <input type="text" class="form-control" id="su" aria-describedby="emailHelp"
                        placeholder=""  name = "score" >
                    </div>

                    
                    <div class="form-group col-lg-4" >
                      <button type="submit" class="btn btn-primary btn-block" name="acc" style="margin-top: 25px">SAVE</button>
                    </div>
                    

                    <hr> 
                </form>
                </div>
                <!-- inputs -->
                <div class="table-responsive p-3">
                  <table class="table align-items-center table-flush" id="dataTable">
                    <thead class="thead-dark tfoot-dark">
                      <tr>
                        <th>#</th>
                        <th>INSTITUTION</th>
                        <th>LEVEL</th>
                        <th>PROGRAM</th>
                        <th>FROM</th>
                        <th>TO</th>
                        <th>SCORE</th>
                        <th>EDIT</th>
                        
                      </tr>
                    </thead>
                    <tfoot>
                      <tr>
                      <th>#</th>
                        <th>INSTITUTION</th>
                        <th>LEVEL</th>
                        <th>PROGRAM</th>
                        <th>FROM</th>
                        <th>TO</th>
                        <th>SCORE</th>
                        <th>EDIT</th>
                      </tr>
                    </tfoot>
                    <tbody>
                         <?php
                            $vacancies = getAccademicById($_SESSION['candidate']);
                              foreach($vacancies as $row){
                                                      
                                print " <tr> ";
                                print "<td>" . $row['id'] . "</td>";
                                print "<td>" . $row['institution']. "</td>";
                                print "<td>" . $row['level']. "</td>";
                                print "<td>" . $row['program']. "</td>";
                                print "<td>" . $row['start']. "</td>";
                                print "<td>" . $row['end']. "</td>";
                                print "<td>" . $row['score']. "</td>";
                                print("<td>");
                                print('<a class="btn btn-danger" href="/hrm/views/candidate/editAcc.php?accid='.$row['id'].'"><i class="fa fa-edit"></i></a>');
                                print("</td>");
                                
                            }
                        ?>

                     
                    </tbody>
                  </table>
                </div>

                </div>
              </div>
            


            <!-- professional. -->

            <div class="col-lg-12">
              <div class="card col-xl-12 col-md-12 mb-4 p-3">
                <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
                  <h6 class="m-0 font-weight-bold text-primary">Professional Bodies</h6>
                </div>

                <!-- inputs -->

                <div class="form-group col-lg-4" style = "align-items:right" id="add6">
                      <button type="button" class="btn btn-primary btn-block" name="add"  onclick="add6()">+ ADD</button>
                    </div>
              <div id="form6" style="display:none">
                <form action="" method="POST" class = "row" >
                <!-- <div style="display: flex;"> -->
                    <div class="form-group col-lg-4 mb-4">
                      <label>Institution/Body</label>
                      <input type="text" class="form-control" id="exampleInputLastName"
                       placeholder="" name="institution">
                    </div>
                    
                   
                    <div class="form-group col-lg-4 mb-4">
                      <label>Level</label>
                      <select name="level" class="form-control" id="channel"  id="c2">
                        <option value="Associate">ASSOCIATE</option>
                         <option value="full member">FULL MEMBER</option>
                         <option value="practicing">PRACTICING</option>
                         
                        </select>
                    </div>

                    <div class="form-group col-lg-4 mb-4">
                      <label>Certification</label>
                      <input type="text" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                        placeholder="" name = "certification" >
                    </div>
                    
                    <div class="form-group col-lg-4 mb-4">
                      <label>Date of Award</label>
                      <input type="date" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                        placeholder="" name = "from" >
                    </div>

                    

                    <div class="form-group col-lg-4 mb-4">
                      <label>Membership No</label>
                      <input type="text" class="form-control" id="su" aria-describedby="emailHelp"
                        placeholder=""  name = "Mno" >
                    </div>

                    
                    <div class="form-group col-lg-4" >
                      <button type="submit" class="btn btn-primary btn-block" name="prof" style="margin-top: 25px">SAVE</button>
                    </div>
                    

                    <hr> 
                </form>
                </div>
                <!-- inputs -->
                <div class="table-responsive p-3">
                  <table class="table align-items-center table-flush" id="dataTable">
                    <thead class="thead-dark tfoot-dark">
                      <tr>
                        <th>#</th>
                        <th>INSTITUTION/BODY</th>
                        <th>CERTIFICATION</th>
                        <th>LEVEL</th>
                        <th>DATE OF AWARD</th>
                        <th>MEMBERSHIP NO</th>
                        <th>EDIT</th>
                        
                      </tr>
                    </thead>
                    <tfoot>
                      <tr>
                      <th>#</th>
                        <th>INSTITUTION/BODY</th>
                        <th>CERTIFICATION</th>
                        <th>LEVEL</th>
                        <th>DATE OF AWARD</th>
                        <th>MEMBERSHIP NO</th>
                        <th>EDIT</th>
                      </tr>
                    </tfoot>
                    <tbody>
                         <?php
                            $vacancies = getProfByUserID($_SESSION['candidate']);
                              foreach($vacancies as $row){
                                                      
                                print " <tr> ";
                                print "<td>" . $row['id'] . "</td>";
                                print "<td>" . $row['institution']. "</td>";
                                print "<td>" . $row['level']. "</td>";
                                print "<td>" . $row['program']. "</td>";
                                print "<td>" . $row['start']. "</td>";
                                print "<td>" . $row['mno']. "</td>";
                                print("<td>");
                                print('<a class="btn btn-danger" href="/hrm/views/candidate/editProf.php?profid='.$row['id'].'"><i class="fa fa-edit"></i></a>');
                                print("</td>");
                                
                            }
                        ?>

                     
                    </tbody>
                  </table>
                </div>

                </div>
              </div>
            




            <!--   end of professional    -->

              
              

            <div class="col-xl-12 mb-4 d-flex justify-content-between">
                    
                   <div class="form-group col-lg-3" >
                      <button type="button" class="btn btn-primary btn-block" name="" style="margin-top: 25px" onclick="btn('btn1', 'bio')">BACK</button>
                    </div>
                    
                    <div class="form-group col-lg-3" >
                      <button type="button" class="btn btn-primary btn-block" name="" style="margin-top: 25px" onclick="btn('btn3', 'experience')">NEXT</button>
                    </div>
                    

            </div> 

            </div>

            <!-- experience -->

            <div  style="display: none;" id="experience">

                            
                   <div class="form-group col-lg-4" style = "align-items:right" id="add">
                      <button type="button" class="btn btn-primary btn-block" name="add1"  onclick="add1()">+ ADD</button>
                    </div>

                    <!-- Datatables -->
                    <div class="col-lg-12">
                    <div class="card col-xl-12 col-md-12 mb-4 p-3">
                    <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
                    <h6 class="m-0 font-weight-bold text-primary">Experience</h6>
                    </div>

                    <!-- inputs -->
                    <div style = "display: none" id = "form2">
                    <form action="" method="POST" class = "row" >
                    <!-- <div style="display: flex;"> -->
                    <div class="form-group col-lg-5 mb-4">
                        <label>Employer</label>
                        <input type="text" class="form-control" id="exampleInputLastName"
                        placeholder="" name="employer">
                    </div>
                    
                    
                    <div class="form-group col-lg-7 mb-4">
                        <label>Position</label>
                        <input type="text" class="form-control" id="exampleInputLastName"
                        placeholder="" name="position">
                    </div>

                    <div class="form-group col-lg-12 mb-4">
                        <label>Roles Played</label>
                        <input type="text" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                        placeholder="" name = "roles" >
                    </div>
                    
                    <div class="form-group col-lg-4 mb-4">
                        <label>Start Date</label>
                        <input type="date" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                        placeholder="" name = "from" >
                    </div>

                    <div class="form-group col-lg-4 mb-4">
                        <label>End Date</label>
                        <input type="date" class="form-control" id="su" aria-describedby="emailHelp"
                        placeholder=""  name = "to" >
                    </div>

                    

                    
                    <div class="form-group col-lg-4" >
                        <button type="submit" class="btn btn-primary btn-block" name="exp" style="margin-top: 25px">SAVE</button>
                    </div>

                    <!-- <div class="form-group col-lg-4" >
                        <button type="button" class="btn btn-primary btn-block" name="acc1" style="margin-top: 25px">Next</button>
                    </div> -->
                    

                    <hr> 
                    </form>
                    </div>
                    <!-- inputs -->
                    <div class="table-responsive p-3">
                    <table class="table align-items-center table-flush" id="dataTable">
                    <thead class="thead-dark tfoot-dark">
                        <tr>
                        <th>#</th>
                        <th>EMPLOYER</th>
                        <th>POSITION</th>
                        <th>ROLE</th>
                        <th>FROM</th>
                        <th>TO</th>
                        <th>EDIT</th>
                        </tr>
                    </thead>
                    <tfoot>
                        <tr>
                        <th>#</th>
                        <th>EMPLOYER</th>
                        <th>POSITION</th>
                        <th>ROLE</th>
                        <th>FROM</th>
                        <th>TO</th>
                        <th>EDIT</th>
                        </tr>
                    </tfoot>
                    <tbody>
                            <?php
                            $vacancies = getExpById($_SESSION['candidate']);
                                foreach($vacancies as $row){
                                                        
                                print " <tr> ";
                                print "<td>" . $row['id'] . "</td>";
                                print "<td>" . $row['employer']. "</td>";
                                print "<td>" . $row['position']. "</td>";
                                print "<td>" . $row['roles']. "</td>";
                                print "<td>" . $row['start']. "</td>";
                                print "<td>" . $row['end']. "</td>";
                                print("<td>");
                                print('<a class="btn btn-danger" href="/hrm/views/candidate/editexp.php?expid='.$row['id'].'"><i class="fa fa-edit"></i></a>');
                                print("</td>");
                                
                            }
                        ?>

                        
                    </tbody>
                    </table>
                    </div>
                    </div>
                    </div>


                    <!-- awards -->

                            
                    <div class="form-group col-lg-4" style = "align-items:right" id="add7">
                      <button type="button" class="btn btn-primary btn-block" name="add1"  onclick="add7()">+ ADD</button>
                    </div>

                    <!-- Datatables -->
                    <div class="col-lg-12">
                    <div class="card col-xl-12 col-md-12 mb-4 p-3">
                    <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
                    <h6 class="m-0 font-weight-bold text-primary">Performance Awards/Achievements</h6>
                    </div>

                    <!-- inputs -->
                    <div style = "display: none" id = "form7">
                    <form action="" method="POST" class = "row" >
                    <!-- <div style="display: flex;"> -->
                    <div class="form-group col-lg-5 mb-4">
                        <label>Awarding Body</label>
                        <input type="text" class="form-control" id="exampleInputLastName"
                        placeholder="" name="body">
                    </div>

                    <div class="form-group col-lg-7 mb-4">
                        <label>Class of Award</label>
                       <select class="form-control" id="example" name="class">

                       <option value="EMPLOYEE OF THE MONTH AWARDS">EMPLOYEE OF THE MONTH AWARDS</option>
                      <option value="WORK ANNIVERSARY AWARDS">WORK ANNIVERSARY AWARDS</option>
                      <option value="DEPARTMENT MVP AWARDS">DEPARTMENT MVP AWARDS</option>
                      <option value="TEAMWORK AWARDS">TEAMWORK AWARDS</option>
                      <option value="MOST IMPROVED AWARD">MOST IMPROVED AWARD</option>
                      <option value="EMPLOYEE CHOICE AWARD">EMPLOYEE CHOICE AWARD</option>
                      <option value="ABOVE & BEYOND AWARD">ABOVE & BEYOND AWARD</option>
                      <option value="SALES AWARDS">SALES AWARDS</option>
                      <option value="EMPLOYEES' CHOICE AWARDS">EMPLOYEES' CHOICE AWARDS</option>
                      <option value="MOST CREATIVE AWARDS">MOST CREATIVE AWARDS</option>
                      <option value="SAFETY AWARDS">SAFETY AWARDS</option>
                      <option value="LEADERSHIP AWARDS">LEADERSHIP AWARDS</option>
                      <option value="CHARACTER AWARDS">CHARACTER AWARDS</option>
                      <option value="MENTORSHIP AWARD">MENTORSHIP AWARD</option>
                      <option value="INNOVATION AWARD">INNOVATION AWARD</option>
                      <option value="DILIGENCE AWARD">DILIGENCE AWARD</option>
                      <option value="CUSTOMER SERVICE AWARD">CUSTOMER SERVICE AWARD</option>
                      <option value="OUTSTANDING ACHIEVEMENT AWARDS">OUTSTANDING ACHIEVEMENT AWARDS</option>
                      <option value="TOP PERFORMER AWARDS">TOP PERFORMER AWARDS</option>
                      <option value="MILESTON AWARDS">MILESTON AWARDS</option>
                      <option value="MEETING AWARDS">MEETING AWARDS</option>     

                       </select>
                    </div>
                    
                    
                    <div class="form-group col-lg-12 mb-4">
                        <label>Title</label>
                        <input type="text" class="form-control" id="exampleInputLastName"
                        placeholder="" name="title">
                    </div>

                    
                    
                    <div class="form-group col-lg-4 mb-4">
                        <label>Date of Award</label>
                        <input type="date" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                        placeholder="" name = "date" >
                    </div>

                    

                    

                    
                    <div class="form-group col-lg-4" >
                        <button type="submit" class="btn btn-primary btn-block" name="award" style="margin-top: 25px">SAVE</button>
                    </div>

                    <!-- <div class="form-group col-lg-4" >
                        <button type="button" class="btn btn-primary btn-block" name="acc1" style="margin-top: 25px">Next</button>
                    </div> -->
                    

                    <hr> 
                    </form>
                    </div>
                    <!-- inputs -->
                    <div class="table-responsive p-3">
                    <table class="table align-items-center table-flush" id="dataTable">
                    <thead class="thead-dark tfoot-dark">
                        <tr>
                        <th>#</th>
                        <th>TITLE</th>
                        <th>BODY</th>
                        <th>CLASS</th>
                        <th>DATE OF AWARD</th>
                        <th>EDIT</th>
                        </tr>
                    </thead>
                    <tfoot>
                        <tr>
                        <th>#</th>
                        <th>TITLE</th>
                        <th>BODY</th>
                        <th>CLASS</th>
                        <th>DATE OF AWARD</th>
                        <th>EDIT</th>
                        </tr>
                    </tfoot>
                    <tbody>
                            <?php
                            $vacancies = getAwardByID($_SESSION['candidate']);
                                foreach($vacancies as $row){
                                                        
                                print " <tr> ";
                                print "<td>" . $row['id'] . "</td>";
                                print "<td>" . $row['tile']. "</td>";
                                print "<td>" . $row['body']. "</td>";
                                print "<td>" . $row['class']. "</td>";
                                print "<td>" . $row['dateOfAward']. "</td>";
                                print("<td>");
                                print('<a class="btn btn-danger" href="/hrm/views/candidate/editexp.php?expid='.$row['id'].'"><i class="fa fa-edit"></i></a>');
                                print("</td>");
                                
                            }
                        ?>

                        
                    </tbody>
                    </table>
                    </div>
                    </div>
                    </div>

            <div class="col-xl-12 mb-4 d-flex justify-content-between">

                    <div class="form-group col-lg-3" >
                      <button type="button" class="btn btn-primary btn-block" name="" style="margin-top: 25px" onclick="btn('btn2', 'accademic')">BACK</button>
                    </div>
                    
                    <div class="form-group col-lg-3" >
                      <button type="button" class="btn btn-primary btn-block" name="" style="margin-top: 25px" onclick="btn('btn5', 'cv')">NEXT</button>
                    </div>
                    

            </div> 
                    <!-- awards -->
             </div>

            <!-- experience -->



                     <!-- coverLeter -->

            <div  style="display: none;" id="cv">

                                                              
                  <div class="form-group col-lg-4" style = "align-items:right" id="add">
                    <button type="button" class="btn btn-primary btn-block" name="add4"  onclick="add4()">+ ADD</button>
                  </div>

                  <!-- Datatables -->
                  <div class="col-lg-12">
                  <div class="card col-xl-12 col-md-12 mb-4 p-3">
                  <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
                  <h4 class="m-0 font-weight-bold text-primary">Referrees</h4>
                  </div>

                  <!-- inputs -->
                  <div style = "display: none" id = "form4">
                  <form action="" method="POST" class = "row" >
                  <!-- <div style="display: flex;"> -->
                  <div class="form-group col-lg-5 mb-4">
                      <label>full Name</label>
                      <input type="text" class="form-control" id="exampleInputLastName"
                      placeholder="" name="fullname">
                  </div>


                  <div class="form-group col-lg-5 mb-4">
                      <label>email</label>
                      <input type="text" class="form-control" id="exampleInputLastName"
                      placeholder="" name="email">
                  </div>

                  <div class="form-group col-lg-5 mb-4">
                      <label>telephone</label>
                      <input type="text" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                      placeholder="" name = "tell" >
                  </div>

                  <div class="form-group col-lg-5 mb-4">
                      <label>organisation</label>
                      <input type="text" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                      placeholder="" name = "organisation" >
                  </div>
                  <div class="form-group col-lg-5 mb-4">
                      <label>Rank in the organisation</label>
                      <input type="text" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                      placeholder="" name = "rank" >
                  </div>

                  <div class="form-group col-lg-5 mb-4">
                      <label>Relationship</label>
                      <input type="text" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                      placeholder="" name = "relation" >
                  </div>

                  
                  <div class="form-group col-lg-4" >
                      <button type="submit" class="btn btn-primary btn-block" name="ref" style="margin-top: 25px">SAVE</button>
                  </div>

                  <!-- <div class="form-group col-lg-4" >
                      <button type="button" class="btn btn-primary btn-block"  style="margin-top: 25px">Next</button>
                  </div> -->


                  <hr> 
                  </form>
                  </div>
                  <!-- inputs -->
                  <div class="table-responsive p-3">
                  <table class="table align-items-center table-flush" id="dataTable">
                  <thead class="thead-dark tfoot-dark">
                      <tr>
                      <th>#</th>
                      <th>FULLNAME</th>
                      <th>EMAIL</th>
                      <th>TELLEPHONE</th>
                      <th>ORGANISATION</th>
                      
                      </tr>
                  </thead>
                  <tfoot>
                      <tr>
                      <th>#</th>
                      <th>FULLNAME</th>
                      <th>EMAIL</th>
                      <th>TELLEPHONE</th>
                      <th>ORGANISATION</th>
                      </tr>
                  </tfoot>
                  <tbody>
                          <?php
                          $vacancies = getReferee($_SESSION['candidate']);
                              foreach($vacancies as $row){
                                                      
                              print " <tr> ";
                              print "<td>" . $row['id'] . "</td>";
                              print "<td>" . $row['fullname']. "</td>";
                              print "<td>" . $row['email']. "</td>";
                              print "<td>" . $row['tell']. "</td>";
                              print "<td>" . $row['organisation']. "</td>";
                             
                              
                          }
                      ?>

                      
                  </tbody>
                  </table>
                  </div>
                  </div>
                  </div>
                  <div class="col-xl-12 mb-4 d-flex justify-content-between" style="display: none">
                  <div class="form-group col-lg-4 mb-5">
                            <label>Expected Salary</label>
                            <input type="text" class="form-control" id="exampleInputLastName"
                            placeholder="" id=salary oninput="copy('salary','salary1')">
                        </div>

                        <div class="form-group col-lg-5 mb-4">
                            <label>Expected Available Date</label>
                            <input type="date" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                            placeholder="" id=available oninput="copy('available','available1')" >
                        </div>

                        
                  </div>

                  <div class="col-xl-12 mb-4 d-flex justify-content-between">

                  <div class="form-group col-lg-3" >
                    <button type="button" class="btn btn-primary btn-block" name="" style="margin-top: 25px" onclick="btn('btn3', 'experience')">BACK</button>
                  </div>

                  <div class="form-group col-lg-3" >
                    <button type="button" class="btn btn-primary btn-block" name="" style="margin-top: 25px" onclick="btn('btn4', 'final')">NEXT</button>
                  </div>


                  </div> 
               </div>

                  <!-- cover leter -->

              


            <!-- final -->
            <div  style="display: none;" id="final">

                        <!-- Datatables -->
                        <div class="col-lg-12">
                        <div class="card col-xl-12 col-md-12 mb-4 p-3">
                        <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
                        <h5 class="m-0 font-weight-bold text-primary">You have chossen to apply for - <?php $job = getJobById($_SESSION['jobID']); echo $job['jobName']  ?></h5>
                        </div>

                        <!-- inputs -->

                        <form action="" method="POST" class = "row" enctype="multipart/form-data">
                        <!-- <div style="display: flex;"> -->
                        <div class="form-group col-lg-12 mb-4">
                            <label>Forwarding Notes  (max 500 words) Justify why you should be considered for an opportunity</label>
                            <textarea type="text" class="form-control" id="superA"
                            placeholder="" name="cleter" rows="15"></textarea>
                        </div>

                        <div class="form-group col-lg-5 mb-4" style="display: block;">
                            <label>Expected Salary</label>
                            <input type="text" class="form-control" id="exampleInputLastName"
                            placeholder="" name="salary" id="salary1">
                        </div>

                        <div class="form-group col-lg-5 mb-4" style="display: block;">
                            <label>Expected Available Date</label>
                            <input type="date" class="form-control" id="exampleInputEmail" aria-describedby="emailHelp"
                            placeholder="" name = "availability" id="available1" >
                        </div>
                        

                        <div class="form-group col-lg-4" >
                            <button type="submit" class="btn btn-primary btn-block" name="final" style="margin-top: 25px">SUBMIT APPLICATION</button>
                        </div>

                       


                        <hr> 
                        </form>
                        <!-- inputs -->
                       
                        <!-- </div> -->
                        
            </div>
            <!-- final -->


           


                </div>


                <script>

          function btn1(chosen, target){
                  document.getElementById("btn1").style.backgroundColor = "#0d47a1"; 
                  document.getElementById("btn2").style.backgroundColor = "#0d47a1";
                  document.getElementById("btn3").style.backgroundColor = "#0d47a1";
                  document.getElementById("btn4").style.backgroundColor = "#0d47a1";
                  document.getElementById("btn5").style.backgroundColor = "#0d47a1";

                  document.getElementById(chosen).style.backgroundColor = "#ff0000";

                  document.getElementById("bio").style.display = "none";
                  document.getElementById("accademic").style.display = "none";
                  document.getElementById("experience").style.display = "none";
                  document.getElementById("final").style.display = "none";
                  document.getElementById("cv").style.display = "none";
                document.getElementById(target).style.display = "block";
              }

          </script>

            <?php
          if($_SESSION['state'] == "acc"){
          echo"
          <script>btn1('btn2', 'accademic')</script>";
          echo "trial reflex";

          }elseif($_SESSION['state'] == "exp"){
          echo"
          <script>btn1('btn3', 'experience')</script>";
          }elseif($_SESSION['state'] == "ref"){
          echo"
          <script>btn1('btn5', 'cv')</script>";
          }

          ?>



          <!-- <div class="row">
            <div class="col-lg-12 text-center">
              <p>Do you like this template ? you can download from <a href="https://github.com/indrijunanda/RuangAdmin"
                  class="btn btn-primary btn-sm" target="_blank"><i class="fab fa-fw fa-github"></i>&nbsp;GitHub</a></p>
            </div>
          </div> -->

          <!-- Modal Logout -->
          <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabelLogout"
            aria-hidden="true">
            <div class="modal-dialog" role="document">
              <div class="modal-content">
                <div class="modal-header">
                  <h5 class="modal-title" id="exampleModalLabelLogout">Ohh No!</h5>
                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                  </button>
                </div>
                <div class="modal-body">
                  <p>Are you sure you want to logout?</p>
                </div>
                <div class="modal-footer">
                  <button type="button" class="btn btn-outline-primary" data-dismiss="modal">Cancel</button>
                  <a href="login.html" class="btn btn-primary">Logout</a>
                </div>
              </div>
            </div>
          </div>

        
    
        <!---Container Fluid-->
      </div>
      <!-- Footer -->
      <footer class="sticky-footer bg-white">
        <div class="container my-auto">
          <div class="copyright text-center my-auto">
            <span>copyright &copy; <script> document.write(new Date().getFullYear()); </script> - developed by
              <b><a href="https://wintec.co.ke" target="_blank">wintec</a></b>
            </span>
          </div>
        </div>
      </footer>
      <!-- Footer -->
    </div>
  </div>

  <!-- Scroll to top -->
  <a class="scroll-to-top rounded" href="#page-top">
    <i class="fas fa-angle-up"></i>
  </a>

  <script src="/hrm/views/vendor/jquery/jquery.min.js"></script>
  <script src="/hrm/views/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="/hrm/views/vendor/jquery-easing/jquery.easing.min.js"></script>
  <script src="/hrm/views/js/ruang-admin.min.js"></script>
  <script src="/hrm/views/vendor/chart.js/Chart.min.js"></script>
  <script src="/hrm/views/js/demo/chart-area-demo.js"></script>  
  <script type="text/javascript" src="/hrm/views/ckeditor/ckeditor.js"></script>
  <script src="/hrm/views/vendor/select2/dist/js/select2.min.js"></script>
  
   

  <script>
    $(document).ready(function () {
      $('#dataTable').DataTable(); // ID From dataTable 
      $('#dataTableHover').DataTable(); // ID From dataTable with Hover
     
    });

   // disable();

    



    function tab(){
      document.getElementById("create").style.display = "none";
      document.getElementById("publish").style.display = "";
    }

    function tab1(){
      document.getElementById("create").style.display = "";
      document.getElementById("publish").style.display = "none";
    }
    function btn(chosen, target){
        document.getElementById("btn1").style.backgroundColor = "#0d47a1"; 
        document.getElementById("btn2").style.backgroundColor = "#0d47a1";
        document.getElementById("btn3").style.backgroundColor = "#0d47a1";
        document.getElementById("btn4").style.backgroundColor = "#0d47a1";
        document.getElementById("btn5").style.backgroundColor = "#0d47a1";

        document.getElementById(chosen).style.backgroundColor = "#ff0000";

        document.getElementById("bio").style.display = "none";
        document.getElementById("accademic").style.display = "none";
        document.getElementById("experience").style.display = "none";
        document.getElementById("final").style.display = "none";
        document.getElementById("cv").style.display = "none";

        // if(chosen == "btn1"){document.getElementById("bio").style.display = "block";}
        // if(chosen == "btn2"){document.getElementById("accademic").style.display = "block";}
        //if(chosen == "btn3"){document.getElementById("experience").style.display = "block";}
       // if(chosen == "btn4"){document.getElementById("final").style.display = "block";}
       document.getElementById(target).style.display = "block";
    }
    function copy(from, to){
      var obj = document.getElementById(from).value;
      document.getElementById(to).value = obj;
    }


    function add(){
      document.getElementById("form1").style.display = "block";
      document.getElementById("add").style.display = "none";

    }
    function add1(){
      document.getElementById("form2").style.display = "block";
      document.getElementById("add1").style.display = "none";

    }

    function add4(){
      document.getElementById("form4").style.display = "block";
      document.getElementById("add4").style.display = "none";

    }

    function add6(){
      document.getElementById("form6").style.display = "block";
      document.getElementById("add6").style.display = "none";

    }
    function add7(){
      document.getElementById("form7").style.display = "block";
      document.getElementById("add7").style.display = "none";

    }
    function disable(){
     
        document.getElementById("c1").setAttribute.readOnly = true;
        document.getElementById("c2").setAttribute.readOnly = true;
        document.getElementById("c3").setAttribute.readOnly = true;
        document.getElementById("c4").setAttribute.readOnly = true;
        document.getElementById("c5").setAttribute.readOnly = true;
        document.getElementById("c6").setAttribute.readOnly = true;
        document.getElementById("c7").setAttribute.readOnly = true;
        document.getElementById("c8").setAttribute.readOnly = true;
        document.getElementById("c9").setAttribute.readOnly = true;
        document.getElementById("c10").setAttribute.readOnly = true;
        document.getElementById("c11").setAttribute.readOnly = true;
        document.getElementById("c12").setAttribute.readOnly = true;

    }
    function enable(){
      document.getElementById("photo").style.display = "block";
      document.getElementById("save").style.display = "block";
      document.getElementById("c1").removeAttribute("readOnly");

      document.getElementById("c1").readOnly = false;
      document.getElementById("c2").readOnly = false;
      document.getElementById("c3").readOnly = false;
      document.getElementById("c4").readOnly = false;
      document.getElementById("c5").readOnly = false;
      document.getElementById("c6").readOnly = false;
      document.getElementById("c7").readOnly = false;
      document.getElementById("c8").readOnly = false;
      document.getElementById("c9").readOnly = false;
      document.getElementById("c10").readOnly = false;
      document.getElementById("c11").readOnly = false;
      document.getElementById("c12").readOnly = false;
    }

    function photo(){
      document.getElementById("photo").style.display = "block";
    }

    

    function sSustomer(){
      var target1 = document.getElementById('select2Single').value;
      if( target1 == "other"){
        document.getElementById("customer").style.display = "block";
        //document.getElementById('c4').value= target;
        //alert("nimefikiwa");
      }else{
        document.getElementById("customer").style.display = "none";
      }
    }


    $('.select2-single').select2();

      // Select2 Single  with Placeholder
      $('.select2-single-placeholder').select2({
        placeholder: "Select",
        allowClear: true
      });      

      // Select2 Multiple
      $('.select2-multiple').select2();

    CKEDITOR.replace( 'superA' );
    CKEDITOR.replace( 'superB' );
    CKEDITOR.replace( 'superC' );

    

    
  </script>
</body>

</html>