ob_start();
ob_clean();
session_start();
include 'dilg/cnt/join.php';
extract($_REQUEST);
include "pagination/pagination.php";
$entries_per_page=12;
$page = (isset($_GET['page'])?$_GET['page']:1);
$result = mysql_query("SELECT * from category where status='1' and id in (SELECT category_name FROM gallery_images where type='Photos' and image!='' and status='1' order by id desc)order by id desc");
$num_rows = mysql_num_rows($result);
$total_pages = ceil($num_rows/$entries_per_page);
$pagination = pagination_six($total_pages,$page);
$offset = (($page * $entries_per_page) - $entries_per_page);
?>
$Pagename=basename($_SERVER['PHP_SELF']); ?>
$sel_cate = mysql_query("SELECT * from category where status='1' and id in (SELECT category_name FROM gallery_images where type='Photos' and image!='' and status='1' order by id desc)order by id desc limit $offset,$entries_per_page");
if(mysql_num_rows($sel_cate)>0)
{
?>
$i=0;
while($cate_details = mysql_fetch_assoc($sel_cate))
{
$i=$i+1;
$cate_id = $cate_details['id'];
$cate_name = $cate_details['category_name'];
$sel_image = mysql_query("select * from gallery_images where category_name='$cate_id' and type='Photos' and image!='' and status='1' order by id desc limit 1");
$tot_imgs = mysql_num_rows($sel_image);
$img_details = mysql_fetch_assoc($sel_image);
//echo $img_details['Image'];
if($tot_imgs != '0')
{
if($img_details['image']!='')
{
$large_image=eregi_replace('gallery-images/','',$img_details['image']);
if(file_exists('uploads/gallery-images/400-'.$large_image))
{
$thumbnail_image='uploads/gallery-images/400-'.$large_image;
}
else
{
$thumbnail_image='uploads/gallery-images/'.$large_image;
}
}
}
?>
} ?>
} ?>
if($num_rows ==0) { echo ' No Data Found!!!';} if($num_rows >12) { echo $pagination;} ?>