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

📄 bookshop2.asp

📁 一个免费的绿叶网上书店请大家提宝贵意见 站长的帐号是   用户名:雨丁香  密码:200505 副站长帐号是   用户名: wangli 密码:197207
💻 ASP
字号:
<!--#include file="base.asp"-->
<% 

if session("username")="" then Response.Redirect "login.htm"

if session("adminflag")>2 and session("class")<>"商品管理"  then Call PrintMsg(NotAdmin)
Response.Buffer=true
Response.Expires=0
  %>
  <%
action = request("action")
id = request("id")
'if action = "open" then				'开放某商品
	'sql = "update produce set xianshi='0' where id=" & id
	'rs.Open sql,conn
'elseif action = "forbid" then		'禁止某商品
	'sql = "update produce set xianshi='1' where id=" & id
	'rs.Open sql,conn
 'end if

if action = "new" then				'把某商品设为新品
	sql = "update books set new=true where id=" & id
	rs.Open sql,conn
elseif action = "old" then		'把某商品设为普通
	sql = "update books set new=false where id=" & id
	rs.Open sql,conn
 end if
%>

<html>
<title>产品管理</title>
<script language="JavaScript">
function confirmDel(id){

alert("测试版不能删除图书!!")
}
function confirmFix(id){
if ( confirm("你确定要修改吗?")) {
window.location.href = "bookfix.asp?id="+id
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
         

<h3 align="center"><font color="#FF0000">网上书店图书管理</font></h3>
<P ALIGN="CENTER">产品类别:  <%   myid=request("myid")
 if myid="1" then  response.redirect "bookshop.asp?pageno=1" 
if myid=""  then    myid=session("myid") 
set rs2=server.createobject("adodb.recordset")
 rs2.open "select classname from class where id="&myid,conn,1,2
		  note=rs2("classname")                    
  %><%=note%><% rs2.close %> </P>
<form name="form1" method="post" action="bookshop2.asp">
  <table width="93%" border="1" cellspacing="1" cellpadding="0" bordercolor="#336666" align="center">
    <tr bgcolor="#3366CC"> 
      <td width="16%"> 
        <div align="center"><font color="#336666" size="2"><a href="proadd.asp"><font color="#FFFFFF">增加产品</font></a></font></div>
      </td>
      <td width="24%"> 
        <div align="center"></div>
        <div align="center"><font color="#336666" size="2"><a href="change.ASP"><font color="#FFFFFF">管理产品分类</font></a></font></div>
      </td>
      <td width="44%"> 
        <div align="center"><font color="#FFFFFF" size="2">选择产品分类 
          <select name="myid">
            <option value="1" selected>请您选择分类</option>
            <%   
		  sql="select * from class"
		  rs.open sql,conn,1,2
		  do while not rs.eof
		  %>
            <option value="<%=rs("id")%>"><%=rs("classname")%></option>
            <% 
			 rs.movenext
		        loop
		  rs.close %>
          </select>
          <input type="submit" name="Submit" value="确定">
          </font></div>
      </td>
      <td width="16%"> 
        <div align="center"><a href="loginout.asp"><font color="#FFFFFF" size="2">退出登录</font></a></div>
      </td>
    </tr>
  </table>
  </form>
 <%   	
	
	 sql="select * from books where class="&myid 		
		rs.open sql,conn,1,2	
		 %>  
<form name="form2" method="post" action="">

  <table width="94%" border="1" align="center" cellpadding="0" cellspacing="1">
    <tr> 
      <td width="84%"> 
        <!--#include file="../include/pages.inc"-->
        <table width="100%" height="98" border="0" align="center" cellpadding="0" cellspacing="1" bordercolorlight="#000000" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">
          <tr bgcolor="#3366CC"> 
            <td width="153" align="center" height="20"><font color="#FFFFFF" class="unnamed1" size="2">产品图片</font></td>
            <td width="213" align="center"><font color="#FFFFFF" class="unnamed1" size="2">产品名称</font></td>
            <td width="95" align="center"><font size="2" color="#FFFFFF">是否新品</font></td>
            <td width="78" align="center"><font size="2" color="#FFFFFF">管理</font></td>
            <td width="90" align="center"><font color="#FFFFFF" size="2">修改</font></td>
            <td width="95" align="center"><font color="#FFFFFF" size="2">删除</font></td>
          </tr>
          <% call ShowPageNavigator(pageno,"bookshop2.asp")%>
          <% for i=1 to rs.pagesize
     if rs.eof then exit for
    %>
          <tr bgcolor="#FFFFFF"> 
            <td height="80" width="153"> 
              <p align="center"><img src="<%=rs("picture")%>" width="85" height="104"> 
            </td>
            <td width="213" height="80"> 
              <p align="center"><a href="booklist.asp?id=<%=rs("id")%>"><font size="2"><%=rs("bookname")%></font></a> 
            </td>
            <td width="95" height="80"> 
              <div align="center"> <% if rs("new")="0" then
				Response.Write "<font color='green' size=2>否</font></td><td align='center'>"
				Response.Write "<input type='button' name='change' value='新品' onclick=""window.location.href='bookshop2.asp?action=new&id="&rs("id")&"'"">"
			else %>
              </div><div align="center"><font color="red" size="2">是</font> </div>
            
            </td>
            <td width="78" height="80"><div align="center"> <input type='button' name='change' value='普通' onClick="window.location.href='bookshop.asp?action=old&id=<%=rs("id")%>'">
              <%end if%></div></td>
            <td width="90" height="80">
              <div align="center"><a href='javascript:confirmFix(<%=rs("id")%>)'><font color="#0000FF" size="2">修改</font></a></div>
            </td>
            <td width="95" bgcolor="#FFFFFF" height="80"> 
              <p align="center"><font color="#0000FF"><a href='javascript:confirmDel(<%=rs("id")%>)'><font size="2">删除</font></a></font> 
            </td>
          </tr>
          <% 
		  rs.movenext
		next
		  %>
        </table>
      </td>
    </tr>
  </table>
</form>
 
 
<p align="center"><a href="index.asp"><img src="../images/agree4.gif" width="100" height="32" border="0"></a></p>
<% session("myid")=myid
 rs.close %>

⌨️ 快捷键说明

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