session_start();
header('Content-Type: text/html; charset=gb2312');
require "../inc/global.php";
require "../inc/function.php";
$pageID = empty($_REQUEST["pageID"]) ? 30 : $_REQUEST["pageID"];
$db=new db();
$sql="( SELECT cy_product.ID,cy_product.XKMQ,cy_product.XKBM,cy_product.price,cy_product.spec, cy_product.spec_date1, cy_product.spec_date2, cy_product.img_path, cy_product.kick,cy_product.keyword,cy_product.tao_url,cy_product.only_spec, cy_productinfo.text
FROM cy_product
LEFT JOIN cy_productinfo ON ( cy_product.XKBM = cy_productinfo.xh AND cy_productinfo.kind = 2 )
WHERE cy_product.ID = ".$_REQUEST["n"]." )
UNION ALL (
SELECT cy_product.ID,cy_product.XKMQ,cy_product.XKBM,cy_product.price,cy_product.spec, cy_product.spec_date1,cy_product.spec_date2,cy_product.img_path,cy_product.kick,cy_product.keyword,cy_product.tao_url,cy_product.only_spec, cy_productinfo.text
FROM cy_product
LEFT JOIN cy_productinfo ON ( cy_product.XKBM = cy_productinfo.xh AND cy_productinfo.kind = 4 )
WHERE cy_product.ID = ".$_REQUEST["n"]." )
UNION ALL (
SELECT cy_product.ID,cy_product.XKMQ,cy_product.XKBM,cy_product.price,cy_product.spec, cy_product.spec_date1,cy_product.spec_date2, cy_product.img_path, cy_product.kick,cy_product.keyword,cy_product.tao_url,cy_product.only_spec, cy_productinfo.text
FROM cy_product
LEFT JOIN cy_productinfo ON ( cy_product.XKBM = cy_productinfo.xh AND cy_productinfo.kind = 10 )
WHERE cy_product.ID = ".$_REQUEST["n"]." )";
$query = $db->query($sql);
$i = 0;
$IP = $db -> check_ip($_SERVER['REMOTE_ADDR']);
while($forum = $db->fetch_array($query)) {
$product[$i]['ID']=$forum['ID'];
$product[$i]['XKMQ']=$forum['XKMQ'];
$product[$i]['XKBM']=$forum['XKBM'];
$product[$i]['text']=html_entity_decode($forum['text'],ENT_QUOTES);
$product[$i]['kick']=$forum['kick'];
if ($IP != "ok") { $price = 0;} else { $price = $forum['price'];}
$product[$i]['pro_new'] = empty($forum['pro_new'])? "" : "";
$product[$i]['price'] = show_spec($price,$forum['only_spec'],$forum['spec'],$forum['spec_date1'],$forum['spec_date2']);
$product[$i]['shopcard']= ($price == 0 || $_SESSION["checkout"]=="on")? "": "";
$product[$i]['img_path'] = $forum['img_path'];
$product[$i]['keyword'] = $forum['keyword'];
$product[$i]['tao_url'] = empty($forum['tao_url'])? "" : " ";
$i++;
}
$img_path=explode(";",$product[0]['img_path']);
if (file_exists("images/".$img_path[0])==1){
$jpgsize=GetImageSize("images/".$img_path[0]);
if (($jpgsize[0]/$jpgsize[1]) > 1.2) {
$newjpg=(650/$jpgsize[0]);
$img1 = "
|
";
} else {
$newjpg=(300/$jpgsize[0]);
$img1 = "
| ";
}
}
if($product[1]['text']==""){$cs="暂无参数";} else { $te=explode("@",$product[1]['text']);
if (count($te)==1) { $cs=$product[1]['text']; } else {
for($i=0;$i";}
}}}
if($product[2]['text']=="") { $sp2="";} else {
$sp2=" |
".$product[2]['text']." |
";
}
$img2="";
for ($i=1; $i < count($img_path)-1; $i++) { $img2 = $img2 ."".show_img($img_path[$i],"big")."
"; }
$pdf = "";
$sql="update cy_product set kick = ".($product[0]['kick'] + 1)." where ID =".$_REQUEST["n"];
$db->query($sql);
$viewdata = array("pageID" => $pageID ,
"siteinfo" => $siteinfo,
"sitename" => $sitename,
"pageID" => $pageID,
"product" => $product,
"pdf" => $pdf,
"img1" => $img1,
"img2" => $img2,
"sp2" => $sp2,
"cs" => $cs,
"gsmq" => $_REQUEST['gsmq'],
"xlno" => $_REQUEST['xlno'],
"urlto" => $_REQUEST['urlto'],
"xh" => $product[0]['XKBM'],
"menu" => showmenu($pageID)
);
$tplname= CModel($_SERVER["SCRIPT_NAME"]);
callview($viewdata,$tplname);
?>