⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wyly_ckly.asp

📁 asp+Access开发的客户资源管理系统,用户名:admin,密码:
💻 ASP
字号:
<%
' 将数据中的单引号改成两个单引号
Function SqlStr( data )
   SqlStr = Replace( data, "'", "''" )
End Function


'完美的显示空格子程序-----------------------------------------------------------
sub break1(now_page,total_page)
	for a_page=1 to total_page-now_page
		if a_page mod 2=1 then
			color="#F8F4E0"
		else
			color="#F4F4E8"
		end if
		response.write "<tr bgcolor="&color&">"
			response.write "<td class='small'>  </td>"
			response.write "<td class='small'>  </td>"
			response.write "<td class='small'>  </td>"
			response.write "<td class='small'>  </td>"
		response.write "</tr>"
	next
end sub


'显示数据的子程序---------------------------------------------------------------
sub showdata
	for ipage=1 to rs.pagesize

	
     
		'决定颜色
		if ipage mod 2=1 then
			color="#F8F4E0"
		else
			color="#F4F4E8"
		end if

		'输出数据
		response.write "<tr bgcolor="&color&">"
			idno=rs("id")
			response.write"<td class='small'>"&rs("name")&"</td>"
			response.write "<td class='small'><a href='javascript:openFrameless("&idno&")' title='点击["&left(rs("title"),18)&"]查看详情'>"&left(rs("title"),18)&"</A></td>"
			response.write "<td class='small'><center><a href=wyly_ckly_ck_sc.asp?id="&idno&"><img src='images/sc.gif' width='15' height='15' border='0' alt='删除'></A></center></td>"
			response.write "<td class='small'><center>"&rs("dat")&"</center></td>"
		response.write "</tr>"
		rs.MoveNext

		'如果没有数据
		if rs.eof then 
			'输出空表格
			call break1(ipage,rs.pagesize)
			exit for
		end if

	next
end sub

'显示分页符号的子程序---------------------------------------------------------------

'如果是第一页
sub fenye
	if page=1 then
		Response.Write " [最前页]"
		Response.Write "[上一页]"
	else
		Response.Write "[<a href=wyly_ckly.asp?page=1 class='01'>最前页</a>]"
		Response.Write "[<a href=wyly_ckly.asp?Page="&Page-1&" class='01'>上一页</a>]"
	End If

	'如果是最后一页
	If Page <> rs.PageCount Then
		Response.Write "[<A HREF=wyly_ckly.asp?Page="&Page+1&" class='01'>下一页</a>]"
		Response.Write "[<A HREF=wyly_ckly.asp?Page="&rs.PageCount&" class='01'>最末页</a>]"
	else
		Response.Write "[下一页]"
		Response.Write "[最末页]"
	End If
end sub

'--程序开始----------------------------------------------------------------------------------------

'打开数据库
Set conn = Server.CreateObject("ADODB.Connection")
	conn.open "driver={Microsoft Access Driver (*.mdb)};pwd=webcool_2000;dbq=" & Server.MapPath("../database/customer.mdb")
	'建立rs对象
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM bbs where form='"&session("username")&"' and form_njd='0'"
'发送一条SQL的指令
rs.Open sql, conn, 3
if rs.eof then
response.redirect("wyly_ckly_no.asp")
else

'设置一页显示n条记录
rs.PageSize =15

'计算总记录数
page1=rs.PageCount
rs.AbsolutePage = Page1
for apage=1 to rs.pagesize
	recno=(page1-1)*rs.pagesize+apage
	rs.movenext
	if rs.eof then exit for
next

'设置当前显示页码
Page = cint(Request("Page"))
If Page < 1 Then Page = 1
If Page > rs.PageCount Then Page = rs.PageCount
rs.AbsolutePage = Page

'如果数据是最后一页,那数字为最后一个
page_end=page*rs.pagesize
if page=rs.PageCount then page_end=recno end if

%>
<SCRIPT LANGUAGE="JavaScript">
	function openFrameless(aaa) 
	{
	var bbb="wyly_ckly_ck_ok.asp?id="+aaa		
	NFW =window.open(bbb,"","fullscreen");//打开一个窗口为满屏显示
	NFW.resizeTo(620,450);//改变窗口大小
	NFW.moveTo(200,100);//移动窗口
	}
</SCRIPT>
<html>
<head>
<title>『晨景软体』-查看留言</title>
<link rel="stylesheet" href="other/customer.css">
<style>
.drag{position:relative;cursor:hand}
</style>
<script language="JavaScript">
var dragapproved=false
var eventsource,x,y
function move()
 {
  if (event.button==1&&dragapproved) //改变被拖动元素在页面上的位置
   {
    self.moveBy (event.clientX-x,event.clientY-y); //改变窗体位置
    return false
   }
 }
function drags()
 {
  if (!document.all)
  return
  if (event.srcElement.className=="drag") //捕捉鼠标当前位置
   {
    dragapproved=true//确信当前鼠标是按下
    x=event.clientX//鼠标当前位置
    y=event.clientY//鼠标当前位置
    document.onmousemove=move//调动move函数
   }
 }
document.onmousedown=drags   //鼠标左键按下时,准备拖动
document.onmouseup=new Function("dragapproved=false")//鼠标左键放开时,拖动停止
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
</head>
<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table border="0" cellpadding="0" cellspacing="0" width="619" height="437">
  <tr>
   <td><img src="images/spacer.gif" width="5" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="609" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="5" height="1" border="0"></td>
   <td><img src="images/spacer.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr>
    <td colspan="3" background="images/cx_r1_c1.gif" class="title" valign="middle">&nbsp;&nbsp;&nbsp;『晨景软体』-查看留言
      <div id="Layer1" style="position:absolute; width:22px; height:21px; z-index:3; left: 598px; top: 6px"><a href="javascript:window.close()"><img src="images/xx.gif" width="13" height="13" border="0"></a></div>
    </td>
   <td><img src="images/spacer.gif" width="1" height="26" border="0"></td>
  </tr>
  <tr>
   <td rowspan="2"><img name="cx_r2_c1" src="images/cx_r2_c1.gif" width="5" height="423" border="0"></td>
    <td bgcolor="#cdd5e4">
      <table width="100%" cellspacing="1" height="415">
        <tr> 
          <td height="12" colspan="2">&nbsp; </td>
        </tr>
        <tr> 
          <td height="319" colspan="2"> 
            <table width="100%" cellspacing="1" bgcolor="#666666">
              <tr bgcolor="#657cb1" class="big_b"> 
                <td width="13%" height="14"> 
                  <div align="center">姓    名</div>
                </td>
                <td width="43%" height="14"> 
                  <div align="center">标   题</div>
                </td>
                <td width="14%" height="14"> 
                  <div align="center">删   除</div>
                </td>
				<td height="14" width="30%"> 
                  <div align="center">发送时间</div>
                  </td>
              </tr>
				<%
				'显示数据的子程序
				call showdata
				%>
            </table>
          </td>
        </tr>
        <tr> 
          <td class="small" width="55%" > 
            <div align="left">[<%=(page-1)*rs.pagesize+1%> - <%=page_end%>] 共<%=recno%>记录 
              &nbsp;&nbsp;</div>
          </td>
          <td class="small" width="45%" > 
            <div align="right" >
				<%
				'调用分页子程序
				call fenye
				%>
            </div>
          </td>
        </tr>
      </table>
   <!-- 重要表 ------------------------------------------------------------------>
    </td>
   <td rowspan="2"><img name="cx_r2_c3" src="images/cx_r2_c3.gif" width="5" height="423" border="0"></td>
   <td><img src="images/spacer.gif" width="1" height="418" border="0"></td>
  </tr>
  <tr>
   <td><img name="cx_r3_c2" src="images/cx_r3_c2.gif" width="609" height="5" border="0"></td>
   <td><img src="images/spacer.gif" width="1" height="5" border="0"></td>
  </tr>
</table>
<div class="drag" id="Layer2" style="position:absolute; left:2px; top:1px; width:596px; height:22px; z-index:2"></div>
</body>
</html>
<%end if
set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -