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

📄 informationlistright.jsp

📁 这个是完整的wap项目的源码 开发语言 Java 系统架构 Struts + hibernate + spring 数据库 Mysql5.0 应用服务器Tomcat5.0 开发工具 MyEc
💻 JSP
字号:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="com.longtime.wap.common.enums.CategoryEnum" %>
<%@ page import="com.longtime.wap.model.Information" %>
<%@ page import="java.util.List" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="com.longtime.wap.frame.common.UserSessionVO" %>
<%@ page import="com.longtime.wap.common.WapConstant" %>
<%@ page import="com.longtime.wap.module.business.common.DateUtil" %>
<%@ page import="java.util.ArrayList" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic"%>
<%@ taglib uri="/page-tag" prefix="page"%>
<script language="javascript" type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>
<html:form action="/informationList.do?method=listInformation" styleId="listInformation" method="post" onsubmit="return false;">
<%
	int userGroup = ((UserSessionVO)session.getAttribute(WapConstant.USER_SESSION)).getUserGroup();
%>
<script language="javascript">
	function adminInformationSearch(formName, action) {	
		var fromDate = document.getElementById(formName).fromDate.value;
		var toDate = document.getElementById(formName).toDate.value;
		if((fromDate == "" && toDate != "") || (fromDate != "" && toDate == "")) {
			alert("起止日期必须同时存在!");
			return;
		} else if (fromDate != "" && toDate != "" && document.getElementById(formName).state.value == "unPub"){
			alert("发布起止日期条件不能与未发布条件同时存在!");
			return;
		} else {
			var fromMonth = fromDate.substring(5,fromDate.lastIndexOf ("-"));
		     var fromDay = fromDate.substring(fromDate.length,fromDate.lastIndexOf ("-")+1);
		     var fromYear = fromDate.substring(0,fromDate.indexOf ("-"));
		    
		     var toMonth = toDate.substring(5,toDate.lastIndexOf ("-"));
		     var toDay = toDate.substring(toDate.length,toDate.lastIndexOf ("-")+1);
		     var toYear = toDate.substring(0,toDate.indexOf ("-"));
		     if (Date.parse(fromMonth+"/"+fromDay+"/"+fromYear) >
			     Date.parse(toMonth+"/"+toDay+"/"+toYear)){
		    	alert("发布起始日期不能大于结束日期");
		    	return;
		     }
		}
		formSubmit(formName, action);
	}
</script>
	<table align="center" width="98%" class="TableBack">
		<th colspan="3" align="left">
			信息管理
		</th>
		<tr>
			<td colspan="3">
				<table width="100%" class="TableBack">
					<tr>
						<td align="left">
							信息搜索:
							<html:text property="searchValue" size="15"></html:text>
							<html:select property="searchType">
								<html:option value="title">标题</html:option>
								<html:option value="content">内容</html:option>
							</html:select>
					</tr>
					<tr>
						<td>
							发布时间从
							<html:text property="fromDate" size="10" onfocus="new WdatePicker(this)" readonly="true"></html:text>
							<html:text property="toDate" size="10" onfocus="new WdatePicker(this)" readonly="true"></html:text>
							<html:select property="state">
								<html:option value="all">全部的信息</html:option>
								<html:option value="pub">已发布的信息</html:option>
								<html:option value="unPub">已撤销的信息</html:option>
								<html:option value="overdue">已过期的信息</html:option>
							</html:select>
							<html:errors property="date"/>
							<input class="ButtonCss" type="button" name="search" value="搜索" onClick="adminInformationSearch('listInformation', 'module/business/informationList.do?method=listInformation')">
						</td>
						<td align="right">
							<input type="button" value="撤消" name="cancel" onClick="informationCancelFormSubmit('unPubInformationIds', 'listInformation', 'module/business/informationList.do?method=saveInformations&isPub=false')">&nbsp;
							<input type="button" value="发布" name="show" onClick="informationPublishFormSubmit('pubInformationIds', 'listInformation', 'module/business/informationList.do?method=saveInformations&isPub=true')">&nbsp;
							<input type="button" value="删除" name="delete" onClick="recordDelete('deleteInformationIds', 'listInformation', 'module/business/informationList.do?method=deleteInformations')">&nbsp;
							<INPUT type="reset" value="重置" name="reset">&nbsp;
							<!--<input type="button" value="重置" name="reset" onClick="formSubmit('listInformation', 'toModule.do?prefix=/module/business&page=/informationList.do?method=listInformation&reset=yes')">
						--></td>
					</tr>
					<logic:notEmpty name="wap_global_messages" scope="request">
					<tr>
						<TD colspan="2">
							<logic:iterate id="message" name="wap_global_messages" scope="request">
								<center>
									<font color="red">
										<li>
											<bean:write name="message" />
										</li>
									</font>
								</center>
							</logic:iterate>
						</TD>
					</tr>
					</logic:notEmpty>
				</table>
			</td>
		</tr>
		<tr>
			<td colspan="3">
				<table align="center" border="1" width="100%" id="informationTable" class="TableBack2">
					<tr>
						<th>
							信息标题
						</th>
						<th>
							发布日期
						</th>
						<th>
							业务类别
						</th>
						<th>
							业务名称
						</th>
						<th>
							查看
						</th>
						<th>
							撤消
						</th>					
						<th>
							发布
						</th>
						<th>
							删除
						</th>
					</tr>
					<%
						if (null != request.getAttribute("informations")){
							List informations = (List)request.getAttribute("informations");
							for (int i = 0; i < informations.size(); i++) {
								Information information = (Information)informations.get(i);
								
								/*
								 * informationState: 0   已经发布
								 *                   1   已经过期
								 *                   2   尚未发布
								 */
								int informationState = 0;
								if (1 == information.getIsPub()) {
									if (DateUtil.isOverDue(information.getPubDate(), information.getBusiness().getDuration())){
										informationState = 1;
									} else {
										informationState = 0;
									}
								} else {
									informationState = 2;
								}
					%>
								<TR>
								<TD align="left">
								<%
								if (informationState == 0) {
								%>
									<img src="images/canedit.gif">
								<%
								} else if (informationState == 1) {
								%>
									<img src="images/yellow.gif">
								<%		
								} else if (informationState == 2) {
								%>
									<img src="images/cantedit.gif">
								<%
								}
								%>
										
								&nbsp;<%=information.getTitle()%>
								</TD>
								<TD align="center">
									<%
										if (informationState != 2) {
											SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
											out.write(sdf.format(information.getPubDate()));
										}
									%>
								</TD>
								<TD align="center">
									<%
										int category = information.getBusiness().getCategory();
										out.write(CategoryEnum.getValue(category).toChinese());
									%>
								</TD>
								<TD align="left">
									&nbsp;&nbsp;&nbsp;&nbsp;<%=information.getBusiness().getBusinessName()%>
								</TD>
								<TD align="center">
									<a href="javascript:formSubmit('listInformation', 'module/business/informationEdit.do?method=getInformation&type=view&id=<%=information.getInformationId()%>')" class="href">查看</a>
								</TD>

								<td align="center">
									<%
										if (informationState == 0) {
									%>
									<input type="checkbox" id="unPubInformationIds" name="unPubInformationIds" value="<%=information.getInformationId()%>" />
									<%				
										} else if (informationState == 1) {
									%>
									<input type="checkbox" id="unPubInformationIds" name="unPubInformationIds" value="<%=information.getInformationId()%>" disabled="true"/>
									<%
										}
									%>
								</td>
								
								
								<td align="center">
									<%
										if (informationState == 2) {
									%>
									<input type="checkbox" id="pubInformationIds" name="pubInformationIds" value="<%=information.getInformationId()%>" />
									<%				
										}
									%>
								</td>
								<TD align="center">
								<input type="checkbox" id="deleteInformationIds" name="deleteInformationIds" value="<%=information.getInformationId()%>" />
								</TD>
								
							</TR>
					<%			
							}
						}
					%>
				</table>
			</td>
		</tr>
		<TR>
			<td class="tborder"></td>
			<td>
				<page:page_tag formName="listInformation" action="module/business/informationList.do?method=listInformation"/>
			</td>
			<td class="tborder"></td>
		</TR>
		<tr>
			<td colspan="3" class="tborder"></td>
		</tr>
	</table>
</html:form>
<br>
<table width="100%" align="center">
	<tr>
		<td>
			&nbsp;&nbsp;注:
			<img src="images/canedit.gif">
			为发布信息
			<img src="images/cantedit.gif">
			为暂存信息
			<img src="images/yellow.gif">
			为过期信息
		</td>
	</tr>
</table>

⌨️ 快捷键说明

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