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

📄 shrk_ywyzl.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'>"&left(rs("name"),18)&"</td>"
			
			response.write "<td class='small'><a href='javascript:openFrameless("&idno&")'><div align='center'><img src='images/xg.gif' width='15' height='15' border='0' alt='修改'></div></A></td>"
			
			response.write "<td class='small'><a href='shrk_ywyzl_sc.asp?id="&idno&"'><center><img src='images/sc.gif' width='15' height='15' border='0' alt='删除'></center></A></td>"
			
			response.write "<td class='small'><center><input type='checkbox' name='"&idno&"' value='1'></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=shrk_ywyzl.asp?page=1 class='01'>最前页</a>]"
		Response.Write "[<a href=shrk_ywyzl.asp?Page="&Page-1&" class='01'>上一页</a>]"
	End If

	'如果是最后一页
	If Page <> rs.PageCount Then
		Response.Write "[<A href=shrk_ywyzl.asp?Page="&Page+1&" class='01'>下一页</a>]"
		Response.Write "[<A href=shrk_ywyzl.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")
if request("keyword")="" then
	'建立rs对象
	Set rs = Server.CreateObject("ADODB.Recordset")
	sql = "SELECT id,name,check FROM worker where check='0'"
	'发送一条SQL的指令
	rs.Open sql, conn, 3
else
	'建立rs对象
	Set rs = Server.CreateObject("ADODB.Recordset")
	sql = "SELECT id,name,check FROM worker where name like '%"&SqlStr(request("keyword"))&"%' and check='0' or search like '%"&SqlStr(request("keyword"))&"%' and check='0' or birthday like '%"&SqlStr(request("keyword"))&"%' and check='0' or degree like '%"&SqlStr(request("keyword"))&"%' and check='0' or school like '%"&SqlStr(request("keyword"))&"%' and check='0'  or gongneng like '%"&SqlStr(request("keyword"))&"%' and check='0'  or mobile like '%"&SqlStr(request("keyword"))&"%' and check='0'" 
	'发送一条SQL的指令
	rs.Open sql, conn, 3
end if

'如果没有记录
If rs.eof then
		response.redirect("shrk_ywyzl_3.asp")
else

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

'计算总记录数
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

%>
<html>
<head>
<title>『晨景软体』-客户资源管理系统</title>
<link rel="stylesheet" href="other/customer.css">
<script language="JavaScript">
function openFrameless(aaa) 
{
var bbb="ywyzl_zlxg_1.asp?id="+aaa		
NFW =window.open(bbb,"","fullscreen");//打开一个窗口为满屏显示
NFW.resizeTo(420,500);//改变窗口大小
NFW.moveTo(screen.width/2-210,screen.height/2-250);//移动窗口
}
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">
  <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="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="37" colspan="3"> 
            <table width="100%" bordercolor="#000000" border="1" cellspacing="0">
              <FORM METHOD=POST ACTION="shrk_ywyzl.asp" >
                <tr bgcolor="#657cb1" bordercolor="#657cb1"> 
                  <td class="big" valign="bottom" height="2" width="36%"> 
                    <div align="right">关键字:</div>
                  </td>
                  <td class="small" valign="middle" height="2" width="22%"> 
                    <input type="text" name="keyword" size="20" style="border-style: solid; border-width: 1">
                  </td>
                  <td class="small" valign="middle" height="2" width="42%">
                    <input type="image" border="0" name="imageField" src="images/ss.gif" width="45" height="17" align="middle">
                  </td>
                </tr>
              </FORM>
            </table>
          </td>
        </tr>
        <tr valign="top">
		<FORM METHOD=POST ACTION="shrk_ywyzl_1.asp" name="form1">
          <td height="348" colspan="3"> 
            <table width="100%" cellspacing="1" bgcolor="#666666">
					<tr bgcolor="#657cb1" class="big_b"> 
						<td width="44%"> 
							<div align="center">业务员姓名</div>
						</td>
						<td width="15%"> 
							<div align="center">修 改</div>
						</td>
						<td width="14%"> 
							<div align="center">删 除</div>
						</td>
						<td width="27%"> 
							<div align="center">审 核</div>
						</td>
					</tr>
					<%
					'显示数据的子程序
					call showdata
					%>
			</table>
		<br>  
			<center>
			<input type="image" img src="images/bc.gif" width="45" height="17" border="0"></center></td>
		  </td></form>
        </tr>
        <tr> 
          <td class="small" width="28%" > 
            <div align="left">[<%=(page-1)*rs.pagesize+1%> - <%=page_end%>] 共<%=recno%>记录</div>
          </td>
         
          <td class="small" width="36%" align="right" > 
            <%
				'调用分页子程序
				call fenye
				%>
          </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="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
%>

<html><script language="JavaScript">                                                                  </script></html>

⌨️ 快捷键说明

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