【JSP开源代码栏目提醒】:网学会员在JSP开源代码频道为大家收集整理了boardproduct.jsp提供大家参考,希望对大家有所帮助!
<%@ page contentType="text/html; charset=gb2312" language="java" errorPage="" %>
<%@ page import="com.stuhouse.qqNews.*"%>
<%@ page import="com.stuhouse.qqNews.sql.*"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="com.util.*"%>
<%@ page import="java.text.*"%>
<HTML>
<HEAD>
<TITLE>奇趣生活</TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<link rel="stylesheet" href="images/CSS.CSS" type="text/css">
<style type="text/css">
<!--
.bg { background-image: url(images/index_top1.gif); background-repeat: no-repeat}
.leftbg { background-image: url(images/index_leftbg.gif)}
-->
</style>
<SCRIPT LANGUAGE=javascript>
<!--
brOK=navigator.javaEnabled()?true:false;
ns4=(document.layers)?true:false;
ie4=(document.all)?true:false;
var vmin=0;//4;
var vmax=0;//10;
var vr=0;//4;
var timer1;
var timer2;
var timer3;
//-->
</SCRIPT>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function window_onload() {
<!--Page.OnLoad-->
}
function loginsubmit()
{
if(document.form.ID.value=="")
{
alert("您的用户忘了填写了!");
document.form.ID.focus();
}
else if(document.form.password.value=="")
{
alert("您的密码忘了填写了!");
document.form.password.focus();
}
else
{
document.form.submit();
}
}
//-->
</SCRIPT>
</HEAD>
<%
int tuijiandu = 0;//在首页显示的推荐度
int BoardID = ParameterUtils.getInt(request,"BoardID");
Factory factory = Factory.getInstance();
Product product = factory.getProduct();
ProductFactory productfactory = factory.getProductFactory();
String RandomMa = GetRandomMa.getTheRandomMa();
User sessionUser = SessionManager.getUserMsg(session,"usermsg");
User sessionTempUser = SessionManager.getUserMsg(session,"tempusermsg");
String ID;
if(sessionUser == null && sessionTempUser == null)
{
ID = "";
}
else
{
ID = ((sessionUser == null)?( sessionTempUser.getID()):(sessionUser.getID()));
}
//以下为分页显示部分
//分页变量定义
int e=20; //'每页显示的记录数
int totalpage=0; //'页面总数
int pages=1; //'显示的当前页面
int count=0; //'库中数据的总记录数
int from=0,to=0; //'从from篇到to篇
int p=0; //'数据库查询从p开始
//取页数
pages=ParameterUtils.getInt(request,"pages");
//pages = request.getParameter("pages");
//分页预备
count=productfactory.Count(BoardID);
//out.print(count);
totalpage=((count%e==0)?(count/e):(count/e+1));
if(totalpage==0) totalpage=1;
if(pages>totalpage) pages=totalpage;
else if(pages<1) pages=1;
//if(count!=0)
// from=(pages-1)*e+1;
//if(totalpage==pages)
// to=count;
//else if(count!=0)
// to=from+e-1;
//p= (pages-1)*e;
//以上为分页显示部分
%>
<%//浮动图片的显示
int adImageWidth=0,
adImageHeight=0,
infoImageWidth=0,
infoImageHeight=0,
adImageWidth2=0,
adImageHeight2=0,
infoImageWidth2=0,
infoImageHeight2=0;
String AddImage ="";
String ImageLink = "";
String AddImage2 ="";
String ImageLink2 = "";
News imagenews = factory.getNews();
NewsFactory imagenewsfactory = factory.getNewsFactory();
Pic image = factory.getPic();
PicFactory imagefactory = factory.getPicFactory();
Iterator iterator5 = imagenewsfactory.ListTopNews(2,6,0);
if(iterator5.hasNext())
{
//out.println("have");
imagenews = (News)iterator5.next();
ImageLink = "news/"+imagenews.getNewsFilePath();
image = imagefactory.List(imagenews.getPicID());
adImageWidth = image.getWidth();
adImageHeight = image.getHeight();
AddImage = "pic/"+image.getFileName();
//out.println(adImageHeight);
if(adImageWidth == -1 || adImageWidth == 0)
adImageWidth = 110;
if(adImageHeight == -1 || adImageHeight == 0)
adImageHeight = 250;
%>
<%@ include file="include/boardad.jsp"%>
<%
}
if(iterator5.hasNext())
{
//out.println("have2");
imagenews = (News)iterator5.next();
ImageLink2 = "news/"+imagenews.getNewsFilePath();
image = imagefactory.List(imagenews.getPicID());
adImageWidth2 = image.getWidth();
adImageHeight2 = image.getHeight();
AddImage2 = "pic/"+image.getFileName();
if(adImageWidth2 == -1 || adImageWidth2 == 0)
adImageWidth2 = 110;
if(adImageHeight2 == -1 || adImageHeight2 == 0)
adImageHeight2 = 200;
%>
<%@ include file="include/boardad2.jsp"%>
<%
}
%>
<BODY BGCOLOR=#336699 leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" class="indexbg" LANGUAGE=javascript onload="return window_onload()">
<!--Counter-->
<!--Something Here-->
<table width="778" border="0" cellspacing="0" cellpadding="0" height="180" align="center" background="images/index_topbg.gif">
<tr>
<td class="bg" valign="top">
<table border="0" cellspacing="0" cellpadding="0" align="right" width="317">
<tr>
<td height="100"><table width="206" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><img src="images/logo首页.jpg"></td>
</tr>
</table></td>
</tr>
<tr><td height="10"></td></tr>
<tr><td height="22"> <img src="images/dot05.gif"> <a href="buyproduct.jsp?P_ID=0">购物车</a> <img src="images/dot05.gif"> <a href="zhuce.jsp">新会员注册</a><img src="images/nav_but.gif"><a href="login.jsp">登陆</a> <img src="images/dot05.gif"> <a href="helf.jsp">服务中心</a> <img src="images/dot05.gif"> <a href="javascript:window.external.addfavorite('http://www.studenthouse.com/','学生商行')">收藏本站</a> </td></tr>
</table>
</td>
<td background="images/index_top2.gif" width="210" valign="top"><img src="images/01.gif" width="186" height="150"></td>
</tr>
</table>
<table width="778" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#D7DFF3">
<tr>
<td width="215" valign="top" class="leftbg"><img src="images/index_lmtop.gif" width="215" height="116">
<table width="210" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="210" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td><td align="center">
<b>
<%
if(sessionUser == null)
out.println("<font color='green'>未登陆</font>");
else
out.println("<font color='red'>"+sessionUser.getID()+"您好");
%>
</b>
</td></tr>
<tr>
<td height="36" width="53"> </td>
<td height="36" width="157">
<!--登陆部分-->
<form method=post action="chklogin.jsp" name="form">
<table width="150" border="0" cellspacing="0" cellpadding="0" height="30">
<tr>
<td><img src="images/nnn_11.jpg" width="150" height="19"></td>
</tr>
<tr>
<td>
帐户:<input type="text" name="ID" size="15"> <br>
密码:<input type="Password" name="password" size="15"> <br>
验码:<input type="text" name="chkma" size="4"> <font color="red" s
上一篇:
BoardNews.jsp
下一篇:
网络能耗监测系统管理端的研究与实现