<!--#include file="conn.asp" -->
<% adm_power_page="1" %>
<!--#include file="admin_dn.asp" -->
<% 
 if Trim(Request.QueryString("w"))="del" then
 for i= 1 to request.form("del").count
  sql="delete * from soft where id="&request.form("del")(i)
  conn.execute(sql)
  next
  msg="删除记录成功........"
 end if

 if Trim(Request.QueryString("w"))="add" then
   if Trim(Request.Form("name"))<>"" and Trim(Request.Form("url"))<>"" then
    sql="insert into soft(name,url,bak) values('"&Trim(Request.Form("name"))&"','"&Trim(Request.Form("url"))&"','"&Trim(Request.Form("bak"))&"')"
    conn.execute(sql)
	  msg="新增记录成功..."
   else
     msg="新加记录失败，带*的为必填项........"
   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><strong><font color="#990000">常用软件下载列表: </font></strong></p>
<p>&nbsp;</p>
<form name="form1" method="post" action="soft_adm.asp?w=add">
  <table width="69%" height="159" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#DDDDDD" bordercolorlight="" bordercolordark="ffffff">
    <tr> 
      <td colspan="2" bgcolor="#F5F5F5">添加软件</td>
    </tr>
    <tr> 
      <td width="25%">软件名字:</td>
      <td width="75%"><input name="name" type="text" id="name">
        <font color="#FF0000">*</font></td>
    </tr>
    <tr> 
      <td>下载地址:</td>
      <td><input name="url" type="text" id="url" value="http://" size="30">
        <font color="#FF0000"> *</font></td>
    </tr>
    <tr> 
      <td>软件简介:</td>
      <td><textarea name="bak" cols="30" rows="4" id="bak"></textarea></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit" name="Submit" value="增加"></td>
    </tr>
  </table>
  <a href="../q4.asp">-查看效果- </a>
</form>
<form name="form2" method="post" action="soft_adm.asp?w=del">
  <table width="96%" height="61" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#DFDFDF" bordercolorlight="" bordercolordark="ffffff">
    <tr bgcolor="#F2F2F2"> 
      <td width="7%" height="18"> <div align="center">id</div></td>
      <td width="30%"> <div align="center">软件名称</div></td>
      <td width="24%"> <div align="center">下载地址</div></td>
      <td width="32%"> <div align="center">软件简介</div></td>
      <td width="7%"> <div align="center">删除</div></td>
    </tr>
    <% rs.open "soft",conn,1,1
	s=0
	while not rs.eof 
	s=s+1
	 %>
    <tr> 
      <td height="23"><div align="center"><%= s %></div></td>
      <td><div align="center"><%= rs("name") %></div></td>
      <td><div align="center"><%= rs("url") %></div></td>
      <td><%= mid(rs("bak"),1,20) %>&nbsp;</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> 
      <td height="18">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><div align="center">
          <input type="submit" name="Submit2" value="删">
        </div></td>
    </tr>
  </table>
</form>
<p align="center"><font color="#FF0000"><%= msg %></font></p>
</body>
</html>
