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

📄 content.jsp

📁 电信的网厅的整站代码
💻 JSP
字号:
<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="com.doone.data.*"%>
<%@ page import="com.doone.fj1w.fj1w.faq.*"%>
<%@ page import="com.doone.fj1w.common.*"%>
<%@ page import="com.doone.util.*"%>
<%@ page import="com.doone.uurm.*"%>
<%@ page import="com.doone.fj1w.bbs.BBSAuth"%>
<%@ page import="java.text.*"%>
<%String sPurvICode="NGB009";%>
<%!
    String formatDate(java.util.Date date){
	   SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	   return sdf.format(date);
    }

    String getHTMLString(String src){
    	String tmp = src;
    	tmp = ExtString.replace(tmp,"  ","&nbsp;&nbsp;");
        tmp = ExtString.replace(tmp,"<","&lt;");
        tmp = ExtString.replace(tmp,">","&gt;");
        tmp = ExtString.replace(tmp,"\t","&nbsp;&nbsp;&nbsp;&nbsp;");
    	tmp = ExtString.replace(tmp,"\r\n","<br>");

        FileLogger.getLogger().debug(tmp);
        return tmp;
    }
%>
<%
	WebAuth auth = WebAuth.getInstance(request);


	FileLogger log = new FileLogger();

    String faqid = request.getParameter("faqid");
    Tf_Faq faq = null;
    DataTable list = null;
    int errCode = 0;
    DacClient db = new DacClient();
    if ( faqid != null ) {
        try{

            faq = new Tf_Faq(db,Long.parseLong(faqid));
            
            list = faq.getChildList(0,0);
            
            log.info(new Integer(list.getRows().getCount()));
        }
        catch(Exception ex){
            FileLogger.getLogger().error(ex);
            
            errCode = -1;   
        }
    }
    else { 
        errCode = -1;
    }
    
	switch ( (int)faq.getFaqCoteId() ) {
		case 1:
			sPurvICode = "NGB009001";
			break;
		case 2:
			sPurvICode = "NGB009002";
			break;
		case 3:
			sPurvICode = "NGB009003";
			break;
	}

    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;
	}

    if ( errCode == -1 ) {
        // TODO 获取FAQ列表出错,让程序直接返回到列表页面。
    }
	BBSAuth bbsAuth = BBSAuth.getInstance(auth, sPurvICode);
%>
<html>
<head>
<title><%= faq.getTitle() %></title>
<link href="../../common/style/main.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="../../common/script/ChangeStyle.js"></script>
</head>
<body scroll="yes">
<!-- TODO 如果是错误返回,则提示客户并提供返回链接。 -->
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="OuterTable">
		<tr class="InnerHead">
			<td>
				<jsp:include page="../../common/inc_top.jsp" >
					<jsp:param name="purvCode" value="<%=sPurvICode%>"/>
				</jsp:include>
			</td>
		</tr>
		<tr class="OuterHead" >
			<td class="title_td">
				<table width="100%"  border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td nowrap="nowrap" style="text-align:left"><span id="ItemTitle"><font face="webdings">8</font>显示帖子详细内容</span></td>
						<td align="right" nowrap><span id="ItemTitle">主题:【<b><%= new Td_FaqCote(db,faq.getFaqCoteId()).getCoteName() %></b>】<%= faq.getTitle()%></span></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
		<td class="caption_td">
		<table border="0" cellpadding="4" cellspacing="0" width="100%"
			class="InnerTable">
			<tr height="50px" bgcolor="white">
				<td style="padding: 3px;" valign="top"><%= getHTMLString(faq.getContent())%>
				</td>
			</tr>
			<tr class="innerFoot"><td>
				<table cellspacing="0" cellpadding="0" border="0" width="100%">
					<tr>
						<td width="15%" >作者:<%= faq.getNickName()%></td>
						<td width="10%">地区:<%= CityBean.getNameByCode(faq.getCityCode())!=null?CityBean.getNameByCode(faq.getCityCode()):"福建省"%></td>
						<td width="10%">子帖数:<%= faq.getSubCount()%></td>
						<td width="30%">发表时间:<%= formatDate(faq.getCreateTime())%></td>
						<td width="35%" align="right"><%
	if ( bbsAuth.hasManagerPurview() || bbsAuth.hasModifyPurview() ) {%>
							<a href="editfaq.jsp?faqid=<%= faq.getFaqId()%>"><img src="../../common/images/edit.gif" border="0"/>编辑</a><%
	} 
	if ( bbsAuth.hasManagerPurview() || bbsAuth.hasDelPurview() ) {%>
							<a href="delfaq.jsp?faqid=<%= faq.getFaqId()%>"><img src="../../common/images/delete.gif" border="0"/>删除</a><%
	}%>
						</td>
					</tr>
				</table>
			</td></tr>
			<tr>
				<td colspan="2" style="border-bottom: solid 1px black;"></td>
			</tr>
		</table>
		</td>
	</tr>
	<%
	Tf_Faq subFaq = null;
    if ( list != null ) {
        for ( int i=0; i<list.getRows().getCount(); i++){
            subFaq = new Tf_Faq(list.getRow(i));     
        %>
	<tr class="">
		<td class="caption_td">
		<table border="0" cellpadding="4" cellspacing="0" width="100%"
			bgcolor="#d5d5d5">
			<tr bgcolor="white" height="50px">
				<td colspan="4" style="padding: 2px;" valign="top"><%= getHTMLString(subFaq.getContent()) %>
				</td>
			</tr>
			<tr class="InnerHead">
				<td width="15%">回复人:<%= subFaq.getNickName() %></td>
				<td width="45%">回复时间:<%= formatDate(subFaq.getCreateTime()) %></td>
				<td width="40%" align="right"><%
	if ( bbsAuth.hasManagerPurview() || bbsAuth.hasModifyPurview() ) {%>
					<a href="editfaq.jsp?faqid=<%= subFaq.getFaqId()%>"><img src="../../common/images/edit.gif" border="0"/>编辑</a><%
	} 
	if ( bbsAuth.hasManagerPurview() || bbsAuth.hasDelPurview() ) {%>
					<a href="delfaq.jsp?faqid=<%= subFaq.getFaqId()%>"><img src="../../common/images/delete.gif" border="0"/>删除</a><%
	}%>
				</td>
			</tr>
		</table>
		</td>
	</tr> <%
        }
    }
    
    boolean bReply = true;
    
    if ( faq.getFaqCoteId() == 1 ) bReply = false;
    if ( subFaq != null && subFaq.getUserType().equalsIgnoreCase("E")) bReply = false;
    
	if ((bbsAuth.hasManagerPurview() || bbsAuth.hasReplyPurview() ) && bReply ) {%>
	<tr height="15px;"><td class="body_td"><img src="../../common/images/spacer.gif"/></tr>
    <tr>
    	<td class="body_td">
	<form action="newfaq_sb.jsp" method="post"><input type="hidden"
		name="faqid" value="<%= faqid %>" />
		<input type="hidden" name="faqcoteid" value="<%= faq.getFaqCoteId() %>" />
	<table cellpadding="0" cellspacing="0" border="0" width="100%">
		<tr>
			<td><textarea rows="10" style="width: 100%;" name="content"></textarea></td>
		</tr>
		<tr class="OuterFoot">
			<td align="right" style="padding: 3px;">
				<input type="submit" name="submit" class="button" value="提交回复" style="width: 80px;" />
				<input type="button" name="return" class="button" value="关闭" onclick="self.close();" /></td>
		</tr>
	</table></form><%
	} else {%>
	<tr class="OuterFoot">
		<td align="right" style="padding: 3px;">
			<input type="button" name="return" class="button" value="关闭" onclick="self.close();" /></td>
	</tr><%
	}%></td></tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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