<?php
/**
 * 金戈企业建站系统：产品显示
 *
 *
 * @name 
 * @author 烟鬼 QQ:460874 Email:460874@qq.com
 * @version 0.1  $id  cp.php
 * @copyright Copyright (c) 2007 - 2008 烟鬼
 */

require('header.php');

$cp_id = $_GET['cp_id'];

$cp_id = my_yz($cp_id);

if (!is_numeric($cp_id)) 
{
     er(nonr);
     exit;
}

//根据产品ID取出产品的内容 等同于'SELECT * FROM cp_cp(表) where cp_id(字段) ='.$cp_id(值)
$cp = root_alli(cp_cp,cp_id,$cp_id);
if ($cp) 
{
     $cp = setassoc($cp);
}
else 
{
	$nochanpin = NOCP;
}
//取出所有的产品分类
$cp_class = root_all(cp_class);
if ($cp_class) 
{
     $cp_class = setarray($cp_class);
}


//将需要显示的变量传递给模板
$smarty->assign('cp',$cp);
$smarty->assign('nocp',$nochanpin);
$smarty->assign('cp_class',$cp_class);
$smarty->display('chanpin.html');

require('footer.php');

?>