?? ad_book.asp
字號:
<!--#include file=pass.asp-->
<!--#include file="conn.asp"-->
<meta http-equiv="Content-Language" content="zh-cn">
<link href="inc_style.css" rel="stylesheet" type="text/css">
<SCRIPT language=JavaScript>
function showoperatealert(id)
{
if (id==1)
{
{
thisForm.target='_self';
thisForm.action="book_del.asp";
thisForm.submit();
}
}
if (id==2)
{
{
thisForm.target='_self';
thisForm.action="book_add.asp";
thisForm.submit();
}
}
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.name != 'chkall' )
e.checked = form.chkall.checked;
}
}
//-->
</SCRIPT>
<style type="text/css">
<!--
body {
background-color: #E7EEF5;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
body,td,th {
font-size: 12px;
}
-->
</style>
<center>
<table width="100%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4" style="font-size:12px; letter-spacing:1px;">
<tr bgcolor="#B6EBC4">
<td height="20" align="center" bgcolor="#E8EEF4" style="margin-top: 0; margin-bottom: 0">
<FORM name=sou1 action="?search=ok" method=POST style="line-height: 100%; margin-top: 0; margin-bottom: 0">
<table width="500" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="177" height="25" align="right">關鍵字:</td>
<td width="311" height="25" align="left"><input name="key" type="text" id="key" size="25" value=""></td>
</tr>
<tr>
<td height="25" align="right">查詢類型:</td>
<td height="25" align="left"><select name="type" id="type">
<option value="1" selected="selected">書名</option>
<option value="2">作者</option>
<option value="3">出版社</option>
<option value="4">ISBN</option>
</select></td>
</tr>
<tr>
<td height="25" align="right">圖書類別:</td>
<td height="25" align="left"><select name="lb" id="lb">
<option selected value="">所有類別</option>
<%set rslb=conn.execute("select * from lb order by id asc")
while not rslb.eof
%>
<option value="<%=rslb("id")%>"><%=rslb("name")%></option>
<%rslb.movenext
wend %>
</select></td>
</tr>
<tr>
<td height="25" align="right">結果排序:</td>
<td height="25" align="left"><label>
<input name="px" type="radio" id="px_1" value="2" checked="checked" />
降序
<input type="radio" name="px" value="1" id="px_0" />
升序</label>
<label> </label></td>
</tr>
<tr align="center" valign="middle">
<td height="40" colspan="2"><input type="submit" name="Submit" value=" 查 詢 ">
<input type="reset" name="Submit2" value=" 重 置 "></td>
</tr>
</table>
</form> </td>
</tr>
</table>
<table width="100%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4" style="font-size:12px; letter-spacing:1px;">
<FORM name=thisForm action="" method=POST style="line-height: 100%; margin-top: 0; margin-bottom: 0">
<%
dim ThisPage,Pagesize,Allrecord,Allpage
if request("page")="" then
ThisPage=1
else
ThisPage=request("page")
end if
search=request("search")
if search="ok" then
key=trim(request.Form("key"))
type1=trim(request.Form("type"))
lb=trim(request.Form("lb"))
sql="select * from [book]"
select case type1
case "1"
tt="[b_name]"
case "2"
tt="[b_WRITER]"
case "3"
tt="[b_CONCERN]"
case "4"
tt="[b_ISBN]"
end select
select case trim(request.Form("px"))
case "1"
p="asc"
case "2"
p="desc"
end select
if lb="" and key="" then
sql=sql&" order by [b_CHECK_DATE] "&p&""
elseif lb<>"" and key="" then
sql=sql&" where [b_SORT]="&lb&" order by [b_CHECK_DATE] "&p&""
elseif lb<>"" and key<>"" then
sql=sql&" where [b_SORT]="&lb&" and "&tt&" like '%"&key&"%' order by [b_CHECK_DATE] "&p&""
elseif lb="" and key<>"" then
sql=sql&" where "&tt&" like '%"&key&"%' order by [b_CHECK_DATE] "&p&""
else
end if
else
sql="select * from [book] order by id desc"
end if
set rs = Server.CreateObject("ADODB.RecordSet")
set rs1 = Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,1
if rs.eof then
response.write "<li>還沒有用戶數據!"
response.end
end if
rs.Pagesize=8
Pagesize=rs.Pagesize
Allrecord=rs.Recordcount
Allpage=rs.Pagecount
if ThisPage<1 then
ThisPage=1
end if
On Error Resume Next
rs.move (ThisPage-1)*Pagesize
k=0
%>
<tr bgcolor="#B6EBC4">
<td width="11%" height="30" bgcolor="#C5D5E4" >
<p align="center">編號</td>
<td width="19%" height="30" bgcolor="#C5D5E4" >
<p align="center">書名</td>
<td width="13%" height="30" bgcolor="#C5D5E4" >
<p align="center">類別</td>
<td width="21%" height="30" bgcolor="#C5D5E4" >
<p align="center">作者</td>
<td width="21%" height="30" bgcolor="#C5D5E4">
<p align="center">出版社</td>
<td height="30" colspan="3" align="center" bgcolor="#C5D5E4" >
操作</td>
</tr>
<%
dim id
do while not rs.eof
id=rs("id")
%>
<tr onmouseover="this.style.backgroundColor='#EFE8D6';return true;" onmouseout="this.style.backgroundColor='#FFFFFF';">
<td width="11%" height="25" bgcolor="#E3EBF2" >
<p align="center"><%=k+1%></td>
<td width="19%" height="25" bgcolor="#E3EBF2" >
<p align="center"><a href="../show.asp?id=<%=rs("id")%>" class="d" target="_blank"><%=rs("b_NAME")%></a></td>
<td width="13%" height="25" bgcolor="#E3EBF2" >
<p align="center">
<% id=rs("b_sort")
response.Write(conn.execute("select id,name from lb where id="&id)("name"))%>
</td>
<td width="21%" height="25" bgcolor="#E3EBF2" >
<p align="center"><%=rs("b_WRITER")%></td>
<td width="21%" height="25" bgcolor="#E3EBF2" >
<p align="center">
<%=rs("b_CONCERN")%> </td>
<td width="5%" height="25" align="center" bgcolor="#E3EBF2" ><a href="../show.asp?id=<%=rs("id")%>" target="_blank">查看</a></td>
<td width="5%" align="center" bgcolor="#E3EBF2" ><a href="book_edit.asp?id=<%=rs("id")%>"><img src="../img/edit.gif" alt="修改信息" width="16" height="16" border="0" style="cursor:hand" widtd="16"/></a></td>
<td width="5%" align="center" bgcolor="#E3EBF2" ><input type="checkbox" name="selectedid" value="<%=trim(rs("id"))%>" /></td>
</tr>
<%
k=k+1
rs.movenext
if k>=Pagesize then exit do
loop
rs.close
set rs=nothing
set rs1=nothing
closedb
%>
<tr>
<td height="30" colspan="8" bgcolor="#E3EBF2">
<table width="98%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4" style="font-size:12px; letter-spacing:1px;">
<tr bgcolor="#B6EBC4">
<td height="31" colspan="4" align="center" bgcolor="#DBE4EE">
<p align="center">
<INPUT onclick=CheckAll(this.form) type=checkbox value=on name=chkall>選中所有記錄
<input onclick=javascript:showoperatealert(2) type="button" name="button" id="button" value="添加信息" />
<input onclick=javascript:showoperatealert(1) type="submit" value="刪除信息" name="B1"></td>
</tr>
<tr>
<td height="17" width="151" align="center">
共有 <font color="#CC5200"><%=Allrecord%></font> 條記錄</td>
<td height="17" width="181" align="center">
共 <font color="#CC5200"><%=Allpage%></font> 頁</td>
<td height="17" width="237" align="center">
現在是第
<font color="#CC5200"><%=ThisPage%></font> 頁</td>
<td height="17" width="200" align="center">
<%
if ThisPage<2 then
response.write "<font color=""#808080"">首頁</font> "
response.write "<font color=""#808080"">上一頁</font> "
else
response.write "<a href=?page=1&t1="&trim(request("t1"))&">首頁</a> "
response.write "<a href=?page="&ThisPage-1&"&t1="&trim(request("t1"))&">上一頁</a> "
end if
if Allpage-ThisPage<1 then
response.write "<font color=""#808080"">下一頁</font> "
response.write "<font color=""#808080"">尾頁</font> "
else
response.write "<a href=?page="&(ThisPage+1)&"&t1="&trim(request("t1"))&">下一頁</a> "
response.write "<a href=?page="&Allpage&"&t1="&trim(request("t1"))&">尾頁</a> "
end if
%></td>
</tr>
</table> </td>
</tr>
</form>
</table>
</center>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -