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

📄 qanswer.jsp

📁 在线教育平台: 从小学
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=gb2312"
	pageEncoding="GB2312"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<jsp:useBean id="user" scope="page" class="edu.UserBean" />
<jsp:useBean id="teacher" scope="page" class="edu.TeacherBean" />
<title>回复</title>
<style type="text/css">
<!--
.STYLE1 {font-size: 12px}
-->
</style>
</head>
<script language="javascript">
<!--
function usercheck(){
var title,content;
title=document.myform.title.value;
content=document.myform.content.value;

if(title==""){
alert("标题不能为空!");
return false;}
if(content==""){
alert("内容不能为空!");
return false;}

}
//-->
</script>
<%
String sort=null,title=null,time=null;
int ask_id=0,u_id=0;
boolean allow=false;
try{
    ask_id =Integer.valueOf(request.getParameter("ask_id")).intValue();
    
    }catch(NumberFormatException e){}
    
%>

<body>

<%try{
	u_id=Integer.valueOf(session.getAttribute("userid").toString()).intValue();

sort=session.getAttribute("sort").toString();
title=session.getAttribute("title").toString();

if(sort.equalsIgnoreCase("user")){
	allow=user.isallow(u_id)&&!user.isforbid(u_id);
}
if(sort.equalsIgnoreCase("teacher")){
	allow=teacher.isallow(u_id);
}
if(sort.equalsIgnoreCase("admin")){
	allow=true;
}
}catch(NullPointerException e){}
if(ask_id==0||u_id==0||!allow)
	response.sendRedirect("error.jsp");
time = java.text.DateFormat.getDateTimeInstance().format(new java.util.Date());
%>
<div align="center">
<table height="160" width="770" border="0" cellspacing="1"
	align="center">
	<tr>
		<td><iframe name="top" height="160" width="770" scrolling="no"
			src="top.jsp" frameborder="0"></iframe></td>
	</tr>
</table>
</div>
<FORM method="POST" name="myform" action="Servletanswer"><input
	type="hidden" name="action" value="new"> <input type="hidden"
	name="ans_id" value="<%=u_id %>"> <input type="hidden"
	name="time" value="<%=time %>"> <input type="hidden" name="id"
	value="<%=ask_id%>"> <input type="hidden" name="sort"
	value="<%=sort%>">
<div align="center">
<table width="100%" border="0" align="center">
	<tr>
		<td align="right">&nbsp;</td>
		<td width="81%"><span class="STYLE1">回复主题:<%=title %></span></td>
	</tr>

	<tr>
		<td>&nbsp;</td>
		<td><input type="hidden" name="content" value=" " /><iframe
			id="eWebEditor1"
			src="editor/eWebEditor.jsp?id=content&amp;style=standard"
			frameborder="0" scrolling="no" width="650" height="350"></iframe></td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td><label> <input type="submit" name="Submit"
			onClick="return usercheck()" value="回复" /> <input type="reset"
			name="Submit2" value="重置" /> </label></td>
	</tr>
</table>
</div>
</FORM>

<div align="center">
<table height="155" width="750" border="0" cellspacing="1"
	align="center">
	<tr>
		<td><iframe name="bottom" height="155" width="750" scrolling="no"
			src="bottom.jsp" frameborder="0"></iframe></td>
	</tr>
</table>
</div>
</body>
</html>

⌨️ 快捷键说明

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