📄 link_page.jsp
字号:
<%@ page contentType="text/html; charset=GBK" language="java" errorPage=""%>
<%request.setCharacterEncoding("GBK");%>
<%@ page import="java.text.*"%>
<%@ page import="com.doone.webtemplate.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.doone.util.FileLogger"%>
<%@ page import="com.doone.upload.*"%>
<%@ page import="com.doone.uurm.WebAuth"%>
<%String sPurvICode="NGB007007";%>
<%
WebAuth auth = WebAuth.getInstance(request);
String uri = request.getContextPath();
if ( ! auth.IsAuthed() ) {
out.write("<script language=\"javascript\">self.parent.location.replace(\"" + request.getContextPath() + "/view/login/login.jsp" + "\");</script>");
return;
}
else if ( ! auth.CheckPurv(sPurvICode) ) {
out.write("<script language=javascript src=\"../../common/script/RightForbidden.js\"></script>");
return;
}
String spath = application.getRealPath("/upload/templateconfig.xml");
new TemplateFactory(spath);
String citycode;
if(auth.getCityCode()==null || auth.getCityCode().equals(""))
citycode = "0590";
else
citycode = auth.getCityCode();
int listMaxCount =20;
int maxPageCount = 15;
int a_currPage = 0;
int a_recordCount = 0;
int a_pageCount = 0;
int c_currPage = 0;
int c_recordCount = 0;
int c_pageCount = 0;
int startRecord = 0;
int endRecord = listMaxCount;
// 目前只支持固定的最大页数。
String currPage = null;
String city = request.getParameter("city");
String to_page = request.getParameter("to_page");
String code = request.getParameter("code");
FileLogger log = new FileLogger();
// 新闻处理部分
StringBuffer sPromotionList = new StringBuffer();
try {
ModuleConfig mc = TemplateFactory.getModuleConfig(code);
if (mc != null) {
Map map = null;
PageConfig[] areaPages = null;
PageConfig[] pages = null;
// 全省的促销活动。
map = new HashMap();
map.put("citycode","0590");
pages = mc.getValidPages(map);
// 通过文件名建立索引。
HashMap pageMap = new HashMap();
for (int i=0; i<pages.length; i++){
pageMap.put(pages[i].getName(),pages[i]);
}
//if ( _auth.getIsAuthed() ){
// 处理地市的相应信息。
map = new HashMap();
map.put("citycode",citycode);
areaPages = mc.getValidPages(map);
ArrayList areaList = new ArrayList();
for (int i = 0; i < areaPages.length; i++) {
if(!"0590".equals(citycode)){
if ( pageMap.get(areaPages[i].getName()) != null )
continue;
}else{
if ( pageMap.get(areaPages[i].getName()) == null )
continue;
}
areaList.add(areaPages[i]);
}
currPage = request.getParameter("c_currpage");
if ( currPage != null && ! currPage.equals("") ){
c_currPage = Integer.parseInt(currPage);
}
c_recordCount = areaList.size();// 取得促销活动的记录数。
int c_pageSize = c_recordCount / listMaxCount;
// log.debug("c_RecordCount-->" + String.valueOf(c_recordCount));
//log.debug("c_PageSize-->" + String.valueOf( c_pageSize ));
if ( c_recordCount % listMaxCount != 0 ) c_pageSize++;
//log.debug("c_PageSize-->" + String.valueOf( c_pageSize ));
if ( c_pageSize > maxPageCount ) c_pageSize = maxPageCount;
if ( city != null && city.equals("c") ){
if ( to_page == null || to_page.equals("") ){
to_page = "0";
}
int topage = Integer.parseInt(to_page);
if ( topage <= c_pageSize ){
c_currPage = topage;
}
}
if ( c_currPage >= c_pageSize ) c_currPage = c_pageSize - 1;
if ( c_pageSize > 1 ){
// 处理分页显示。
sPromotionList.append("<tr><td colspan=\"2\"><table width=\"100%\" height=\"26\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"../../images/t_r_bg03.gif\" ><tr>");
sPromotionList.append("<td width=\"20%\" align=\"left\"><b>"+citycode+mc.getTitle()+"</b></td>");
sPromotionList.append("<td valign=\"middle\" align=\"right\" class=\"color_hui1\">");
for ( int i = 0; i< c_pageSize; i++){
if ( i == c_currPage ) {
sPromotionList.append(" ");
sPromotionList.append(i);
sPromotionList.append(" ");
}
else {
sPromotionList.append(" <a href=\"#\" city=\"c\" onclick=\"toPage(); return false;\">");
sPromotionList.append(i);
sPromotionList.append("</a> ");
}
}
sPromotionList.append("</td></tr></table></td></tr>");
}
else if ( c_recordCount > 0 ){
sPromotionList.append("<tr><td colspan=\"4\"><table width=\"100%\" height=\"26\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"../../images/t_r_bg03.gif\" ><tr>");
sPromotionList.append("<td width=\"80%\" align=\"left\"><b>"+citycode+mc.getTitle()+"</b></td>");
sPromotionList.append("<td valign=\"middle\" align=\"right\" class=\"color_hui1\">");
sPromotionList.append(" ");
sPromotionList.append("</td></tr></table></td></tr>");
}
startRecord = c_currPage * listMaxCount;
endRecord = startRecord + listMaxCount;
//log.debug("c_StartRecord-->" + String.valueOf(startRecord));
//log.debug("c_EndRecord-->" + String.valueOf(endRecord));
if ( endRecord > c_recordCount ) endRecord = c_recordCount;
int opt = endRecord - startRecord;
if(c_recordCount <= 0)opt=0;
for (int i = 0; i < opt; i++) {
PageConfig pc = (PageConfig)areaList.get(i);
if(pc != null){
sPromotionList.append("<tr>");
sPromotionList.append("<td width=\"10\">·</td><td width=\"70%\" height=\"20\" id=\""+pc.getName()+"\" align=\"left\"><a href=\"");
sPromotionList.append(pc.getName());
sPromotionList.append("\">");
sPromotionList.append(pc.getDesc()+"</span></a></td><td>");
sPromotionList
.append("<span class=\"color_blue2\"> ");
if ( pc.getCreateTime() != null ){
SimpleDateFormat sdf = new SimpleDateFormat(
"yyyy-MM-dd");
//sPromotionList.append(sdf.format(pc.getCreateTime()));
}
sPromotionList.append("</td><td width=\"30%\"> <a href=\"javascript:ren_type('"+pc.getName()+"')\">修改</a> <span><a href=\"javascript:deltreepage('"+code+"','"+pc.getName()+"')\">删除</span></td></tr>");
}
}
//}//做用户登录认证
}
} catch (Exception ex) {
log.error("获取信息列表时出错:", ex);
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>配置首页</title>
<link href="../../common/main.css" rel="stylesheet" type="text/css">
<script language="javascript">
function toPage() {
try{
var src = window.event.srcElement;
if ( typeof(src) == "object" && src.tagName == "A" ) {
document.faqForm.to_page.value = src.innerText;
document.faqForm.city.value = src.city;
document.faqForm.submit();
}
}
catch(ex){}
}
</script>
<script>
function aa(){
var start = document.all.FILE1.value;
var end = start.substring(start.lastIndexOf("\\")+1,start.length);
var end2 = start.substring(start.lastIndexOf(".")+1,start.length);
document.all.name.value = end;
document.all.type.value = end2;
}
</script>
<SCRIPT >
<!--
var lastTypeName2;
var lastTypeID2;
lastTypeName2 = "";
lastTypeID2 = "";
//根据传入的组名(type_id)与组说明(type_id2)值,动态将文字改为输入框,并加上两个按钮
function ren_type(type_id2) {
//取到组说明.....................
var TypeName2;
var TypeID2;
if ( lastTypeID2 != "") document.all.item(lastTypeID2).innerText = lastTypeName2;
TypeName2 = document.all.item(type_id2).innerText;
document.all.item(type_id2).innerHTML = "<input type=text size=30 maxLength=55 value=" + TypeName2 + " id=desc name=desc style='font-size: 12px;color: #333333;BORDER: #cccccc 1px solid;'> <input type=button value=Yes onclick=confirm_rename('"+type_id2+"'); style='font-size: 12px;color: #333333;BORDER: #cccccc 1px solid;'> <input type=button value=No onclick=cancel_rename2(); style='font-size: 12px;color: #333333;BORDER: #cccccc 1px solid;'><input type=\"hidden\" id=\"name\" name=\"name\" value="+type_id2+" /><input type=hidden name=oldTypeName value='" + TypeName2 + "'>";
lastTypeName2 = TypeName2;
lastTypeID2 = type_id2;
}
//用于响应取消改名操作的按钮
function cancel_rename2() {
document.all.item(lastTypeID2).innerText = lastTypeName2;
}
function confirm_rename(type_id2){
//var nv = document.all.desc.value;
//set_data.src = "updatepage.jsp?name="+type_id2+"&code=<%=code%>&desc="+nv;
//document.all.item(type_id2).innerText = nv;
//lastTypeName2 = nv;
updateForm.submit();
}
function deltreepage(code,name){
//删除
//action=del&code="+code+"&name="+pc.getName()
document.delpage.code.value = code;
document.delpage.name.value = name;
delpage.submit();
}
//-->
</SCRIPT>
<style>
.botton {
font-size: 12px;
color: #804000;
BORDER-RIGHT: #666666 1px solid;
BORDER-TOP: #666666 1px solid;
BORDER-LEFT: #666666 1px solid;
BORDER-BOTTOM: #666666 1px solid;
BACKGROUND-COLOR: #ffffff;
}
.add_zl {
font-size: 12px;
line-height: 18px;
color: #333333;
text-decoration: none;
}
body {
margin-top: 0px;
}
.biaoti {
font-size: 12px;
color: #FFFFFF;
text-decoration: none;
}
.style2 {font-weight: bold}
.style3 {font-size: 12px; color: #FFFFFF; text-decoration: none; font-weight: bold; }
</style>
<link href="../../common/style/main.css" rel="stylesheet" type="text/css">
</head>
<body>
<table id="ibtnPanel" style="font-size: 9pt; border-bottom: #efefef 1px outset" cellspacing="0"
cellpadding="0" width="100%" border="0">
<tr bgcolor="#efefef" height="33">
<td align="left" valign="middle" id="ibtnaddResearch" title="" DefaultClass="btnDefault" OverClass="btnOver" DownClass="btnDown"><table width="100%" border="0" cellpadding="0" cellspacing="1" class="add_zl">
<tr>
<td height="27" bgcolor="#f5f5f5"> <a href="edit_web_index.jsp">返回修改首页导航</a></td>
</tr>
</table></td>
</tr>
</table>
<form action="update_link_page.jsp" method="post" name="delpage">
<input type="hidden" id="code" name="code" />
<input type="hidden" id="name" name="name" />
<input type="hidden" id="action" name="action" value="del" />
</form>
<form action="link_page.jsp" method="post" name="faqForm">
<input type="hidden" id="city" name="city" value="" />
<input type="hidden" id="a_currpage" name="a_currpage" value="<%= a_currPage %>" />
<input type="hidden" id="c_currpage" name="c_currpage" value="<%= c_currPage %>" />
<input type="hidden" id="to_page" name="to_page" value="" />
</form>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="52%" valign="top" background="../../images/t_l_bg.gif" class="add_zl">
<br>
<table width="100%" class="add_zl">
<form action="update_link_page.jsp" method="post" name="updateForm">
<input type="hidden" id="code" name="code" value="<%= code %>" />
<input type="hidden" id="action" name="action" value="update" />
<%=sPromotionList.toString()%>
</form>
</table>
<br>
</td>
<td width="48%" valign="top" background="../../images/t_l_bg.gif">
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" background="images/sc_sheet.gif">
<FORM NAME="upload" METHOD="POST" ACTION="update_link_page.jsp" >
<tr>
<td align="left" valign="top">
<div align="center">
<br>
<input type="hidden" name="citycode" value="<%=citycode%>">
</div>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" class="add_zl">
<tr bgcolor="#FFFFFF">
<td height="35"> 标 题:
<input name="desc" type="text" class="botton" id="desc" size="40" maxlength="40">
<input name="code" type="hidden" value="<%=code%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="35"> 路 径:
<input name="name" type="text" class="botton" id="name" size="50" maxlength="100">
<input name="action" type="hidden" id="action" value="add">
</td>
</tr>
</table>
<br>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="TreeOver">说明:如果是外网,路径请加上http://或https:// 全称 ,请不要用中文名。 </td>
</tr>
</table>
<br>
<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><input name="Submit" type="submit" class="botton" value="添加"></td>
</tr>
</table>
<br>
</td>
</tr></FORM>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -