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 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='Videos' and url!='' and video_thumb_code!='' and status='1' order by id desc)order by id desc ");
echo mysql_num_rows($sel_cate);
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 type='Videos' and category_name='$cate_id' and status='1' order by id desc limit 1");
$tot_video = mysql_num_rows($sel_image);
$img_details = mysql_fetch_assoc($sel_image);
$type=$img_details['type'];
$subtype= $img_details['subtype'];
$url = $img_details['url'];
$video_thumb_code = $img_details['video_thumb_code'];
?>
} ?>
} else { ?>
if($num_rows ==0) { echo ' No Data Found!!!';} if($num_rows >12) { echo $pagination;} ?>
} ?>