<%@page contentType="text/html; charset=UTF-8"%>
<%@include file="/inc/init.jsp" %>
<%@include file="/inc/checklogin.jsp" %>
<%@include file="inc/header.jsp" %>
<%
DOC doc=null;
int payid=pu.getInt("payid");
Pay_type_db ptdb=new Pay_type_db();
doc=ptdb.getOne(payid);
%>
<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(!checknumber(document.modifyForm.rebate.value)){
		alert('折扣不能为空并只能填写数字！');
		document.modifyForm.rebate.focus();
		return false;
	}else if(document.modifyForm.payid.value=="2"){
		if(document.modifyForm.alipaypartner.value==''){
		alert('支付宝商家ID不能为空！');
		document.modifyForm.alipaypartner.focus();
		return false;
		}
		if(document.modifyForm.alipaykey.value==''){
		alert('支付宝商家密钥不能为空！');
		document.modifyForm.alipaykey.focus();
		return false;
		}
		if(document.modifyForm.alipayuser.value==''){
		alert('支付宝帐号不能为空！');
		document.modifyForm.alipayuser.focus();
		return false;
		}
	}else{
		return true;
	}
}
	</script>
		<form method="post" name="modifyForm" action="fun/F_paytype.jsp"  onsubmit="return checkform();">
			<input type="hidden" name="action" value="edit" />
			<input type="hidden" name="payid" value="<%=payid%>" />
			<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="2%">&nbsp;</td>
									<td width="79%"><input type="text" name="name" id="name" value="<%=doc.get("name")%>"  />
										&nbsp;</td>
								</tr>
								<tr>
									<td width="19%" align="right">是否启用<font color="#FF0000"></font></td>
									<td width="2%">&nbsp;</td>
									<td width="79%">
									<select name="state" id="state" class="select">
										<%=Select.getSelectByKey("onoff",doc.get("state"))%>
									</select>&nbsp;
								</td>
								</tr>
								<tr>
									<td width="19%" align="right">显示模式（电脑版）<font color="#FF0000"></font></td>
									<td width="2%">&nbsp;</td>
									<td width="79%"><p>
										<label>
											<input name="pcshow" type="radio" id="showtype" value="0" <%=doc.geti("retain1")==0?" checked":""%> />
											文字<br />
										</label>
										<input type="radio" name="pcshow" id="showtype2" value="1" <%=doc.geti("retain1")==1?" checked":""%> />
										图片</p>
										<p>&nbsp;</p></td>
								</tr>
								<tr>
									<td width="19%" align="right">显示模式（手机版）<font color="#FF0000"></font></td>
									<td width="2%">&nbsp;</td>
									<td width="79%"><p>
										<label>
											<input name="phoneshow" type="radio" id="showtype3" value="0" <%=doc.geti("retain2")==0?" checked":""%> />
											文字</label>
									</p>
										<p>
											<input type="radio" name="phoneshow" id="showtype4" value="1" <%=doc.geti("retain2")==1?" checked":""%> />
											图片</p></td>
								</tr>
								<tr>
									<td width="19%" align="right">折扣<font color="#FF0000">*</font></td>
									<td width="2%">&nbsp;</td>
									<td width="79%"><input type="text" name="rebate" id="rebate" value="<%=doc.get("rebate")%>"  class="input" />
										&nbsp;9折填写0.9，不打折是1，1不显示折扣信息</td>
								</tr>
								<%if(payid==2){%>
								<tr>
									<td width="19%" align="right">商家ID<font color="#FF0000">*</font></td>
									<td width="2%">&nbsp;</td>
									<td width="79%"><input type="text" name="alipaypartner" id="alipaypartner" value="<%=Config.get("alipaypartner")%>"  class="input" />
										&nbsp;支付宝商家ID，2088开头</td>
								</tr>
								<tr>
									<td width="19%" align="right">商家密钥<font color="#FF0000">*</font></td>
									<td width="2%">&nbsp;</td>
									<td width="79%"><input type="text" name="alipaykey" id="alipaykey" value="<%=Config.get("alipaykey")%>"  class="input" />										&nbsp;支付宝商家密钥</td>
								</tr>
								<tr>
									<td width="19%" align="right">支付宝帐户<font color="#FF0000">*</font></td>
									<td width="2%">&nbsp;</td>
									<td width="79%"><input type="text" name="alipayuser" id="alipayuser" value="<%=Config.get("alipayuser")%>"  class="input" />
										&nbsp;</td>
								</tr>
								<tr>
									<td width="19%" align="right">支付类型<font color="#FF0000">*</font></td>
									<td width="2%">&nbsp;</td>
									<td width="79%">
									<select name="alipaytype" id="alipaytype" class="select">
										<option value="1" <%=Config.geti("alipaytype")==1?" selected":""%>>即时到账</option>
										<option value="2" <%=Config.geti("alipaytype")==2?" selected":""%>>担保交易</option>
										<option value="3" <%=Config.geti("alipaytype")==3?" selected":""%>>即时和担保双功能</option>
									</select>
										&nbsp;</td>
								</tr>
								<%}%>
								<tr>
									<td width="19%" align="right">提示内容(手机版)</td>
									<td width="2%">&nbsp;</td>
									<td width="79%" valign="middle"><textarea id="content" name="content" class=" textarea"><%=doc.get("content")%></textarea>
										建议40字内</td>
								</tr>
								<tr>
									<td width="19%" align="right">提示内容(电脑版)</td>
									<td width="2%">&nbsp;</td>
									<td width="79%" valign="middle"><textarea id="remark" name="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" %>
