📄 addresslist.asp
字号:
<!--#include File="../ConnDB.asp"-->
<!--#include File="../class/AddressList.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>公告管理</title>
<link href="../style.css" rel="stylesheet">
<script language="javascript">
function newWin(url) {
var oth="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=200,top=200";
oth = oth+",width=500,height=450";
var newWin = window.open(url,"newWin",oth);
newWin.focus();
return false;
}
function SelectChk()
{
var s = false; //用来记录是否存在被选中的复选框
var Addressid, n=0;
var strid, strurl;
var nn = self.document.all.item("Address"); //返回复选框Address的数量
for (j=0; j<nn.length; j++) {
if (self.document.all.item("Address",j).checked) {
n = n + 1;
s = true;
Addressid = self.document.all.item("Address",j).id+""; //转换为字符串
//生成要删除公告编号的列表
if(n==1) {
strid = Addressid;
}
else {
strid = strid + "," + Addressid;
}
}
}
strurl = "AddressDelt.asp?id=" + strid;
if(!s) {
alert("请选择要删除的个人信息!");
return false;
}
if (confirm("你确定要删除这些个人信息吗?")) {
form1.action = strurl;
form1.submit();
}
}
function sltAll()
{
var nn = self.document.all.item("Address");
for(j=0;j<nn.length;j++)
{
self.document.all.item("Address",j).checked = true;
}
}
function sltNull()
{
var nn = self.document.all.item("Address");
for(j=0;j<nn.length;j++)
{
self.document.all.item("Address",j).checked = false;
}
}
</script>
<style type="text/css">
<!--
.STYLE1 {
color: #990000;
font-weight: bold;
}
-->
</style>
</head>
<body link="#000080" vlink="#080080">
<form name="form1" method="POST">
<%
'从表AddressList中获取所有个人信息
set objAddress = new AddressList
objAddress.GetAddresslist
'如果rs为空,则显示提示信息
If objAddress.rs.EOF Then
Response.Write "<tr><td colspan=5 align=center>通讯录中没有记录。</td></tr></table>"
Else
%>
<p align=center class="STYLE1"><font style='FONT-SIZE:12pt'>通讯录</font></p>
<table align=center border="1" cellspacing="0" width="100%" bordercolorlight="#4DA6FF" bordercolordark="#ECF5FF" style='FONT-SIZE: 9pt'>
<tr bgcolor="#FFCCFF">
<td width="8%" align="center"><strong>类型</strong></td>
<td width="10%" align="center"><strong>姓名</strong></td>
<td width="8%" align="center"><strong>性别</strong></td>
<td width="10%" align="center"><strong>通讯地址</strong></td>
<td width="8%" align="center"><strong>邮编</strong></td>
<td width="10%" align="center"><strong>电子邮件</strong></td>
<td width="10%" align="center"><strong>固定电话</strong></td>
<td width="10%" align="center"><strong>移动电话</strong></td>
<td width="10%" align="center"><strong>单位</strong></td>
<td width="8%" align="center"><strong>生日</strong></td>
</tr>
<%
'设置每页记录数量为15
objAddress.rs.PageSize = 15
'设置并读取页码参数page
iPage = CLng(Request("page"))
If iPage <=0 Then
iPage = 1
End If
If iPage > objAddress.rs.PageCount Then
iPage = objAddress.rs.PageCount
End If
RowCount = objAddress.rs.PageSize
'依次显示公告信息
Do While Not objAddress.rs.EOF And RowCount > 0
%>
<tr>
<td align="center">
<% if objAddress.rs("Flag")=1 then
response.write "同学"
else
response.write "老师"
end if
%> </td>
<td align="center"><%=objAddress.rs("Name")%> </td>
<td align="center">
<% if objAddress.rs("Sex")=0 then
response.write "男"
else
response.write "女"
end if
%> </td>
<td align="center"><%=objAddress.rs("Address")%> </td>
<td align="center"><%=objAddress.rs("Postcode")%> </td>
<td align="center"><%=objAddress.rs("Email")%> </td>
<td align="center"><%=objAddress.rs("Telephone")%> </td>
<td align="center"><%=objAddress.rs("Mobile")%> </td>
<td align="center"><%=objAddress.rs("Company")%> </td>
<td align="center"><%=objAddress.rs("Birthday")%> </td>
</tr>
<%
objAddress.rs.MoveNext()
'控制每页显示记录的数量
RowCount = RowCount - 1
Loop
%>
</table>
<%
'显示页码链接
If objAddress.rs.PageCount>1 then
Response.Write "<table border='0'><tr><td><b>分页:</b></td>"
For i=1 to rs.PageCount
Response.Write "<td><a href='AddresslistMan.asp?page=" & i & "'>"
Response.Write "[<b>" & i & "</b>]</a></td>"
Next
Response.Write "</tr></table>"
End If
End If
%>
<p align="center"><br>
<input type=hidden name="Address">
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -