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

📄 home.jsp

📁 课程设计中的在线书店源码
💻 JSP
字号:
<%@ page contentType="text/html;charset=gb2312" import="java.sql.*,java.util.Date"%>
<%@ include file="check.jsp"%>
<%@ include file="top.jsp"%>
<jsp:useBean id="conn" class="dbBean.DBBean" scope="session"/>
<jsp:setProperty name="conn" property="connStr" value="jdbc:odbc:forum"/>
<html>
<head>
<title>欢迎您访问本论坛</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<%!
	String today="";
	String n1="0";
	int n2=0;
	String n3="0";
	String n4="0";
%>
<%
	StringBuffer to=new StringBuffer((new Date()).toLocaleString());
	if(to.charAt(6)=='-')
		to.insert(5,"0");
	if(to.charAt(9)==' ')
		to.insert(8,"0");
	today=to.substring(0,10);
%>
<p><center>
  <table width="95%" cellpadding="3" cellspacing="0" border bordercolor="#ff6600" bordercolorlight="#FFFFFF">
    <tr> 
      <th background="images/bg1.gif" height="26" colspan="2"> 
        <marquee scrollamount="3">
  <strong>欢迎<%=session.getAttribute("name")%>的到来,今天是<%=today%></strong>
</marquee> 
</th>
<%
	ResultSet rs=null;
	String sql="select count(*) from user where rank<>4";
	rs=conn.executeQuery(sql);
	if(rs.next())
		n1=rs.getString(1);
	rs.close();
	sql="select pubtime from article";
	rs=conn.executeQuery(sql);
	n2=0;
	while(rs.next())
	{
		String t=(rs.getString(1)).substring(0,10);
		if(t.equals(today))
			n2++;
	}
	rs.close();
	sql="select count(*) from article where reID=0";
	rs=conn.executeQuery(sql);
	if(rs.next())
		n3=rs.getString(1);
	rs.close();
	sql="select count(*) from article";
	rs=conn.executeQuery(sql);
	if(rs.next())
		n4=rs.getString(1);
	rs.close();
%>
<tr bgcolor="#FFFAF7">
<td width="50%">现有会员总数:<%=n1%></td>
<td width="50%">今日发贴总数:<%=n2%></td>
<tr bgcolor="#FFFAF7">
<td>主题总数:<%=n3%></td>
<td>贴子总数:<%=n4%></td>
</table>
<p>
<%
	String editor1="",editor2="",editor3="";
	sql="select * from user where rank=1";
	rs=conn.executeQuery(sql);
	while(rs.next())
	{
		editor1+=rs.getString("name");
		editor1+="&nbsp;&nbsp;";
	}
	sql="select * from user where rank=2";
	rs=conn.executeQuery(sql);
	while(rs.next())
	{
		editor2+=rs.getString("name");
		editor2+="&nbsp;&nbsp;";
	}
	sql="select * from user where rank=3";
	rs=conn.executeQuery(sql);
	while(rs.next())
	{
		editor3+=rs.getString("name");
		editor3+="&nbsp;&nbsp;";
	}
	rs.close();
	conn.close();
%>
<table width="95%">
<tr> 
<th background="images/bg1.gif" height="20" colspan="2"> 
<strong>技术交流</strong>
</th>
<tr bgcolor="#FFFAF7">
<td colspan="2"><img src="images/readme.gif">最新最快的讯息中心,IT高手的聚会天地,欢迎各路英豪到此进行技术交流,探讨最新的IT技术,切磋各自的编程心得!</td>
<tr bgcolor="#FFF0E6"> 
<td width="85%">斑竹:<%=editor1%></td>
<td><div align="right"><a href="board.jsp?boardid=1">进入>>></a></div></td>
</table>
<p><table width="95%" >
<tr> 
<th background="images/bg1.gif" height="20" colspan="2"> 
<strong>美食天地</strong>
</th>
<tr bgcolor="#FFFAF7">
<td colspan="2"><img src="images/readme.gif">嘿嘿,我是大嘴,我是大胃,拿手招牌菜,得意小搭配,吃喝DIY;餐馆很多,看看哪家好吃又不贵!</td>
<tr bgcolor="#FFF0E6"> 
<td width="85%">斑竹:<%=editor2%></td>
<td><div align="right"><a href="board.jsp?boardid=2">进入>>></a></div></td>
</table>
<p><table width="95%">
<tr> 
<th background="images/bg1.gif" height="20" colspan="2"> 
<strong>生活五味</strong>
</th>
<tr bgcolor="#FFFAF7">
<td colspan="2"><img src="images/readme.gif">让生活中真情的呼唤在这里听到回声、感人的故事在这里留下印迹,倾诉生活中的酸、甜、苦、辣,灌、灌、灌出您生活中的精彩!</td>
<tr bgcolor="#FFF0E6"> 
<td width="85%">斑竹:<%=editor3%></td>
<td><div align="right"><a href="board.jsp?boardid=3">进入>>></a></div></td>
</table>
</center>
</body>
</html>

⌨️ 快捷键说明

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