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

📄 cp_right.asp

📁 自己做的鞋业网站代码
💻 ASP
字号:
<!--#include file="conn.asp"--> 
<html>
<head>
<title>List</title>
<link  href="css/css.css" type="text/css" rel="stylesheet">
<script language="javascript" src="js/pub.js"></script>
<script language="javascript">
fea_action = "width=10,height=10,left=0,top=0,resizable=1,scrollbars=1,dependent=yes"
fea_edit =  "width=500,height=450,left=150,top=150,resizable=0,scrollbars=0,dependent=yes";
function f_fy(page){
	form2.page.value = page;
	form2.pagesize.value = form1.pagesize.value;
	form2.submit();
	return false;
} 
function f_edit(hw_id){ 
	window.open("cp_edit.asp?hw_id="+hw_id,"edit",fea_edit)
}
function f_del(hw_id){ 
	if(window.confirm("Confirm to delete?")){
		window.open("cp_action.asp?action=del&hw_id="+hw_id,"del",fea_action)
	}
}
function f_tj(){
	if (form2.i.value == "0"){
		alert("There is no record you want to submit!")
		return;
	}
	var strid = ""
	if (form1.strid.length > 0){
		for(var i=0;i< form1.strid.length;i++){
			if (form1.strid[i].checked)
				strid += "@@@@" + form1.strid[i].value;
		}
		strid = strid.substr(4)
	}
	else{
		strid = form1.strid.value
	}
	
	//alert(strid)
	if (strid==""){
		alert("You didn't select any record")
		return;
	}
	if(window.confirm("Want submit?")){
		window.open("cp_action.asp?action=tj&strid="+strid,"action",fea_action)
	}
}
function f_select(){
	if (form1.isselect.value=="select all"){
		form1.isselect.value = "diselect"
	}
	else{
		form1.isselect.value = "select all"
	}
	for (var i=0;i<form1.elements.length;i++){
    		var e = form1.elements[i];
			if (e.name == "strid" ){
				if (form1.isselect.value == "diselect"){
					e.checked = true;
				}
				else{
					e.checked = false;
				}
			}
    }
}
function f_del_all(){
	var strid = "";
	var i = 0;
	var j = 0;
	if (form2.i.value == "0"){
		alert("There is no record you want to delete!")
		return;
	}
	if (form1.strid.length > 0){
		for(var i=0;i< form1.strid.length;i++){
			if (form1.strid[i].checked)
				if (form1.strid[i].value != "@@@@"){
					strid += "," + form1.strid[i].value;
				}
		}
		strid = strid.substr(1)
	}
	else{
		strid = form1.strid.value
	}

	if (strid==""){
		alert("You didn't select any record")
		return;
	}
	if (window.confirm("Confirm to delete?")){
		window.open("cp_action.asp?action=del_all&strid="+strid,"action",fea_action)
	}
}
function f_return(){
	window.top.frames["list"].location.href='../right.asp'
}
</script>
</head>
<body  leftmargin="10" rightmargin="10" topmargin="0">
<form name="form1" style="margin-top:0px;">
<table width="308" height="30" border="0" cellpadding="0" cellspacing="0">
<tr><td width="308">
	<input type="button" value="select all" onClick="f_select()" name="isselect" style="font-size: 9pt;  color: #000000; background-color: #EAEAF4; solid #EAEAF4" onMouseOver ="this.style.backgroundColor='#ffffff'" onMouseOut ="this.style.backgroundColor='#EAEAF4'">
	<input type="button" value="delete" onclick = "f_del_all()" name="del" style="font-size: 9pt;  color: #000000; background-color: #EAEAF4; solid #EAEAF4" onMouseOver ="this.style.backgroundColor='#ffffff'" onMouseOut ="this.style.backgroundColor='#EAEAF4'">
	
</td></tr>
<tr><td height="5"></td></tr>
</table>
<%
brand = request("brand")  
if brand="" then
  brand = "all"
end if
%>
<div align='center'><font class='font10b'>list
</font></div> 
<input type="hidden" name="pagesize" value="20">
<table cellspacing="1" cellpadding="0" border="1" width="100%" class="table_main">
<tr class="TDtop1">
	<td align="center">select</td>
	<td align="center">brand</td>
    <td align="center">style</td>
    <td align="center">size</td>
	<td align="center">price</td>
	<td align="center">photopath</td> 
	<td align="center">description</td>
	<td align="center">state</td>
	<td align="center" colspan=2>operate</td>
</tr>
<% 
set rs = server.CreateObject("adodb.recordset")
if brand = "all" then
	sql = "SELECT top 200 * from hw"
else 
    sql = "SELECT top 200 * from hw where sort_name='"&brand&"'"
end if  
rs.open sql,conn,1,1

'当前页数
if request("page") <> ""  then 	curpage = cint(request("page")) else curpage = 1
 '每页显示记录数
if request("pagesize") <> "" then pagesize = cint(request("pagesize")) else	pagesize = 20
recordcount = rs.recordcount
rs.pagesize = pagesize
pagecount = int(recordcount / pagesize)
if  recordcount mod pagesize <>  0  then  pagecount = pagecount + 1
if recordcount <> 0  then  rs.AbsolutePage = curpage
rowcount = pagesize
i = 0
do while not rs.eof and rowcount > 0 
%>
<%
if rowcount mod 2=0 then
%>
<tr>
<% else %>
<tr bgcolor=#EBF0FC>
<%end if %>
	<td align="center"> 
		<input type="checkbox" name="strid"  value="<%=rs("hw_id")%>">
	 
	</td>
	<td align="center"><%=rs("sort_name")%></td>
	<td align="center"><%=rs("nsort_name")%></td>
	<td align="center"><%=rs("hw_name")%></td>
	<td align="center">$<%=rs("hw_cash")%></td> 
		<td align="left"><%=rs("hw_pic")%></td> 

		<td align="left" title="<%=rs("hw_content")%>">
		<%
		if len(rs("hw_content")) >15 then
			response.write mid(rs("hw_content"),1,15) & "..."
		else
			response.write rs("hw_content")
		end if
		%>
		</td>
	<td align="center">
	  <%
	  if rs("tuijian") = 1 then 
	  	response.Write "<font color='#FF0006'>Best</font>"
	  elseif rs("tuijian") = 2 then
	  	response.Write "<font color='#3123EF'>WeeklyBest</font>"
	  elseif rs("tuijian") = 3 then
		response.Write "<font color='#000000'>NewArrivals</font>"
	  elseif rs("tuijian") = 4 then 
	    response.Write "<font color='#626260'>PutInStorage</font>"
	  end if%>
	</td>
	<td align="center">
      <a href="javascript:f_edit('<%=rs("hw_id")%>')"><img src="images/edit.gif" border="0" alt="update?"></a>
	</td>
	<td align="center">
      <a href="javascript:f_del('<%=rs("hw_id")%>')">
      <img src="images/del.gif" border="0" alt="delete?">
	  </a>
	</td>
</tr>
<%
	rowcount = rowcount - 1
	rs.movenext
loop
rs.close
%> 
</table>   

<table width="100%">
  <tr>
  <td align="left" width="100%">RecordCount:<%=recordcount%>&nbsp;&nbsp;CurrentPage:<%=curpage%>/<%=pagecount%>&nbsp;&nbsp;
  <%
    go = 0
  	if curpage -1 > 0 then
		go = 1
  		response.write "<a href=""javascript:f_fy(1);"" class=""pg"">First</a>&nbsp;"
  		response.Write "<a href=""javascript:f_fy(" & (curpage - 1) & ");"" class="" pg "">Prev</a>&nbsp;"
  	end if
  	if curpage < pagecount  then
		go = 1
  		response.write "<a href=""javascript:f_fy(" & (curpage + 1) & ");"" class=""pg"">Next</a>&nbsp;"
  		response.write "<a href=""javascript:f_fy(" & pagecount & ");"" class=""pg"">End</a>&nbsp;"
  	end if 
	if go =1 then
  %>
   go page<select name="gopage" onChange="javascript:f_fy(form1.gopage.value)">
   <%
    for i = 1 to pagecount
		response.Write "<option value='"&i&"'>"&i&"</option>"
    next
   %>
   </select>
  <%else%>
     <input type="hidden" name="gopage">
  <%end if%> 
   </td>
  </tr>
</table>
</form>

<form name="form2" action="" method="post">
	<input type="hidden" name="i" value="<%=i%>">
	<input type = "hidden" name = "page" value="<%=curpage%>">
	<input type = "hidden" name = "pagesize" value="<%=pagesize%>">
</form>
<%
set rs = nothing 
%>
</body>
</html>

<script language="javascript">
	form1.pagesize.value = "<%=pagesize%>";
	form1.gopage.value = "<%=curpage%>"
</script>

⌨️ 快捷键说明

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