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

📄 administratorlist.jsp

📁 电子商务网站使用MVC模式B/S结构功能不是很全适合初学者看
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312"%>
<%@page import="java.util.Hashtable"%>
<%@page import="java.util.ArrayList" %>

<script src="<%=request.getContextPath()%>/js/showDiv.js"></script> 
<script src="<%=request.getContextPath()%>/js/search.js"></script> 
<script >
function toResultPage(str){
	form1.action="<%=request.getContextPath()%>/clientListAction?pageNumber="+str;
	form1.submit();
}	
</script>
<% 	
		String searchResultSize=session.getAttribute("searchResultSize".toUpperCase()).toString();

		if(request.getParameter("logged")!=null){
%>
			<script language="javascript">
				alert("请登陆!");
			</script>
<%	
		}else if(request.getParameter("done")!=null){		
%>		
			<script language="javascript">
				alert("操作成功!");
			</script>
<%
		}	
%>		

<style type="text/css">
<!--
A {
    COLOR: #3333CC; TEXT-DECORATION: none ;border-bottom:1px dotted
}
.mobile_top5_1{
	margin:5px 4;
	padding:0;
	width:190px;
	height:127px;
   background:url(<%=request.getContextPath()%>/image/moblie_bg1.gif);
}
.mobile_top5_1 h4{
 margin:22px 5px 2 1px;
 font-size:12px; 
 width:20px; 
 height:100px; 
 float:left; 
 text-align: center; 
 font-weight:normal;
}
.mobile_top5_1 table{
margin:5px 5px 2px 0; 
float:right;
}
.aindex{color: blue;font-size: 13px}
.currentindex{color: red;font-size: 13px}
.index{color: black;font-size: 12px}
.style1 {color: #ECE9D8;font-size: 12px}
.style3 {font-size: 12px}
.style4 {color: #3333CC}
-->
</style>
<body >
<center>
<div align="center"></div>
<table    width="757" height="333" border="1" align="center" cellpadding="0" cellspacing="1">
  <tr >
    <td width="202" valign="top"  background="<%=request.getContextPath()%>/image/6.gif" >

	<table cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
		<tr>
			<td>
				<img src="<%=request.getContextPath()%>/image/fh.gif" width="197">
			</td>
		</tr>
		<tr height="100">	
			<td bgcolor="#CCCCCC" height="100">	
				<marquee behavior="scroll" direction="up" loop="-1" height="120" id=zimu onmouseover=zimu.stop() onmouseout=zimu.start() scrollDelay=120>
<%	
		String card="",restNum="",num="",model="",photo="",net="",price="",special="",picture="",describe="";
		int id=0;
		ArrayList list=new ArrayList();
				Hashtable table;
					list=(ArrayList)(application.getAttribute("newOrders".toUpperCase()));
					if(list!=null){	
						for(int i=0;i<list.size();i++){
							table=(Hashtable)list.get(i);
							String username="",orderID="",addDay="",totalPrice="",consignment="";	
							username=table.get("username".toUpperCase()).toString();
							orderID=table.get("orderID".toUpperCase()).toString();
							addDay=table.get("addDay".toUpperCase()).toString();
							totalPrice=table.get("totalPrice".toUpperCase()).toString();
							consignment=table.get("consignment".toUpperCase()).toString();
%>
						<a href="<%=request.getContextPath()%>/administratorShowOrderAction" target="_blank"><font color="" size="2"><%=username%>在<%=addDay.substring(0,11)%>下的订单</font></a><br><br>
<%
						}
					}	
%>		
				</marquee>
			</td>
		</tr>
	</table>
	
	</td>
    <td  valign="top" width="546" >
		<form action="print.jsp" name="form1" method="post" > 
  			<%	
				list=(ArrayList)(session.getAttribute("list".toUpperCase()));
				if(list!=null){	
					for(int i=0;i<list.size();i++){
						table=(Hashtable)list.get(i);
						card=table.get("card".toUpperCase()).toString();
						num=table.get("num".toUpperCase()).toString();
						model=table.get("model".toUpperCase()).toString();
						photo=table.get("photo".toUpperCase()).toString();
						net=table.get("net".toUpperCase()).toString();
						price=table.get("price".toUpperCase()).toString();
						price=price.substring(0,price.indexOf("."));
						special=table.get("special".toUpperCase()).toString();
						picture=request.getContextPath()+"/image/phone/"+card+"/"+num+"/"+table.get("picture".toUpperCase()).toString();
						describe=table.get("describe".toUpperCase()).toString();
						id=Integer.parseInt(table.get("id".toUpperCase()).toString());
						restNum=table.get("restNum".toUpperCase()).toString();
			%>
					<TABLE cellSpacing=1 cellPadding=0 width=554 bgColor=#6a6967 
						border=0>
						  <TBODY>
						  <TR vAlign=bottom>
							<TD bgColor=#c8cccf colSpan=3 height=20><input type="checkbox" name="id" value="<%=id%>">&nbsp;
							  <%=card%>&nbsp;<%=num%></SPAN></B></TD></TR>
						  <TR align=middle>
							<TD width=133 bgColor=#ffffff height=102>
							<img src="<%=picture%>" width=100 height=108 ></TD>
							<TD width=292 bgColor=#f9f6ed>
							  <TABLE width=353>
								<TBODY>
								<TR>
								  <TD>手机制式:<%=net%><BR>手机类型:<%=model%><BR>数码相机像素(万):<%=photo%>
								  </TD>
								</TR>
								<TR>
								  <TD width="345" height=25 align=middle><nobr><B><FONT 
									color=#ff0000>报价:<%=price%>(元)</FONT>&nbsp;</TD>
								</TR>
								</TBODY>
							</TABLE></TD>
						  </TR></TBODY></TABLE>
			<%			
					}
				}
			%>
					<table>
						<tr>
							<td align="right" bgcolor="#CCCCCC" background="<%=request.getContextPath()%>/image/top01_3.gif" colspan="5">
									&nbsp;&nbsp;&nbsp;
                                <span class="style1"><a href="<%=request.getContextPath()%>/administratorAddListInitAction">添加</a></span> <span class="style1"><a href="javascript:del();">删除</a></span> <span class="style1"><a href="javascript:edit();">修改</a>|</span> 
									<input type="button" name="chkother" value="反选" onclick="CheckOthers(this.form)" title="对本页面反向选择商品">
							</td>
						</tr> 
						<tr> 
						  	<td width="554" align="right" bgcolor="#CCCCCC" background="<%=request.getContextPath()%>/image/top01_3.gif" colspan="5">
                              <%						
						int dirPage=4;
						int startPage=1;
						int pageNumber=1;
						if(session.getAttribute("searchResultSize".toUpperCase())!=null) 
							out.println("共"+session.getAttribute("searchResultSize".toUpperCase())+"个记录");
						if(session.getAttribute("pageNumber".toUpperCase())!=null){
							pageNumber=Integer.parseInt(session.getAttribute("pageNumber".toUpperCase()).toString());
							if(pageNumber%4!=0){
								startPage=pageNumber/dirPage*dirPage+1;
							}else{
								startPage=(pageNumber-1)/dirPage*dirPage+1;
							}
							if(session.getAttribute("pages".toUpperCase()).toString().equals("0"))pageNumber=0;
%>
                              <b></b>
                              <%							
							if(startPage!=1){
								int prePageNumber=startPage-4;
%>
                              <span class="aindex"><a href="javascript:toResultPage(<%=prePageNumber%>)">上页</a>&nbsp;&nbsp;</span>
                              <%							}else {
%>
                              <span class="index">上页&nbsp;&nbsp;</span>
                              <%							}
						}
						if(session.getAttribute("pages".toUpperCase())!=null){
							int pages=Integer.parseInt(session.getAttribute("pages".toUpperCase()).toString());
							for(int i=startPage;i<startPage+dirPage&&i<=pages;i++){
								if(i!=pageNumber){
%>
                              <span class="aindex"><a href="javascript:toResultPage(<%=i%>)"><%=i%></a></span>&nbsp
                              <%								}else{
%>
                              <span class="currentindex"><a href="javascript:toResultPage(<%=i%>)"><%=i%></a></span>&nbsp;
                              <%								}
							}
				
							if(startPage/4<(pages-1)/4){
								int nextPageNumber=startPage+4;
%>
                              <span class="aindex"><a href="javascript:toResultPage(<%=nextPageNumber%>)">下页</a></span>
                              <%							}else {
%>
                              <span class="index">&nbsp;&nbsp;下页</span>
                              <%							}
						}
%>
                              <b><span class="index"><%=pageNumber%>/<%=session.getAttribute("pages".toUpperCase()).toString()%></span></b> <span class="index">到第
                              <input type="text" size=3 name="pageNumber2">
                              页 <IMG  title=到指定的页面  alt=翻指定的页码 
src="<%=request.getContextPath()%>/image/searchPage.gif" onClick="javascript:checkPageNumber(this.form.pageNumber.value)"></span> 
							</td>
						</tr>
					</table>	
		</form>
	</td>
</tr>
</table>		
<script language="javascript">

	function checkPageNumber(str){
		if(isNaN(parseInt(str))){
			alert("页码必须是数字.");
			//document.form1.pageNumber.focus();
			return false;
		}
		form1.action="<%=request.getContextPath()%>/clientListAction?pageNumber="+str;
		form1.submit();
	}
	function CheckOthers(form){
		for (var i=0;i<form.elements.length;i++){
			var e = form.elements[i];
			if (e.checked==false){
				e.checked = true;
			}
			else{
			e.checked = false;
			}
		}
	}
</script>
<script>
function del(){
	var len=document.form1.id.length;
	var a=0;
	for(i=0;i<len;i++){
		if(document.form1.id[i].checked) 
			a=a+1;
	}
	if(a==0){
		alert("请选择要删除的商品");		
		return ;
	}	
	form1.action="<%=request.getContextPath()%>/administratorDelListAction";
	form1.submit();
}
function edit(){
	var len=document.form1.id.length;
	var a=0;
	for(i=0;i<len;i++){
		if(document.form1.id[i].checked) 
			a=a+1;
	}
	if(a==0){
		alert("请选择要修改的商品");		
		return ;
	}	
	form1.action="<%=request.getContextPath()%>/administratorReadyEditListAction";
	form1.submit();

}
function show(){
	form1.action="<%=request.getContextPath()%>/administratorListAction";
	form1.submit();
}
</script>
</body>
  

⌨️ 快捷键说明

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