?? a_layout.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" import="java.util.*,mrgf.hibernate.*" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<jsp:useBean id="hn" class="mrgf.other.Hibernate" scope="request"/>
<html>
<link rel="stylesheet" href="css/style.css">
<style type="text/css">
<!--
.style1 {color: #CC33FF}
.style2 {color: #000000}
-->
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>
index
</title>
</head>
<body bgcolor="#ffffff" topmargin="0">
<script language="javascript" type="">
<!--
function checkEmptySearch(formName){
for(i=0;i<formName.length;i++){
if(formName.elements[i].value==""){
alert("請認真填寫商品信息!!!");
return false;
}
}
}
function checkEmptyLand(formName){
for(i=0;i<formName.length;i++){
if(formName.elements[i].value==""){
alert("請認真填寫登錄信息!!!");
return false;
}
}
}
function controlAlign(){
width=screen.width;
height=screen.height;
var hdc=window.open('findPassword.do','','width=400,height=200');
hdc.moveTo((width-400)/2,(height-200)/2);
}
function controlLandAlign(){
width=screen.width;
height=screen.height;
var hdc=window.open('managerLand.do','','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=400');
hdc.moveTo((width-600)/2,(height-400)/2);
}
function controlAfficheAlign(id){
width=screen.width;
height=screen.height;
var hdc=window.open("seeAffiche.do?afficheId="+id,"","scrollbars=yes,width=600,height=400");
hdc.moveTo((width-600)/2,(height-400)/2);
}
//-->
</script>
<table width="983" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="113" rowspan="5"> </td>
<td colspan="2"><img src="image/layout/top.jpg" width="757" height="59"></td>
<td width="43" rowspan="4"><img src="image/layout/rightLine.jpg" width="43" height="839"></td>
<td width="70" rowspan="5"> </td>
</tr>
<tr>
<td colspan="2" height="42" background="image/layout/topTwo.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td> <a href="index.do">首頁</a></td>
<td><a href="taxis.do">銷售排行</a></td>
<td><a href="new_merchandise.do">新品上架</a></td>
<td><a href="special_offer.do">特價商品</a></td>
<td><a href="see_order_for_goods.do">查看訂單</a></td>
<td><a href="shopping_cart.do">購 物 車</a></td>
<td><a href="update_data.do">修改資料</a> </td>
<td><a href="#" onclick="this.style.behavior='url(#default#homepage)';this.sethomepage('http://www.mingrisoft.com')" >設為首頁</a></td>
</tr>
</table></td>
</tr>
<form action="searchMerchandise.do" name="search" onsubmit="return checkEmptySearch(search)">
<tr>
<td colspan="2" height="31" background="image/layout/topThree.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<%
mrgf.other.SpecialMethod sm=new mrgf.other.SpecialMethod();
String username=(String)session.getAttribute("username");
String land="not";
if(username==null){
username="歡迎您登錄本站,今天是 "+sm.getDateWithString()+"!!!";
}else{
username=username+":您好,今天是 "+sm.getDateWithString()+"!!!";
land="yes";
}
%>
<td><span class="word_deepgrey"><%=username %></span></td>
<td><span class="word_deepgrey">搜索商品名稱:</span><input type="text" name="searchMerchandiseName" style="color:purple"></td>
<td><input type="image" name="search" src="image/layout/button.gif"></td>
</tr>
</table></td>
</tr>
</form>
<tr>
<td><table width="194" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="191" background="image/layout/land.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="20">
<td width="12%"></td>
<td width="32%"></td>
<td width="56%"></td>
</tr>
<tr height="20" align="center">
<%
String landClueOn="";
if(request.getAttribute("landClueOn")!=null){
landClueOn=request.getAttribute("landClueOn").toString();
}
%>
<td colspan="3"><font color="red"><%=landClueOn %></font></td>
</tr>
<form action="land.do" method="POST" name="land" onsubmit="return checkEmptyLand(land)">
<tr>
<td> </td>
<td colspan="2">名稱:<input type="text" <%if(land.equals("yes")){ %>readonly="readonly"<%} %> name="username" size="16" style="color:purple"></td>
</tr>
<tr>
<td> </td>
<td colspan="2">密碼:<input type="password" <%if(land.equals("yes")){ %>readonly="readonly"<%} %> name="password" size="16" style="color:purple"></td>
</tr>
<tr>
<td colspan="3"><!--記錄用戶請求登錄時所在的頁--><input type="hidden" name="pageInLand" value="<%=request.getServletPath() %>" /></td>
</tr>
<tr>
<td> </td>
<%
if(land.equals("yes")){
%>
<td valign="bottom"><a href="exitLand.do" class="style2">退出登錄</a></td>
<%
}else{
%>
<td> </td>
<%
}
%>
<td><input type="reset" name="Submit" value="重置">
<input type="submit" name="Submit2" value="登錄"></td>
</tr>
</form>
<tr>
<td colspan="3"> </td>
</tr>
<%
if(!land.equals("yes")){
%>
<tr align="center">
<td colspan="3"><a href="login.do" class="style2">我要注冊</a>
<a href="#" class="style2" onClick="controlAlign()">找回密碼</a></td>
</tr>
<%
}else{
%>
<tr align="center">
<td colspan="3">我要注冊 找回密碼</td>
</tr>
<%
}
%>
<tr>
<td colspan="3"> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="217" background="image/layout/affiche.jpg"><table width="96%" border="0" cellspacing="0" cellpadding="0">
<tr height="30">
<td> </td>
</tr>
<tr>
<td><marquee height="187" direction="up" scrollamount="1" onmouseout="this.start()" onmouseover="this.stop()">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
//加載公告
List affiches=null;
if(session.getAttribute("affiches")==null){
String hql="from Affiche";
affiches=hn.query(hql);
session.setAttribute("affiches",affiches);
}else{
affiches=(List)session.getAttribute("affiches");
}
for(int i=0;i<affiches.size();i++){
Affiche affiche=(Affiche)affiches.get(i);
%>
<tr>
<td width="6%"> </td>
<td width="88%">
<a href="#" class="style2" onClick="controlAfficheAlign(<%=affiche.getId() %>)"><%=affiche.getTitle()+" "+affiche.getDates() %></a></td>
<td width="6%"> </td></tr>
<tr>
<td colspan="3"> </td>
</tr>
<%
}
%>
</table>
</marquee>
</td>
</tr>
</table></td>
</tr>
<%
//搜索銷售排行信息
String hql="";
hql="from MerchandiseSort where photo = '0'";
List sonSortsl=(List)hn.query(hql);
List sellFirstOfEverySort = new ArrayList();
for(int i=0;i<sonSortsl.size();i++){
MerchandiseSort sonSort=(MerchandiseSort)sonSortsl.get(i);
String sql = "select merchandise_id from (select * from tb_sell_info where merchandise_id in (select id from tb_merchandise_info where sort_id=" + sonSort.getId() + ")) sortMerchandise group by sortMerchandise.merchandise_id order by sum(amount) desc";
List idTaxis = hn.queryWithSql(sql);
if(idTaxis.size()>0){
String sid = idTaxis.get(0).toString();
int id = Integer.parseInt(sid);
hql = "from MerchandiseInfo where id=" + id;
MerchandiseInfo info = (MerchandiseInfo) hn.queryOne(hql);
sellFirstOfEverySort.add(info);
}
}
%>
<tr>
<td height="299" background="image/layout/compositor.jpg" valign="top">
<table width="96%" border="0" cellspacing="0" cellpadding="0">
<tr height="30">
<td> </td>
</tr>
<tr>
<td><marquee height="266" direction="up" scrollamount="1" onmouseout="this.start()" onmouseover="this.stop()">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<%
for(int i=0;i<sellFirstOfEverySort.size();i++){
MerchandiseInfo info=(MerchandiseInfo)sellFirstOfEverySort.get(i);
%>
<tr>
<td></td>
<td><a href="merchandise_info.do?merchandiseId=<%=info.getId() %>" class="style2"><%=info.getName()+" RMB:"+info.getPrice() %></a></td>
</tr>
<%
}
%>
</table>
</marquee></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="563" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="65" valign="top" background="image/layout/topFour.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="40" height="8"></td>
</tr>
<tr align="center" height="29">
<%
//加載商品類別
hql="from MerchandiseSort where photo<>'0'";
List fatherSorts=hn.query(hql);
session.setAttribute("fatherSorts",fatherSorts);
//遍例父類
MerchandiseSort fatherSort=null;
fatherSort=(MerchandiseSort)fatherSorts.get(0);
%>
<td rowspan="3"><a href="fatherSort.do?fatherId=<%=fatherSort.getId() %>&requestPage=<%=request.getServletPath() %>"><img src="image/layout/type/<%=fatherSort.getPhoto() %>" width="23" height="21"></a></td>
<td><a href="fatherSort.do?fatherId=<%=fatherSort.getId() %>&requestPage=<%=request.getServletPath() %>" class="style2"><%=fatherSort.getName() %></a></td>
<%
for(int i=1;i<fatherSorts.size();i++){
fatherSort=(MerchandiseSort)fatherSorts.get(i);
%>
<td rowspan="3"><img src="image/layout/type/oneLine.jpg"></td>
<td rowspan="3"><a href="fatherSort.do?fatherId=<%=fatherSort.getId() %>&requestPage=<%=request.getServletPath() %>"><img src="image/layout/type/<%=fatherSort.getPhoto() %>" width="23" height="21"></a></td>
<td><a href="fatherSort.do?fatherId=<%=fatherSort.getId() %>&requestPage=<%=request.getServletPath() %>" class="style2"><%=fatherSort.getName() %></a></td>
<%
}
%>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="40" height="1"></td>
</tr>
<tr align="center">
<%
//遍例子類
Set sonSorts=null;
if(request.getAttribute("sonSorts")==null){
sonSorts=((MerchandiseSort)fatherSorts.get(0)).getSonSorts();
session.setAttribute("sonSorts",sonSorts);
}else if(request.getAttribute("sonSorts")!=null&&request.getAttribute("sonSorts").equals("session")){
sonSorts=(Set)session.getAttribute("sonSorts");
}else{
sonSorts=(Set)request.getAttribute("sonSorts");
session.setAttribute("sonSorts",sonSorts);
}
Iterator it=sonSorts.iterator();
MerchandiseSort sonSort=null;
while(it.hasNext()){
sonSort=(MerchandiseSort)it.next();
%>
<td><a href="sonSort.do?fatherId=<%=sonSort.getId() %>&requestPage=<%=request.getServletPath() %>" class="style2"><%=sonSort.getName() %></a></td>
<%
while(it.hasNext()){
%>
<td><img src="image/layout/type/twoLine.jpg"></td>
<%
break;
}
}
%>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top">
<!--內容開始-->
<tiles:insert attribute="content"/>
<!--內容結束-->
</td>
</tr>
</table>
</td>
</tr>
<tr valign="bottom">
<td colspan="3" width="800" height="101" background="image/layout/bottom.jpg">
<a href="#" onClick="controlLandAlign()">登錄</a></td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -