Execute($SQL);
if ($RS->fields["newsid"] != "")
{ $total_jumlah_record = $RS->RecordCount();
$num = $total_jumlah_record ;
$page = isset($_GET['page']) && intval($_GET['page']) >= 1 ? intval($_GET['page']):1;
$perpage = 15;
$param = '';
$pagination = paging($perpage, $num, $page, $param);
$total_jumlah_page = ceil(($total_jumlah_record)/$conf["page"]);
$teks_parameter = "";
if ($page != 0 ) {
if ($page > $total_jumlah_page) $page=$total_jumlah_page;
//$pagination = pagination($page, $total_jumlah_page, $teks_parameter);
$SQL = "SELECT *
FROM modnews
ORDER BY newsid DESC
LIMIT ".$pagination['from'].", ".$perpage."";
$RS = $db->Execute($SQL);
$i=0;
while (!$RS->EOF) {
$list_images[$i] = '';
if( $RS->fields["mainimagename"] != '' && file_exists('upload/thumb_'. $RS->fields["mainimagename"]) )
{
$list_images[$i] = '

';
}
$list_newsid[$i] = $RS->fields["newsid"];
$list_newstitle[$i] = $RS->fields["newstitle_en"];
$list_newsopen[$i] = $RS->fields["newsopen_en"];
$datenow = strtotime($RS->fields["timestamp"]);
$datenow = date('d', $datenow) .' '. $montharr[intval(date('n', $datenow))].' '.date('Y', $datenow);
$list_timestamp[$i] = $datenow ;
$RS->MoveNext();
$i++;
}
} else $msg = "Sorry, There is no record in our database
";
} else
{
echo'
Sorry, There is no record in our database.
Home
';
}
//****** Tampilan News
if ($msg == "") {
echo "
";
if($num>0)
{
//echo "
" . $pagination["halaman_first"] . $pagination["halaman_next"] . $pagination["halaman_content"] . $pagination["halaman_prev"] .$pagination["halaman_last"]."
";
echo '
'.$pagination['first'].$pagination['prev'].''.$pagination['page'].''.$pagination['next'].$pagination['last'].'
';
}
}
}
} else {
//*** MAIN CODE
$x = $_GET["detail"];
$x = $crypt->decrypt($x);
$SQL = "SELECT *
FROM modnews
WHERE newsid = '".$x."'
ORDER BY newsid DESC";
$RS =$db->Execute($SQL);
$list_images = '';
if( $RS->fields["mainimagename"] != '' && file_exists('upload/thumb_'. $RS->fields["mainimagename"]) )
{
$list_images = '

';
}
$list_newsid = $RS->fields["newsid"];
$list_newstitle = $RS->fields["newstitle_en"];
$list_newsopen = $RS->fields["newsopen_en"];
$list_newsdescription = $RS->fields["newsdescription_en"];
$datenow = strtotime($RS->fields["timestamp"]);
$datenow = date('d', $datenow) .' '. $montharr[intval(date('n', $datenow))].' '.date('Y', $datenow);
$list_timestamp = $datenow;
$SQL1 = "SELECT *
FROM modnews
WHERE newsid != '".$x."'
ORDER BY newsid DESC LIMIT 5";
$RS1 = $db->Execute($SQL1);
$i=0;
while (!$RS1->EOF) {
$temp_newsid[$i] = $RS1->fields["newsid"];
$temp_newstitle[$i] = $RS1->fields["newstitle_en"];
$datenow = strtotime($RS1->fields["timestamp"]);
$datenow = date('d', $datenow) .' '. $montharr[intval(date('n', $datenow))].' '.date('Y', $datenow);
$temp_timestamp[$i] = $datenow ;
$RS1->MoveNext();
$i++;
}
//*** Tampilan
if (($RS->fields["newsid"]) != "") {
echo "
";
echo "".$list_timestamp." |
";
echo "".$list_newstitle." |
";
echo " |
";
echo "".$list_images . html_entity_decode($list_newsdescription)." |
";
echo " |
";
echo "[ Kembali ] |
";
echo " |
";
echo "
";
}
if (($temp_newsid[0]) != "") {
echo '
----------------------------------------------------------------
';
echo "
";
echo "Berita lain: ";
}
}
?>