<%@page contentType="text/html; charset=UTF-8"%>
<%@include file="/inc/init.jsp" %>
<%@include file="/inc/checklogin.jsp" %>
<%
Product_db pdb=new Product_db();
int productid=pu.getInt("productid");
DOC doc=pdb.getOne(productid);

DOC[] docs=null;
Product_class_db pcdb=new Product_class_db();
docs=pcdb.getListAll();
%>
<%@include file="inc/header.jsp" %>
<div id="c">
<%@include file="inc/left.jsp" %>
<div id="right">
<%@include file="inc/position.jsp" %>
<div class="right">
<div id="right_box">
<script type="text/javascript">
function checkform(){
	if(document.modifyForm.name.value==''){
		alert('产品名称不能为空！');
		document.modifyForm.name.focus();
		return false;
	}else if(document.modifyForm.classid.value==''||document.modifyForm.classid.value=='0'){
		alert('产品分类不能为空，如没有分类，请在添加分类页面添加！');
		document.modifyForm.classid.focus();
	}else if(!checknumber(document.modifyForm.sequence.value)){
		alert('产品排序必须为数字！');
		document.modifyForm.sequence.focus();
		return false;
	}else if(!checknumber(document.modifyForm.price2.value)){
		alert('价格必须为数字！');
		document.modifyForm.price2.focus();
		return false;
	}else{
		return true;
	}
}
</script>
<form method="post" name="modifyForm" action="fun/F_product.jsp"  onSubmit="return checkform();">
<input type="hidden" name="action" value="edit" />
<input type="hidden" name="productid" value="<%=productid%>" />
<div class="tags">
  <div id="tagstitle"> <a id="one1" onClick="setTab('one',1,20)" class="hover" href="#">修改产品</a> </div>
  <div id="tagscontent" class="right_box">
    <div id="con_one_1"  >
      <table width="100%" border="0" cellspacing="0" cellpadding="0" id="table1">

<tbody>

<tr>
  <td width="19%" align="right">产品名称<font color="#FF0000">*</font></td>
  <td width="1%">&nbsp;</td>
  <td width="70%">
  <input type="text" name="name" id="name" value="<%=doc.get("name") %>"  />&nbsp;</td>
</tr>
<tr>
  <td align="right">产品所属分类<font color="#FF0000">*</font></td>
  <td>&nbsp;</td>
  <td><label>
    <select name="classid" id="classid"  class="select">
    <option value="">请选择产品分类</option>
     <%
	for(int i=0;i<docs.length;i++){
	%>
    <option value="<%=docs[i].get("classid")%>" <%=docs[i].geti("classid")==doc.geti("classid")?"selected":""%>><%=docs[i].get("name")+docs[i].get("retain3")%></option>
    <%}%>
    </select>
  </label></td>
</tr>
<tr>
  <td align="right">是否推荐<font color="#FF0000">*</font></td>
  <td>&nbsp;</td>
  <td>
    <input name="isshow" type="radio" id="radio2" value="0" <%=doc.geti("isshow")==0?"checked":""%>/>
    否 
    <input type="radio" name="isshow" id="radio" value="1" <%=doc.geti("isshow")==1?"checked":""%>/>
是
	<input type="radio" name="isshow" id="radio3" value="2" <%=doc.geti("isshow")==2?"checked":""%>/>
停用(前台不显示)</label>  	
<div style="margin-top:5px;"></div>
注：(若产品分类中选择显示方式是单选按钮，则高亮闪动推荐，不选中)</td>
</tr>
<tr>
  <td align="right">产品排序<font color="#FF0000">*</font></td>
  <td>&nbsp;</td>
  <td><input type="text" name="sequence" id="sequence" value="<%=doc.geti("sequence") %>" class="input" />
    (<font color="#FF0000">数值越小，越靠前</font>) </td>
</tr>
<!--
<tr>
  <td align="right">原价</td>
  <td>&nbsp;</td>
  <td><input type="text" name="price" id="price" value="<%=doc.get("price") %>" class="input" /></td>
</tr>
-->
<tr>
  <td width="19%" align="right">价格<font color="#FF0000">*</font></td>
  <td width="1%">&nbsp;</td>
  <td width="70%">
    <input type="text" name="price2" id="price2" value="<%=doc.get("price2") %>" class="input" />
    (<font color="#FF0000">以此价格为结算价</font>) </td>
</tr>
<!--
<tr>
  <td align="right">存货量</td>
  <td>&nbsp;</td>
  <td><input type="text" name="number" id="number" value="<%=doc.get("number") %>" class="input" /></td>
</tr>
-->
<tr>
  <td align="right">备注(如详细产品介绍)</td>
  <td>&nbsp;</td>
  <td><textarea name="remark" id="remark"  class="textarea"><%=doc.get("remark") %></textarea></td>
</tr>

</tbody>
</table>
    </div>
  </div>
</div>
<input type="submit" name="submit" value=" 提交 " class="btn_a" />
</form>

<div class="clear"></div>
</div>
</div>

<div class="right_bottom">
</div>
</div>

<div id="footer">
</div>
</div>
<%@include file="inc/msg.jsp" %>
<%@include file="inc/footer.jsp" %>
