📄 notice_error.jsp
字号:
<%@page contentType="text/html;charset=gbk"%>
<%@page import="org.apache.log4j.*,java.util.*,com.util.StringUtils,com.util.XMLParse,com.web.vo.*" %>
<%@page import="com.web.view.IndexView" %>
<%!
static Logger logger = Logger.getLogger("notice_error.jsp");
%>
<%
IndexView iv = new IndexView();
String roadid = StringUtils.Zh_parseString(request.getParameter("roadid"));
roadid = StringUtils.replaceString(roadid,"<font color='#ff0000'>","");
roadid = StringUtils.replaceString(roadid,"</font>","");
String roadinfo = StringUtils.Zh_parseString(request.getParameter("roadinfo"));
roadinfo = StringUtils.replaceString(roadinfo,"<font color='#ff0000'>","");
roadinfo = StringUtils.replaceString(roadinfo,"</font>","");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gbk">
<title>Down v1.0</title>
<link href="css/main.css" rel="stylesheet" type="text/css">
<script language="Javascript">
function if_name(){
//var n = document.getElementsByName("name")[0];
var n = document.getElementById("name");
var c = document.getElementById("noname");
if(c.checked){
n.readOnly=true;
n.className = "text_onlyread";
}
else{
n.readOnly=false;
n.className = "";
}
}
function checkform(){
var c = document.getElementById("noname");
if(!c.checked){
if(Jtrim(document.getElementById("name").value)==""){
alert("大侠请留名!");
document.getElementById("name").focus();
return false;
}
}
if(Jtrim(document.getElementById("einfo").value)==""){
alert("您还没填写线路纠错信息呢!");
document.getElementById("einfo").focus();
return false;
}
return true;
}
function Jtrim(str)
{
var i = 0;
var len = str.length;
if ( str == "" ) return( str );
j = len -1;
flagbegin = true;
flagend = true;
while ( flagbegin == true && i< len)
{
if ( str.charAt(i) == " " )
{
i=i+1;
flagbegin=true;
}
else
{
flagbegin=false;
}
}
while (flagend== true && j>=0)
{
if (str.charAt(j)==" ")
{
j=j-1;
flagend=true;
}
else
{
flagend=false;
}
}
if ( i > j ) return ("")
trimstr = str.substring(i,j+1);
return trimstr;
}
</script>
</head>
<body>
<br/>
<br/>
<p><b>
如果您认为这个公交线路有错,恳请您提交该线路的纠错信息,非常感谢您的支持.
</b></p>
<table width="90%" align="center" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999">
<form name="form1" action="notice_error_post.jsp" method="post" onsubmit="return checkform();">
<tr bgcolor="#ffffff">
<td width="80" class="s_td_c">
公交车次:
</td>
<td class="s_td">
<%=roadid%> 路公交<input type="hidden" value="<%=roadid%>" name="roadid" id="roadid">
</td>
</tr>
<tr bgcolor="#ffffff">
<td width="80" class="s_td_c">
公交线路:
</td>
<td class="s_td">
<%=roadinfo%><input type="hidden" value="<%=roadinfo%>" name="roadinfo" id="roadinfo">
</td>
</tr>
<tr bgcolor="#ffffff">
<td width="80" class="s_td_c">
大侠姓名:
</td>
<td class="s_td">
<input type="text" size="20" maxlength="10" value="" name="name" id="name">
<input type="checkbox" name="noname" id="noname" value="1" onclick="if_name()">不留名字
</td>
</tr>
<tr bgcolor="#ffffff">
<td width="80" class="s_td_c">
纠错信息:
</td>
<td class="l_td">
<textarea name="einfo" id="einfo" cols="60" rows="3"></textarea> <input type="submit" value="提交纠错信息">
<input type="button" name="btn" value="关闭窗口" onclick="javascript:window.opener=3;window.close();">
</td>
</tr>
</form>
</table>
<br/>
<table width='90%' align='center' border='0' cellpadding='0' cellspacing='0'>
<tr><td class='l' algin="left" height='28'>
网友提供的<%=roadid%> 路公交纠错信息==>
</td>
</tr>
</table>
<%
out.println("<table width='90%' align='center' border='0' cellpadding='0' cellspacing='1' bgcolor='#dddddd'>");
String filename = getServletContext().getRealPath("/")+"WEB-INF/classes/xmldb/error.xml";
XMLParse xmlp = new XMLParse(filename);
xmlp.setEncoding("utf-8");
List list = xmlp.getErrorInfoSeq(roadid);
int recordCount = list.size();
if(list != null&&list.size()>0){
for(int j=0;j<list.size();j++){
ErrorInfo errorinfo = (ErrorInfo) list.get(j);
out.println("<tr bgcolor='#ffffff'>");
out.println("<td style='font-size:12px;padding:2px;line-height:21px;color:#333333;text-align:center;' width='18%'><font color='#f60000'>"+errorinfo.name+"</font><br/>"+errorinfo.etime+"</td>");
out.println("<td style='font-size:14px;padding-left:6px;padding-top:3px;padding-right:4px;padding-bottom:3px;line-height:21px;color:#333333' valign='top' width='82%'>"+errorinfo.einfo+"</td>");
out.println("</tr>");
}
}
else{
out.println("<tr><td colspan='2' style='font-size:12px;height:26px;' valign='middle'> 抱歉,没有找到与第 "+roadid+" 路公交相关的线路纠错信息.</td>");
}
out.println("</table>");
%>
<% out.println(iv.getBottom()); %>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -