<?
//*********************************************************************************
// Original Website By : Niadesain.com Di Jual melalui http://niadesain.com
// Please Call / SMS : 081384745483 (support@niadesain.com)
// Niadesain.com - Jasa Pembuatan Website Paling Murah dan Paling Lengkap
//*********************************************************************************
?>
<style type="text/css">
<!--

.isi {
	font-family:verdana;
	font-size:11px;
	padding-left:4px;
	text-align:left;
	line-height: 16px;
}
.style1 {
	font-size: 12px;
	font-weight: bold;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #000066;
}
</style>
<div align="center">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="37"><p align="center" class="style1">KESAKSIAN MEMBER </p></td>
    </tr>
    <tr>
      <td><span class="isi">
        <?
$batas   = 5;
$halaman = $_GET['halaman'];
if(empty($halaman)){
	$posisi  = 0;
	$halaman = 1;
}
else{
	$posisi = ($halaman-1) * $batas;
}
$db->select("userid, nama, kota, testimoni, foto, published, tgl", "testimonial", "published=1", "userid desc LIMIT $posisi,$batas");
if($db->num_rows() > 0) {
	while($row = $db->fetch_row()) {
	$adafoto = $row[4];
	    echo "<table>";
	    echo "<tr><td>";
		echo "<div class='isi'><font color='#000000'>Kiriman : $row[1]</font></div>";
		echo "<div class='isi'><font color='#000000'>Kota    : $row[2]</font></div>";
		echo "<div class='isi'><font color='#000000'>Tanggal : $row[6] </font></div>";
		echo "<br>";
		if ($adafoto !=''){
		echo "<img class='img' src='foto_testimonial/".$row[4]."' width=75 height=75 hspace=10 border=0 align=left></div>";
		}
		else
		{
		echo "<div class='img'><img src='images/noimage.jpg' width=75 height=75 hspace=10 border=0 align=left></div>";
		} 
		echo "<div class='isi'><font color='#000000'>$row[3] </font></div>";
		echo "</td></tr></table>";
		echo "<div><hr width=100% size=1 color=#000000></div>";
			}	
} else {
	echo "<p>&nbsp;</p><p align=center>Belum ada Kesaksian</p><p>&nbsp;</p>";
}	
$tampil2 = mysql_query("SELECT * FROM testimonial");
$jmldata = mysql_num_rows($tampil2);
$jmlhal  = ceil($jmldata/$batas);
echo "<div class=isi>";
echo "</div>";
if($halaman > 1){
	$prev=$halaman-1;
	echo "<span class=prevnext><a href=$_SERVER[PHP_SELF]?m=testimonial&halaman=$prev&id=$id>Prev</a></span> ";
}
else{ 
	echo "<span class=disabled>Prev</span> ";
}

// Tampilkan link halaman 1,2,3 ...
for($i=1;$i<=$jmlhal;$i++)
if ($i != $halaman){
	echo " <a href=$_SERVER[PHP_SELF]?m=testimonial&halaman=$i&id=$id>$i</a> ";
}
else{
	echo " <span class=current>$i</span> ";
}

// Link kehalaman berikutnya (Next)
if($halaman < $jmlhal){
	$next=$halaman+1;
	echo "<span class=prevnext><a href=$_SERVER[PHP_SELF]?m=testimonial&halaman=$next&id=$id>Next</a></span>";
}
else{ 
	echo "<span class=disabled>Next</span>";
}
echo "</div>";
echo "<br>";
echo "<p align=center><div class='isi1'>Total : <b>$jmldata</b> Kesaksian</div></p>";
?></span></td>
    </tr>
    <tr>
      <td height="5" background="images/bgMENU.jpg"></td>
    </tr>
  </table>
  <p>&nbsp;</p>
</div>
