⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_user.asp

📁 简简单单的客户管理系统-This a simple customer management systems
💻 ASP
字号:
<!--#Include File="Const.Asp"-->
<!--#Include File="Admin_User_Class.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 http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>客户管理管理</title>
<link href="Style.Css" rel="stylesheet" type="text/css" />
</head>
<body>
<%
'// Script CreateBy: Mscga
'// Modify DateTime: 2007-9-3 20:41:22
Dim Rs,Sql
Dim ID,Key,Page,Orders,DFieldKey,DFieldOrders,JumpUrl
ID = Request("ID")
Key = Request("Key")
Page = Request("Page")
Orders = Request("Orders")
DFieldKey = Request("DFieldKey")
DFieldOrders = Request("DFieldOrders")
If len(ID) > 0 And Not IsNumeric(ID) Then : Response.Write "编号只能是数字!" : Response.End '// 检测ID
key = Replace(Key,"'","") '// 过滤关键字里的'
If Len(Page) = 0 Or Not IsNumeric(ID) Then Page = 1 '// Page值判断
If Page < 1 Then Page = 1
Page = Int(Page)
If LCase(Orders) <> "asc" Then Orders = "Desc" '// 排序方式
If Instr("[id],[xm],[dw],[dz],[dh],[zt],[mail],[bz]" , "[" & Lcase(DFieldKey) & "]") = 0 Then DFieldKey = "" '// 搜索字段
If Len(DFieldKey) = 0 Then DFieldKey = "ID"
If Instr("[id],[xm],[dw],[dz],[dh],[zt],[mail],[bz]" , "[" & Lcase(DFieldOrders) & "]") = 0 Then DFieldOrders = "" '// 排序字段
If Len(DFieldOrders) = 0 Then DFieldOrders = "ID"
JumpUrl = "Admin_User.Asp?Page=" & Page & "&Key=" & Key & "&DFieldKey=" & DFieldKey & "&Orders=" & Orders & "&DFieldOrders=" & DFieldOrders
Select Case Request("Act")
Case "Guide" '// 界面
	If Len(ID) = 0 Then
		Call U.Initialize()
		Call Main_Guide(0)
	Else
		U.vID = ID
		Call U.SetValue()
		Call Main_Guide(1)
	End If
Case "UpDate" '// 更新
	If U.GetValue() Then
		If Len(ID) = 0 Then
			If Not U.Create() Then
				Alert U.LastError,JumpUrl
			Else
				Alert "",JumpUrl
			End If
		Else
			U.vID = ID
			If Not U.Modify() Then
				Alert U.LastError,JumpUrl
			Else
				Alert "",JumpUrl
			End If
		End If
	Else
		Alert U.LastError,JumpUrl
	End If
Case "Delete" '// 删除
	If Len(ID) > 0 Then
		U.vID = ID
		If Not U.Delete() Then
			Alert U.LastError,JumpUrl
		Else
			Alert "",JumpUrl
		End If
	Else
		Call Main()
	End If
Case Else '// 列表
	Call Main()
End Select
Set U = Nothing
Conn.Close : Set Conn = Nothing
Sub Main()
	Sql = "Select [ID],[Xm],[Dw],[Dz],[Dh],[Zt],[Mail],[Bz] From [User]"
	If Len(Key) > 0 Then
		If Instr(",ID,","," & DFieldKey & ",") > 0 Then
			If Len(Key) > 0 And IsNumeric(Key) Then
				Sql = Sql & " Where [" & DFieldKey & "]=" & Key & ""
			End If
		Else
			Sql = Sql & " Where [" & DFieldKey & "] Like '%" & Key & "%'"
		End If
	End If
	Sql = Sql & " Order By [" & DFieldOrders & "] " & Orders & ""
	Set Rs = DB(Sql,2)
	%>
	<table width=100% border=0 cellpadding=3 cellspacing=1 class=css_table bgcolor='#E1E1E1'>
	  <tr class=css_menu>
	    <td colspan=9><table width=100% border=0 cellpadding=4 cellspacing=0 class=css_main_table>
	        <form name=frmSearch method=post action=Admin_User.Asp>
	          <tr>
	            <td class=css_main><a href=Admin_User.Asp>客户管理</a> <a href=Admin_User.Asp?Act=Guide&Page=<%=Page%>&Key=<%=Key%>&DFieldKey=<%=DFieldKey%>&Orders=<%=Orders%>&DFieldOrders=<%=DFieldOrders%>>添加客户</a></td>
	            <td class=css_search><select name=DFieldKey id=DFieldKey>
	              <option value="ID" <%If Lcase(DFieldKey) = "id" Then Response.Write "selected='selecte'" %>>按[编号]搜索</option><option value="Xm" <%If Lcase(DFieldKey) = "xm" Then Response.Write "selected='selected'" %>>按[姓名]搜索</option><option value="Dw" <%If Lcase(DFieldKey) = "dw" Then Response.Write "selected='selected'" %>>按[单位]搜索</option><option value="Dz" <%If Lcase(DFieldKey) = "dz" Then Response.Write "selected='selected'" %>>按[地址]搜索</option><option value="Dh" <%If Lcase(DFieldKey) = "dh" Then Response.Write "selected='selected'" %>>按[电话]搜索</option><option value="Zt" <%If Lcase(DFieldKey) = "zt" Then Response.Write "selected='selected'" %>>按[状态]搜索</option><option value="Mail" <%If Lcase(DFieldKey) = "mail" Then Response.Write "selected='selected'" %>>按[邮箱]搜索</option><option value="Bz" <%If Lcase(DFieldKey) = "bz" Then Response.Write "selected='selected'" %>>按[备注]搜索</option>
	              </select>
	              <input name=Key type=text id=Key value="<%=Key%>">
	              <input type=submit name=Submit value=搜>
	            </td>
	          </tr>
	        </form>
	      </table></td>
	  </tr>
	  <tr>
	    <td width="20" class='css_top'>编号</td>
	    <td width="60" class='css_top'>姓名</td>
	    <td class='css_top'>单位</td>
	    <td class='css_top'>地址</td>
	    <td width="100" class='css_top'>电话</td>
	    <td class='css_top'>状态</td>
	    <td class='css_top'>邮箱</td>
	    <td class='css_top'>备注</td>
	    <td width="90" class='css_top'>管理选项</td>
	  </tr>
	  <%
	  If Rs.Eof Then
	  %>
	  <tr class=css_norecord>
	    <td colspan=9>没有任何记录!</td>
	  </tr>
	  <%
	  Else
	  Dim i
	  Rs.PageSize = 12
	  Rs.AbsolutePage = Page
	  For i = 1 To Rs.PageSize
	  If Rs.Eof Then Exit For
	  %>
	  <tr>
	    <td width="20" class='css_list'><%=Rs("ID")%></td>
	    <td width="60" class='css_list'><%=Rs("Xm")%></td>
	    <td class='css_list'><%=Rs("Dw")%></td>
	    <td class='css_list'><%=Rs("Dz")%></td>
	    <td width="100" class='css_list'><%=Rs("Dh")%></td>
	    <td class='css_list'><%=Rs("Zt")%></td>
	    <td class='css_list'><%=Rs("Mail")%></td>
	    <td class='css_list'><%=Rs("Bz")%></td>
	    <td width="90" class='css_list'><input name=modify type=button onClick="location.href='Admin_User.Asp?Act=Guide&ID=<%=Rs("ID")%>&Page=<%=Page%>&Key=<%=Key%>&DFieldKey=<%=DFieldKey%>&Orders=<%=Orders%>&DFieldOrders=<%=DFieldOrders%>';" value=修改>
	      <input name=delete type=button onClick="if(confirm('您确定要删除这条记录吗?')){location.href='Admin_User.Asp?Act=Delete&ID=<%=Rs("ID")%>&Page=<%=Page%>&Key=<%=Key%>&DFieldKey=<%=DFieldKey%>&Orders=<%=Orders%>&DFieldOrders=<%=DFieldOrders%>';}" value=删除>
        </a></td>
	  </tr>
	  <%
	  Rs.MoveNext
	  Next
	  End If
	  %>
	  <tr class=css_page_list>
	    <td colspan=9><%=PageList(Rs.PageCount,Page,Rs.RecordCount,15,"Admin_User.Asp?Page={p}&Key=" & Key & "&DFieldKey=" & DFieldKey & "&Orders=" & Orders & "&DFieldOrders=" & DFieldOrders)%></td>
	  </tr>
</table>
	<%
	Rs.Close
End Sub
Sub Main_Guide(T)
	%>
	<table width=100% border=0 cellpadding=3 cellspacing=1 class=css_table bgcolor='#E1E1E1'>
	  <tr class=css_menu>
	    <td colspan=2><table width=100% border=0 cellpadding=4 cellspacing=0 class=css_main_table>
	        <tr>
	          <td class=css_main><a href=Admin_User.Asp>客户管理</a></td>
	        </tr>
	      </table></td>
	  </tr>
	  <form name='frm' method='post' action='Admin_User.Asp?Act=UpDate&ID=<%=ID%>&Page=<%=Page%>&Key=<%=Key%>&DFieldKey=<%=DFieldKey%>&Orders=<%=Orders%>&DFieldOrders=<%=DFieldOrders%>'>
	    <%If T = 0 Then Style="" Else Style=""%>
	    <tr<%=Style%>>
	      <td class=css_col11>姓名:<span id='hXm' style="color:#ccc;letter-spacing: 0px;font-size:13px;"></span></td>
	      <td class=css_col21>
	      <input name="oXm" type="text" class='css_input' id="oXm" onFocus="hXm.style.color='red';" onBlur="hXm.style.color='#ccc';" value="<%=U.vXm%>" size="40"  >
	      </td>
	    </tr>
	    <%If T = 0 Then Style="" Else Style=""%>
	    <tr<%=Style%>>
	      <td class=css_col12>单位:<span id='hDw' style="color:#ccc;letter-spacing: 0px;font-size:13px;"></span></td>
	      <td class=css_col22>
	      <input name="oDw" type="text" class='css_input' id="oDw" onFocus="hDw.style.color='red';" onBlur="hDw.style.color='#ccc';" value="<%=U.vDw%>" size="40"  >
	      </td>
	    </tr>
	    <%If T = 0 Then Style="" Else Style=""%>
	    <tr<%=Style%>>
	      <td class=css_col11>地址:<span id='hDz' style="color:#ccc;letter-spacing: 0px;font-size:13px;"></span></td>
	      <td class=css_col21>
	      <input name="oDz" type="text" class='css_input' id="oDz" onFocus="hDz.style.color='red';" onBlur="hDz.style.color='#ccc';" value="<%=U.vDz%>" size="40"  >
	      </td>
	    </tr>
	    <%If T = 0 Then Style="" Else Style=""%>
	    <tr<%=Style%>>
	      <td class=css_col12>电话:<span id='hDh' style="color:#ccc;letter-spacing: 0px;font-size:13px;"></span></td>
	      <td class=css_col22>
	      <input name="oDh" type="text" class='css_input' id="oDh" onFocus="hDh.style.color='red';" onBlur="hDh.style.color='#ccc';" value="<%=U.vDh%>" size="40"  >
	      </td>
	    </tr>
	    <%If T = 0 Then Style="" Else Style=""%>
	    <tr<%=Style%>>
	      <td class=css_col11>状态:<span id='hZt' style="color:#ccc;letter-spacing: 0px;font-size:13px;"></span></td>
	      <td class=css_col21>
	      <input name="oZt" type="text" class='css_input' id="oZt" onFocus="hZt.style.color='red';" onBlur="hZt.style.color='#ccc';" value="<%=U.vZt%>" size="40"  >
	      </td>
	    </tr>
	    <%If T = 0 Then Style="" Else Style=""%>
	    <tr<%=Style%>>
	      <td class=css_col12>邮箱:<span id='hMail' style="color:#ccc;letter-spacing: 0px;font-size:13px;"></span></td>
	      <td class=css_col22>
	      <input name="oMail" type="text" class='css_input' id="oMail" onFocus="hMail.style.color='red';" onBlur="hMail.style.color='#ccc';" value="<%=U.vMail%>" size="40"  >
	      </td>
	    </tr>
	    <%If T = 0 Then Style="" Else Style=""%>
	    <tr<%=Style%>>
	      <td class=css_col11>备注:<span id='hBz' style="color:#ccc;letter-spacing: 0px;font-size:13px;"></span></td>
	      <td class=css_col21>
	      <textarea class='css_textarea' name="oBz" type="text" id="oBz" onFocus="hBz.style.color='red';" onBlur="hBz.style.color='#ccc';" cols=50 rows=5 ><%=Server.HtmlEnCode(U.vBz)%></textarea>
	      </td>
	    </tr>
	    <tr class=css_page_list>
	      <td colspan=2><input type='submit' name='Submit' value='保存'></td>
	    </tr>
	  </form>
	</table>
	<%
End Sub
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -