<!--#include file="conn.asp" -->
<% adm_power_page=1 %>
<!--#include file="admin_dn.asp" -->
<% 

msg=""
msg1=""
if Trim(Request.QueryString("w"))="del" then
  for i= 1 to request.form("del").count
  sql="delete * from matter where id="&request.form("del")(i)
  conn.execute(sql)
  next
  end if

if Trim(Request.QueryString("w"))="add" then
 if Trim(Request.Form("matter"))="" then msg="<li>代理名称为空.</li>"
 if instr("12345",Trim(Request.Form("class")))=0 then msg=msg&"<li>代理级别只能为12345中的数字</li>"
 for i=1 to len(Trim(Request.Form("je")))
 if instr("0123456789",mid(Trim(Request.Form("je")),i,1))=0 then msg1="<li>预交金额只能为0123456789的组合</li>"
 next
 msg=msg&trim(msg1)
 rs.open "select * from matter where class="&request.Form("class"),conn,1,1
 if not rs.eof then msg=msg&"<li>代理级别非唯一</li>"
 rs.close
 if trim(msg)="" then
  sql="insert into matter (matter,class,je,bak) values ('"&Trim(Request.Form("matter"))&"',"&Request.Form("class")&","&Request.Form("je")&",'"&Trim(Request.Form("bak"))&"')"
 'sql="insert into matter (matter,class,je,bak) values ('"&Trim(Request.Form("title"))&"',"&Request.Form("class")&","&Request.Form("je")&",'"&Trim(Request.Form("bak"))&")'"
 conn.execute(sql)
 msg="新建成功..."
 else
 msg="</b>新增失败!!!</b><ul>"&msg&"</ul>"
 end if
 
 end if
 %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>:::管理页面:::</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body leftmargin="4" topmargin="4">
<p>代理相关调整</p>
<form name="form1" method="post" action="matter.asp?w=del">
  <table width="96%" border="0" align="center" cellpadding="0" cellspacing="2">
    <tr bgcolor="#000066"> 
      <td width="6%" height="15"><div align="center"><strong><font color="#FFFFFF">id</font></strong></div></td>
      <td width="41%" height="15" bgcolor="#000066"> <div align="center"><font color="#FFFFFF"><strong>代理名称</strong></font></div></td>
      <td width="17%" height="15"><div align="center"><font color="#FFFFFF"><strong>代理级别 
          </strong> </font></div></td>
      <td width="15%" height="15"><div align="center"><font color="#FFFFFF"><strong>需预交金额</strong></font></div></td>
      <td width="10%" height="15"><div align="center"><font color="#FFFFFF"><strong>编 
          辑</strong></font></div></td>
      <td width="11%" height="15"><div align="center"><strong><font color="#FFFFFF">删除</font></strong></div></td>
    </tr>
    <% rs.open "matter",conn,1,1
	while not rs.eof  %>
    <tr bgcolor="#F0F0FF"> 
      <td height="20"><div align="center"><%= rs("id") %></div></td>
      <td><div align="center"><a href="#" title=<%=rs("bak")%>><%= rs("matter") %></a></div></td>
      <td><div align="center"><strong><font color="#990000"><%= rs("class") %></font></strong></div></td>
      <td><div align="center"><font color="#FF0000"><%= rs("je") %></font></div></td>
      <td valign="middle"> <div align="center"><a href="matter_edit.asp?id=<%=rs("id")%>"><img src="images/folder.gif" width="16" height="16" border="0"></a></div></td>
      <td> <div align="center"> 
          <input name="del" type="checkbox" class="unnamed1" id="del" value="<%=rs("id")%>">
        </div></td>
    </tr>
    <% rs.movenext
	wend
	rs.close %>
    <tr bgcolor="#000066"> 
      <td colspan="6">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr> 
            <td width="80%">&nbsp;</td>
            <td width="20%">
<div align="center"> 
                <input type="submit" name="Submit2" value="-删除-">
              </div></td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>
<p>&nbsp;</p>
<form name="form2" method="post" action="matter.asp?w=add">
  <table width="70%" height="182" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr bgcolor="#000066"> 
      <td height="17" colspan="2"><font color="#FFFFFF"><strong>代理级别新增</strong></font></td>
    </tr>
    <tr bgcolor="#EEEEFF"> 
      <td width="24%" height="21"><div align="center">代理名称:</div></td>
      <td width="76%"> <input name="matter" type="text" id="matter">
        <font color="#FF0000">*</font></td>
    </tr>
    <tr bgcolor="#EEEEFF"> 
      <td height="27"><div align="center">代理级别:</div></td>
      <td> <select name="class" id="class">
          <option value="1" selected>1</option>
          <option value="2">2</option>
          <option value="3">3</option>
          <option value="4">4</option>
          <option value="5">5</option>
        </select>
        不能重复 <font color="#FF0000">*</font></td>
    </tr>
    <tr bgcolor="#EEEEFF"> 
      <td><div align="center">需预交金额:</div></td>
      <td> <input name="je" type="text" id="je" value="0" size="6">
        只能为数字 <font color="#FF0000">*</font></td>
    </tr>
    <tr bgcolor="#EEEEFF"> 
      <td><div align="center">其它说明:</div></td>
      <td> <textarea name="bak" cols="30" rows="4" id="bak"></textarea></td>
    </tr>
    <tr bgcolor="#000066"> 
      <td>&nbsp;</td>
      <td><input type="submit" name="Submit" value="-确定新增-"></td>
    </tr>
  </table>
</form>
<table width="55%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><font color="#FF0000" size="2"><%= msg %></font></td>
  </tr>
</table>
<p><font color="#FF0000">注:</font>这里的代理级别1-5分别代表在产品划价时的金额 1-5</p>
<p align="center">&nbsp;</p>
</body>
</html>
