📄 system_square.asp
字号:
<table onclick="window.location.replace('transData.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif">数据转移</td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onclick="window.location.replace('manageUser.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif">用户管理</td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onclick="window.location.replace('system_level.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td><img src="images/tab_on_left.gif" width="16" height="24"></td>
<td background="images/tab_on_middle.gif">系统设置</td>
<td><img src="images/tab_on_right.gif" width="16" height="24"></td>
</tr>
</table>
<% End If %>
<table onclick="window.location.replace('logout.asp')" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="right">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif">注销</td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table>
<table onclick="window.location.reload();" style="cursor: hand;" border="0" cellspacing="0" cellpadding="0" align="right">
<tr>
<td><img src="images/tab_off_left.gif" width="16" height="24"></td>
<td background="images/tab_off_middle.gif">刷新</td>
<td><img src="images/tab_off_right.gif" width="16" height="24"></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="5"><img src="images/null.gif" width="1" height="1"></td>
</tr>
<tr>
<td bgcolor="#1E75CF"> </td>
</tr>
<tr id="block1" style="display: block;">
<td>
<%
Dim action
action = Trim(Request.QueryString("action"))
Select Case action
Case "add"
Call addOrEdit()
Case "save"
Call saveData()
Case "edit"
Call addOrEdit()
Case "restore"
Call restore()
Case "delete"
Call deleteData()
Case Else
Call addOrEdit()
End Select
Sub saveData()
Dim areaName,squareName
areaName =Trim(Request.Form("areaName"))
squareName = Trim(Request.Form("squareName"))
If areaName = "" Or squareName = "" Then
Response.Write("<div align=""center"">提交的数据不完整,请返回重新填写。<br>")
Response.Write("<input name=""back"" type=""button"" value="" 返 回 "" onClick=""history.back();""></div>")
Exit Sub
End If
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_square Where squareName = '" & squareName & "'",conn,3,2
If rs.RecordCount > 0 Then
Response.Write("<div align=""center"">该地区已经存在。<br>")
Response.Write("<input name=""back"" type=""button"" value="" 返 回 "" onClick=""history.back();""></div>")
rs.Close
Set rs = Nothing
Exit Sub
Else
rs.AddNew
rs("areaName") = areaName
rs("squareName") = squareName
rs.Update
rs.Close
Set rs = Nothing
Response.Redirect("?")
End If
End Sub
Sub restore()
Dim squareNameOld,areaNameOld,areaName,squareName
squareNameOld = Trim(Request.Form("squareNameOld"))
areaName = Trim(Request.Form("areaName"))
squareName = Trim(Request.Form("squareName"))
If squareNameOld = "" Or areaName = "" Or squareName = "" Then
Response.Write("<div align=""center"">提交的数据不完整,请返回重新填写。<br>")
Response.Write("<input name=""back"" type=""button"" value="" 返 回 "" onClick=""history.back();""></div>")
Exit Sub
End If
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_square Where squareName <> '" & squareNameOld & "'",conn,3,1
Do While Not rs.BOF And Not rs.EOF
If rs("squareName") = squareName Then
Response.Write("<div align=""center"">该地区已经存在。<br>")
Response.Write("<input name=""back"" type=""button"" value="" 返 回 "" onClick=""history.back();""></div>")
rs.Close
Set rs = Nothing
Exit Sub
End If
rs.MoveNext
Loop
rs.Close
rs.Open "Select * From baidu_square Where squareName = '" & squareNameOld & "'",conn,3,2
If rs.RecordCount = 1 Then
squareNameOld = rs("squareName")
rs("areaName") = areaName
rs("squareName") = squareName
rs.Update
If areaNameOld <> areaName Then
Dim rss
Set rss = Server.CreateObject("ADODB.Recordset")
rss.Open "Select * From baidu_client Where cSquare = '" & squareNameOld & "'",conn,3,2
Do While Not rss.BOF And Not rss.EOF
rss("cSquare") = squareName
rss.Update
rss.MoveNext
Loop
rss.Close
Set rss = Nothing
End If
End If
rs.Close
Set rs = Nothing
Response.Redirect("?")
End Sub
Sub deleteData()
Dim squareNameOld,areaNameOld
squareNameOld = Trim(Request("squareNameOld"))
If squareNameOld = "" Then
Response.Write("<div align=""center"">提交的数据不完整,请返回重新填写。<br>")
Response.Write("<input name=""back"" type=""button"" value="" 返 回 "" onClick=""history.back();""></div>")
Exit Sub
End If
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_square Where squareName = '" & squareNameOld & "'",conn,3,2
If rs.RecordCount > 0 Then
squareNameOld = rs("squareName")
rs.Delete
rs.Update
End If
rs.Close
If areaNameOld <> "" Then
rs.Open "Select * From baidu_client Where cSquare = '" & squareNameOld & "'",conn,3,2
Do While Not rs.BOF And Not rs.EOF
rs.Delete
rs.Update
rs.MoveNext
Loop
rs.Close
End If
Set rs = Nothing
Response.Redirect("?")
End Sub
Sub addOrEdit()
Dim areaName,squareName,squareNameOld,strOut,strAction
If action = "edit" Then
Dim rs
squareNameOld = Trim(Request("squareNameOld"))
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From baidu_square Where squareName = '" & squareNameOld & "'",conn,3,1
If rs.RecordCount = 1 Then
areaName = rs("areaName")
squareName = rs("squareName")
End If
rs.Close
Set rs = Nothing
strOut = "编辑地区:"
strAction = "?action=restore"
Else
strOut = "添加地区:"
strAction = "?action=save"
End If
%>
<table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF">
<form name="squareForm" action="<% = strAction %>" method="post" onSubmit="return checkInput('squareForm');">
<tr>
<td width="60"> </td>
<td><% = strOut %>
<% If action="edit" Then %><input name="squareNameOld" type="hidden" id="squareNameOld" value="<% = squareNameOld %>"><% End If %></td>
</tr>
<tr>
<td width="60"> </td>
<td>地区名称:
<input name="squareName" type="text" id="squareName" size="16" maxlength="16" value="<% = squareName %>" selfValue="地区名称">
省份 :
<% = getList(1,"baidu_area","","areaName","areaName","省份") %>
</td>
</tr>
<tr>
<td width="60" align="center"> </td>
<td align="center"> <input type="submit" name="Submit" value=" 提 交 ">
<input name="Reset" type="reset" id="Reset" value=" 重 置 ">
</td>
</tr>
</form>
</table>
<script language="JavaScript">
<!--
var strArea = "<% = areaName %>";
for(var i=0;i<document.all.areaName.options.length;i++){
if(document.all.areaName.options[i].value == strArea){
document.all.areaName.options[i].selected = true;
}
}
-->
</script>
<%
End Sub
%>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="16" align="center" bgcolor="#1E75CF" id="oHeadBar" style="cursor: hand;" title="隐藏头部" onClick="return showHideHead(document.all.oHeadCtrl.src);">
<img src="images/arrow_up.gif" alt="隐藏头部" width="16" height="16" align="absmiddle" id="oHeadCtrl"> </td>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#FFFFFF" style="padding: 10px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>[<a href="system_level.asp">用户级别</a>] [<a href="system_group.asp">用户组</a>]
[<a href="system_clientsType.asp">客户类型</a>] [<a href="system_clientsTrade.asp">产品分类</a>]
[<a href="system_recordsType.asp">拜访类型</a>] [<a href="system_area.asp">省份</a>]
[<a href="system_square.asp">地区</a>] </td>
</tr>
</table>
<table width="100%" align="center" border="1" cellpadding="3" cellspacing="0" bordercolor="#DCDCDC" bordercolordark="#FFFFFF">
<tr>
<td width="120" align="center" bgcolor="menu">省份名称</td>
<td align="center" bgcolor="menu">地区名称</td>
<td width="120" align="center" bgcolor="menu">操作</td>
<% = list() %>
</tr>
</table> </td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -