do_query($sql); if($mysql->rownum){ $row=$mysql->do_fetch_row(1); $whereAry[]=" a.brandid='$bid' "; $sortname="品牌:".$row["brandname"]; $header_title[] = $row["brandname"]; $url_formate[] = "bid"; $url_formate[] = $bid; } } if(!empty($_GET["pid"])){ $pid=intval($_GET["pid"]); if(isset($my_proSortAry[$pid])){ $sortname=$my_proSortAry[$pid]; $whereAry[]=" a.sortid='$pid' "; $header_title[] = $sortname; $url_formate[] = "pid"; $url_formate[] = $pid; } else{ page_redirect("未找到该信息!请正确输入!",__dir_rel_web); exit; } } if(empty($_GET['pid']) && empty($_GET['bid'])){ $url_formate[] = "pid"; $url_formate[] = 0; } /* if(!empty($_GET["flag"])){ switch($_GET["flag"]){ case "istuijian": $sortname="推荐产品"; $whereAry[]=" a.isjingpin='Y' "; break; case "isnew": $sortname="新品展示"; $whereAry[]=" a.isnew='Y' "; break; case "ishot": $sortname="热门产品"; $whereAry[]=" a.ishot='Y' "; break; } } if(!empty($_GET["search"])){ $whereAry[]="(a.proname like '%".trim($_GET["search"])."%')"; $sortname="搜索:".$_GET["search"]; } */ $where=count($whereAry)>0?" where ".implode(" and ",$whereAry):""; $perpage=25; $p_no=empty($_GET["p"])?1:(int)$_GET["p"]; if(empty($p_no))$p_no=1; $limit=" limit ".($p_no-1)*$perpage.",".$perpage; $order=" order by pos asc,id desc "; $strSQL="select id,proname,model,mprice,price,wholeprice,isShowPrice,unit from [#TAB]product as a ".$where.$order.$limit; //echo $strSQL; $mysql->do_query($strSQL); $productAry=$imgid=array(); for($i=0;$i<$mysql->rownum;$i++){ $row=$mysql->do_fetch_row(1); $row["cut_name"]=cnSubStr($row["proname"],14,true); $productAry[]=$row; if(!in_array($row["id"],$imgid))$imgid[]=$row["id"]; } $smarty->assign("productAry",toErWeiAry($productAry,5)); include("./getimg.php"); $page=new Page($perpage,false); $page->css="newsPagelink"; $page->pageformat="%s"; $page->currentformat="%s"; $url_formate[] = '%s'; $page->is_rewrite = true; $page->url_formate = implode("-",$url_formate).".html"; $strSQL="select count(a.id) from [#TAB]product as a {$where}"; $page->setPageSQL($strSQL); $smarty->assign("page_html",$page->showPage($p_no,rebuild_query_string("p"),'p',true,true,2)); $smarty->assign("cat_name",$sortname); $smarty->assign("cfg_web_title",implode("_",array_reverse($header_title))); smarty_end($smarty,$tpl,$cacheId); include("./include/footer.php"); ?>