function xhr_4post($url,$data){
global $ar,$db;
$dt=[];
$headers = [
'Content-Type: application/json',
'accept-encoding: gzip',
'host: api-petugas.haji.go.id',
'origin: https://petugas.haji.go.id',
'referee: https://petugas.haji.go.id',
'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW0iOiJhcHBfcGV0dWdhcyIsInN1YiI6IjNlMjVmMDc2LTNlYzgtNGMyOS04Njg0LTkzMGYzNTBmMzdiNiIsImlzcyI6IjJZdHhQVW8xY0FRRjNydkZLdm5kYklNWlV1RXpRU1dvIiwiZXhwIjoxNzg3NjU5NDAzLCJyb2wiOnt9fQ.9fHvoqzyqdqcSgC4v-nG59A1do86h5bPPrs42jtUhrw',
'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36',
'sec-fetch-dest: empty',
'sec-fetch-mode: cors',
'sec-fetch-site: same-site',
'Accept: application/json'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
if (curl_errno($ch)) {
$dt['message']=curl_error($ch);
} else {
$dt['success']=true;
$dt['response']=$response;
}
curl_close($ch);
return $dt;
}