1
2'仿 Lotus Notes 的界面程序
3'作者:塞北的雪
4'创作日期:2002年3月
5'修改日期:2005年3月
6'为了安全和共享的方便,将其中asp程序的标记改成中文字符,使用时可以批量替换回
1<html>
2<head>
3<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
4<style>
5.tHeader{font-weight:bold;background-color: #D0D0D0; color: #000000; border-left:
6
71 solid #FFFFFF; border-right: 1 solid #000000; border-top: 1 solid #FFFFFF;
8
9border-bottom: 1 solid #000000}
10.tHeaderPush{font-weight:bold;background-color: #D0D0D0; color: #000000; border: 1
11
12solid #707070;}
13</style>
14<title>模仿Lotus Notes特效</title>
15<script language="javascript">
16var yesH="√"; //选中后显示的标志
17var noH=' '; //未选中时的某人显示
18var IfPush='no'; //移动鼠标选中的时候用于控制,'yes'表示鼠标已经按下,拖动有
19
20效;'no'表示鼠标已经泰起来了,再移动鼠标已经没有作用了
21
22var FI='yes'; //移动鼠标选中的时候用于控制,'yes'可以处理当前单元格,'no'
23
24则不能处理
25//默认为'yes',当我们进入某个单元格区域,则处理他,然后改为
26
27'no',则不再
28//对该单元格处理,当离开单元格时又改为'yes',又可以处理下一
29
30个进入的单元格
31
32//执行数据删除
33function delInfo(iCount)
34{
35var pKey=new String();
36if(iCount>0)
37{
38for(var i=1;i<=iCount;i++)
39{
40if (document.getElementById("a" + i).innerText==yesH)
41{pKey += ("'" + document.getElementById("pKey" + i).value + "',")}
42//此处生成关键字串,由于是字符型,故在每个关键字的两侧加了单引号,
43//然后用逗号连接,如果是数字型,则不用单引号。
44}
45}
46if(pKey!="")
47{
48pKey=pKey.substring(0,pKey.length-1);
49if(confirm("确定要删除选定的信息吗?"))
50{
51document.getElementById("delPkey").value=pKey;
52document.getElementById("delForm").submit();
53}
54}
55}
56
57//执行数据修改,无论选中多少,但只对第一个进行修改
58function editInfo(iCount)
59{
60var pKey=new String();
61if(iCount>0)
62{
63for(var i=1;i<=iCount;i++)
64{
65if (document.getElementById("a" + i).innerText==yesH)
66{pKey += document.getElementById("pKey" + i).value;
67break;}
68}
69}
70if(pKey!="")
71{
72window.open("editinfo.asp?unid=" + pKey,"_blank");
73//此处进入边界界面,对选中信息进行编辑。editinto.asp代码没有编写。
74}
75}
76
77function md()
78{IfPush='yes';}
79
80function mu()
81{IfPush='no';}
82
83//拖拉选取
84function Wr(whoTd)
85{
86if (IfPush=='yes')
87{
88if (FI=='yes')
89{ FI='no';
90if (whoTd.innerText!=noH)
91{whoTd.innerText=noH;}
92else
93{whoTd.innerText=yesH;}
94}
95}
96}
97
98//单击选取
99function WRone(whoTd)
100{
101if (whoTd.innerText!=noH)
102{whoTd.innerText=noH;}
103else
104{whoTd.innerText=yesH;}
105}
106</script>
107</head>
'连接数据库
Set db=Server.CreateObject("ADODB.Connection")
dim DBPath
DBPath = Server.MapPath("crc\configinfo\dispatch.mdb")
dim mmm
mmm="driver={Microsoft Access Driver (*.mdb)};dbq="& DBPath
db.Open mmm
'执行删除
if request("delPkey")<>"" then
Response.Write "del:" & request("delPkey")
Response.Redirect Request.ServerVariables("Path_info")
'此处代码属于多余,但是可以避免刷新提示。根据需要,可以自由设计程序
end if
'读取数据
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open "select * from notes",db,3
1<body oncontextmenu="return false" ondragstart="return false" onmousedown="md();" onmouseup="mu();" onselectstart="return false">
2<br/><br/><br/><div align="center">
3<table border="1" cellpadding="0" cellspacing="0" frame="hsides" rules="none" width="90%">
4<tr>
5<td bgcolor="#FFFFFF" style="cursor:hand" width="4%">
6<table border="0" cellpadding="0" cellspacing="0" width="100%">
7<tr><td class="tHeader" onmousedown="javascript:this.className='tHeaderPush';" onmouseout="javascript:this.className='tHeader';" onmouseup="javascript:this.className='tHeader';"> </td>
8<td align="center" class="tHeader" onmousedown="javascript:this.className='tHeaderPush';" onmouseout="javascript:this.className='tHeader';" onmouseup="javascript:this.className='tHeader';" width="62%"><font size="2">标题</font></td>
9<td align="center" class="tHeader" onmousedown="javascript:this.className='tHeaderPush';" onmouseout="javascript:this.className='tHeader';" onmouseup="javascript:this.className='tHeader';" width="34%"><font size="2">日期</font></td>
10</tr>
if rs.RecordCount>0 then
BGC="#DAF0FE"
Whi=0
j=0
rs.MoveFirst
do while not rs.EOF
j=j+1
1<tr>
2<td align="center" bgcolor="#FFFFE8" id="a```
3=j
4```" onmousedown="WRone(this);" onmouseout="javascrpt:FI='yes';" onmouseover="Wr(this);">
5<p align="center"> </p>
6</td>
7<input ```"="" id="pKey```
8=j
9```" type="hidden" unid")="" value="
=rs("/>
if Whi=0 then
BGC="#faaded"
whi=1
else
whi=0
BGC="#DAF0FE"
end if
1</tr>
rs.MoveNext
loop
end if
1</table>
2</td>
3</tr>
4</table>
5<br/>
if rs.RecordCount>0 then
1<input name="editinfo" onclick="editInfo('```
2=rs.RecordCount
3```');" type="button" value="修改…"/>
4<input name="delinfo" onclick="delInfo('```
5=rs.RecordCount
6```');" type="button" value="删除…"/>
end if
1</div>
2<div style="visibility:hidden;">
3<form action="<%=Request.ServerVariables(" id="delForm" method="post" path_info")%="">">
4<input id="delPkey" name="delPkey" type="hidden" value=""/>
5</form>
6</div>
7</body>
8</html>