runQuery($sQuery0);
$iFilteredTotal = $db->dbRows();
$result=$db->runQuery($sQuery0.$sLimit);
/* Total data set length */
$sQuery2 = "
SELECT COUNT(tp.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 = array(
"sEcho" => intval($_GET['sEcho']),
"iTotalRecords" => $iTotal,
"iTotalDisplayRecords" => $iFilteredTotal,
"aaData" => array()
);
while ( $aRow = $db->dbFetch($result) )
{
//print_r($aRow);
$row = array();
if($aRow['new']==0){
$badge=' - Baru';
}else{
$badge='';
}
$row[0]="".$aRow['judul']."".$badge;
$row[1]=tanggalIndo($aRow['tgl'],'j F Y, H:i');
$output['aaData'][] = $row;
// print_r($row);
}
echo json_encode( $output );
?>