?? main.asp
字號(hào):
<%Option Explicit%>
<!--#include file="config.asp"-->
<%
If session("admin")<>"ok" Then
response.redirect"index.asp"
Else
Dim searchKey,searchCompany,searchName,searchTelephone,searchDemo
searchKey=trim(request.form("searchKey"))
searchCompany=trim(request.form("searchCompany"))
searchName=trim(request.form("searchName"))
searchTelephone=trim(request.form("searchTelephone"))
searchDemo=trim(request.form("searchDemo"))
Dim recycle,Id
recycle=request("recycle")
If recycle="" Then recycle=0
Dim PageNo
PageNo=request("PageNo")
If PageNo="" Then PageNo=1
Sub ShowCustomer(objRS,PageNo)
objRS.AbsolutePage=PageNo
Dim I
For I=1 To rsPage
response.write"<tr>"
'response.write"<td align='center'><input type='checkbox' name='CustCheck' value='"&objRS("Id")&"'></td>"
response.write"<td align='left'> <input type='checkbox' name='CustCheck' value='"&objRS("Id")&"'>"
If objRS("VIP")=3 Then
response.write "<a title='"&objRS("Company")&"' onclick=""winOpen('viewcustomer.asp?Id="&objRS("Id")&"')"" style='cursor:hand'><font color='#ff0000'>"&Left(objRS("Company"),13)&"</font></a>"
ElseIf objRS("VIP")=2 Then
response.write "<a title='"&objRS("Company")&"' onclick=""winOpen('viewcustomer.asp?Id="&objRS("Id")&"')"" style='cursor:hand'><font color='#008000'>"&Left(objRS("Company"),13)&"</font></a>"
ElseIf objRS("VIP")=1 Then
response.write "<a title='"&objRS("Company")&"' onclick=""winOpen('viewcustomer.asp?Id="&objRS("Id")&"')"" style='cursor:hand'><font color='#000000'>"&Left(objRS("Company"),13)&"</font></a>"
End If
response.write"</td>"
response.write"<td align='center'>"&Left(objRS("Name"),5)&"</td>"
response.write"<td align='center'>"&Left(objRS("Title"),5)&"</td>"
response.write"<td align='center'>"&Left(objRS("Tel1"),8)&"</td>"
response.write"<td align='center'>"&Left(objRS("Date1"),10)&"</td>"
response.write"<td align='center'><a href='editcustomer.asp?Id="&objRS("Id")&"'>編輯</a></td>"
response.write"</tr>"
objRS.MoveNext
If objRS.EOF Then Exit For
Next
End Sub
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title><%=title%></title>
<style type="text/css">
td{font-size:10pt;font-family:宋體;color:#000000;height:30px}
input{border:0}
</style>
<SCRIPT language=JavaScript>
<!--
function winOpen(url){
window.open(url,'','width=520,height=500,left=30,top=50,scrollbar=auto');
}
function check(id){
var isChecked = false;
for (var i=0;i<document.CustForm.elements.length;i++){
//var e = document.CustForm.elements[i];
if (document.CustForm.elements[i].name == 'CustCheck'){
if (document.CustForm.elements[i].checked == true){
isChecked = true;
break;
}
}
//return isChecked;
}
if(!isChecked){
alert("請(qǐng)先選擇客戶!");
return false;
}
document.CustForm.target="_self";
if(id==1){
if(confirm("你確定要將選中的客戶放入回收站嗎?")==true){
document.CustForm.action="del.asp";
document.CustForm.submit();
}
}
if(id==2){
if(confirm("你確定要將選中的客戶徹底刪除嗎(不可恢復(fù))?")==true){
document.CustForm.action="del.asp";
document.CustForm.submit();
}
}
if(id==3){
if(confirm("你確定要將選中的客戶資料還原嗎?")==true){
document.CustForm.action="del.asp";
document.CustForm.submit();
}
}
}
function delConfirm(){
//if(id==4){
if(confirm("你確定要清空回收站嗎?")==true){
document.CustForm.action="del.asp";
document.CustForm.submit();
}
//}
}
function CheckAll(f)
{
for (var i=0;i<f.elements.length;i++)
{
var e = f.elements[i];
if (e.name == 'CustCheck')
if (e.checked == false){
e.checked = true;
}else{
e.checked = false;
}
}
}
//-->
</SCRIPT>
</head>
<body topmargin=0 leftmargin=0 bgcolor="#000000">
<table width="750" align="center" bordre=0 bgcolor="#ffffff"><tr><td width="100%">
<table align="center" border=0 width="98%" cellspacing=0 cellpadding=0>
<tr>
<td width="100%" align="center" valign="middle" style="font-size:11pt"><b><%=cnVersion%></b></td>
</tr>
</table>
<table align="center" border=1 width="98%" cellspacing="0" cellpadding="0" bordercolorlight="#ffffff" bordercolordark="#999999">
<form name="searchForm" method="post">
<tr>
<td colspan=6 align="right" valign="middle">請(qǐng)輸入查詢關(guān)鍵字:
<input type="text" name="searchKey" style="border:1 solid #cccccc">
<!--
<select name="searchField">
<option value="searchCompany" selceted>單位名稱</option>
<option value="searchName">聯(lián)系人</option>
<option value="searchTelephone">聯(lián)系電話</option>
<option value="searchDemo">備注</option>
</select> -->
<input type="submit" value="查找" style="border:1px solid #000000">
</td>
</tr>
</form>
<form name="CustForm" method="post">
<tr bgcolor="#D4D0C8">
<td colspan=7 align="left">
<input type="button" value="·全選/反選·" onclick="return CheckAll(CustForm)">
<%If recycle<>1 Then%>
<input type="submit" name="s1" value="·刪除·" onclick="return check(1);">
<%End If%>
<%If recycle=1 Then%>
<input type="submit" name="s3" value="·還原·" onclick="return check(3);">
<%End If%>
<input type="submit" name="s2" value="·徹底刪除·" onclick="return check(2);">
<%If recycle<>1 Then%>
<a href="main.asp?recycle=1">回收站</a>
<a href="addcustomer.asp">添加新客戶</a>
<%ElseIf recycle=1 Then%>
<input type="submit" name="s4" value="·清空·" onclick="return delConfirm();">
<a href="main.asp">返回</a>
<%End If%>
<a href="exit.asp">退出系統(tǒng)</a>
</td>
</tr>
<tr bgcolor="#D4D0C8">
<td align="center" valign="middle" width="30%">單位名稱</td>
<td align="center" valign="middle" width="20%">聯(lián)系人</td>
<td align="center" valign="middle" width="10%">職務(wù)</td>
<td align="center" valign="middle" width="10%">辦公電話</td>
<td align="center" valign="middle" width="20%">加入時(shí)間</td>
<td align="center" valign="middle" width="10%">編輯</td>
</tr>
<!--#include file="conn.asp"-->
<%
Dim objRS,strSQL
set objRS=Server.CreateObject("ADODB.Recordset")
If recycle=1 Then
strSQL="select Id,Company,Name,Title,Tel1,VIP,Date1 from customer where Delete=1 and (Company like '%"&searchKey&"%' or Name like '%"&searchKey&"%' or Tel1 like '%"&searchKey&"%' or Tel2 like '%"&searchKey&"%' or Demo like '%"&searchKey&"%') order by VIP desc,Date1 desc"
Else
strSQL="select Id,Company,Name,Title,Tel1,VIP,Date1 from customer where Delete=0 and (Company like '%"&searchKey&"%' or Name like '%"&searchKey&"%' or Tel1 like '%"&searchKey&"%' or Tel2 like '%"&searchKey&"%' or Demo like '%"&searchKey&"%') order by VIP desc,Date1 desc"
End If
objRS.Open strSQL,objConn,1,3
Dim rsCount,rsPage,pageCount,pageMode
rsCount=objRS.RecordCount
objRS.PageSize=13 '設(shè)置每頁(yè)記錄數(shù)
rsPage=objRS.PageSize '設(shè)置每頁(yè)記錄數(shù)
If rsCount>0 Then
pageCount=objRS.PageCount
ShowCustomer objRS,PageNo
Else
response.write"<tr>"
'If recycle=1 Then
response.write"<td width='100%' align='left' colspan=7> 當(dāng)前沒有任何客戶記錄!</td>"
response.write"</tr>"
End If
%>
<tr bgcolor="#D4D0C8">
<td colspan=7 align="left">
<input type="button" value="·全選/反選·" onclick="return CheckAll(CustForm)">
<%If recycle<>1 Then%>
<input type="submit" name="s1" value="·刪除·" onclick="return check(1);">
<%End If%>
<%If recycle=1 Then%>
<input type="submit" name="s3" value="·還原·" onclick="return check(3);">
<%End If%>
<input type="submit" name="s2" value="·徹底刪除·" onclick="return check(2);">
<%If recycle<>1 Then%>
<a href="main.asp?recycle=1">回收站</a>
<a href="addcustomer.asp">添加新客戶</a>
<%ElseIf recycle=1 Then%>
<input type="submit" name="s4" value="·清空·" onclick="return delConfirm();">
<a href="main.asp">返回</a>
<%End If%>
<a href="exit.asp">退出系統(tǒng)</a>
</td>
</tr>
<%
If pageCount>1 Then
response.write"<form name='jumpPage' method='post' action='?'>"
response.write"<tr bgcolor='#D4D0C8'>"
response.write"<td colspan=7 align='right'>"
response.write"每頁(yè)<font color='#ff0000'>"&rsPage&"</font>條,當(dāng)前<font color='#ff0000'>"&PageNo&"</font>/"&pageCount&"頁(yè) "
If Int(PageNo)>1 Then
response.write"<a href='?recycle="&recycle&"&PageNo=1'>首頁(yè)</a> "
response.write"<a href='?recycle="&recycle&"&PageNo="&PageNo-1&"'>上頁(yè)</a> "
End If
If Int(PageNo)>=1 And Int(PageNo)<pageCount Then
response.write"<a href='?recycle="&recycle&"&PageNo="&PageNo+1&"'>下頁(yè)</a> "
response.write"<a href='?recycle="&recycle&"&PageNo="&pageCount&"'>尾頁(yè)</a>"
End If
response.write" "
response.write"轉(zhuǎn)到第<input type='text' name='PageNo' style='width:20px;border:1px solid #000000'>頁(yè)"
response.write"<input type='submit' value='>>>'>"
response.write"</td>"
response.write"</tr>"
response.write"</form>"
End If
%>
</form>
</table>
<table align="center" border=0 width="98%" cellspacing=0 cellpadding=0>
<tr>
<td width="100%" align="center" valign="middle" style="font-size:10pt"><%=bottom%></td>
</tr>
</table>
</td></tr></table>
</body>
</html>
<%
End If
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -