?? informationlistright.jsp
字號(hào):
<%@ 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("起止日期必須同時(shí)存在!");
return;
} else if (fromDate != "" && toDate != "" && document.getElementById(formName).state.value == "unPub"){
alert("發(fā)布起止日期條件不能與未發(fā)布條件同時(shí)存在!");
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("發(fā)布起始日期不能大于結(jié)束日期");
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">標(biāo)題</html:option>
<html:option value="content">內(nèi)容</html:option>
</html:select>
</tr>
<tr>
<td>
發(fā)布時(shí)間從
<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">已發(fā)布的信息</html:option>
<html:option value="unPub">已撤銷的信息</html:option>
<html:option value="overdue">已過(guò)期的信息</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')">
<input type="button" value="發(fā)布" name="show" onClick="informationPublishFormSubmit('pubInformationIds', 'listInformation', 'module/business/informationList.do?method=saveInformations&isPub=true')">
<input type="button" value="刪除" name="delete" onClick="recordDelete('deleteInformationIds', 'listInformation', 'module/business/informationList.do?method=deleteInformations')">
<INPUT type="reset" value="重置" name="reset">
<!--<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>
信息標(biāo)題
</th>
<th>
發(fā)布日期
</th>
<th>
業(yè)務(wù)類別
</th>
<th>
業(yè)務(wù)名稱
</th>
<th>
查看
</th>
<th>
撤消
</th>
<th>
發(fā)布
</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 已經(jīng)發(fā)布
* 1 已經(jīng)過(guò)期
* 2 尚未發(fā)布
*/
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">
<%
}
%>
<%=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">
<%=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>
注:
<img src="images/canedit.gif">
為發(fā)布信息
<img src="images/cantedit.gif">
為暫存信息
<img src="images/yellow.gif">
為過(guò)期信息
</td>
</tr>
</table>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -