<?php
	!defined('DIRCMS_MANAGE') && exit('Access Denied!');
	if(!$module->roleid_check('yp',$_roleid))showmsg_nourl($lang['RETURN_NOPRI']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>产品信息管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" href="admin/template/css/style.css" />
<script type="text/javascript" src="images/js/jquery.min.js"></script>
<script language="javascript" src="admin/template/js/css.js"></script>
<script src="images/js/check.func.js"></script>
<script language="javascript" type="text/javascript">
	$(document).ready(function(){
		checkForm(0);
		$('#typeid').val('<?php echo $productinfo['typeid'];?>');
	});
</script>
</head>
<body>
<div id="wrap">
	<div class="tab">
		<ul>
			<li><a href="?file=yp&mod=yp&action=product&ypid=<?php echo $productinfo['ypid'];?>">产品管理</a></li>
			<li><a href="javascript:void(0);" class="on">编辑产品</a></li>	
		</ul>
	</div>
	<div class="main">
	<fieldset>
		<legend><?php echo $lang['RETURN_TIPS'];?></legend>
		1：产品信息标题不能为空
	</fieldset>
	<form action="" method="post" name="myform">
	<input type="hidden" name="do_submit" value="1" />
	<input type="hidden" name="id" value="<?php echo $id;?>" />
	<input type="hidden" name="info[ypid]" value="<?php echo $productinfo['ypid'];?>" />
	<table cellspacing="0" class="sub" width="98%">
		<tr>
			<td width="201" align="right">产品分类：</td>
			<td width="1084">
			<select name="info[typeid]" id="typeid">
				<option value="0">不限分类</option>
				<?php 
				$r=$yp->producttype($productinfo['ypid'],0);
				foreach($r as $_r)
				{
				?>
				<option value="<?php echo $_r['id'];?>"><?php echo $_r['name'];?></option>
				<?php
					$r=$yp->producttype($productinfo['ypid'],$_r['id']);
					foreach($r as $_r)
					{
				?>
				<option value="<?php echo $_r['id'];?>">|-<?php echo $_r['name'];?></option>
				<?php	
					}
				}
				?>
			</select>
		  </td>
		</tr>
		<tr>
			<td width="201" align="right">产品名称：</td>
			<td width="1084">
			<input type="text"  name="info[title]" value="<?php echo $productinfo['title'];?>" datatype="limit" min="1" max="100" size="40" />
		  </td>
		</tr>
		<tr>
			<td width="201" align="right">产品关键字：</td>
			<td>
			<input type="text" size="40" datatype="max" max="100" value="<?php echo $productinfo['keywords'];?>" name="info[keywords]" />
			<span>多个关键字用,隔开</span>
			</td>
		</tr>
		<tr>
			<td width="201" align="right">产品缩略图：</td>
			<td>
			<?php echo $form->image('thumb',$productinfo['thumb']);?>
			</td>
		</tr>
		<tr>
			<td width="201" align="right">计量单位：</td>
			<td>
			<input type="text" size="6" value="<?php echo $productinfo['unit'];?>" onchange="$('.unitspan').html($('#unit').val());" name="info[unit]" id="unit" />
			</td>
		</tr>
		<tr>
			<td width="201" align="right">原价：</td>
			<td>
			<input type="text" size="10" value="<?php echo $productinfo['market_price'];?>" datatype="number"  name="info[market_price]" /> 元/<span class="unitspan">件</span>
			</td>
		</tr>
		<tr>
			<td width="201" align="right">折扣价：</td>
			<td>
			<input type="text" size="10" value="<?php echo $productinfo['price'];?>" datatype="number"  name="info[price]" /> 元/<span class="unitspan">件</span>
			</td>
		</tr>
		<tr>
			<td width="201" align="right">Description：</td>
			<td>
			<textarea rows="5" cols="60" name="info[description]"><?php echo $productinfo['description'];?></textarea>
			</td>
		</tr>
		<tr>
			<td width="201" align="right" valign="top">产品信息内容：</td>
			<td>
			<?php echo $form->fckeditor('content',$productinfo['content']);?>
			</td>
		</tr>
		<tr class="bg2"><td></td><td><input type="button" class="button" onclick="doSubmit(this);" value="保存产品" /> <input type="button" class="button" onclick="window.location.href='<?php echo ADMIN_FILE;?>?file=yp&mod=yp&action=product&ypid=<?php echo $ypid;?>'" value="取消返回" /></td></tr>
	</table>
	</form>

	</div>
</div>
</body>
</html>