Supplier.asp
上传用户:apresys
上传日期:2021-03-30
资源大小:813k
文件大小:15k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

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.Supplier_name.value == "")
  26. {
  27. alert("供应商名称不能为空!");
  28. myform.Supplier_name.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 Supplier"
  61. rs.open sql,conn,1,3
  62. rs.addnew
  63. rs("Supplier_name") = trim(request.Form("Supplier_name"))
  64. rs("Contact_person") = trim(request.Form("Contact_person"))
  65. rs("Title") = trim(request.Form("Title"))
  66. rs("adr") = trim(request.Form("adr"))
  67. rs("Prov") = trim(request.Form("Prov"))
  68. rs("city") = trim(request.Form("city"))
  69. rs("zip") = trim(request.Form("zip"))
  70. rs("tel") = trim(request.Form("tel"))
  71. rs("Facsimile") = trim(request.Form("Facsimile"))
  72. rs("Condition") = trim(request.Form("Condition"))
  73. rs("email") = trim(request.Form("email"))
  74. rs("content") = trim(request.Form("content"))
  75. rs.update
  76. response.Write "<script language=javascript>alert('添加成功!');</script>"
  77. response.write "<meta http-equiv=""refresh"" content=""0;url=Supplier.asp"">"
  78. response.end
  79. rs.close
  80. set rs=nothing
  81. end sub
  82.  
  83. sub SaveModify   
  84. set rs=server.createobject("adodb.recordset") 
  85. sql="select * from Supplier where id="&request.Form("id")
  86. rs.open sql,conn,1,3
  87. rs("Supplier_name") = trim(request.Form("Supplier_name"))
  88. rs("Contact_person") = trim(request.Form("Contact_person"))
  89. rs("Title") = trim(request.Form("Title"))
  90. rs("adr") = trim(request.Form("adr"))
  91. rs("Prov") = trim(request.Form("Prov"))
  92. rs("city") = trim(request.Form("city"))
  93. rs("zip") = trim(request.Form("zip"))
  94. rs("tel") = trim(request.Form("tel"))
  95. rs("Facsimile") = trim(request.Form("Facsimile"))
  96. rs("Condition") = trim(request.Form("Condition"))
  97. rs("email") = trim(request.Form("email"))
  98. rs("content") = trim(request.Form("content"))
  99. rs.update
  100. response.Write "<script language=javascript>alert('修改成功!');</script>"
  101. response.write "<meta http-equiv=""refresh"" content=""0;url=Supplier.asp"">"
  102. response.end
  103. rs.close
  104. set rs=nothing
  105. end sub   
  106.  
  107.   sub delCate()
  108.         conn.execute("delete from Supplier where id in ("&Request.Form("selBigClass")&")")
  109. response.Write "<script language=javascript>alert('删除成功!');</script>"
  110. response.write "<meta http-equiv=""refresh"" content=""0;url=Supplier.asp"">"
  111. response.end
  112.   end sub
  113.   %> <% sub myform(isEdit) %>    
  114. <TABLE width=98% align=center border="1" cellspacing="0" bordercolor="#D6D3CE">
  115.   <TBODY> 
  116.   <TR> 
  117.     <td align="center" valign="top"> 
  118. <%if oskey="supper" or oskey="admin" then%>
  119. <fieldset style="width:98%"><legend>
  120. <%
  121.     set rs=server.createobject("adodb.recordset")
  122.    if isedit then
  123.    rs.open "select * from Supplier where id=" & request("id"),conn,1,1
  124.        response.write "编辑供应商"
  125.    else
  126.        response.write "添加供应商"
  127.    end if %></legend>
  128.         <table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#D4D0C8">
  129.           <tr class="but"> 
  130. <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">供应商名称</td>
  131.             <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">联系人</td>
  132. <td width="5%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">职 称</td>
  133. <td width="20%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">地 址</td>
  134. <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">电话号码</td>
  135. <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">传真号码</td>
  136. <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">付款条件</td>
  137. <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">电子邮件</td>
  138.           </tr>
  139.   <form name="reg" method="post" action="Supplier.asp" onSubmit="return Juge(this)" >
  140.   <tr> <input type="Hidden" name="action" value='<% If isedit then%>modify<% Else %>add<% End If %>'> 
  141.   <% If isedit then%><input type="Hidden" name="id" value="<%=rs("id")%>"> <% End If %>
  142.             <td height="18" align="center"><input name="Supplier_name" type="text"  size="10"  value='<% if isedit then
  143.                                                          response.write rs("Supplier_name")
  144.   end if %>'></td>
  145.             <td><input name="Contact_person" type="text"  size="10" value='<% if isedit then
  146.                                                          response.write rs("Contact_person")
  147.   end if %>'></td>
  148.             <td><input name="Title" type="text"  size="10" value='<% if isedit then
  149.                                                          response.write rs("Title")
  150.   end if %>'></td>
  151. <td><input name="adr" type="text"  size="25" value='<% if isedit then
  152.                                                          response.write rs("adr")
  153.   end if %>'></td>
  154. <td><input name="tel" type="text"  size="10" value='<% if isedit then
  155.                                                          response.write rs("tel")
  156.   end if %>'></td>
  157. <td><input name="Facsimile" type="text"  size="10" value='<% if isedit then
  158.                                                          response.write rs("Facsimile")
  159.   end if %>'></td>
  160. <td><input name="Condition" type="text"  size="10" value='<% if isedit then
  161.                                                          response.write rs("Condition")
  162.   end if %>'></td>
  163. <td><input name="email" type="text"  size="10" value='<% if isedit then
  164.                                                          response.write rs("email")
  165.   end if %>'></td>
  166.           </tr>
  167.   <tr class="but"> 
  168. <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">省  份</td>
  169.             <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">城  市</td>
  170. <td width="70%" colspan="6" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">备  注</td>
  171.           </tr>
  172.   <tr> 
  173.             <td height="18" align="center"><% if isedit then%><%=rs("prov")%><%end if %><select name="prov" onChange="javascript:selectcity()">
  174. <option selected>选择</option>
  175.               </select>
  176.               <script language="javascript">                       
  177.  ProvinceOptionMenu();                       
  178. </script></td>
  179.             <td><% if isedit then%><%=rs("city")%><%end if %><select name="city">
  180.                 <option selected>选择</option>
  181.               </select></td>
  182.             <td colspan="5"><textarea name="content" cols="80" rows="1"><% if isedit then
  183.                                                          response.write rs("content")
  184.   end if %></textarea></td>
  185. <td width="148"><input type="submit" class="button" value="<% if isedit then
  186.                                                          response.write "编辑"
  187.  else
  188.  response.write "添加"
  189.   end if %>"> </td>
  190.           </tr></form>
  191.   
  192.            </table>
  193.         </fieldset>
  194. <%end if%>
  195.       <TABLE cellSpacing=1 cellPadding=0 width="100%" border=0 >
  196.         <TR>
  197.           <TD height="25" align="center">供 应 商 列 表</TD>
  198.               </TR>
  199.             </TABLE>
  200. <form action="Supplier.asp" method="post" name="selform" >
  201.   <table width="100%"  border="1" cellpadding="0" cellspacing="0" bordercolor="#D4D0C8" align="center">
  202.     <tr> 
  203.       
  204.       <td width="100%" align="center" valign="top">
  205.   <fieldset style="width:95%">
  206.         <table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#D4D0C8">
  207.           <tr class="but"> 
  208. <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">供应商名称</td>
  209.             <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">联系人</td>
  210. <td width="5%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">职 称</td>
  211. <td width="20%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">地 址</td>
  212. <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">电话号码</td>
  213. <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">传真号码</td>
  214. <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">付款条件</td>
  215. <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">电子邮件</td>
  216. <td width="10%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">备 注</td>
  217.             <td width="5%" height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'">操 作</td>
  218.           </tr>
  219.  <%
  220. set rs=server.CreateObject("ADODB.RecordSet") 
  221. rs.Source="select* from Supplier"
  222. rs.Open rs.Source,conn,1,1
  223. if not rs.EOF then
  224. do while not rs.eof
  225. %>
  226. <tr><td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><a href="Supplier.Asp?id=<%=rs("ID")%>&action=edit"><%=rs("Supplier_name")%></a></td>
  227. <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><%=rs("Contact_person")%><%if rs("Contact_person")="" then%>&nbsp;<%end if%></td>
  228. <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><%=rs("Title")%><%if rs("Title")="" then%>&nbsp;<%end if%></td>
  229. <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><%=rs("adr")%><%if rs("adr")="" then%>&nbsp;<%end if%></td>
  230. <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><%=rs("tel")%><%if rs("tel")="" then%>&nbsp;<%end if%></td>
  231. <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><%=rs("Facsimile")%><%if rs("Facsimile")="" then%>&nbsp;<%end if%></td>
  232. <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><%=rs("Condition")%><%if rs("Condition")="" then%>&nbsp;<%end if%></td>
  233. <td height="18" align="center" class="but" onMouseDown="this.className='tddown'" onMouseUp="this.className='but'" onMouseOut="this.className='but'"><%=rs("email")%><%if rs("email")="" then%>&nbsp;<%end if%></td>
  234. <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>
  235. <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>
  236. </tr>
  237. <%
  238. rs.movenext
  239. loop
  240. end if
  241. rs.close
  242. set rs=nothing
  243. %>
  244. <tr><td align="right" colspan="10" height="22"> <%if oskey="supper" or oskey="admin" then%>
  245.         <input type="checkbox" name="checkbox" value="checkbox" onClick="javascript:SelectAll()"> 选择/反选
  246.               <input onClick="{if(confirm('此操作将删除该信息!nn确定要执行此项操作吗?')){this.document.selform.submit();return true;}return false;}" type=submit value=删除 name=action2> 
  247.               <input type="Hidden" name="action" value='del'><%end if%></td></tr>
  248.         </table>
  249. </fieldset>
  250.   
  251. </td>
  252.     </tr>
  253.     <tr> 
  254.       <td height="50" colspan="3" align="center">
  255.         
  256.         </td>
  257.     </tr>
  258.   </table>
  259. </form>
  260. </TD>
  261.               </TR>
  262.           </table>
  263.           
  264.       <table width="100%" border="0" cellspacing="0" cellpadding="4">
  265.       
  266.       </table>
  267.   </TBODY>
  268. </TABLE>
  269. <%end sub%>
  270. <P>
  271. <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
  272.   <TBODY>
  273.   <TR vAlign=center>
  274.     <TD align=middle width="100%"><!--#include file="footer.htm"--></TD>
  275.   </TR></TBODY></TABLE></P></BODY></HTML>