:: Gallery | Lorena Karina ::'; }else{ echo ':: Galeri | Lorena Karina ::'; } ?>
'; }else{ echo 'FOTO GALLERY'; } ?>

GALLERY PHOTO
 


$i"; } } $html = ''; if ($totalpages <= 10) { for ($i=1; $i<=$totalpages; $i++) { if($current_page == $i){ $html .= ' '.$i; } else { $html .= ' '.$i.' '; } } } else if ($totalpages > 10 && $difference < 5) { $html .= ' 1 ... '; for ($i=($totalpages-5); $i<=$totalpages; $i++) { if($current_page == $i){ $html .= $i; } else { $html .= ' '.$i.' '; } } } else if ($totalpages > 10) { if ($current_page < 6) { for ($i=1; $i<7; $i++) { if($current_page == $i){ $html .= $i; } else { $html .= ' '.$i.' '; } } $html .= ' ... '.$totalpages.''; } else { $html = ' 1 ... '; for ($i=$low_range; $i<$high_range; $i++) { if($current_page == $i){ $html .= $i; } else { $html .= ' '.$i.' '; } } $html .= ' ... '.$totalpages.''; } } if ($current_page == 1) { $previous_page = ' < '; $first_page = ' << '; } else { $previous_page = ' < '; $first_page = ' << '; } if ($current_page == $totalpages) { $next_page = ' > '; $last_page = ' >> '; } else { $next_page = ' > '; $last_page = ' >> '; } $from = intval(($current_page-1)*$itemperpage); $ret['prev'] = $previous_page; $ret['first'] = $first_page; $ret['next'] = $next_page; $ret['last'] = $last_page; $ret['page'] = $html; $ret['from'] = $from; return $ret; } $catid = isset($_GET['c']) && intval($_GET['c'])>0 ? intval($_GET['c']) : 0; $galleryid = isset($_GET['i']) && intval($_GET['i'])>0 ? intval($_GET['i']) : 0; $norecords = $_SESSION['lang'] != '_en' ? 'Maaf belum ada data di dalam database.' : 'Sorry, there is no records in database.'; $halaman = $_SESSION['lang'] != '_en' ? 'Halaman' : 'Page'; if($galleryid>0) { $sql = 'SELECT * FROM `tgallery_main` where catid=\''.$catid.'\' AND galleryid=\''.$galleryid.'\' order by galleryid desc limit 0, 1;'; $res = mysql_query($sql); $num = mysql_num_rows($res); if($num>0) { $row = mysql_fetch_assoc($res); } } elseif ($catid>0) { $sql = 'SELECT `galleryid` FROM `tgallery_main` where catid=\''.$catid.'\' order by galleryid desc '; $res = mysql_query($sql); $num = mysql_num_rows($res); $page = isset($_GET['page']) && intval($_GET['page']) >= 1 ? intval($_GET['page']):1; $perpage = 15; $param = 'c='.$catid; $pagination = paging($perpage, $num, $page, $param); if($num>0) { echo '

'.$halaman.':
'.$pagination['first'].$pagination['prev'].$pagination['page'].$pagination['next'].$pagination['last'].'

'; } echo ''; $sql = 'SELECT * FROM `tgallery_main` where catid=\''.$catid.'\' order by galleryid desc limit '.$pagination['from'].', '.$perpage.';'; $res = mysql_query($sql); $num = mysql_num_rows($res); if($num>0) { $jcol = 3; $wcol = round(100/$jcol).'%'; $i=0; while($row = mysql_fetch_assoc($res)) { if($i==0) { echo ''; } ?> '; $i=0; } } if($i>0) { for($i=$i; $i<$jcol;$i++) { echo ''; } echo ''; } for($i=$num; $i < 7; $i++) { echo ''; } } else { echo ''; } echo '

 
'.$norecords.'
'; if($num>0) { echo '

'.$halaman.':
'.$pagination['first'].$pagination['prev'].$pagination['page'].$pagination['next'].$pagination['last'].'

'; } } else { $sql = 'SELECT * FROM `tgallery_cat` order by catid desc;'; $res = mysql_query($sql); $num = mysql_num_rows($res); echo ''; if($num >0) { $jcol = 2; $wcol = round(100/$jcol).'%'; $i=0; while($row = mysql_fetch_assoc($res)) { if($i==0) { echo ''; } ?> '; $i=0; } } if($i>0) { for($i=$i; $i<$jcol;$i++) { echo ''; } echo ''; } for($i=$num; $i < 7; $i++) { echo ''; } } else { echo ''; } echo '
Image


 
'.$norecords.'
'; } ?>