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

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.content.value==''){
		alert('内容不能为空！');
		document.modifyForm.content.focus();
		return false;
	}else if(document.modifyForm.classid.value==''||document.modifyForm.classid.value=='0'){
		alert('产品分类不能为空，如没有分类，请在添加分类页面添加！');
		document.modifyForm.classid.focus();
		return false;
	}else{
		return true;
	}
}
</script>
<form method="post" name="modifyForm" action="fun/F_smscontent.jsp"  onSubmit="return checkform();">
<input type="hidden" name="action" value="edit" />
<input type="hidden" name="scid" value="<%=scid%>" />
<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="18%" align="right">插入变量<font color="#FF0000">*</font></td>
  <td width="2%">&nbsp;</td>
  <td width="80%">&nbsp;<a href="javascript:insert('truename')" class="btn_e">客户名字：#truename#</a> <a href="javascript:insert('companyname')" class="btn_e">公司名：#companyname#</a> <a href="javascript:insert('orderid')" class="btn_e">订单ID：#orderid#</a> <a href="javascript:insert('price')" class="btn_e">价格：#price#</a> <a href="javascript:insert('number')" class="btn_e">订购数量：#number#</a> <a href="javascript:insert('paytype')" class="btn_e">支付方式：#paytype#</a><a href="javascript:insert('phone')" class="btn_e">客户手机：#phone#</a> <a href="javascript:insert('address')" class="btn_e">地址：#address#</a> <a href="javascript:insert('producturl')" class="btn_e">产品网址：#producturl#</a> <a href="javascript:insert('kfphone')" class="btn_e">客服电话：#kfphone#</a><a href="javascript:insert('QQ')" class="btn_e">客服QQ：#QQ#</a> <a href="javascript:insert('setname')" class="btn_e">产品名称：#setname#</a> <a href="javascript:insert('kdh')" class="btn_e">快递号：#kdh#</a> <a href="javascript:insert('kdjindu')" class="btn_e">快递最新进度：#kdjindu#</a></td>
</tr>
<tr>
  <td width="18%" align="right">短信内容<font color="#FF0000">*</font></td>
  <td width="2%">&nbsp;</td>
  <td width="80%">&nbsp;
  <textarea name="content" id="content"  class="textarea"><%=doc.get("content") %></textarea></td>
</tr>
<tr>
  <td align="right">内容所属分类<font color="#FF0000">*</font></td>
  <td>&nbsp;</td>
  <td>&nbsp;<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 width="18%" align="right">短信类型<font color="#FF0000">*</font></td>
  <td width="2%">&nbsp;</td>
  <td width="80%">&nbsp;
  <select name="type" id="type" class="select">
			<%=Select.getSelectByKey("smstype",doc.get("type"))%>
		</select>
		</td>
</tr>
<tr>
  <td align="right">备注</td>
  <td>&nbsp;</td>
  <td>&nbsp;&nbsp;<input type="text" name="remark" id="remark" value="<%=doc.get("remark") %>" class="input" /></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>
<script language="javascript">
function insert(id){
   $('#content').insertContent('#'+id+'#');   
}
</script>
<%@include file="inc/msg.jsp" %>
<%@include file="inc/footer.jsp" %>
