runQuery($sQuery0); $iFilteredTotal = $db->dbRows(); $result = $db->runQuery($sQuery0.$sLimit); /* Total data set length */ $sQuery2 = " SELECT COUNT(tj.id) as total FROM $sTable $where2 "; $db->runQuery($sQuery2); $aResultTotal = $db->dbFetch(); $iTotal = $aResultTotal['total']; /*$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or fatal_error( 'MySQL Error: ' . mysql_errno() ); $aResultTotal = mysql_fetch_array($rResultTotal); $iTotal = $aResultTotal[0];*/ /* * Output */ $output = [ 'sEcho' => intval($_GET['sEcho']), 'iTotalRecords' => $iTotal, 'iTotalDisplayRecords' => $iFilteredTotal, 'aaData' => [], ]; while ($aRow = $db->dbFetch($result)) { //print_r($aRow); $row = []; $tujuan = ''; if ($aRow['publish'] == 'N') { $publish = ' -draft '; $terbit = '
  • Terbitkan
  • '; $tombol = 'btn-warning'; } else { $publish = ''; $terbit = ''; $tombol = 'btn-primary'; } $row[0] = $aRow['nmLengkap'].' ('.$aRow['nim'].')'.$publish; $row[1] = '['.strtoupper($aRow['jenis']).'] '.$aRow['judul']; $row[2] = tanggalIndo($aRow['start'], 'j F Y H:i'); $jenisSidang = $aRow['jenis']; $btnLihatBerkas = ''; switch ($jenisSidang) { case 'Sidang': $btnLihatBerkas = '
  • Lihat Berkas
  • '; break; case 'SidHas': $btnLihatBerkas = '
  • Lihat Berkas
  • '; break; case 'Outline': $btnLihatBerkas = '
  • Lihat Berkas
  • '; break; } $tombolaksi = '
    '; $row[3] = $tombolaksi; $output['aaData'][] = $row; // print_r($row); } echo json_encode($output);