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

📄 main.jsp

📁 一个真实的网络选课系统,由实际需求得到的,本人实际开发出来,运用JSP+TOMCAT
💻 JSP
字号:
<%@ page contentType="text/html; charset=UTF-8" language="java"  import="com.*" import="java.util.Date"  errorPage="errorpage.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>学生选课</title>
<script language="javascript" type="text/javascript">
  <!--
   function isSure()
   {
   		if(window.confirm('您确定选择吗?'))
		 {  
		 	return true;
		 	
		 }
		return false;
	 	
	}
	//-->
</script>
 <script language="javascript">
function   MyOnload()
			{  
					if(window.location.search   !=   "?2"){ 
					window.setTimeout("a()",1000); 
					}
 			}   
function a()
		{
		window.location.href   =   window.location.href   +   "?2";
		}
  
</script>
</head>


<body onload="MyOnload()" bgcolor="#66CCCC">


<p>星期五上午八点才可以选机时!</p>
<% if(Value.isValid(new Date()))
{

%>
<div align="center"> 
  <p><font color="#00FF00" size="+3" face="方正舒体">下周的安排如下</font></p>
  <p align="right">
  <% String id=(String)session.getAttribute("id");
  %>
				 当前用户ID<%=id %>&nbsp;&nbsp;
				<font size="2" color="#ff0080">提醒:同一天内只能选一个时间段</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="index.jsp" title="查看本周选机">本周机时信息</a>&nbsp;&nbsp;&nbsp;
				<a href="../logout" title="退出">退出</a>
			</p>
  <table width="75%" border="1">
   <% String riqi[]=Value.getRiQi2(new Date());
					%>
    <tr> 
      <td width="16%">时间/日期
      </td>
      <td width="12%">星期一
      <br>
	 <%=riqi[0]%>
      </td>
      <td width="12%">星期二
      <br>
	 <%=riqi[1]%>
      </td>
      <td width="12%">星期三
      <br>
	<%=riqi[2]%>
      </td>
      <td width="12%">星期四
      <br>
	  <%=riqi[3]%>
      </td>
      <td width="12%">星期五
      <br>
	  <%=riqi[4]%>
      </td>
      <td width="12%">星期六
      <br>
	  <%=riqi[5]%>
      </td>
      <td width="12%">星期日
      <br>
	  <%=riqi[6]%>
      </td>
    </tr>
    
     <tr> 
      <td width="16%">
						<font color=""><strong><font color="">是否上机</font>
						</strong>
						</font>
					</td>
					<% 
					boolean WeekTf[]=SelInfo.getWeekTF2();
					for(int p=0;p<7;p++)
					{
					if(WeekTf[p]==false)
					{
					%>
      <td width="12%">
						
						<font color="#008080"><strong><font color="">不上机 </font>
						</strong>
						</font>
					</td>
					<%}else{ %>
					<td width="12%">
						
						<font color=""><strong><font color="">上机</font>
						</strong>
						</font>
					</td>
     
					<% }}%>
      </tr>
    
	<%
	String name[]=SelInfo.getInfo2(); 
	String time[]={"8:30-9:00",
					"9:00-9:30",
					"9:30-10:00",
					"10:00-10:30",
					"10:30-11:00",
					"11:00-11:30",
					"14:00-14:30",
					"14:30-15:00",
					"15:00-15:30",
					"15:30-16:00",
					"16:00-16:30",
					"值  日"};
	for(int i=0;i<11;i++) {%>
	<tr><td width="16%"><%=time[i] %></td>
	<%for(int j=0;j<7;j++) {
	if(name[i*7+j]==null){
		if(WeekTf[j])
		{
	%>
	<td><input type="Button" name="button" value="请选择" onclick="if(window.confirm('您确定选择吗?')) window.open('http://222.192.23.25:8088/select/Maindo?button='+<%=(i*7+j)%>,'_self');"/></td>
	<%	}
		else
		{
	%>
		
	<td><input type="Button" name="button" value="请选择" onclick="" disabled="disabled"/></td>
		
	<%
		}
	}
	else 
	{
	%>
	<td ><span id="time1"><font color="" face=""><%=name[i*7+j] %></font></span></td>
	<%}
	  }
	 %>
	</tr>
	<%}%>
</table>
</div>
<%} 
	else
	{
%>
<p>对不起,本周星期五上午才可以选机时!</p>
<% 
    }
%>
</body>
</html>

⌨️ 快捷键说明

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