<?php
include("dbConfig.php");
header('Content-type: application/json; charset=utf-8');

$company_id = $_GET['company_id'];
//
$sql_v_w = "SELECT * FROM vacations_type_waseet_tbl where company_id!='0' AND company_id='$company_id' and deleted='0'";
                    $result_v_w = $conn->query($sql_v_w);
                    if ($result_v_w->num_rows > 0) {
                    while($row_v_w = $result_v_w->fetch_assoc()) { 
     
     
                if($employ_sex=='male'){
                   $sql_vt = "SELECT * FROM vacations_type_tbl where  (vacation_gender='all_gender' or vacation_gender='male_gender')  AND vacations_type_id='".$row_v_w["vacations_type_id"]."' and deleted='0' ";
                }else{
             $sql_vt = "SELECT * FROM vacations_type_tbl where  (vacation_gender='all_gender' or vacation_gender='female_gender')  AND vacations_type_id='".$row_v_w["vacations_type_id"]."' and deleted='0' ";
                }
                    $result_vt = $conn->query($sql_vt);
                   if ($result_vt->num_rows > 0) {
                    $response = array();
                     while($row_vt = $result_vt->fetch_assoc()) {  

             if($lang=='ar'){$vac_name=$row_vt["vacation_name_ar"];}else{$vac_name=$row_vt["vacation_name_en"];}

             $a[] = array(
                'success' => true,
                'vacations_type_id' => $row_vt["vacations_type_id"],
                'vacation_name_ar' => $row_vt["vacation_name_ar"],
                'vacation_name_en' => $row_vt["vacation_name_en"],
              
            );

       }} }
       $response = [
        'success' => true,
        'data' => $a,
    ];
    }else{
        $a = array();
        $response = [
            'success' => true,
            'msg' => "not found",
            'data' => $a,
        ];
       } 
//

echo json_encode($response, JSON_UNESCAPED_UNICODE);
?>