//echo get("View");
$que='';
$total_groups='';
$get_total_rows = 0;
$items_per_group = 6;
if (get("View")!= "")
$_SESSION["List"] = get("View") ;
$View = $_SESSION["List"];
if ($View=="") $View='G';
$lang = get("lang");
$sword = get("word");
$stype = get("type");
$prod_cat = get("cat");
$prod_scat = get("scat");
$desc = get("desc");
$lang = getValue("select cat_lang from category where cat_id=$prod_cat");
if ($sword =="")
{
if (get("lang")!="" && $lang!=get("lang"))
{
$prod_cat = getValue("select cat_title_h from category where cat_id=$prod_cat");
$desc = getValue("select cat_title from category where cat_id=$prod_cat");
$lang = getValue("select cat_lang from category where cat_id=$prod_cat");
}
}
$addque = " or extra IN ('". $prod_cat ."') ";
$que="select * from products prd where prd.prod_cat = '". $prod_cat ."' AND prod_subcat='". $prod_scat ."' and prod_active=1 order by prod_seq, prod_isbn, prod_name";
if ($prod_scat == 0) $que="select prd.*, sc.subcat_title from products prd left join subcategory sc on prd.prod_subcat = sc.subcat_id and prd.prod_cat = sc.cat_id where prd.prod_cat = '". $prod_cat ."' and prod_active=1 order by sc.subcat_title, prod_seq, writer_e, prod_name";
if (get("new") == 1) $que = "select * from products prd where prd.prod_new = 1 and prod_active=1 order by prod_seq, writer_e, prod_name";
if (get("hot") == 1) $que = "select * from products prd where prd.prod_hot = 1 and prod_active=1 order by prod_seq,writer_e, prod_name";
if (get("spec") == 1) $que = "select * from products prd where prd.prod_special = 1 and prod_active=1 order by prod_seq,writer_e, prod_name";
if (get("forthc") == 1) $que = "select * from products prd where prd.prod_forthc = 1 and prod_active=1 order by prod_seq,writer_e, prod_name" ;
if (get("best") == 1) $que = "select top 20 * from products prd order by prod_rate-prod_sprate desc, prod_code,writer_e, prod_name";
if (get("auth") <> "") $que = "select * from products prd where writer_e = '". get("auth") ."' and prod_active=1 order by prod_seq,writer_e, prod_name";
if ($sword <> "")
{
$addque = " where prod_store=$StoreId and (prod_code like '%" . $sword . "%'";
$addque = $addque . " OR prod_name_e like '%" . $sword . "%'";
$addque = $addque . " OR prod_name like '%" . $sword . "%'";
$addque = $addque . " OR prod_ISBN like '%" . $sword . "%'";
//$addque= $addque . " OR prod_publisher like '%" . $sword . "%'";
$addque = $addque . " OR writer_e like '%" . $sword . "%')";
if ($lang !="")
$addque .= " and prod_type='$lang'";
//$addque = $addque . " OR prod_year like '%" . $sword . "%' or prod_publisher like '%" . $sword . "%' or prod_ISBN like '%" . $sword . "%' or prod_name_e like '%" . $sword . "%' or writer_e like '%" . $sword . "%'";
if ($prod_cat != "") $addque = $addque . " and prod_cat= '". $prod_cat."' ";
$que="select * from products prd " . $addque . " and prod_active=1 order by prod_seq, writer_e, prod_name";
}
//echo $que;
$disp = "none";
$result = mysql_query($que);
$total_books = mysql_num_rows($result);
$total_groups= ceil($total_books/$items_per_group);
$total_groups;
//$total_groups= ceil($total_books/$items_per_group);
// $View_Class="layout-list";
//if ($View=="G") $View_Class="row add-clearfix";
?>
echo getBanner($StoreId,$page,"Main") ?>
if ($total_books > 0)
{
$disp = "block";
$msg="";
}
else
{
$msg = "
No books found.";
}
?>
if ($total_books == 300 && $sword != "")
echo "Please refine your search. we found more matching with the given keyword.
";?>
Total echo $total_books?> echo get("desc") ?> echo get("word") ?> showing
if ($total_books > 6){?>
}?>