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

📄 post.jsp

📁 一套完整的工商12315的源程序jsp部分在12315里,后台JAVA部分在gs12315src里,没有打包数据库.
💻 JSP
字号:
<%@ page import="java.util.*,
		 java.lang.*,
		 com.powerrun.ioffice.*,
                 com.powerrun.ioffice.util.*,
                 com.powerrun.shortmsg.*,
		 com.powerrun.util.*"
	errorPage="error.jsp"
%>
<link rel="stylesheet" href="../../style/global.css">
<jsp:useBean id="messageBean" scope="session"
 class="com.powerrun.shortmsg.messagebean.MessageBean"/>

<%!	//////////////////////////////////
	// customize the look of this page
	// Colors of the table that displays a list of forums
	final static String messagePagingRowColor = "#a0b0c0";
%>

<%@ page contentType="text/html;charset=gb2312"%>				 
<%	////////////////////////
	// Authorization check
	// check for the existence of an authorization token
	Authorization authToken = SkinUtils.getUserAuthorization(request,response);
	//Authorization authToken = AuthorizationFactory.getAuthorization("root", "123");
	if( authToken == null ) {
		response.sendRedirect("../login.jsp?referer=index.jsp");
		return;
	}
%>

<%!private static final String BR_TAG="<BR>";
   private String convertNewlines(String input){
	   String result=StringUtils.replace(input,"\r\n",BR_TAG);
  	   return StringUtils.replace(result,"\n",BR_TAG);
   	       }
%>
<%	///////////////////////
	String param_admins    = ParamUtils.getParameter(request,"param_admins");
	String name1 = null;
	String admins    = ParamUtils.getParameter(request,"admins");
	IofficeFactory iofficeFactory = IofficeFactory.getInstance(authToken);
	ProfileManager manager= iofficeFactory.getProfileManager();
	User user = manager.getUser(authToken.getUserID());
%>

<%	/////////////////
	// get parameters
	String userID  = ParamUtils.getParameter(request,"userID");//发信人
	int userid=Integer.parseInt(userID);
	boolean reply = ParamUtils.getBooleanParameter(request,"reply");
	
	String acceptID  = ParamUtils.getParameter(request,"acceptID");//回复

	boolean doPost = ParamUtils.getBooleanParameter(request,"doPost");
	
	String subject  = ParamUtils.getParameter(request,"subject");//回复内容
	if (subject!=null){
		subject = StringUtils.getChnString(subject);
	}

	String body = ParamUtils.getParameter(request,"body");
	if (body!=null){
		body = StringUtils.escapeHTMLTags(body);
		body = convertNewlines(body);
		body = StringUtils.getChnString(body);
	}
%>
<%	/////////////////
	// error check
	boolean errors = false;
	String errorMessage = "";
	if( doPost && subject == null ) {
		errors = true;
		errorMessage = "请输入主题!";
	}
	else if( doPost && body == null ) {
		errors = true;
		errorMessage = "对不起,您不能发送无内容信件,请输入信件内容!";
	}
	
%>
<%	/////////////////////////
	// Create the new message
	if( doPost && !errors ) {
		// Create a new message object
		ComponentManager cpman = iofficeFactory.getComponentManager();
		IofficeComponent cp = cpman.getComponent( "message" );
		////////
		ShortMsgAgent agent =(ShortMsgAgent) cp.getAgentInstance();
		if (reply) {
		   int acceptid = Integer.parseInt(acceptID);
	    	   User acceptuser = iofficeFactory.getProfileManager().getUser(acceptid);
	    	   String acceptName = acceptuser.getName();			
		   agent.createUsermessage(acceptid,subject,userid,body);
		}else  {

		   StringTokenizer admins_token = null;
     	           int userID1;
     	           User user1 = null;
     	           String userName1 = null;
     	           if(admins!=null)
     	           {
     			admins_token = new StringTokenizer(admins,",");
		        while(admins_token.hasMoreTokens())
		        {
			   userID1    = Integer.parseInt(admins_token.nextToken());
 			   user1     = manager.getUser(userID1);
			   if(user1!=null)
			   {	
				agent.createUsermessage(userID1,subject,userid,body);			}
		           }
                      	}
		   }			
		
		
		response.sendRedirect("main.jsp");
		return;
}		
		
%>	
<%	if( errors ) { %>
	<script language="JavaScript">
		alert("<%=errorMessage%>");
	</script>	
<%	} %>
<%
	String ipaddr = request.getRemoteAddr();
	session.putValue("doThing","发送短信");
	iofficeFactory.reportPulse(ipaddr,"发送短信");
%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<title>欢迎光临本网站</title>
<script language="javascript">
<!--



function js_callpage(htmlurl) {
(navigator.appName.indexOf("Netscape") != -1)
  {
    openwin=window.open(htmlurl,"homeWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=704,height=414");
    openwin.focus();
    return false;
  }
}
function send()
{
	var title = document.post.subject.value;
	var body = document.post.body.value;
	if(title==null||title.length<=0)
	{
		alert("请输入主题");
		return;
	}
	if(body==null||body.length<=0)
	{
		alert("请输入信件内容");
		return;
	}
	document.post.submit();
}

//-->
</script>
<style>
<!--
table{ font-family: 宋体; font-size: 10pt }
a:link{ font-family: 宋体; font-size: 10pt; color: #000000; text-decoration: none }
a:visited{  font-family: 宋体; font-size: 10pt; color: #000000; text-decoration: none }
a:hover{ font-family: 宋体; font-size: 10pt; color: red; text-decoration:underline }
-->
</style>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<body topmargin="0" leftmargin="0" >
<table border="0" cellpadding="0" cellspacing="0" width="770">
  <tr>
    <td width="91" background="../images/rq21.gif" valign="top"><img border="0" src="../images/rq20.gif" width="144" height="339">
      <p> </td>
    <td width="675" valign="top">
      <div align="right">
                <table width="100%">
                  <tr>
                    <td vAlign="bottom" width="100%">
                      <img border="0" src="images/duanxin.gif" width="622" height="51">
                    </td>
                  </tr>
                  <tr>
      <td width="100%">
      <% if(reply==false){
      %>
      <img border="0" src="images/duanxin001.gif" width="342" height="31"> 
      <%}else{%>
            <div align="center">
        <table border="0" cellpadding="0" cellspacing="0" width="100%" height="30">
          <tr>
            <td width="6%"><img border="0" src="images/duanxin01_01.gif" width="118" height="27"></td>
            <td width="24%" align="center"><b><font color="#800080"><%=manager.getUser(Integer.parseInt(acceptID)).getName()%></font></b></td>
            <td width="70%"><img border="0" src="images/duanxin01_03.gif" width="75" height="27"></td>
          </tr>
          <tr>
            <td width="6%"><img border="0" src="images/duanxin01_04.gif" width="118" height="4"></td>
            <td width="33%" background="images/duanxin01_05.gif"><img border="0" src="images/duanxin01_05.gif" width="149" height="4"></td>
            <td width="61%"><img border="0" src="images/duanxin01_06.gif" width="75" height="4"></td>
          </tr>
        </table>
      </div>
	<%}%>
      
      </td>                  
    </tr> 
    <tr>                  
      <td width="100%">                  
	<form action="post.jsp" name="post" method="post">
	<input type="hidden" name="doPost" value="true">
	<input type="hidden" name="reply" value="<%=reply%>">
	<input type="hidden" name="userID" value="<%=userID%>">
	<input type="hidden" name="acceptID" value="<%=acceptID%>">
	<input type="hidden" name="property" value="no">
	<input type="hidden" name="manproperty" value="no">
          <div align="center">
            <table border="0" cellspacing="0" width="100%">
              <tr>
                <td width="686">
                  <div align="center">
                    <center>
                    <table border="1" cellPadding="3" cellSpacing="0" width="100%" bordercolorlight="#FF9460" bordercolordark="#FFFFFF">
                    
<%
	String formSubject = "";
	if( reply ) {
		formSubject = subject;
		
			formSubject = "回复: " + formSubject;
	}
	else if( doPost && errors && subject != null ) {
		formSubject = subject;
	}
%>
<% if(reply==false){
%>
                      <tr>
                        <td width="13%" bgcolor="#BFDFFF" align="center"><b>接 
                          收 人</b></td>
                        <td width="87%" bgcolor="#eeeeee">  
                 	<input type="hidden" value="<%=param_admins!=null?param_admins:",1"%>" name="admins">
	&nbsp; <a href="javascript:ShowManChooser(document.dateimgin,document.post.username)" onClick="event.cancelBubble=true;">
    	<input type="text" disabled  name="username" value="
    	<%
     	StringTokenizer admins_token = null;
     	int userID1;
     	User user1 = null;
     	String userName1 = null;
     	if(param_admins!=null)
     	{
     		admins_token = new StringTokenizer(param_admins,",");
		while(admins_token.hasMoreTokens())
		{
			userID1    = Integer.parseInt(admins_token.nextToken());
			
			user1     = manager.getUser(userID1);
			if(user1!=null)
			{
				name1 = user1.getName(); 
				userName1 = user1.getUsername(); 
			}

		}
     		
     	}
     
     %>" size=70></a>
     <a href="javascript:ShowManChooser(document.dateimgin,document.post.username)" onClick="event.cancelBubble=true;"><img align="top" border="0" height="21" id="dateimgin" name="dateimgin" title="参数管理员" src="./images/user.gif" style="POSITION: relative"></a> 
</td>
                      </tr>
   <% }	%>
                      <tr>
                        <td width="13%" bgcolor="#BFDFFF" align="center"><b>主&nbsp;&nbsp;&nbsp; 
                          题</b></td>
                        <td width="87%" bgcolor="#eeeeee">
                        &nbsp;<input name="subject" value="<%= formSubject %>" size="80" maxlength="100"></td>
                      </tr>
                      <tr>
                        <td width="13%" valign="top" bgcolor="#BFDFFF" align="center"><b>信件内容</b></td>
                        <td width="87%" bgcolor="#eeeeee">&nbsp;<textarea name="body" cols="80" rows="15" wrap="hard"></textarea></td>
                      </tr>
                      <tr>
                        <td width="13%" bgcolor="#BFDFFF" align="center"><b>操&nbsp;&nbsp;&nbsp; 
                          作</b></td>
                        <td width="87%" bgcolor="#eeeeee">
                          <p align="center">	<input type="button" value="发送<%= (reply)?"回信":"信件" %>" onclick="send();">
		&nbsp;&nbsp;&nbsp;
	<input type="submit" value="取 消" onclick="location.href='main.jsp?userID=<%= userID %>';return false;">
</td>
                      </tr></table>
                    </center>
                  </div>
                </td>                       
              </tr>                       
            </table>                                 
          </div>                                 
        </form>                                 
      </td>                                 
    </tr>     
    
                 
                  
                  </table></div></td>
 </tr>       
 
 
 
                    
</table>   
<table border="0" cellpadding="3" cellspacing="0" width="775">  
  <tr>  
    <td width="100%" bgcolor="#0065CE">  
      <%
                	String edition = PropertyManager.getProperty("edition");
                	if(edition==null)
                	{
                		edition = "Copyright ?2001 北京四通搏运软件技术有限公司 版权所有.";
                	}
                	else
                	{
                		edition = StringUtils.getChnString(edition);
                	}
      %>
      <p align="center"><font color="#FFFF00"><%=edition%></font></td> 
  </tr>       
  <tr>       
    <td width="100%"><img border="0" src="../images/rq11.gif" width="774" height="2"></td>      
  </tr>      
</table>      
      
</body>      
                          
<script language="JavaScript" type="text/javascript">
<!--
document.post.subject.focus();
//-->
</script>	

<iframe frameBorder="0" id="ManFrame" marginHeight="0" marginWidth="0" noresize scrolling="no" src="../netstate/manager_choose.jsp?formActiont=post.jsp" style="DISPLAY: none; HEIGHT: 220px; POSITION: absolute; WIDTH: 470px;font-size:8pt">  
</iframe>

<%--////////////////////////////////--%>
<script>  
<!--  
	var g_eC = null;  
	var g_eCV = "";  
	var g_dFmt = "mmddyy";  
	var g_fnCB = null;  
	  
//显示管理员  

function ShowManChooser(eP,eD,eDP,dmin,dmax,fnCB){  
var pro = document.post.manproperty.value;
if(pro=="no")
{
	alert("人员选择界面还未下载完,请稍侯再试!");
	window.open("post.jsp?reply=<%=reply%>&userID=<%=userID%>","_self");
	return;
}
var dF = document.all.ManFrame;  
var wF = window.frames.ManFrame;  
g_fnCB = fnCB; //?  
if(eD == g_eC && "block"==dF.style.display)  
{  
	if(g_eCV != eD.value && GetInputDate(eD.value,g_dFmt))  
	{  
		g_eCV = eD.value;  
	}  
	else dF.style.display="none";  
}  
else
{  
	dF.style.left = eP.offsetLeft;  
	
	var eT = eP.offsetTop;  
	var eH = eP.offsetHeight;  
	var dH = dF.style.pixelHeight;  
	var sT = document.body.scrollTop;  
	if(eT-dH >= sT && eT+eH+dH > document.body.clientHeight+sT) dF.style.top = eT-dH;  
	else dF.style.top = eT+eH;  
	
	////////////////////////////
	var eL = eP.offsetLeft;  
	var eW = eP.offsetWidth;  
	var dW = dF.style.pixelWidth;  
	var sL = document.body.scrollLeft;  
	if(eL+dW > document.body.clientWidth+sL) dF.style.left = eL-dW;  
	else dF.style.left = eL;  
	/////////////////////////////
	
	if("none" == dF.style.display)  
		dF.style.display="block";  
	g_eC = eD;  
	g_eCV = eD.value;  
}  
	}  
//-->
</script>
<script>
function closeManFrame()//关闭弹出窗口
{
      document.all.ManFrame.style.display="none";  
}
function setMan(manID,manName)//从弹出窗口中获得用户参数
{
	
	document.post.admins.value = manID;
	document.post.username.value = manName;
}
function setManProperty()
{
	document.post.manproperty.value="yes";
}
</script>
<%--///////////////////////////////////--%>
<script event="onclick()" for="document">
<!--  
document.all.ManFrame.style.display="none";  
//-->  
</script>  

                                   
</html>                                   

⌨️ 快捷键说明

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