<!--#include file="utf-8.asp" -->
<!--#include file="js/Function.asp" -->
<!--#include file="CheckAdmin.asp" -->
<!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>
<META NAME="copyright" CONTENT="Copyright 2010-2012 - yidacms.com" />
<META NAME="Author" CONTENT="世纪伟成  yidacms.com" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="js/admin.css" rel="stylesheet" type="text/css">
<title>产品计价单位配置！</title>
<script language="JavaScript" src="js/admin.js" type="text/JavaScript"></script>
</head>

<body>
<%
'版权：世纪伟成(http://yidacms.com)
'本信息不会影响您网站的正常访问，无论免费用户或是收费用户请保留这里的信息.
'如果您删除了这里的版权信息,将追究法律责任.
        if request("yidacms")="money" Then
			if len(trim(request.Form("shuaiweb_money")))<1 then
				response.write ("<script language=javascript> alert('单位名称必填且不能少于1个字符！');history.back(-1);</script>")
				response.end
			end if	  
		dim rs,sql
		set rs=server.createobject("adodb.recordset")
		sql="select * from shuaiweb_currency" 
		rs.open sql,dbok,3,2
		rs.addnew 
			rs("shuaiweb_money")=trim(request.form("shuaiweb_money"))
			rs("shuaiweb_moneysort")=trim(request.form("shuaiweb_moneysort"))
		rs.update
		rs.close
		set rs=nothing
		response.write "<script language=javascript> alert('成功添加！');location.replace('products/admin_products.asp');</script>"
		End If 
%>
		  <table width="98%" height="100%" border="0"cellpadding="6" cellspacing="0" bordercolor="#cccccc" style="border-collapse:collapse" bgcolor="#FFFFFF" align="center">
		  <form action="?yidacms=money" method="post" name="form1" id="form1" onsubmit="return numericCheck()">
			<tr>
			  <td class="infont"></td>
			  <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">单位名称<br /><input name="shuaiweb_money" type="text" id="shuaiweb_money" size="15"  class="win"/></td>
			</tr>
			<tr>
			<tr>
			  <td class="infont"></td>
			  <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">排序<br /><input name="shuaiweb_moneysort" type="text" id="shuaiweb_moneysort" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" class="win2"/> 这里必须是数字！</td>
			</tr>
			<tr>
			  <td>&nbsp;</td>
			  <td><label>
				<input type="submit" name="Submit" value="添 加" class="inanniu"/>
			  </label></td>
			</tr>
			</form>
		  </table>
                <%
			set rs = server.createobject("adodb.recordset")
			sql="select * from shuaiweb_currency ORDER BY shuaiweb_moneysort ASC"
			rs.open sql,dbok,1,1
		%>
		  <table width="98%" border="1" cellpadding="6" cellspacing="0" bordercolor="#cccccc" style="border-collapse:collapse;margin-top:30px;" bgcolor="#FFFFFF" align="center">
			<tr>
			  <td width="162" bgcolor="#CCCCCC">单位名称</td>
			  <td width="240" bgcolor="#CCCCCC">排序</td>
			  <td width="114" bgcolor="#CCCCCC">操作！</td>
			</tr>
				<%
		if rs.bof and rs.eof then
			No_record = "暂无记录!"
						Else
				do while not rs.eof 
				%>
			<tr onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">
			  <td width="162"><%=rs("shuaiweb_money")%></td>
			  <td width="240"><%=rs("shuaiweb_moneysort")%></td>
			  <td width="114"><a href="?yidacms=moneyeditdel&id=<%=rs("id")%>"><img src="images/015.gif" alt="删除"/></a> </td>
			</tr>
				<%
				rs.MoveNext 
				loop   
				End If 
	rs.Close
	set rs=nothing
				%>
<tr>
                <td colspan="3"><%=No_record%></td>
</tr>
		  </table>
<%
		if request("yidacms")="moneyeditdel" Then 
		set rs = server.createobject("adodb.recordset")
		sql="DELETE * FROM shuaiweb_currency WHERE id= "&request("id")&""
		rs.open sql,dbok,3,2
		rs.update
		rs.close
		set rs=nothing
		response.write "<script language=javascript> alert('成功删除！');location.replace('admin_money.asp');</script>"
		End If 
%>
</body>
</html>
