<%
'Interface program imitating Lotus Notes
'Author: Snow in Saibei
'Creation date: March 2002
'Modification date: March 2005
'For the sake of security and convenience of sharing, the tags of the asp program are changed to Chinese characters, which can be replaced in batches during use.
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
.tHeader{font-weight:bold;background-color: #D0D0D0; color: #000000; border-left:
1 solid #FFFFFF; border-right: 1 solid #000000; border-top: 1 solid #FFFFFF;
border- bottom: 1 solid #000000}
.tHeaderPush{font-weight:bold;background-color: #D0D0D0; color: #000000; border: 1
solid #707070;}
</style>
<title>Imitate Lotus Notes special effects</title>
<script language=javascript>
var yesH="√"; //The mark displayed after selection
var noH=' '; //Show someone when not selected
var IfPush='no'; //Used for control when moving the mouse to select it. 'yes' means that the mouse has been pressed and dragging
is effective
; 'no' means that the mouse has been pushed up, and moving the mouse again has no effect.
var FI='yes'; //Used for control when moving the mouse to select, 'yes' can process the current cell, 'no'
cannot.
//The default is 'yes'. When we enter a certain cell range, we will process it, and then change it to
'no', then no more.
//Process this cell, change it to 'yes' when leaving the cell, and process
the next
entering cell.
//Perform data deletion
functiondelInfo(iCount)
{
var pKey=new String();
if(iCount>0)
{
for(var i=1;i<=iCount;i++)
{
if (document.getElementById("a" + i).innerText==yesH)
{pKey += ("'" + document.getElementById("pKey" + i).value + "',")}
//The keyword string is generated here. Since it is a character type, single quotes are added on both sides of each keyword.
//Then connect with commas. If it is a numeric type, no single quotes are needed.
}
}
if(pKey!="")
{
pKey=pKey.substring(0,pKey.length-1);
if(confirm("Are you sure you want to delete the selected information?"))
{
document.getElementById("delPkey").value=pKey;
document.getElementById("delForm").submit();
}
}
}
//Perform data modification, no matter how many are selected, but only modify the first one
function editInfo(iCount)
{
var pKey=new String();
if(iCount>0)
{
for(var i=1;i<=iCount;i++)
{
if (document.getElementById("a" + i).innerText==yesH)
{pKey += document.getElementById("pKey" + i).value;
break;}
}
}
if(pKey!="")
{
window.open("editinfo.asp?unid=" + pKey,"_blank");
//Enter the boundary interface here to edit the selected information. The editinto.asp code is not written.
}
}
function md()
{IfPush='yes';}
functionmu()
{IfPush='no';}
//Drag to select
function Wr(whoTd)
{
if (IfPush=='yes')
{
if (FI=='yes')
{ FI='no';
if (whoTd.innerText!=noH)
{whoTd.innerText=noH;}
else
{whoTd.innerText=yesH;}
}
}
}
//Click to select
function WRone(whoTd)
{
if (whoTd.innerText!=noH)
{whoTd.innerText=noH;}
else
{whoTd.innerText=yesH;}
}
</script>
</head>
<%
'Connect to database
Set db=Server.CreateObject("ADODB.Connection")
dim DBPath
DBPath = Server.MapPath("crcconfiginfodispatch.mdb")
dim mmm
mmm="driver={Microsoft Access Driver (*.mdb)};dbq="& DBPath
db.Open mmm
'Execute deletion
if request("delPkey")<>"" then
Response.Write "del:" & request("delPkey")
Response.Redirect Request.ServerVariables("Path_info")
'The code here is redundant, but it can avoid refreshing the prompt. You can freely design the program according to your needs
end if
'Read data
set rs=Server.CreateObject("ADODB.Recordset")
rs.Open "select * from notes",db,3
%>
<body onmousedown="md();" onmouseup="mu();" oncontextmenu="return false"
ondragstart="return false" onselectstart="return false">
<br><br><br><div align=center>
<table border="1" rules=none frame=hsides cellspacing=0 cellpadding=0 width="90%">
<tr>
<td width="4%" bgcolor="#FFFFFF" style="cursor:hand" >
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr><td class="tHeader"
onmousedown="javascript:this.className='tHeaderPush';"
onmouseup="javascript:this.className='tHeader';"
onmouseout="javascript:this.className='tHeader' ;" > </td>
<td width="62%" onmousedown="javascript:this.className='tHeaderPush';"
onmouseup="javascript:this.className='tHeader';"
onmouseout="javascript:this.className='tHeader';" class="tHeader" align="center"
><font size="2">Title</font></td>
<td width="34%" onmousedown="javascript:this.className='tHeaderPush';"
onmouseup="javascript:this.className='tHeader';"
onmouseout="javascript:this.className='tHeader';" class="tHeader" align="center"
><font size="2">Date</font></td>
</tr>
<%if rs.RecordCount>0 then
BGC="#DAF0FE"
Whi=0
j=0
rs.MoveFirst
do while not rs.EOF
j=j+1%>
<tr>
<td align=center id="a<%=j%>"
onmouseover="Wr(this);" onmouseout="javascrpt:FI='yes';"
onmousedown="WRone(this);" bgcolor="# FFFFE8">
<p align="center"> </p>
</td>
<input type="hidden" id="pKey<%=j%>" value="
<%=rs("unid")%>">
<td id="b<%=j%>"
bgcolor="<%=BGC%>"><font size="2"> <%=rs("subject")%></font>< /td>
<td id="c<%=j%>" bgcolor="<%=BGC%>"
align=center><font size="2"><%=rs("disptime")%></font> </td>
<%
if Whi=0 then
BGC="#faaded"
whi=1
else
whi=0
BGC="#DAF0FE"
end if
%>
</tr>
<%rs.MoveNext
loop
end if%>
</table>
</td>
</tr>
</table>
<br>
<%if rs.RecordCount>0 then%>
<input type=button name="editinfo" value="Modify..."
onclick="editInfo('<%=rs.RecordCount%>');">
<input type=button name="delinfo" value="Delete..."
onclick="delInfo('<%=rs.RecordCount%>');">
<%end if%>
</div>
<div style='visibility:hidden;'>
<form method="post" id="delForm" action="<%=Request.ServerVariables("Path_Info")%
>">
<input type="hidden" id="delPkey" name="delPkey" value="">
</form>
</div>
</body>
</html>