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

📄 manager_meeting_add.jsp

📁 一个JSP范例
💻 JSP
字号:
	<%@ page errorPage="ErrPage.jsp"
	         import="java.util.Date, java.sql.*"
	         contentType="text/html;charset=gb2312"%>
	<jsp:useBean id="pool" scope="application" class="com.PoolBean"/>
	<%
	String strLoginUser = (String)session.getAttribute("LoginUser");
	if (strLoginUser == null || strLoginUser.length() == 0)	
		response.sendRedirect("Login.jsp");	
	%>
	<html>
	<head>
	<LINK REL="stylesheet" HREF="littleproject.css" TYPE="text/css">
	<SCRIPT LANGUAGE="JavaScript" SRC="meeting.js"></SCRIPT>
	<script language="Javascript">
	<!--
	function isok(theform)
	{  
	  if (theform.meeting_title.value=="") 
	  {
	    alert("请您填写会议主题!");
	    theform.meeting_title.focus();
	    return (false);
	  }
	 var getformyear;
	    getformyear= theform.beginyear.value;		 
	 var getformmonth;
	    getformmonth = theform.beginmonth.value;		
	 var getformday;
	    getformday = theform.beginday.value;
	 var subreturndate;
	 subreturndate = isrightdate(getformyear,getformmonth,getformday);
	 if (subreturndate == 1)
	 {
	     alert(getformyear+"年"+getformmonth+"月只有三十天,
      请您重新选择会议起始日期!");
		 return false;
	 }
	 if (subreturndate == 2)
	 {
	     alert(getformyear+"年二月只有29天,请您重新选择会议起始日期!");
		 return false;
	 }
	 if (subreturndate == 3)
	 {
	     alert(getformyear+"年二月只有28天,请您重新选择会议起始日期!");
		 return false;
	 }
	 
	 var getformyear1;
	      getformyear1= theform.endyear.value;		 
	 var getformmonth1;
	     getformmonth1 = theform.endmonth.value;		
	 var getformday1;
	     getformday1 = theform.endday.value;
	 var subreturndate1;
	 subreturndate1 = isrightdate(getformyear1,getformmonth1,getformday1);
	 if (subreturndate1 == 1)
	 {
	     alert(getformyear1+"年"+getformmonth1+"月只有三十天,
       请您重新选择会议结束日期!");
		 return false;
	 }
	 if (subreturndate1 == 2)
	 {
	     alert(getformyear1+"年二月只有29天,请您重新选择会议结束日期!");
		 return false;
	 }
	 if (subreturndate1 == 3)
	 {
	     alert(getformyear1+"年二月只有28天,请您重新选择会议结束日期!");
		 return false;
	 }
	   if (theform.place.value=="") 
	  {
	    alert("请您填写会议召开地点!");
	    theform.place.focus();
	    return (false);
	  }
	  if (theform.touch_man.value=="") 
	  {
	    alert("请您填写联系人!");
	    theform.touch_man.focus();
	    return (false);
	  }
	  if (theform.touch_tel.value=="") 
	  {
	    alert("请您填写联系电话!");
	    theform.touch_tel.focus();
	    return (false);
	  }
	  if (theform.touch_address.value=="") 
	  {
	    alert("请您填写联系地址!");
	    theform.touch_address.focus();
	    return (false);
	  }
	  if (theform.touch_email.value=="") 
	  {
	    alert("请您填写联系邮件地址!");
	    theform.touch_email.focus();
	    return (false);
	  }
	  if (theform.remark.value=="") 
	  {
	    alert("请您填写会议简介!");
	    theform.remark.focus();
	    return (false);
	  }
	  theform.nrooms.value= noblankrooms;	
	  return (true);
	}
	
	-->
	</script>
	  <title>会务信息录入</title>  
	</head>
	<body bgcolor=LightBlue>
	<% 
	   Date date = new Date();
	try
	{
            if (pool.getConnectionSize() == 0)
		{
			pool.initializePool();
		}		
		Connection con = null;
		Statement stmt = null;		
		con = pool.getConnection();
		stmt= con.createStatement();
	    ResultSet  rs=null;		
		String sqlString = "select num from meeting order by num desc";
		rs =stmt.executeQuery(sqlString);
		//int mycode=0;
		int meeting_num=0;
		//rs.last();
		if(rs.next())
		{
		  meeting_num = rs.getInt("num");
		}
		meeting_num=meeting_num+1;	
	%>
	<center>
	<br>
	<font color="blue" size="6" face="隶书">召开新会议</font>
	  <form action="manager_meeting_addext.jsp" method=POST
     onsubmit="return isok(this)">
	  <input type="hidden" name="meeting_num" value="<%=meeting_num %>">
	  <TABLE border=1 bordercolor=RoyalBlue bgcolor=LightBlue width=650>
		 <tr>
		   <td align="center" bgcolor=LightYellow width="100">
		     <font color="red">会议主题</font>
		   </td>
		   <td width="550">
		     <input type="text" size=45 name="meeting_title" 
       style="border-style: solid; border-width: 1">
		   </td>
		 </tr> 
		 <tr>
		   <td align="center" bgcolor=LightYellow width="100">
		     <font color="red">起始日期</font>
		   </td>
		   <td align="left" width="550">
		     <select name="beginyear" size="1">
			  <option value="<%=date.getYear()+1900%>">
       <%=date.getYear()+1900%>
       </option>
	<%
	          for (int y=date.getYear()+1900;y<date.getYear()+1905;y++)
			  {
	%>
			     <option value="<%=y%>"><%=y%></option>
	<%
	          }
	%>     
	       </select>年
		  <select name="beginmonth" size="1">	
			  
       
      	    
			  <%
			  for (int i=0; i<10;i++)
			  {
	%>
			     <option value="0<%=i+1%>"><%=i+1%></option>
	<%
	          }
			  for (int i=10; i<12;i++)
			  {
	%>
			     <option value="<%=i+1%>"><%=i+1%></option>
	<%
	          }
	%>
	       </select>月
		   <select name="beginday" size="1">		 
			  
			  <%
			  for (int j=1; j<10;j++)
			  {
	%>
			     <option value="0<%=j%>"><%=j%></option>
	<%
	          }
			  for (int j=10; j<32;j++)
			  {
	%>
			     <option value="<%=j%>"><%=j%></option>
	<%
	          }
	%>
	       </select>日
		   </td>
		 </tr>	
		 <tr>
		 <tr>
		   <td align="center" bgcolor=LightYellow width="100">
		     <font color="red">结束日期</font>
		   </td>
		   <td align="left" width="550">
		     <select name="endyear" size="1">
			  <option value="<%=date.getYear()+1900%>">
        <%=date.getYear()+1900%>
       </option>
	<%
	          for (int y=date.getYear()+1900;y<date.getYear()+1905;y++)
			  {
	%>
			     <option value="<%=y%>"><%=y%></option>
	<%
	          }
	%>     
	       </select>年
		  <select name="endmonth" size="1">	
			  
      
      	    
	         <%
			  for (int i=0; i<10;i++)
			  {
	          %>
			     <option value="0<%=i+1%>"><%=i+1%></option>
	         <%
	          }
			  for (int i=10; i<12;i++)
			  {
	         %>
			     <option value="<%=i+1%>"><%=i+1%></option>
	         <%
	          }
	        %>
	       </select>月
		   <select name="endday" size="1">		 
			  
			  <%
			  for (int j=1; j<10;j++)
			  {
	          %>
			     <option value="0<%=j%>"><%=j%></option>
	          <%
	          }
			  for (int j=10; j<32;j++)
			  {
	         %>
			     <option value="<%=j%>"><%=j%></option>
	         <%
	          }
	         %>
	       </select>日
		   </td>
		 </tr>	
		 <tr>  	   
		   <td align="center" bgcolor=LightYellow width="100">	   
		     <font color="red">开会地点</font>
		   </td>
		   <td width="550">
		     <input type="text" size=25 name="place"
       style="border-style: solid; border-width: 1">
		   </td>	 
		 </tr>
		 <tr>
		   <td align="center" bgcolor=LightYellow width="100">
		     <font color="red">联&nbsp;系&nbsp;人</font>
		   </td>
		   <td width="550">
		     <input type="text" size=35 name="touch_man"
       style="border-style: solid; border-width: 1">
		   </td>
		 </tr>
		 <tr>  	   
		   <td align="center" bgcolor=LightYellow width="100">
		     <font color="red">联系电话</font>
		   </td>
		   <td width="550">
		     <input type="text" size=30 name="touch_tel"
       style="border-style: solid; border-width: 1">
		   </td>
		 </tr>
		 <tr>  	   
		   <td align="center" bgcolor=LightYellow width="100">
		     <font color="red">联系地址</font>
		   </td>
		   <td width="550">
		     <input type="text" size=45 name="touch_address"
        style="border-style: solid; border-width: 1">
		   </td>
		 </tr> 	 
		 <tr>  	   
		   <td align="center" bgcolor=LightYellow width="100">
		     <font color="red">邮件地址</font>
		   </td>
		   <td width="550">
		    <input type="text" size=30 name="touch_email"
       style="border-style: solid; border-width: 1">
		   </td>
		 </tr> 	
		 <tr>	 
		   <td align="center" bgcolor=LightYellow width="100">
		     <font color="red">会议简介</font>
		   </td>
		   <td width="550">
		    <textarea rows="10" name="remark" cols="73"
       style="border-style: solid; border-width: 1"></textarea>
		   </td>
		 </tr>	
		 <tr align="right">
		  <td colspan="2" width="650">
		   <input type="submit" value="添  加" name=submit1>
		   <input type="reset" value="重  置" name=reset1>
		  <a href="manager_meeting.jsp">退  出</a>
		  </td>
		 </tr>
	 </table>
	 </form>
	<%  
	 rs.close();
	 stmt.close();
	 pool.releaseConnection(con);
	}
	catch (Exception e)
	{
	   out.println(e.getMessage());
	}
	%>
	</center>
	</html>

⌨️ 快捷键说明

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