<?php
include("dbConfig.php");
$add_user_id = $_POST["add_user_id"];
$i = $_POST["i"];
$company_id = $_POST["company_id"];
$sql1 = "UPDATE hr_request_permission_tbl SET deleted='1' where request_per_id='$i'";


//==================العمليات==================================
$browserAgent = $_SERVER['HTTP_USER_AGENT'];
 $system_type='Shipping_Clearance_System';
  $proccess_type='delete_permission_equest';
$proccess_details='حذف طلب الإذن رقم '.$i;
$proccess_details_en='delete permission request'; 
$table_name='hr_request_permission_tbl';   
  date_default_timezone_set("Asia/Riyadh");
  $createdDate = date("Y-m-d h:i:sa");
   $sql3 = "INSERT INTO process_systems_tbl(system_type,user_id,company_id,user_ip,proccess_type,proccess_details,proccess_details_en,table_name,proccess_id,proccess_date,process_time,process_datetime,browser)values('$system_type','$add_user_id','$company_id','$user_ip','$proccess_type','$proccess_details','$proccess_details_en','$table_name','$i',NOW(),NOW(),'$createdDate','$browserAgent')";
 //==================العمليات==================================
  
  if ($conn->query($sql1) === TRUE  && $conn->query($sql3) === TRUE) {
       echo "1";
        } else {
          echo "Error: " . $sql . "<br>" . $conn->error;
        }    


?>
