<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html;charset=utf-8" />
        <meta name="viewport" content="width=device-width" />
        <meta name="description" content="Sohar Aluminium Recruitment Team">
        <meta name="keywords">
        <title>Valeoman Recruitment Team</title>
        <link href="Content/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="Content/css/customf24c.css" rel="stylesheet" />
        <script src="Scripts/jquery-3.5.1.min.js"></script>
        <script src="Scripts/bootstrap.min.js"></script>
        <script src="Scripts/popper.js"></script>
        <script src="Scripts/toastr.js"></script>
        <script type="text/javascript" src="jquery-latest.js"></script>
        <script src="jquery-ui-1.8.18.custom.min.js"></script>
        <script type="text/javascript" src="validate.js"></script>
        <link href="Content/toastr.css" rel="stylesheet" />
        <style>
            table {
              font-family: arial, sans-serif;
              border-collapse: collapse;
              width: 75%;
            }

            td, th {
              border: 1px solid #dddddd;
              text-align: left;
              padding: 8px;
              width: 1%;
            }

            tr:nth-child(even) {
              background-color: #dddddd;
            }

            .blink_me {
              animation: blinker 1s linear infinite;
            }

            @keyframes blinker {
              50% {
                opacity: 0;
              }
            }
        </style>
    </head>
    <body>
        <?php
        //error_reporting(0);
        $conn = mysqli_connect('localhost','menahrs_ceo','Ceo@2024');
        //$conn = mysqli_connect('localhost','root','');
                mysqli_select_db($conn,'menahrs_ceo');

        $timenow = date('Y-m-d h:i:s');
        $mesg  = '';

        if(!empty($_POST))
        {
            $job_id = $_POST['position'];
            $dob = $_POST['yr'] . "-" .$_POST['mon'] .  "-" .$_POST['dat'];
   //print_r("INSERT INTO candidate(applicant_id, site_id, first_name, last_name, middle_name, gender, dob, nationality, o_nat, national_id, gsm_code, gsm, email1, region, wilayat, passport, country, o_coun, qualification, o_qual, discipline, o_disc, year, university, institute, o_inst, gpa, exp_year, exp_month, rexp_year, rexp_month, cur_emp, cur_pos, salary, prefexp, date_created, current_salary, employmentstatus, ministry, crnumber)VALUES('0', '1', '$_POST[firstname]', '$_POST[lastname]', '$_POST[middlename]', '$_POST[gender]', '$dob', '$_POST[nationality]', '$_POST[o_nat]', '$_POST[nationalid]', '$_POST[gsm_code]', '$_POST[gsm]', '$_POST[email]', '$_POST[region]', '$_POST[wilayat]', '$_POST[passport]', '$_POST[country]', '$_POST[o_coun]',  '$_POST[qualification]', '$_POST[o_qual]', '$_POST[discipline]', '$_POST[o_disc]', '$_POST[year]', '$_POST[universitynew]', '$_POST[university]', '', '$_POST[gpa]', '$_POST[exp_year]', '$_POST[exp_month]', '0', '0', '$_POST[present_company]', '$_POST[present_desig]', '$_POST[salary]', '$_POST[prefexp]', '$timenow', '$_POST[current_salary]', '$_POST[employmentstatus]', '$_POST[ministry]', '$_POST[crnumber]')"); die();
            $qry = mysqli_query($conn,"INSERT INTO candidate(applicant_id, site_id, first_name, last_name, middle_name, gender, dob, nationality, o_nat, national_id, gsm_code, gsm, email1, region, wilayat, passport, country, o_coun, qualification, o_qual, discipline, o_disc, year, university, institute, o_inst, gpa, exp_year, exp_month, rexp_year, rexp_month, cur_emp, cur_pos, salary, prefexp, date_created, current_salary, employmentstatus, ministry, crnumber)VALUES('0', '1', '$_POST[firstname]', '$_POST[lastname]', '$_POST[middlename]', '$_POST[gender]', '$dob', '$_POST[nationality]', '$_POST[o_nat]', '$_POST[nationalid]', '$_POST[gsm_code]', '$_POST[gsm]', '$_POST[email]', '$_POST[region]', '$_POST[wilayat]', '$_POST[passport]', '$_POST[country]', '$_POST[o_coun]',  '$_POST[qualification]', '$_POST[o_qual]', '$_POST[discipline]', '$_POST[o_disc]', '$_POST[year]', '$_POST[universitynew]', '$_POST[university]', '', '$_POST[gpa]', '$_POST[exp_year]', '$_POST[exp_month]', '0', '0', '$_POST[present_company]', '$_POST[present_desig]', '$_POST[salary]', '$_POST[prefexp]', '$timenow', '$_POST[current_salary]', '$_POST[employmentstatus]', '$_POST[ministry]', '$_POST[crnumber]')");
            $cand_id = mysqli_insert_id($conn);

            if($_POST['o_disc']!=''){
                mysqli_query($conn,"INSERT INTO cm_discipline(discipline)values('$_POST[o_disc]')");
            }

            if($_POST['o_nat']!=''){
                mysqli_query($conn,"INSERT INTO cm_nationality(nat_name)values('$_POST[o_nat]')");
            }

            if($_POST['o_coun']!=''){
                mysqli_query($conn,"INSERT INTO cm_country(short_name)values('$_POST[o_coun]')");
            }

            if($_POST['o_res']!=''){
                mysqli_query($conn,"INSERT INTO cm_resident_type(res_type)values('$_POST[o_res]')");
            }

            if($_POST['o_qual']!=''){
                mysqli_query($conn,"INSERT INTO cm_qualification(quali)values('$_POST[o_qual]')");
            }

            if($_POST['o_inst']!=''){
                mysqli_query($conn,"INSERT INTO university(university)values('$_POST[o_inst]')");
            }

            $prefix = "CE";
            $app_inc = 1000 + $cand_id;
            $app_id = $prefix.$app_inc;

            mysqli_query($conn,"UPDATE candidate SET applicant_id='$app_id' WHERE candidate_id='$cand_id'");

            $national = $_POST['nationality'];
            $nat_id = $_POST['nationalid'];
            $rsNationalId = mysqli_query($conn,"SELECT * FROM candidate WHERE national_id='$nat_id'");
            $nation_cnt = mysqli_num_rows($rsNationalId);
            if($national==249 && $nation_cnt>1){
              mysqli_query($conn,"UPDATE candidate SET dup_chk=1 WHERE candidate_id='$cand_id'");
            }
//print_r("INSERT INTO candidate_joborder(candidate_id, joborder_id, date_created, site_id, status,date_modified)VALUES('$cand_id','$job_id','$timenow',1,100,'$timenow')"); die();
            $qry2 = mysqli_query($conn,"INSERT INTO candidate_joborder(candidate_id, joborder_id, date_created, site_id, status,date_modified,applicant_id,final_comment,final_comment2,remarks)VALUES('$cand_id','$job_id','$timenow',1,100,'$timenow',0,0,0,0)");
            $joborder_id = mysqli_insert_id($conn);

            $qry3 = mysqli_query($conn,"INSERT INTO candidate_joborder_status_history(candidate_id, joborder_id, date, status_from, status_to, site_id)VALUES('$cand_id','$job_id', '$timenow', '100', '100', '1')");

            $dataroot = "/home/menahrs/public_html/ceo/rpms";
            //$dataroot = "rpms";

            $email_val = $app_id . "_". $job_id;
            $md5 = $email_val;
    
            $extens_names = end(explode('.', $_FILES["uploadedfile"]["name"]));
            $upload_filenames = $app_id."_Resume_JO" .$job_id."." .$extens_names;
            $vFolderName_1 = $dataroot.'/attachments/site_1/0xxx/'.$md5;
    
            //$extname1     = end(explode('.', $_FILES["cand_photo"]["name"]));
            //$upload_photo = $app_id."_Photo" . "." .$extname1;

            if(!is_dir($vFolderName_1))
            {
                  $res=mkdir($vFolderName_1, 0777);
            }
            
            if($_FILES["uploadedfile"]["error"] > 0)
            {
                 echo "<br><div align='center'><font color='red'>Sorry there is no files found"."</font></div>";
            }else{
                  if(file_exists("$vFolderName_1/" . $_FILES["uploadedfile"]["name"])){
                    echo $_FILES["uploadedfile"]["name"] . " already exists. ";
                  }else{
                    $file_name = preg_replace('/[^A-Za-z0-9-_.]/', '', $upload_filenames);
                    $move = move_uploaded_file($_FILES["uploadedfile"]["tmp_name"],"$vFolderName_1/" .$file_name);
                    //$foto_name = preg_replace('/[^A-Za-z0-9-_.]/', '', $upload_photo);
                    //$move1 = move_uploaded_file($_FILES["cand_photo"]["tmp_name"],"$vFolderName_1/" .$foto_name);
                  }
            }

            $extraDatas = $_FILES["uploadedfile"]["name"];
            $exten_name = end(explode('.', $extraDatas));
            $orig_filename = $app_id."_Resume_JO" .$job_id. "." .$exten_name;
            $titles = $app_id."_Resume";
            $content_types = $_FILES["uploadedfile"]["type"];
            $file_sizes = $_FILES["uploadedfile"]["size"]/1024;
            $mdsums = md5_file($_FILES["uploadedfile"]["tmp_name"]);
            $dire_name = $app_id."_".$job_id;
            $dir_namee = "site_1/0xxx/".$dire_name."/";
         
            mysqli_query($conn,"INSERT INTO attachment(data_item_id, data_item_type, site_id,title, original_filename, stored_filename, content_type, resume, date_created, date_modified, profile_image, directory_name, md5_sum, file_size_kb)VALUES('$cand_id', '100', '1', '$titles', '$orig_filename', '$orig_filename', '$content_types', '1', '$timenow', '$timenow', 0, '$dir_namee', '$mdsums', '$file_sizes')");


          /*  $extens_names1 = end(explode('.', $_FILES["uploadedfile1"]["name"]));
            $upload_filenames1 = $app_id."_gpa_proof" .$job_id."." .$extens_names1;
            //$vFolderName_11 = $dataroot.'/attachments/site_1/1xxx/'.$md5;
    
            //$extname1     = end(explode('.', $_FILES["cand_photo"]["name"]));
            //$upload_photo = $app_id."_Photo" . "." .$extname1;

            if(!is_dir($vFolderName_1))
            {
                  $res=mkdir($vFolderName_1, 0777);
            }
            
            if($_FILES["uploadedfile1"]["error"] > 0)
            {
                 echo "<br><div align='center'><font color='red'>Sorry there is no files found"."</font></div>";
            }else{
                  if(file_exists("$vFolderName_1/" . $_FILES["uploadedfile1"]["name"])){
                    echo $_FILES["uploadedfile1"]["name"] . " already exists. ";
                  }else{
                    $file_name1 = preg_replace('/[^A-Za-z0-9-_.]/', '', $upload_filenames1);
                    $move1 = move_uploaded_file($_FILES["uploadedfile1"]["tmp_name"],"$vFolderName_1/" .$file_name1);
                    //$foto_name = preg_replace('/[^A-Za-z0-9-_.]/', '', $upload_photo);
                    //$move1 = move_uploaded_file($_FILES["cand_photo"]["tmp_name"],"$vFolderName_1/" .$foto_name);
                  }
            }

            $extraDatas1 = $_FILES["uploadedfile1"]["name"];
            $exten_name1 = end(explode('.', $extraDatas1));
            $orig_filename1 = $app_id."_gpa_proof" .$job_id. "." .$exten_name1;
            $titles1 = $app_id."_gpa_proof";
            $content_types1 = $_FILES["uploadedfile1"]["type"];
            $file_sizes1 = $_FILES["uploadedfile1"]["size"]/1024;
            $mdsums1 = md5_file($_FILES["uploadedfile1"]["tmp_name"]);
            $dire_name1 = $app_id."_".$job_id;
            $dir_namee1 = "site_1/0xxx/".$dire_name1."/";
         
            mysqli_query($conn,"INSERT INTO attachment(data_item_id, data_item_type, site_id,title, original_filename, stored_filename, content_type, resume, date_created, date_modified, profile_image, directory_name, md5_sum, file_size_kb)VALUES('$cand_id', '100', '1', '$titles1', '$orig_filename1', '$orig_filename1', '$content_types1', '1', '$timenow', '$timenow', 0, '$dir_namee1', '$mdsums1', '$file_sizes1')");*/

            /*for($k=0; $k<count((array)$_FILES['upload_doc']['name']); $k++){
                $exten_doc = end(explode('.', $_FILES["upload_doc"]["name"][$k]));
                $docu_name = $app_id . "_" . $_POST['doc_name'][$k].".".$exten_doc;
                $target_path = $vFolderName_1 ."/" . $docu_name; 
                move_uploaded_file($_FILES['upload_doc']['tmp_name'][$k], $target_path);                 
            }*/

            $mesg = "<p><font color='green' face='verdana'>Thank you for applying. Your Applicant ID is emailed to the registered email id. Please check your inbox and spam folders for the mail. <br><p align='center'><b>KINDLY NOTE DOWN YOUR APPLICANT ID IS ".$app_id."</b></font></p><p align='center'><font color='red' face='verdana'><b><small>If mail is received in your SPAM or JUNK folder kindly mark the mail as NOT SPAM or SAFE SENDER to receive future mails in your inbox<br><br><a href='javascript:void(0);' onClick='window.print()'>Print</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='https://menahrs.com/ceo'>Back</a></small></b></font></p>";

            $email = $_POST['email'];
            $cand_name = $_POST['firstname'] . " " .$_POST['lastname'];
            $to = $email;
            $subject = " Application Received";
            $message .= "Dear $cand_name,
            <br><br>
            Your application has been successfully registered with us and your Applicant ID is ".$app_id.". Kindly state the Applicant ID in all future communication.
            For any queries or clarifications send email to ceo@menahrs.com with National ID or Applicant ID starting with CE.
            <br><br>
            Wish you good luck!
            <br><br>
            CEO Recruitment Team<br><br>";

            $headers  = "MIME-Version: 1.0" . "\r\n";
            $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
            $headers .= 'From: <noreply@menahrs.com>' . "\r\n";
            $headers .= "Organization: Sender Organization\r\n";
            $headers .= "X-Priority: 3\r\n";
            $headers .= "X-Mailer: PHP". phpversion() ."\r\n"; 

            mail($to,$subject,$message,$headers);
        }

        $mesag = "<p><font color='red' face='verdana'><b><small>Your application is ready for submission. Please check details once and click the SEND APPLICATION button below.</small></b></p></font></p>";
        ?>
        <div class="image-container">
            <!--<img class="img-fluid d-none d-md-block" width="20%" height="20%" alt="Application Logo" src="valeomanlogo.jpg" style="margin-left: 6%;margin-top: 0%;margin-bottom: 1%;width: 13%;"/>
            <img class="img-fluid d-block d-md-none" width="50%" height="100%" alt="Application Logo" src="valeomanlogo.jpg" />-->
        </div>
        <div class="image-top-right">
            <div class="row">
                <div class="mr-3" id="registerbtn">
                    <?php if($mesg =='') { ?>
                    <a href="#applicationForm"> <button class="btn btn-mocha"> Register Now </button></a>
                <?php } ?>
                </div>
                <div></div>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row justify-content-center" style="background-color:#f4f4f4; padding:10px;">
                <div class="col-md-9 justify-content-center">
                    <h1 class="font-custom-h1 blue-text-color mt-4 text-center">CEO Recruitment</h1>
                    <br />
                </div>
            </div>
            <?php if($mesg!='')
            { 
                echo '<center>'.$mesg.'</center';
            } 
            ?>
        </div>
        <?php if($mesg =='') { ?>
        <div class="container paragraph-pading">
            <div class="row justify-content-center ">
                <div class="col-md-9 mb-3">
                    <!--<h2 class="font-custom-h2">About Vale OMAN</h2>
                    <p class="font-custom-p">
                         We arrived in Oman in 2007 with the aim of expanding our presence in the Middle East. Since then, we have been developing and exploring opportunities that generate jobs, train local talent and drive the local supply chain and the economic diversification of the country. This is proven by the fact that, in 2013, the government of Oman was recognized by the United Nations for its excellence in promoting export-oriented foreign investment, and Vale's operations in the Sultanate were used as a case study.
                    </p>
                    <b style="font-size: larger;">Recognitions</b> 
                        <ul>
                            <li>In 2013, the Government of Oman was recognized by the United Nations (UN) for the excellence in promoting export-oriented foreign investment having Vale’s operations in the Sultanate as the case of the study.</li>
                            <li>Vale in Oman was awarded the prestigious Best Specialist Dry Bulk Port or Terminal award, for its terminal located in Sohar Port at the 2015 International Bulk Journal Awards in Belgium in November.</li>
                            <li>Vale was awarded the Manufacturing Supply Chain Management of the Year at the Logistics Middle East Awards 2017.</li>
                            <li>Vale in Oman was awarded as the Best Foreign Direct Investment in Oman 2018.</li>
                        </ul>  -->
                </div>
                <div class="col-md-5 font-custom">
                    <h4 class="mb-3 opensons-semi-bold"></h4>
                    <!--<p class="font-custom-p">
                        Sohar Aluminium was formed in September 2004 to undertake a landmark Greenfield aluminium smelter project in the Sultanate of Oman. Jointly owned by Oman Oil Company, Abu Dhabi National Energy Company PJSC - TAQA and Rio Tinto, Sohar Aluminium has won global acclaim for its superior, environmentally-friendly and energy-efficient technology.<br><br>
                        By implementing decades of industry insight in its design, specification and construction Sohar Aluminium has been created to ensure efficiency, environmental protection and the utmost safety of its workforce. The smelter has an annual production capacity of 375,000 tonnes of high quality Aluminium.<br><br>
                        Omanisation, which currently stands at 76% of its workforce, is a driving force within the organisation. The development of its young employees is paramount and with that in mind, Sohar Aluminium has its own internationally recognised training centre which gives each and every employee the opportunity for further learning.<br><br>
                        SA is a strong believer in supporting Small and Medium Enterprises (SMEs) and has executed a number of projects to establish and sustain SMEs. 60% of its production is earmarked for consumption by local downstream industries while the rest is exported.<br><br>
                        Sohar Aluminium firmly believes in supporting and giving back to the local communities it operates in. Our well established CSR framework ensures we execute a number of projects that impact various sections of the society in a positive manner.<br><br>
                        In many ways, Sohar Aluminium’s development mirrors the Sultanate of Oman’s own emergence onto the world stage - driving forward at a formidable pace, but all the while mindful and respectful of its cultural heritage and values. Sohar Aluminium intends to become a benchmark smelter while contributing to the sustainable development of Oman.
                        
                    </p>-->
                </div>
                <div class="col-md-4">
                    <!--<iframe width="100%" height="220px" src="sohar-aluminium-corporate-video-givefastlink.mp4"></iframe>-->
                </div>
            </div>
        </div>
        <?php } ?>
        <?php if($mesg =='') { ?>
        <center style="color:red;" class="blink_me">Last Date to apply : 17th Augest 2024 </center>
        <?php } ?>
        <br>
        <div class="container paragraph-pading" style="display:none;">
            <div class="row justify-content-center">
                <div class="col-md-9 font-custom mb-3">
                    <h3 style="color: #08165B;font-size: 16px;"><b>Jobs that are anticipate in the periodic maintenance in the industries are listed below with the job descriptions:</b></h3>
                    <br>
                    <center style="color:red;" class="blink_me">Last Date to apply : 13th March 2024 </center>
                </div>
            </div>
            <div class="row justify-content-center" style="height: 100%;">
                <!--<div class="col-md-3 col-8 @*test-block*@" id="1">
                    <a class="pointer ">
                        <div id="circle" style="height: 65%;width: 100%;border-radius: 50%;border:1px solid #424040;;line-height: 65px;text-align: center;-webkit-box-shadow: 10px -10px rgb(235 155 155 / 60%);"><b style=" text-decoration-line: underline;">Job One</b><br><b><span style="    color: red;">Click Here</span></b></div>
                    </a>
                </div>
                <div class="col-md-3 col-8 @*test-block*@" id="2">
                    <a class="pointer ">
                        <div id="circle" style="height: 65%;width: 100%;border-radius: 50%;border:1px solid #424040;;line-height: 65px;text-align: center;-webkit-box-shadow: 10px -10px rgb(155 235 213 / 60%);"><b style=" text-decoration-line: underline;">Job Two</b><br><b><span style="    color: red;">Click Here</span></b></div>
                    </a>
                </div>
                <div class="col-md-3 col-8 @*test-block*@" id="3">
                    <a class="pointer">
                        <div id="circle" class="img-fluid" style="height: 65%;width: 100%;border-radius: 50%;border:1px solid #424040;;line-height: 65px;text-align: center;-webkit-box-shadow: 10px -10px rgb(233 204 70 / 60%);"><b style=" text-decoration-line: underline;">Job Three</b><br><b><span style="    color: red;">Click Here</span></b></div>
                    </a>
                </div>-->
                <table>
                  <tr>
                    <td><a href="jd/1.Site_Manager.pdf" target="_blank">Site Manager</a></td>
                    <td><a href="jd/2.Site_Mechanical_Superintendent.pdf" target="_blank">Site Mechanical Superintendent</a></td>
                    <td><a href="jd/3.QA-QC_Lead.pdf" target="_blank">QA/QC Lead</a></td>
                  </tr>
                </table>
            </div>
        </div>
        <div id="applicationForm" style="margin-right: 20%;margin-left: 20%;">
        <?php if($mesg=='')
        { 
        ?>
        <center><b>CANDIDATE APPLICATION FORM</b></center>
        <br><br>
         <form method="post" action="" name="applicantdata" id="applicantdata" enctype="multipart/form-data">
              <div class="form-group row">
                  <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Position applying for<span style="color:red;">*</span></h6>
                    <select class="form-control" data-error="Position applying for" id="position" placeholder="" name="position" required>
                        <option value="">SELECT</option>
                            <?php 
                              $jobQuery = "SELECT * FROM joborder where status = 'Active'";
                              $jobResult = mysqli_query($conn,$jobQuery);
                              while($jobRow = mysqli_fetch_array($jobResult,MYSQLI_ASSOC)){
                            ?>
                        <option value="<?php echo $jobRow['joborder_id'];?>"><?php echo $jobRow['title'];?></option>
                       
                        <?php } ?>
                        

                        
                       
                    </select>
                    <p class="error-msg errorposition"></p>
                     <p id="response"></p>
                </div>
              </div>
            <div class="form-group row">
                
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">First name<span style="color:red;">*</span></h6>
                    <input type="text" class="form-control" data-error="First Name" id="firstname" name="firstname">
                    <p class="error-msg errorfname"></p>
                </div>
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Middle name</h6>
                    <input type="text" class="form-control" data-error="Middle name" id="middlename" name="middlename">
                </div>
            </div>
            <div class="form-group row">
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Last name<span style="color:red;">*</span></h6>
                    <input type="text" class="form-control" data-error="Last Name" id="lastname" name="lastname">
                    <p class="error-msg errorlname"></p>
                </div>
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Gender<span style="color:red;">*</span></h6>
                    <select class="form-control" data-error="Gender" id="gender" name="gender">
                        <option value="">SELECT</option>
                        <option value="1">Male</option>
                        <option value="2">Female</option>
                    </select>
                    <p class="error-msg errorgender"></p>
                </div>
            </div>
            <div class="form-group row">
                
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Date of Birth<span style="color:red;">*</span></h6>
                    <div style="display:flex;">
                        <select class="form-control" name="dat" id="dat" style="width:80px;">
                            <option value="">DATE</option>
                            <?php for($dt=1;$dt<=31;$dt++){
                            if($_POST['dat']==$dt){
                            $vSelected = "selected";
                            }else{
                            $vSelected = "";
                            }
                            ?>
                            <option value="<?php echo $dt;?>" <?php echo $vSelected;?>><?php echo $dt; ?></option>
                            <?php } ?>
                        </select>
                        <select class="form-control" name="mon" id="mon" style="width:100px;margin-left: 2%;">
                            <option value="">MONTH</option>
                            <option value='1'>January</option>
                            <option value='2'>February</option>
                            <option value='3'>March</option>
                            <option value='4'>April</option>
                            <option value='5'>May</option>
                            <option value='6'>June</option>
                            <option value='7'>July</option>
                            <option value='8'>August</option>
                            <option value='9'>September</option>
                            <option value='10'>October</option>
                            <option value='11'>November</option>
                            <option value='12'>December</option>
                        </select>
                        <select class="form-control" name="yr" id="yr" style="width:100px;margin-left: 2%;">
                            <option value="">YEAR</option>
                            <?php  for($yr=2004;$yr>=1954;$yr--)
                            {
                            if($_POST['yr']==$yr){
                            $vSelected = "selected";
                            }else{
                            $vSelected = "";
                            }
                            echo "<option value = ".$yr." $vSelected>".$yr."</option>";
                            }?>
                        </select>
                    </div>
                    <p class="error-msg errordob"></p>
                </div>
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Email ID<span style="color:red;">*</span></h6>
                    <input class="form-control" name="email" id="email">
                    <p class="error-msg erroremailid"></p>
                </div>
            </div>
            <div class="form-group row">
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Nationality<span style="color:red;">*</span></h6>
                    <select class="form-control" name="nationality" id="nationality">
                        <option value="">SELECT</option>
                        <?php $rsNat = mysqli_query($conn,"SELECT * FROM cm_nationality where nat_name IN('Omani') AND nat_code !=158  ORDER BY nat_name");
                        while($rwNat = mysqli_fetch_array($rsNat)){
                        $nat = utf8_encode($rwNat['nat_name']);
                        if($_POST['nationality']==$rwNat['nat_code']){
                        $vSelected = "selected";
                        }else{
                        $vSelected = "";
                        }
                        ?>
                        <option value="<?php echo $rwNat['nat_code'];?>" <?php echo $vSelected;?>><?php echo $nat;?></option>
                        <?php } ?>
                        <option value="others">Expat</option>
                    </select>
                    <p class="error-msg errornationality"></p>
                </div>
                <div class="col-md-6 mb-2">
                    <div class="nat1" style="display:none;">
                        <h6 class="popins-font font14px">National ID<span style="color:red;">*</span></h6>
                        <input type="text" class="form-control" id="nationalid" name="nationalid">
                        <p class="error-msg errornationalid"></p>
                    </div>
                    <div class="nat1" style="display:none;">
                        <h6 class="popins-font font14px">Region<span style="color:red;">*</span></h6>
                        <select class="form-control" name="region" id="region">
                            <option value="">SELECT</option>
                            <?php $rsReg = mysqli_query($conn,"SELECT * FROM cm_region");
                            while($rwReg = mysqli_fetch_array($rsReg)){
                            $reg = utf8_encode($rwReg['region']);
                            if($_POST['region']==$rwReg['id']){
                            $vSelected = "selected";
                            }else{
                            $vSelected = "";
                            }
                            ?>
                            <option value="<?php echo $rwReg['id'];?>" <?php echo $vSelected;?>><?php echo $reg;?></option>
                            <?php } ?>
                        </select>
                        <p class="error-msg errorregion"></p>
                    </div>
                    <div class="nat1" style="display:none;">
                        <h6 class="popins-font font14px">Wilayat<span style="color:red;">*</span></h6>
                        <select class="form-control" name="wilayat" id="wilayat">
                            <option value="">SELECT</option>
                            <?php
                            $wila = $_POST['wilayat'];
                            $reg_post = $_POST['region']; 
                            $rsWila = mysqli_query($conn,"SELECT * FROM cm_wilayat WHERE region_id='$reg_post'");
                            while($rwWila = mysqli_fetch_array($rsWila))
                            { 
                                if($_POST['wilayat']==$rwWila['id']){
                                    $vSelected = "selected";
                                }else{
                                    $vSelected = "";
                                }
                            ?>
                            <option value="<?php echo $rwWila['id'];?>" <?php echo $vSelected;?>><?php echo $rwWila['wilayat'];?></option>
                              <?php 
                            }
                            ?>
                        </select>
                        <p class="error-msg errorwilayat"></p>
                    </div>
                    <div class="o_nat" style="display:none;">
                        <h6 class="popins-font font14px">Other nationality<span style="color:red;">*</span></h6>
                        <input type="text" class="form-control" id="o_nat" name="o_nat">
                        <p class="error-msg erroronat"></p>
                    </div>
                    <div class="nat2" style="display:none;">
                        <h6 class="popins-font font14px">Passport Number<span style="color:red;">*</span></h6>
                        <input type="text" class="form-control" id="passport" name="passport">
                        <p class="error-msg errorpassport"></p>
                    </div>
                </div>
            </div>
            <div class="form-group row">
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Present Country of residence<span style="color:red;">*</span></h6>
                    <select class="form-control" name="country" id="country">
                        <option value="">SELECT</option>
                        <?php $rsCountry = mysqli_query($conn,"SELECT * FROM cm_country");
                        while($rwCountry = mysqli_fetch_array($rsCountry)){
                        $country = utf8_encode($rwCountry['short_name']);
                        if($_POST['country']==$rwCountry['country_id']){
                        $vSelected = "selected";
                        }else{
                        $vSelected = "";
                        }
                        ?>
                        <option value="<?php echo $rwCountry['country_id'];?>" <?php echo $vSelected;?>><?php echo $country;?></option>
                        <?php } ?>
                    </select>
                    <p class="error-msg errorpcountry"></p>
                </div>
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">GSM<span style="color:red;">*</span></h6>
                    <div style="display:flex;">
                        <span id="gsm_codee">
                            <input class="form-control" name="gsm_code" id="gsm_code" placeholder = "+968" style="width: 80px;">
                        </span> 
                        <input class="form-control" name="gsm" id="gsm" style="width: 250px;margin-left:2px;">
                    </div>
                    <p class="error-msg errorgsmcode"></p>
                    <p class="error-msg errorgsm"></p>
                </div>
            </div>
            <div class="form-group row">
                
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Highest Qualification<span style="color:red;">*</span></h6>
                    <select class="form-control" name="qualification" id="qualification">
                        <option value="">SELECT</option>
                        <?php $rsQuali = mysqli_query($conn,"SELECT * FROM cm_qualification");
                        while($rwQuali = mysqli_fetch_array($rsQuali)){
                        $quali = utf8_encode($rwQuali['quali']);
                        if($_POST['qualification']==$rwQuali['id']){
                        $vSelected = "selected";
                        }else{
                        $vSelected = "";
                        }
                        ?>
                        <option value="<?php echo $rwQuali['id'];?>" <?php echo $vSelected;?>><?php echo $quali;?></option>
                        <?php } ?>
                    </select>
                    <p class="error-msg errorqulification"></p>
                </div>
                  <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Discipline / Specialization<span style="color:red;">*</span></h6>
                    <select class="form-control" name="discipline" id="discipline">
                        <option value="">SELECT</option>
                        <?php $qry15 = mysqli_query($conn,"SELECT * FROM cm_discipline  GROUP BY discipline ORDER BY discipline");
                        while($res15 = mysqli_fetch_array($qry15)){?>
                        <option value="<?php echo $res15['id'];?>"><?php echo $res15['discipline'];?></option>
                        <?php } ?>
                        <option value="others">Others</option>
                    </select>
                    <div class="o_disc" style="display:none;"><input type="text" class="form-control" name="o_disc" id="o_disc" value=""></div>
                    <p class="error-msg errordiscipline"></p>
                    <p class="error-msg errorotherdiscipline"></p>
                </div>
            </div>
            <div class="form-group row">
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">University<span style="color:red;">*</span></h6>
                    <select class="form-control" name="universitynew" id="universitynew">
                        <option value="">SELECT</option>
                        <option value="1">Omani University</option>
                        <option value="2">Other University</option>
                    </select>
                    <p class="error-msg errorouniversitynew"></p>
                </div>
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Education Institute / university<span style="color:red;">*</span></h6>
                    <input class="form-control" name="university" id="university">
                    <p class="error-msg erroruniversity"></p>
                </div>
            </div>
            <div class="form-group row">
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Year of Passing<span style="color:red;">*</span></h6>
                    <select class="form-control" name="year" id="year">
                        <option value="">SELECT</option>
                        <?php
                       for($i=2023;$i>=1940;$i--)
                       {
                       if($_POST['year']==$i){
                       $vSelected = "selected";
                       }else{
                       $vSelected = "";
                       }
                       echo "<option value = ".$i." $vSelected>".$i."</option>";
                       }
                       ?>
                    </select>
                    <p class="error-msg erroryear"></p>
                </div>
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Final Overall GPA<span style="color:red;">*</span></h6>
                    <input class="form-control" name="gpa" id="gpa">
                    <p class="error-msg errorgpa"></p>
                </div>
            </div>
            <div class="form-group row">
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Your employment status<span style="color:red;">*</span></h6>
                    <div style="display: flex;">
                        <input class="form-control" type="radio" name="employmentstatus" value="freshGraduate" id="employmentstatus" style="width: 30px;height: 15px;">Fresh Graduate
                        <input class="form-control" type="radio" name="employmentstatus" value="experienced" id="employmentstatus" style="width: 30px;margin-left: 3px;height: 15px;">Experienced
                    </div>
                    <p class="error-msg errorempstatus"></p>
                </div>
                <div class="col-md-6 mb-2">
                    <div style="display:none;" id="expe">
                        <h6 class="popins-font font14px">Present Company<span style="color:red;">*</span></h6>
                        <input class="form-control" type="text" name="present_company" id="present_company"/>
                        <p class="error-msg errorpcompany"></p>
                    </div>
                    <div style="display:none;" id="expe1">
                        <h6 class="popins-font font14px">Present Designation<span style="color:red;">*</span></h6>
                        <input class="form-control" type="text" name="present_desig" id="present_desig"/>
                        <p class="error-msg errorpdesignation"></p>
                    </div>
                    <div style="display:none;" id="expe2">
                        <h6 class="popins-font font14px">Current Salary<span style="color:red;">*</span></h6>
                        <input class="form-control" type="text" name="current_salary" id="current_salary"/>
                        <p class="error-msg errorcsalary"></p>
                    </div>
                    <div style="display:none;" id="expe4">
                        <h6 class="popins-font font14px">Total years of work experience<span style="color:red;">*</span></h6>
                        <div style="display: flex;">
                            <select class="form-control" name="exp_year" id="exp_year" style="width:100px;">
                                <option value="">Years</option>
                                <?php
                                    for($i=0;$i<=50;$i++)
                                    {
                                        if($_POST['exp']==$i && $_POST['exp']!=''){
                                            $vSelected = "selected";
                                        }else{
                                            $vSelected = "";
                                        }
                                        echo "<option value=".$i." $vSelected>".$i."</option>";
                                    }
                                ?>
                            </select>
                            <select class="form-control" name="exp_month" id="exp_month" style="width:100px;margin-left: 2px">
                                <option value="">Months</option>
                                <option value='1' <?php if($_POST['exp_month']==1){echo 'selected';} ?>>1</option>
                                <option value='2' <?php if($_POST['exp_month']==2){echo 'selected';} ?>>2</option>
                                <option value='3' <?php if($_POST['exp_month']==3){echo 'selected';} ?>>3</option>
                                <option value='4' <?php if($_POST['exp_month']==4){echo 'selected';} ?>>4</option>
                                <option value='5' <?php if($_POST['exp_month']==5){echo 'selected';} ?>>5</option>
                                <option value='6' <?php if($_POST['exp_month']==6){echo 'selected';} ?>>6</option>
                                <option value='7' <?php if($_POST['exp_month']==7){echo 'selected';} ?>>7</option>
                                <option value='8' <?php if($_POST['exp_month']==8){echo 'selected';} ?>>8</option>
                                <option value='9' <?php if($_POST['exp_month']==9){echo 'selected';} ?>>9</option>
                                <option value='10' <?php if($_POST['exp_month']==10){echo 'selected';} ?>>10</option>
                                <option value='11' <?php if($_POST['exp_month']==11){echo 'selected';} ?>>11</option>
                            </select>
                            
                        </div>
                        <p class="error-msg erroreyear"></p>
                            <p class="error-msg erroremonth"></p>
                    </div>
                </div>
            </div>
            <div class="form-group row">
                <div class="col-md-6 mb-2">
                    <div style="display:none;" id="ministry2">
                        <h6 class="popins-font font14px">Have you registered with the Ministry of Labor as a job seeker<span style="color:red;">*</span></h6>
                        <select class="form-control" name="ministry" id="ministry"><option value="">SELECT</option>
                            <option value="Yes">Yes</option>
                            <option value="No">No</option>
                        </select>
                        <p class="error-msg errorministry"></p>
                    </div>
                </div>
                <div class="col-md-6 mb-2">
                    <div style="display:none;" id="ministry1">
                        <h6 class="popins-font font14px">Date of Registration<span style="color:red;">*</span></h6>
                        <input class="form-control" type="date" name="crnumber" id="crnumber" value="<?php echo $_POST['crnumber']?>" max="<?php echo date("Y-m-d");?>"/>
                        <p class="error-msg errorcrnumber"></p>
                    </div>
                </div>
            </div>
            <div style="margin-left: 40px;">
                <small>
                    <br>
                         Please upload your Resume/CV in <b>PDF / DOC / DOCX format</b> only. Do not upload certificates or any other documents.
                    <br><br>
                </small>
            </div>
            <div class="form-group row">
                <div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Resume/CV field <span style="color:red;">*</span></h6>
                    <input class="form-control" name="uploadedfile" type="file" id="uploadedfile" value=""><small>[Max file upload size: 2MB]</small>
                    <p class="error-msg errorresume"></p>
                </div>
                <!--<div class="col-md-6 mb-2">
                    <h6 class="popins-font font14px">Final Overall GPA Proof (Transcript) <span style="color:red;">*</span></h6>
                    <input class="form-control" name="uploadedfile1" type="file" id="uploadedfile1" value=""><small>[Max file upload size: 2MB]</small>
                    <p class="error-msg errorgpaproof"></p>
                </div>-->
            </div>
            <input type="hidden" name="dup" id="dup" value="">
            <p class="error-msg errordup"></p>
            <input hidden class="form-control" type="text" name="prefexp" id="prefexp" value="N.A">
            <input hidden class="form-control" type="text" name="salary" id="salary" value="0">
            <hr style="width:100%; height: 2px;">
            <br>
            <div id="show_div" style="display:none;"><?php echo $mesag;?></div>
            <br>
            <br>
            I hereby certify that all the above information is true and correct to the best of my knowledge and belief.
            <br><b>For any queries or clarifications send email to ceo@menahrs.com</b>
            <br><br>
            <center><div class="hide_cl">
                <button type="button" class="btn btn-mocha" name="btnSave" id="btnSave">VERIFY AND SUBMIT</button>
            </div></center>
            <center><div class="show_cl" style="display:none;">
                <button type="button" class="btn btn-mocha" name="btn_save" id="btn_save">SEND APPLICATION</button>
            </div></center>
        </form>
        <?php
            }
        ?>
        </div>
        <br>
<!--<div class="container paragraph-pading">
<div class="row justify-content-center">
<div class="col-md-9 mb-3">
<h2 class="font-custom-h2">About oxy Application Form</h2>
</div>
<div class="col-md-9">
<p class="font-custom-p">
Please provide correct information about yourself to evaluate the suitability of your profile for the Tashgheel Programme. We will contact those candidates who are suitable for the next stages of this Programme. Those who are not suitable will not be contacted.

</p>
</div>
</div>
</div>-->
<div class="container-fluid blue-background paragraph-pading">
<div class="container">
<div class="row justify-content-center">
<!--<div class="col-md-3 col-8">
<img class="img-fluid" src="Content/Images/faq.png" />
</div>
<div class="col-md-3 col-8">
<img class="img-fluid" src="Content/Images/eligibility.png" />
</div>
<div class="col-md-3 col-8">
<img class="img-fluid" src="Content/Images/role-detail.png" />
</div>-->
<div class="col-md-3 col-8">
<!--<a href="#" target="_blank"><img class="img-fluid" src="valeomanlogo-removebg.png" style="margin-top: 22%;  width:71%"/></a>-->
</div>
<div class="col-md-3 col-8">
<a href="https://menahrs.com/" target="_blank"><img class="img-fluid" src="menahrlogo.png" style="margin-top: 31%;"/></a>
</div>
<div class="col-md-3 col-8">
<?php if($mesg =='') { ?>
<a href="#applicationForm"><img class="img-fluid" src="registernow.png" style="margin-top: 20%;" /></a><?php } ?>
</div>
<!--<ul>
  <li><a href="https://tashgheel.om/public" target="_blank">About Tashgheel</a></li>
  <li><a href="https://menahrs.com/" target="_blank">About MENA HR</a></li>
  <li><a href="#applicationForm">Registration Form</a></li>
</ul>  -->
</div>
</div>
</div>
<section class="footer-background">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-9">
<p>Copyright | @MENA HR Solutions LLC</p>
</div>
</div>
</div>
</section>
<div class="fix-cookie-msg-bar" id="popup">
<div class="container padding-0">
<div class="row">
</div>
</div>
</div>
<script>
    $(document).ready( function() {
        $("#position").on('change', function() {
            var jobid = $(this).val();
            
            $.ajax({
                type: "POST",
                url: "getjobjd.php",
                data: "jobid=" + jobid,
                success: function(html){
                    $("#response").html(html);
                }
            });
        });
    });
</script>
</body>
</html>

