<?
//***************************************************
// http://www.niadesain.com
// Solusi Hemat Script Bisnis Online Anda
// Menerima Jasa Pembuatan Website & Template Website
//***************************************************
?>
<?
echo "<div class='media accordion-inner'>";
$batas   = 25;
//$halaman = $_GET['halaman'];
$halaman = isset($_GET['halaman']) ? $_GET['halaman'] : null;
if(empty($halaman)){
	$posisi  = 0;
	$halaman = 1;
}
else{
	$posisi = ($halaman-1) * $batas;
}

$db->select("id, nama, idmitra, kota, propinsi, hubungan, foto", "member", "hubungan<>'' and foto<>''", "id desc LIMIT $posisi,$batas");

if($db->num_rows() > 0) {
	//echo $db->result(0, "maintext");
	while($row = $db->fetch_row()) {
	$adafoto = $row[4];
	    echo "<table>";
	    echo "<tr><td>";

                echo "<font color='#282D3A'>$row[3] - $row[4]</font>";
		echo "<div class='isi'><font color='#282D3A'><h4><a href='#'><font color='#ff6700' class='judulberita'>$row[1], $row[2]</font></a></h4></font></div>";
		
		if ($adafoto !=''){
		echo "<div class='pull-left'><a href='#'><img class=user-image img-responsive src=member/images/".$row[6]." width=45 height=45 hspace=0 border=1 align=left title='$row[1]'></a><img class='img' src='images/news/awblank.png' width=15 height=45 align=left></div>";
		}
		else
		{
		echo "<div class='pull-left'><a href='#'><img class=user-image img-responsive src=member/images/no_avatar.gif width=45 height=45 hspace=0 border=1 align=left title='$row[1]'></a><img class='img' src='images/news/awblank.png' width=15 height=45 align=left></div>";
		}

		// Tampilkan hanya sebagian isi berita
  	  	$isi_berita = nl2br($row[5]);
        	$isi = substr($isi_berita,0,200); // ambil sebanyak 200 karakter
                //$isi = substr($isi_berita,0,strrpos($isi," ")); // spasi antar kalimat
		echo "<div class='media-body'><div align=left><font color='#282D3A'>$isi</font></div></div>";
		echo "</td></tr></table>";
		echo "<div><hr width=100% size=1 color=#CCCCCC></div>";
			}
} else {
	echo "<p>&nbsp;</p><p align=left class='isi'>Maaf belum ada testimoni untuk ditampilkan...</p><p>&nbsp;</p>";
}

$tampil2 = mysql_query("SELECT * FROM member where hubungan<>'' and foto<>''");
$jmldata = mysql_num_rows($tampil2);
$jmlhal  = ceil($jmldata/$batas);
echo "<div class=paging>";
echo "</div>";

if($halaman > 1){
	$prev=$halaman-1;
	echo "<span class=prevnext><a href=$_SERVER[PHP_SELF]?scrindo=testimonialmitralist&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]?scrindo=testimonialmitralist&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]?scrindo=testimonialmitralist&halaman=$next&id=$id>Next</a></span>";
}
else{
	echo "<span class=disabled>Next</span>";
}
echo "</div>";
echo "<div class='media accordion-inner'>";
echo "Total testimoni <strong><font color=#ff6700>". strtolower($set_bisnis) ."</font></strong> ada : <b>$jmldata</b>";
echo "<br>";
echo "Ket : Testimoni yang ditampilkan hanya member yang sudah ada foto profilnya.";
echo "<br><font color=#ffffff>design by $set_develop</font>";
echo "</div>";
echo "</div>";
?>