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

📄 questionanswer.jsp

📁 电信的网厅的整站代码
💻 JSP
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="com.doone.data.*" %>
<%@ page import="com.doone.util.*" %>
<%@ page import="java.text.*" %>
<%@ page import="com.doone.uurm.WebAuth"%>
<%@ page import="com.doone.fj1w.common.*" %>
<%@ page import="com.doone.fj1w.fj1w.faq.Tf_Faq"%>
<%String sPurvICode="NGB009003";%>

<%// 获取栏目列表,同时统计帖子数。
    long faqCoteId = 3;

	WebAuth auth = WebAuth.getInstance(request);

    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 cityCode = auth.getCityCode();
	FileLogger log = new FileLogger();

	String sFaqID = request.getParameter("faqid");
	String sTitle = "添加新的问答内容";
	String sQuestion = "";
	String sAnswer = "";
	if ( sFaqID != null && sFaqID.length() > 0 ) { 
		try {
			sTitle = "修改问答内容";

			Tf_Faq faq = new Tf_Faq(new DacClient(), Long.parseLong(sFaqID));
			sQuestion = faq.getTitle();
			cityCode = faq.getCityCode();
			sAnswer = faq.getContent();
		}
		catch(Exception ex) {
			log.info(ex.getMessage(),ex);
		}
	}

	String sCITY_S_T = "";
    boolean isDisabled = false;
    if ( auth.getCityCode() != null && ! auth.getCityCode().equals("0590") ) {
    	isDisabled = true;
    }

    try {
		DataTable cityList = ConfigFactory.getCityList();
        StringBuffer cityStr = new StringBuffer();

        for (int i = 0; i < cityList.getRows().getCount(); i++) {
		    TD_City cb = new TD_City(cityList.getRow(i));
            cityStr.append("<option value=\"");
            cityStr.append(cb.getCityCode());
            cityStr.append("\"");
            if ( cityCode != null && cb.getCityCode().equals(cityCode) ){
                cityStr.append(" selected=\"selected\"");
            }
            cityStr.append(">");
            cityStr.append(cb.getCityName());
            cityStr.append("</option>");
		}
        sCITY_S_T = cityStr.toString();
    } catch (Exception ex) {
		log.error("获取程序信息出错", ex);
	}
%>
<html>
<head>
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Content-Type" content="text/html;charset=GBK">
    <title>常见问题问答编辑</title>
	<link href="../../common/style/main.css" rel="stylesheet" type="text/css" />
	<script language="JavaScript" src="../../common/mainTool.js"></script>
    <script language="javascript" src="../../common/XMLHttpClient.js"></script>
	<script language="JavaScript" src="../../common/script/ChangeStyle.js"></script>

    <script language="javascript">
    function dosubmit(){
        var fm = document.form1;
        if ( fm.title.value == "" ){
            alert("问题不能为空。");
            fm.title.focus();
        }
        else{
      		document.getElementById("citycode").disabled = false;
	        document.form1.submit();
        }
    }
    
    function doback() {
        history.back();
    }
    
    function fn_onload() {
    	document.getElementById("title").focus();
    }
    </script>

</head>
<body onload="fn_onload();">
    <form action="QuestionAnswer_sb.jsp" method="post" name="form1">
        <input type="hidden" name="questionid" value="<%= (sFaqID==null)?"":sFaqID%>" />

        <table align="center" border="0" cellspacing="1" cellpadding="4" width="100%" class="InnerTable">
			<tr class="InnerHead">
				<td colspan="2">
					<jsp:include page="../../common/inc_top.jsp" >
						<jsp:param name="purvCode" value="<%=sPurvICode%>"/>
					</jsp:include>
				</td>
			</tr>
            <tr class="OuterHead">
                <td colspan="2" class='head'>
                    <font color="#FFFFFF"><b>&nbsp;&nbsp;添加新的问答内容</b></font></td>
            </tr>
            <tr bgcolor="#e0e0e0">
                <td width="15%" align="right">
                    <b>所属地区</b>
                </td>
                <td width="85%"><select id="citycode" name='citycode' style="width: 100%" class="subject" <%= isDisabled?"disabled":""%>>
                    <option value="0590">福建省</option>
                    <%=sCITY_S_T %></select>
                    </td>
            </tr>
            <tr bgcolor="#e0e0e0">
                <td width="15%" align="right">
                    <b>问题:</b>
                </td>
                <td>
                    <input id="title" type='text' name='title' style="width: 100%" maxlength='2048' class="subject"
                        value='<%= sQuestion%>'></td>
            </tr>
            <tr bgcolor="#e0e0e0">
                <td valign="top" align="right">
                    <b>回答:</b>
                </td>
                <td>
                    <div id="content_edit" style="display: none; width: 600px; height: 150px; overflow: auto;"
                        contenteditable="true" onactivate="" onblur="">
                    </div>
                    <!-- 扩展使用Div的编辑功能。 -->
                    <textarea rows="25" style="width: 100%" name='content'><%= sAnswer%></textarea>
                </td>
            </tr>
			<tr class="outerFoot">
				<td colspan="2" align="right">
                    <input type='button' value='保 存' class="button" onclick="javascript:dosubmit();">
					<input type="button" name="close" class="button" value="关 闭" onclick="window.close(); return false;"></td>
			</tr>
        </table>
    </form>
</body>
</html>

⌨️ 快捷键说明

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