class.asp
Upload User: apresys
Upload Date: 2021-03-30
Package Size: 813k
Code Size: 9k
Development Platform:

DOS

  1. <!--#include file="conn.asp"-->
  2. <!--#include file="checkuser.asp"-->
  3. <html>
  4. <head>
  5. <title>∷汽车4S店配件仓储管理系统:.</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  7. <link href="css/main.css" rel="stylesheet" type="text/css">
  8. <SCRIPT language=javascript  src="js/selectcity.js"></script>
  9. <script language="JavaScript" src="js/validate.js" type="text/JavaScript"></script>
  10. <script language="JavaScript" src="js/type.js"></script>
  11. <SCRIPT language=javascript src="css/init.js"></SCRIPT>
  12. <style type="text/css">
  13. <!--
  14. td {  font-family: "宋体"; font-size: 9pt}
  15. body {  font-family: "宋体"; font-size: 9pt}
  16. select {  font-family: "宋体"; font-size: 9pt}
  17. A {text-decoration: none; color: #336699; font-family: "宋体"; font-size: 9pt}
  18. A:hover {text-decoration: underline; color: #FF0000; font-family: "宋体"; font-size: 9pt} 
  19. -->
  20. </style>
  21. <SCRIPT LANGUAGE=javascript>
  22. <!--
  23. function Juge(myform)
  24. {
  25. if (myform.classnumber.value == "")
  26. {
  27. alert("编号不能为空!");
  28. myform.classnumber.focus();
  29. return (false);
  30. }
  31. }
  32. function SelectAll() {
  33. for (var i=0;i<document.selform.selBigClass.length;i++) {
  34. var e=document.selform.selBigClass[i];
  35. e.checked=!e.checked;
  36. }
  37. }
  38. //-->
  39. </script>
  40. </HEAD>
  41. <BODY topMargin=0 rightMargin=0 leftMargin=0>       
  42. <!--#include file="top.asp"--><% dim sql,rs
  43.   select case request("action")
  44.   case "add"
  45.        call SaveAdd()
  46.   case "modify"
  47.        call SaveModify()
  48.   case "del"
  49.        call delCate()
  50.   case "edit"
  51.        isEdit=True
  52.        call myform(isEdit)
  53.   case else
  54.        isEdit=False
  55.        call myform(isEdit) 
  56.   end select
  57.   
  58.   sub SaveAdd   
  59. set rs=server.createobject("adodb.recordset") 
  60. sql="select * from class"
  61. rs.open sql,conn,1,3
  62. rs.addnew
  63. rs("classnumber") = trim(request.Form("classnumber"))
  64. rs("classname") = trim(request.Form("classname"))
  65. rs("content") = trim(request.Form("content"))
  66. rs.update
  67. rs.close
  68. set rs=nothing
  69. response.Write "<script language=javascript>alert('添加成功!');</script>"
  70. response.write "<meta http-equiv=""refresh"" content=""0;url=class.asp"">"
  71. response.end
  72. rs.close
  73. set rs=nothing
  74. end sub
  75.  
  76. sub SaveModify   
  77. set rs=server.createobject("adodb.recordset") 
  78. sql="select * from class where id="&request.Form("id")
  79. rs.open sql,conn,1,3
  80. rs("classname") = trim(request.Form("classname"))
  81. rs("classnumber") = trim(request.Form("classnumber"))
  82. rs("content") = trim(request.Form("content"))
  83. rs.update
  84. rs.close
  85. set rs=nothing
  86. response.Write "<script language=javascript>alert('修改成功!');</script>"
  87. response.write "<meta http-equiv=""refresh"" content=""0;url=class.asp"">"
  88. response.end
  89. rs.close
  90. set rs=nothing
  91. end sub   
  92.  
  93.   sub delCate()
  94.         conn.execute("delete from class where id in ("&Request.Form("selBigClass")&")")
  95. response.Write "<script language=javascript>alert('删除成功!');</script>"
  96. response.write "<meta http-equiv=""refresh"" content=""0;url=class.asp"">"
  97. response.end
  98.   end sub
  99.   %> <% sub myform(isEdit) %>    
  100. <TABLE width=98% align=center border="1" cellspacing="0" bordercolor="#D6D3CE">
  101.   <TBODY> 
  102.   <TR> 
  103.     <td align="center" valign="top"> <%if oskey="supper" or oskey="admin" then%>
  104. <fieldset style="width:98%"><legend>
  105. <%
  106.     set rs=server.createobject("adodb.recordset")
  107.    if isedit then
  108.    rs.open "select * from class where id=" & request("id"),conn,1,1
  109.        response.write "编辑类别"
  110.    else
  111.        response.write "添加类别"
  112.    end if %></legend>
  113.         <table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#D4D0C8">
  114.           <tr class="but"> 
  115. <td width="20%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">类别编号</td>
  116.             <td width="30%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">类别名称</td>
  117. <td width="50%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'" colspan="2">备注</td>
  118.           </tr>
  119.   <form name="reg" method="post" action="class.asp" onSubmit="return Juge(this)" >
  120.   <tr> <input type="Hidden" name="action" value='<% If isedit then%>modify<% Else %>add<% End If %>'> 
  121.   <% If isedit then%><input type="Hidden" name="id" value="<%=rs("id")%>"> <% End If %>
  122.             <td height="18" align="center"><input name="classnumber" type="text"  size="10"  value='<% if isedit then
  123.                                                          response.write rs("classnumber")
  124.   end if %>'></td>
  125.             <td><input name="classname" type="text"  size="25" value='<% if isedit then
  126.                                                          response.write rs("classname")
  127.   end if %>'></td>
  128. <td><input name="content" type="text"  size="55" value='<% if isedit then
  129.                                                          response.write rs("content")
  130.   end if %>'></td>
  131. <td width="148"><input type="submit" class="button" value="<% if isedit then
  132.                                                          response.write "编辑"
  133.  else
  134.  response.write "添加"
  135.   end if %>"> </td>
  136.           </tr>
  137.   </form>
  138.   
  139.            </table>
  140.         </fieldset><%end if%>
  141.       <TABLE cellSpacing=1 cellPadding=0 width="100%" border=0 >
  142.         <TR>
  143.           <TD height="25" align="center">类 别 列 表</TD>
  144.               </TR>
  145.             </TABLE>
  146. <form action="class.asp" method="post" name="selform" >
  147.   <table width="100%"  border="1" cellpadding="0" cellspacing="0" bordercolor="#D4D0C8" align="center">
  148.     <tr> 
  149.       
  150.       <td width="100%" align="center" valign="top">
  151.   <fieldset style="width:95%">
  152.         <table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#D4D0C8">
  153.           <tr class="but"> 
  154. <td width="20%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">类别编号</td>
  155.             <td width="40%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">类别名称</td>
  156. <td width="35%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">备 注</td>
  157.             <td width="5%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">操 作</td>
  158.           </tr>
  159.  <%
  160. set rs=server.CreateObject("ADODB.RecordSet") 
  161. rs.Source="select* from class"
  162. rs.Open rs.Source,conn,1,1
  163. if not rs.EOF then
  164. do while not rs.eof
  165. %>
  166. <tr><td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><a href="class.Asp?id=<%=rs("ID")%>&action=edit"><%=rs("classnumber")%></a></td>
  167. <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><%=rs("classname")%><%if rs("classname")="" then%>&nbsp;<%end if%></td>
  168. <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><%=rs("content")%><%if rs("content")="" then%>&nbsp;<%end if%></td>
  169. <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><input name="selBigClass" type="checkbox" id="selBigClass" value="<%=rs("ID")%>"></td>
  170. </tr>
  171. <%
  172. rs.movenext
  173. loop
  174. end if
  175. rs.close
  176. set rs=nothing
  177. %>
  178. <tr><td align="right" colspan="10" height="22"> <%if oskey="supper" or oskey="admin" then%>
  179.         <input type="checkbox" name="checkbox" value="checkbox" onClick="javascript:SelectAll()"> 选择/反选
  180.               <input onClick="{if(confirm('此操作将删除该信息!nn确定要执行此项操作吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=删除 name=action2> 
  181.               <input type="Hidden" name="action" value='del'><%end if%></td></tr>
  182.         </table>
  183. </fieldset>
  184.   
  185. </td>
  186.     </tr>
  187.     <tr> 
  188.       <td height="50" colspan="3" align="center">
  189.         
  190.         </td>
  191.     </tr>
  192.   </table>
  193. </form>
  194. </TD>
  195.               </TR>
  196.           </table>
  197.           
  198.       <table width="100%" border="0" cellspacing="0" cellpadding="4">
  199.       
  200.       </table>
  201.   </TBODY>
  202. </TABLE>
  203. <%end sub%>
  204. <P>
  205. <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
  206.   <TBODY>
  207.   <TR vAlign=center>
  208.     <TD align=middle width="100%"><!--#include file="footer.htm"--></TD>
  209.   </TR></TBODY></TABLE></P></BODY></HTML>