<?php
session_start();
include("dbConfig.php");
include("../Function/level_salf.php");
    
$company_id = $_POST["company_id"];

$system_id='2222';

$dept_id = $_POST["dept_id"];
$employ_id = $_POST["employ_id"];
$add_user_id = $_POST["add_user_id"];


date_default_timezone_set("Asia/Riyadh");
  $created_date = date("Y-m-d");
  $createdDate_time = date("Y-m-d h:i:sa");
  
 $link_lang = $_POST["link_lang"];
 $messag_add = $_POST["messag_add"];

 $id_first = $_POST["id_first"];
 $selectedOption = $_POST["selectedOption"];
 if($selectedOption=="final_reject"){
    $refusedetailsAr = "رفض نهائي";
     $refusedetailsEn = "Final Reject";
    }elseif($selectedOption=="returnto_employee"){
   
     $refusedetailsAr = "تم الرفض ويمكنك الترقيه";
     $refusedetailsEn = "Rejected and you can upgrade";
    }else{
        $refusedetailsAr = refusedetailsAr($selectedOption,$company_id);
        $refusedetailsEn = refusedetailsEn($selectedOption,$company_id);
    }



 $sql = "UPDATE hr_advance_level_tbl SET level_refuse = '$selectedOption',level_refuse_stat_details_ar = '$refusedetailsAr',level_refuse_stat_details_en = '$refusedetailsEn' WHERE id = '$id_first'";
 
if ($conn->query($sql) === TRUE ) {
  
  echo "1";


} else {
  echo "Error: " . $sql . "<br>" . $conn->error;
}



?>

