<?php
session_start();
include("dbConfig.php");

    
$company_id = $_POST["company_id"];

$system_id='2222';

$company_id_sel = $_POST["company_id_sel"];
$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"];
 $id_second = $_POST["id_second"];

 $level_first = $_POST["level_first"];
 $level_second = $_POST["level_second"];


 $sqll = "UPDATE hr_advance_level_tbl SET level = '$level_second' WHERE id = '$id_first' and company_id='$company_id' and type='salf' ";
 $sql = "UPDATE hr_advance_level_tbl SET level = '$level_first' WHERE id = '$id_second' and company_id='$company_id' and type='salf'";

 $sqll2 = "UPDATE hr_level_employ_approval SET level = '$level_second' WHERE salf_id = '$id_first' and company_id='$company_id' and type='salf' ";
 $sql2 = "UPDATE hr_level_employ_approval SET level = '$level_first' WHERE salf_id = '$id_second' and company_id='$company_id' and type='salf'";



if ($conn->query($sqll) === TRUE && $conn->query($sql) === TRUE && $conn->query($sqll2) === TRUE && $conn->query($sql2) === TRUE ) {
  
  echo "1";


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



?>

