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

📄 header.jsp

📁 网上购物系统
💻 JSP
字号:
<%@ page language="java" pageEncoding="UTF-8"  isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<a name="top"></a>
<!---header area start--->
<div>
	<div id="header">
		<div id="headerlogo">
			<h1><a href="${pageContext.request.contextPath}/default.htm" title="在线商城-产品论坛-免费购物-新豆网 - " id="logo"><img src="${pageContext.request.contextPath}/upload/logo/logo.gif" title="在线商城-产品论坛-免费购物-新豆网 - " border="0" /></a></h1>
		</div>
		<div id="HeadNavBar">
			<ul id="navlist">
				<c:choose>
					<c:when test="${empty requestScope.username && empty sessionScope.username}">
						<li style="width: 150px; text-align: right;">欢迎:<span>游客</span></li>
						<li><a href="${pageContext.request.contextPath}/register.htm">注册</a></li>
						<li><a href="${pageContext.request.contextPath}/login.htm">登录</a></li>
					</c:when>
					<c:otherwise>
						<li style="width: 150px; text-align: right;">欢迎:<span>${username}</span></li>
						<li><a href="${pageContext.request.contextPath}/logout.htm">[退出]&nbsp;</a></li>
						<li class="message"><img src="${pageContext.request.contextPath}/images/head/mymessage.gif" /><a href="${pageContext.request.contextPath}/user/usercpinbox.htm">消息</a></li>
						<li class="more"><img src="${pageContext.request.contextPath}/images/head/myxindou.gif" /><a href="${pageContext.request.contextPath}/user/usercp.htm">控制面板</a></li>
						<li id="my" class="more2" onmouseover="showMenu(this.id);" onmouseout="showMenu(this.id);"><a href="###">我的&nbsp;&nbsp;&nbsp;</a></li>
						<div id="my_menu" class="downlist" style="display: none;">
							<h4><span class="last"><a href="${pageContext.request.contextPath}/user/usercporder.htm">我的订单</a></span></h4>
							<div class="Dspace2">&nbsp;</div>
							
							<form action="${pageContext.request.contextPath}/search.htm" method="post" name="sch">							
							<input type="hidden" name="author" value="${username}"/>
							<input type="hidden" name="digest" />
							<h4><span class="last"><a href="#"><div onclick="document.sch.submit();">我的主题</div></a></span></h4>
							<div class="Dspace2">&nbsp;</div>
							<h4><span class="last"><a href="#"><div onclick="document.sch.submit();">我的帖子</div></a></span></h4>
							<div class="Dspace2">&nbsp;</div>
							<h4><span class="last"><a href="#"><div onclick="document.sch.digest.value='true';document.sch.submit();">我的精华</div></a></span></h4>						
							</form>
						
						</div>
					</c:otherwise>
				</c:choose>
				<li class="gwc"><img src="${pageContext.request.contextPath}/images/head/gwc.gif" /><a href="${pageContext.request.contextPath}/cart.htm">购物车</a></li>
				<!-- 
					<li><a href="#">在线</a></li>
				 -->
				<li class="gwc"><a href="${pageContext.request.contextPath}/rootforum.htm?id=1"><b style='color: red'>论坛交流区</b></a></li>
				<li class="last"><img src="${pageContext.request.contextPath}/images/head/help.gif" /><a href="#">帮助</a></li>
			</ul>
		</div>
		<div id="HeadNavMenuDiv">			
			<div id="ServicePhoneDiv"><img src="${pageContext.request.contextPath}/images/head/servicephone.gif" alt="客服电话:4008206003" /></div>			 
			<div>
				<ul id="HeadNavMenu">
					<li id="rcDefault" onmouseover="ActiveLi(this)" onmouseout="LeaveLi()"><a href="${pageContext.request.contextPath}/default.htm">首页</a></li>
					<c:forEach items="${requestScope.rootcategorys}" var="rootcategory">
						<li id="rc${rootcategory.id}" onmouseover="ActiveLi(this)" onmouseout="LeaveLi()"><a href='${pageContext.request.contextPath}/rootcategory.htm?id=${rootcategory.id}'>${rootcategory.name}</a></li>
					</c:forEach>
				</ul>
			</div>
		</div>
	</div>
</div>
<div id="SearchDiv">
	<div id="SearchBar">
		<div id="SearchCenterBar">
			<div id="searchalldiv">
				<a href="${pageContext.request.contextPath}/categorylist.htm" target="_blank"><b>[所有分类]</b></a>&nbsp;
				<a href="${pageContext.request.contextPath}/brandlist.htm" target="_blank"><b>[所有品牌]</b></a>&nbsp;
			</div>
			<div id="searchdivs">
				<select name="Header1$ddlSearchType" id="Header1_ddlSearchType">
					<option selected="selected" value="0">搜索商品</option>
					<option value="1">搜索帖子</option>
				</select>
				<input name="tbKey" type="text" id="tbKey" class="SearchInput" onkeydown="if(event.keyCode == 13) search2();" />
				<select name="ddlSearchCategory" id="ddlSearchCategory">
					<option selected value="0">所有分类</option>
					<c:forEach items="${requestScope.categorys}" var="category">
						<option value="${category.id}">
							<c:choose>
								<c:when test="${category.type==1}"></c:when>
								<c:when test="${category.type==2}"> &nbsp;&nbsp;</c:when>
								<c:otherwise> &nbsp;&nbsp; &nbsp;&nbsp;</c:otherwise>
							</c:choose>
							${category.name}
						</option>
					</c:forEach>
				</select>
				<input type="button" name="ibSearch" value="" onclick="search();" id="ibSearch" class="SearchButton" style="background-color:red;"/>&nbsp;
				<input type="button" name="ibBlurSearch" value="" onclick="blursearch();" id="ibBlurSearch" class="BlurSearchButton" />
			</div>
			<div id="SearchPromotionDiv"><a href="${pageContext.request.contextPath}/promotion.htm" target="_blank"> <img src="${pageContext.request.contextPath}/images/head/xindoutime.gif" /></a></div>
		</div>
	</div>
</div>

<script type="text/javascript">

function search()
{
    var word = document.getElementById("tbKey").value;
    if(word == "")
    {
        alert("请填写搜索关键词");
        return;
    }
	//此处修改搜索页的路径
    if(document.getElementById("Header1_ddlSearchType").value=='0')
    {		
        top.window.location = "${pageContext.request.contextPath}"+"/psearch.htm?word="+encodeURI(word)+"&cid="+document.getElementById("ddlSearchCategory").value;
    }
    else
    {
        top.window.location = "${pageContext.request.contextPath}"+"/search.htm?type=post&word="+encodeURI(word)+"&searchforumid="+document.getElementById("ddlSearchCategory").value;
    }
}

function blursearch()
{
    var word = document.getElementById("tbKey").value;
    if(word == "")
    {
        alert("请填写搜索关键词");
        return;
    }
	//此处修改搜索页的路径
    if(document.getElementById("Header1_ddlSearchType").value=='0')
    {
        top.window.location = "${pageContext.request.contextPath}"+"/pquery.htm?word="+encodeURI(word)+"&cid="+document.getElementById("ddlSearchCategory").value;
    }
    else
    {
       //top.window.location = "${pageContext.request.contextPath}"+"/query.htm?type=post&word="+encodeURI(word)+"&searchforumid="+document.getElementById("ddlSearchCategory").value;
       alert('暂不支持帖子模糊搜索!');
    }
}

function LeaveLi()
{
    var lis = document.getElementById("HeadNavMenu").getElementsByTagName("li");
    for(var i=0;i<lis.length;i++)
		{
			lis[i].className = "NormalMenu";
		}
	var rcactive = document.getElementById('rc${requestScope.rootid}');
    if(rcactive)
        rcactive.className = "ActiveMenu";
    else
        document.getElementById('rcDefault').className="ActiveMenu";
		
}
var rcactive = document.getElementById('rc<c:out value="${requestScope.rootid}" default=""/>');
if(rcactive)
	rcactive.className = "ActiveMenu";
else
	document.getElementById('rcDefault').className="ActiveMenu";
	
</script>
	<!---header area end--->

⌨️ 快捷键说明

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