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

📄 editvote.jsp

📁 用jsp编写的网上投票系统
💻 JSP
字号:
<%@ page language="java" import="java.util.*" contentType="text/html;charset=GBK"%>
<%@ page import="java.text.*"
 %>
 <%@ page import="votebean.*" %>
 <% if(session.getAttribute("userName")==null){
 	response.sendRedirect("/admin/login.jsp");
 	}
 	 %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>修改投票项目</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  	<%NumberFormat nf=NumberFormat.getPercentInstance();
  		Questions question=(Questions)request.getAttribute("question");
  		Collection c=question.getItem();
  		Date startTime=question.getStartime();
  		Date endTime=question.getEndtime();
  		Calendar startCalendar=Calendar.getInstance();
  		startCalendar.setTime(startTime);
  		Calendar endCalendar=Calendar.getInstance();
  		endCalendar.setTime(endTime);
  	 %>
  	 <table width="100%" border="0" align="center" cellpadding="0" 
  	 cellspacing="1" bgcolor="#000000">
  	 <tr>
  	 	<td width "" height="30" bgcolor="#F0F0F0">
  	 	<table width="100%" border="0">
  	 	<tr>
  	 		<td width="300" >&nbsp;&gt;&gt;修改投票</td>
  	 	<td width="200"><a href="/vote/admin/index.jsp">首页</a></td>
  	 	</tr>
  	 	</table>
  	 	</td>
  	 	</tr>
  	 	<tr>
  	 	<td width="746" height="349" bgcolor="#F0F0F0">
  	 		<form action="servlet/EditVoteServlet" method="post" name="form1">
  	 		<table width="70%" height="224" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999" >
  	 		<tr>
  	 			<td width="100%" height="18" bgcolor="#F0F0F0"></td>
  	 		</tr>
  	 		<tr>
  	 		<td height="25" bgcolor="#F0F0F0">主题<%=question.getTitle() %></td>
  	 		</tr>
  	 		<tr>
  	 		<td height="25" bgcolor="#F0F0F0">选项</td>
  	 		</tr>
  	 		<%if(c!=null){
  	 		Iterator iterator=c.iterator();
  	 		int i=1;
  	 		Item item=null;
  	 		while(iterator.hasNext()){
  	 			item=(Item)iterator.next();
  	 		 %>
  	 		 <tr>
  	 		 <td align="left" bgcolor="#F0F0F0">[<%=i %>]<%=item.getOptions() %></td>
  	 		 </tr>
  	 		 <%i++;
  	 		 	}
  	 		 	}%>
  	 		 	<tr>
  	 		 	<td height="25" bgcolor="F0F0F0"> 方式:<%=question.getStyle().equals("radio")?"单选":"多选" %></td>
  	 		 	</tr>
  	 		 	<tr>
  	 		 	<td height="25" bgcolor="F0F0F0"> 开始时间:<select name="startyear" size="1">
  	 		 	<option value="<%=startCalendar.get(Calendar.YEAR) %>" selected>
  	 		 		<%=startCalendar.get(Calendar.YEAR)%></option>
  	 		 		<%for(int i=6;i<10;i++){
  	 		 			out.println("<option value=200"+i+">200"+i+"</option>");
  	 		 			}
  	 		 		 %>
  	 		 	</select>年<select name="startmonth" size="1">
  	 		 	<option value="<%=startCalendar.get(Calendar.MONTH)+1 %>" selected>
  	 		 		<%=startCalendar.get(Calendar.MONTH)+1%></option>
  	 		 		<%for(int i=2;i<13;i++){
  	 		 			out.println("<option value="+i+">"+i+"</option>");
  	 		 			}
  	 		 		 %>
  	 		 	</select>月<select name="startday" size="1">
  	 		 	<option value="<%=startCalendar.get(Calendar.DAY_OF_MONTH) %>" selected>
  	 		 		<%=startCalendar.get(Calendar.DAY_OF_MONTH)%></option>
  	 		 		<%for(int i=2;i<32;i++){
  	 		 			out.println("<option value="+i+">"+i+"</option>");
  	 		 			}
  	 		 		 %>
  	 		 	</select>日&nbsp;&nbsp;
  	 		 	</td>
  	 		 	</tr>
  	 		 	<tr>
  	 		 	<td height="25" bgcolor="F0F0F0"> 结束时间:<select name="endyear" size="1">
  	 		 	<option value="<%=endCalendar.get(Calendar.YEAR) %>" selected>
  	 		 		<%=endCalendar.get(Calendar.YEAR)%></option>
  	 		 		<%for(int i=6;i<10;i++){
  	 		 			out.println("<option value=200"+i+">200"+i+"</option>");
  	 		 			}
  	 		 		 %>
  	 		 	</select>年<select name="endmonth" size="1">
  	 		 	<option value="<%=endCalendar.get(Calendar.MONTH)+1 %>" selected>
  	 		 		<%=endCalendar.get(Calendar.MONTH)+1%></option>
  	 		 		<%for(int i=2;i<13;i++){
  	 		 			out.println("<option value="+i+">"+i+"</option>");
  	 		 			}
  	 		 		 %>
  	 		 	</select>月<select name="endday" size="1">
  	 		 	<option value="<%=endCalendar.get(Calendar.DAY_OF_MONTH) %>" selected>
  	 		 		<%=endCalendar.get(Calendar.DAY_OF_MONTH)%></option>
  	 		 		<%for(int i=2;i<32;i++){
  	 		 			out.println("<option value="+i+">"+i+"</option>");
  	 		 			}
  	 		 		 %>
  	 		 	</select>日&nbsp;&nbsp;
  	 		 	</td>
  	 		 	</tr>
  	 		 	<tr>
  	 		 	<td height="25" bgcolor="#F0F0F0" >当前调查项目?<input type="radio" name="active" value="1" 
  	 		 	<%=question.getActive()==1?"checked":"" %>>是<input type="radio" name="active" value="0" 
  	 		 	<%=question.getActive()==0?"checked":"" %>>否</td></tr>
  	 		 	<tr><td height="25" align="center" bgcolor="#F0F0F0"><input type="hidden" value="<%=question.getId() %>"
  	 		 	name="id">
  	 		 	<input type="submit" value="提交" name="B1">&nbsp;&nbsp;&nbsp;<input type="reset" value="取消" name="B2">
  	 		 	</td>
  	 		 	</tr>
  	 		</table>
  	 		</form>
  	 		</td>
  	 		</tr>
  	 </table>
  </body>
</html>

⌨️ 快捷键说明

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