<%@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(document.modifyForm.sequence.value==''){
		alert('产品排序不能为空！');
		document.modifyForm.sequence.focus();
		return false;
	}else if(document.modifyForm.price.value==''){
		alert('产品价格不能为空！');
		document.modifyForm.price.focus();
		return false;
	}else{
		return true;
	}
}
</script>
<form method="post" name="modifyForm" action="productView.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 name="name" type="text" disabled="disabled" 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" disabled="disabled">
    <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":""%> disabled="disabled"/>
    否 
    <input type="radio" name="isshow" id="radio" value="1" <%=doc.geti("isshow")==1?"checked":""%> disabled="disabled"/>
是
	<input type="radio" name="isshow" id="radio3" value="2" <%=doc.geti("isshow")==2?"checked":""%> disabled="disabled"/>
停用(前台不显示)</td>
</tr>
<tr>
  <td align="right">产品排序<font color="#FF0000">*</font></td>
  <td>&nbsp;</td>
  <td><input name="sequence" type="text" disabled="disabled" class="input" id="sequence" value="<%=doc.geti("sequence") %>" /></td>
</tr>
<!--
<tr>
  <td align="right">原价</td>
  <td>&nbsp;</td>
  <td><input name="price" type="text" disabled="disabled" class="input" id="price" value="<%=doc.get("price") %>" /></td>
</tr>
-->
<tr>
  <td width="19%" align="right">优惠价<font color="#FF0000">*</font> </td>
  <td width="1%">&nbsp;</td>
  <td width="70%">
    <input name="price2" type="text" disabled="disabled" class="input" id="price2" value="<%=doc.get("price2") %>" />
    (<font color="#FF0000">以此价格为结算价</font>) </td>
</tr>

<!--    
<tr>
  <td align="right">存货量</td>
  <td>&nbsp;</td>
  <td><input name="number" type="text" disabled="disabled" class="input" id="number" value="<%=doc.get("number") %>" /></td>
</tr>
-->
<tr>
  <td align="right">备注(如详细产品介绍)</td>
  <td>&nbsp;</td>
  <td><textarea name="remark" disabled="disabled"  class="textarea" id="remark"><%=doc.get("remark") %></textarea></td>
</tr>

</tbody>
</table>
    </div>
  </div>
</div>
<input type="button" name="editp" value=" 编辑该产品 " class="btn_a" onclick="window.location.href='productEdit.jsp?productid=<%=productid%>'"/>
</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" %>
