Skip to content

Instantly share code, notes, and snippets.

@vbcupu
Last active February 26, 2021 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vbcupu/3576533c1d505c67334c31d19670519b to your computer and use it in GitHub Desktop.
Save vbcupu/3576533c1d505c67334c31d19670519b to your computer and use it in GitHub Desktop.
<?php
date_default_timezone_set('Asia/Jakarta');
$Xrsid = ""; //koders
$Xpass = ""; //password sirs
$currentDate = time();
$now = new DateTime();
$unixTime = $now->getTimestamp();
$url = "http://sirs.kemkes.go.id/fo/index.php/Fasyankes";
$header = array('X-rs-id:'.$Xrsid, 'X-Timestamp:'.$unixTime, 'X-pass:'.$Xpass);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
//print_r($output);
// die();
$data = json_decode($output);
$data = $data->fasyankes;
$i = 0;
echo "<html>";
echo "<head>";
echo '<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">';
echo "</head>";
echo "<body>";
echo '<table class="table"><thead><tr><th>IdTT</th><th>TT</th><th>RUANG</th><th>KODE SIRANAP</th><th>JUMLAH RUANG</th><th>TERPAKAI</th><th>PREPARE</th><th>PREPARE PLAN</th><th>KOSONG</th><th>COVID</th><th>ID_TT</th></tr></thead><Tbody>';
foreach($data as $row){
echo '<TR>';
echo '<td>'.$row->id_tt.'</td>';
echo '<td>'.$row->tt.'</td>';
echo '<td>'.$row->ruang.'</td>';
echo '<td>'.$row->kode_siranap.'</td>';
echo '<td>'.$row->jumlah_ruang.'</td>';
echo '<td>'.$row->terpakai.'</td>';
echo '<td>'.$row->prepare.'</td>';
echo '<td>'.$row->prepare_plan.'</td>';
echo '<td>'.$row->kosong.'</td>';
echo '<td>'.$row->covid.'</td>';
echo '<td>'.$row->id_t_tt.'</td>';
echo '</tr>';
}
echo '</tbody></table>';
echo "</body></html>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment