<?php
$data__ = array();
$sql_     = $pdo->query("SELECT * FROM tb_whatsapp WHERE tlp != '' AND send_whatsapp = 'checked'");
while($data_    = $sql_->fetch(PDO::FETCH_ASSOC))
{
    $data__[] = $data_['tlp'].'|'.$data_['nama'];
}
$nomor_whatsapp = implode(',', $data__);
?>

<?php
$sql     = $pdo->query("SELECT * FROM tb_whatsapp_skedul WHERE category = 'excel'");
$data    = $sql->fetch(PDO::FETCH_OBJ);
$scedule = $data->tanggal_skedul . ' '. $data->jam_skedul;
?>

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.fonnte.com/send',
  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 => array(
'target' => ''.$nomor_whatsapp.'',
'message' => $data->whatsapp_message,
'delay' => '0',
'schedule' => strtotime($scedule), //time
'countryCode' => '62', //optional
),
  CURLOPT_HTTPHEADER => array(
    'Authorization: ' . $data->api_key . '' //change TOKEN to your actual token
  ),
));

$response = curl_exec($curl);

curl_close($curl);
//echo $response;
$data = json_decode($response,true);

echo "<br>Detail: ". $data['detail']; 
echo "<br>Status: ". $data['process']; 

?>