array( 'method' => 'DELETE' ) )) );
//}
$data = [
'id' => $nomor,
'isLegacy' => false,
];
/**
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $base_url.':8000/session/add',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query($data),
]);
$response = curl_exec($curl);
*/
$postData = http_build_query($data);
$opts = ['http' =>
[
'method' => 'POST',
'ignore_errors' => true,
'header' => 'Content-Type: application/x-www-form-urlencoded',
'content' => $postData
]
];
$context = stream_context_create($opts);
$response = file_get_contents($base_url.':8000/session/add', false, $context);
$decodedResponse = json_decode($response, true);
$resultQR = "";
if(isset($decodedResponse['success'])){
$success = (bool) $decodedResponse['success'];
$msg = $decodedResponse['message'];
if($success){
$base64QR = $decodedResponse['data']['qr'];
$resultQR = "status : $success, pesan : $msg"."
"."";
}
}else{
$resultQR = $response.' '.'Tidak dapat terhubung dengan API';
}
}
?>
| No. | Nomor | Hapus |
|---|---|---|
| $no | $val | $btnHapusSesi |