comment.jsp
上传用户:sami52198
上传日期:2010-02-11
资源大小:5174k
文件大小:10k
源码类别:

电子政务应用

开发平台:

MultiPlatform

  1. <%@ page contentType="text/html;charset=gb2312" %>
  2. <% request.setCharacterEncoding("gb2312"); %>
  3. <%@ include file="include/config.jsp"%>
  4. <%@include file="include/bean.jsp"%>
  5. <%@include file="include/head.jsp"%>
  6. <html>
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  9. <title>欢迎来到乐趣工作室!</title>
  10. <LINK href="../css/style.css" rel=stylesheet type=text/css>
  11. <script language="JavaScript" src="../js/JsInclude.js"></script>
  12. <jsp:useBean id="user" scope="page" class="com.rich.project.user.User" />
  13. <jsp:setProperty name="user" property="*" />
  14. </head>
  15. <%
  16.      String par = request.getParameter("par");
  17.      String id = request.getParameter("id");
  18.      
  19.      if(par!=null&&par.equals("add"))
  20.       {
  21.           String userid = request.getParameter("userid");
  22.           String password = request.getParameter("password");     
  23.            String ip = request.getRemoteAddr();      
  24.           Vector username_vct = user.login(userid,password);           
  25.           
  26.           if(username_vct!=null&&username_vct.size()>0)
  27.            {
  28.                        //登录信息
  29.                          Vector t_vct =(Vector)username_vct.get(0);                         
  30.                          session.setAttribute("inc",t_vct.get(0));                         
  31.                          session.setAttribute("id",t_vct.get(1));                         
  32.                          session.setAttribute("nickname",t_vct.get(2));  
  33.                          //添加评论userid,id=tbs051.tbs051_inc
  34.                           
  35.                          comment.createComment(userid,id,ip);
  36.            }
  37.           else
  38.            {
  39.                throw new Exception("输入的会员ID或密码不正确,请重新输入!");
  40.            } 
  41.           
  42.             
  43.       }
  44.    
  45.    
  46. %>
  47. <body leftmargin="0">
  48. <table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  49.   <tr> 
  50.     <td><table width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  51.         <tr> 
  52.           <td width="150"><img src="images/logo.gif" width="150" height="42"></td>
  53.           <td width="500"> <div align="center"><img src="images/bannar.gif" width="458" height="60"></div></td>
  54.           <td width="110"><table width="110" border="0" cellspacing="0" cellpadding="0">
  55.               <tr> 
  56.                 <td height="20" valign="middle"> <div align="center"><font size="2">设为首页 
  57.                     </font></div></td>
  58.               </tr>
  59.               <tr> 
  60.                 <td height="20" valign="middle"> <div align="center"><font size="2">设为首页 
  61.                     </font></div></td>
  62.               </tr>
  63.               <tr> 
  64.                 <td height="20" valign="middle"> <div align="center"><font size="2">设为首页 
  65.                     </font></div></td>
  66.               </tr>
  67.             </table></td>
  68.         </tr>
  69.       </table></td>
  70.   </tr>
  71.   <tr> 
  72.     <td height="8"><img src="images/tmtp.gif" width="2" height="2"></td>
  73.   </tr>
  74.   <tr> 
  75.     <td height="22" valign="middle" bgcolor="#FCCB05"> 
  76.     <div align="center">
  77.     <%@include file="include/board1.jsp"%> 
  78.         </div>
  79.         </td>
  80.   </tr>
  81.   <tr> 
  82.     <td height="17" bgcolor="#FC9803">&nbsp;</td>
  83.   </tr>
  84.   <tr> 
  85.     <td height="10"><img src="images/tmtp.gif" width="2" height="2"></td>
  86.   </tr>
  87.   <tr> 
  88.  
  89.     <td height="10"><table width="760" border="1" cellpadding="0" cellspacing="0" bordercolor="#CD9501" bordercolordark="#FFFFFF">
  90.         
  91. <%
  92.      //m_vct = pageCtl.getcurData(comment.getComment(id),20,curpage);    
  93.      
  94.     m_vct = comment.getComment(id); 
  95.     
  96.     if(m_vct!=null&&m_vct.size()>0)
  97.      {
  98. %>
  99.         <tr> 
  100.           <td bgcolor="#FFCC00"><font size="2">本新闻所有评论共 <%=m_vct.size()%> 条     </font></td>
  101.         </tr>
  102. <%           
  103.        
  104.        
  105.        for(int i=0;i<m_vct.size();i++)
  106.         {
  107.           Vector t_vct = (Vector)m_vct.get(i);
  108.           
  109.            %>
  110.         <tr> 
  111.           <td height="5"><img src="images/tmtp.gif" width="2" height="2"></td>
  112.         </tr>       
  113.         <tr> 
  114.           <td height="25" bgcolor="#FFFBEC"> &nbsp;&nbsp;<img src="images/dis01.gif" width="13" height="18"> 
  115.             <font size="2">评论人: <%=t_vct.get(1)%>  时间: <%=(t_vct.get(3).toString()).substring(0,19)%>   IP:<%=((String)t_vct.get(2)).substring(0,((String)t_vct.get(2)).lastIndexOf("."))%>.*</font></td>
  116.         </tr>
  117.         
  118.         <tr> 
  119.           <td><br>
  120.           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=t_vct.get(0)%> 
  121.           <br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=t_vct.get(4)%> <br>&nbsp;
  122.           </td>
  123.         </tr>
  124.        
  125.            <%       
  126.         }
  127.      }
  128.    else
  129.     {
  130. %>
  131.         <tr> 
  132.           <td bgcolor="#FFCC00"><font size="2">本新闻所有评论共 0 条     </font></td>
  133.         </tr>
  134. <%        
  135.     
  136.     }     
  137. %>         
  138.       
  139.         <tr> 
  140.           <td>&nbsp;</td>
  141.         </tr>
  142.       </table></td>
  143.   </tr>
  144.   <tr> 
  145.     <td height="10">&nbsp;</td>
  146.   </tr>
  147. <form name="commentform" method="post">  
  148. <input type="hidden" name="par">
  149.   <tr> 
  150.     <td><table width="760" border="1" cellpadding="0" cellspacing="0" bordercolor="#CD9501" bordercolordark="#FFFFFF">
  151.         <tr> 
  152.           <td width="50%" bgcolor="#FFFBEC">&nbsp;&nbsp;<img src="images/dis01.gif" width="13" height="18"> 
  153.             <font size="2"> 
  154.             会员ID: 
  155.             <input name="userid" type="text" size="10">
  156.             密码: 
  157.             <input name="password" type="password" size="10">
  158.             </font> </td>
  159.           <td width="50%" bgcolor="#FFFBEC">&nbsp;&nbsp;<img src="images/dis01.gif" width="13" height="18"> 
  160.             <font size="2"><strong>相关产品 </strong></font></td>
  161.         </tr>
  162.         <tr> 
  163.           <td width="50%" height="130"> <div align="center"> 
  164.               <table width="380" border="0" cellspacing="0" cellpadding="0">
  165.                <tr> 
  166.                   <td height="1"> 
  167.                   <div align="left"> 
  168.                      &nbsp;&nbsp;&nbsp;&nbsp;
  169.                     </div></td>
  170.                 </tr>               
  171.                <tr> 
  172.                   <td height="20"> 
  173.                   <div align="left"> 
  174.                      &nbsp;&nbsp;&nbsp;&nbsp;标 题 : <input name="title" type="text">
  175.                     </div></td>
  176.                 </tr>              
  177.                 <tr> 
  178.                   <td height="130"> <div align="center"> 
  179.                       <textarea name="content" cols="45" rows="7"></textarea>
  180.                     </div></td>
  181.                 </tr>
  182.                 <tr> 
  183.                   <td height="30" valign="top"> <div align="center"> 
  184.                       <input type="button" name="Submit" value="提交" onclick="subcomment()">
  185.                     </div></td>
  186.                 </tr>
  187.               </table>
  188.             </div></td>
  189.           <td width="50%" valign="top"> <br> <table width="360" border="0" align="center" cellpadding="0" cellspacing="0">
  190.               <tr> 
  191.                 <td height="20"><font size="2">· 布什将宣布成立调查委员会调查美对伊武器情报</font></td>
  192.               </tr>
  193.               <tr> 
  194.                 <td height="20"><font size="2">· 布什将宣布成立调查委员会调查美对伊武器情报</font></td>
  195.               </tr>
  196.               <tr> 
  197.                 <td height="20"><font size="2">· 布什将宣布成立调查委员会调查美对伊武器情报</font></td>
  198.               </tr>
  199.               <tr> 
  200.                 <td height="20"><font size="2">· 布什将宣布成立调查委员会调查美对伊武器情报</font></td>
  201.               </tr>
  202.               <tr> 
  203.                 <td height="20"><font size="2">· 布什将宣布成立调查委员会调查美对伊武器情报</font></td>
  204.               </tr>
  205.               <tr> 
  206.                 <td height="20"><font size="2">· 布什将宣布成立调查委员会调查美对伊武器情报</font></td>
  207.               </tr>
  208.             </table></td>
  209.         </tr>
  210.       </table></td>
  211.   </tr>
  212. <script language="javascript">  
  213. function subcomment()
  214. {
  215.    if(isWhitespace(document.commentform.userid.value))
  216.     {
  217.        alert("请输入会员ID!");
  218.        document.commentform.userid.focus();
  219.        return;
  220.     }
  221.     
  222.    if(isWhitespace(document.commentform.password.value))
  223.     {
  224.        alert("请输入密码!");
  225.        document.commentform.password.focus();
  226.        return;
  227.     }    
  228.    if(isWhitespace(document.commentform.title.value))
  229.     {
  230.        alert("请输入评论标题!");
  231.        document.commentform.title.focus();
  232.        return;
  233.     }
  234.     
  235.    if(isWhitespace(document.commentform.content.value))
  236.     {
  237.        alert("请输入评论内容!");
  238.        document.commentform.title.focus();
  239.        return;
  240.     } 
  241.   document.commentform.par.value="add";
  242.   document.commentform.submit();       
  243. }
  244. </script>
  245. </form>  
  246.   <tr> 
  247.     <td> <div align="left"> &nbsp;&nbsp;&nbsp;&nbsp; </div></td>
  248.   </tr>
  249. </table>
  250. <table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  251.   <tr> 
  252.     <td width="760" height="20" bgcolor="#FFCC00"><font size="2">&nbsp;&gt;&gt; 
  253.       合作伙伴</font></td>
  254.   </tr>
  255.   <tr> 
  256.     <td height="60" bgcolor="#FFFBEC"> <table width="750" border="0" cellspacing="0" cellpadding="0">
  257.         <tr> 
  258.           <td><div align="center"><img src="images/2rich.gif" width="88" height="31"></div></td>
  259.           <td><div align="center"><img src="images/2rich.gif" width="88" height="31"></div></td>
  260.           <td><div align="center"><img src="images/2rich.gif" width="88" height="31"></div></td>
  261.           <td><div align="center"><img src="images/2rich.gif" width="88" height="31"></div></td>
  262.           <td><div align="center"><img src="images/2rich.gif" width="88" height="31"></div></td>
  263.           <td><div align="center"><img src="images/2rich.gif" width="88" height="31"></div></td>
  264.         </tr>
  265.         <tr> 
  266.           <td><div align="center"></div></td>
  267.           <td><div align="center"></div></td>
  268.           <td><div align="center"></div></td>
  269.           <td><div align="center"></div></td>
  270.           <td><div align="center"></div></td>
  271.           <td><div align="center"></div></td>
  272.         </tr>
  273.       </table></td>
  274.   </tr>
  275.   <tr> 
  276.     <td height="10"><hr size="1"></td>
  277.   </tr>
  278.   <tr> 
  279.     <td height="10"><div align="center"><font size="2">公司简介 | 公司简介 | 公司简介 | 公司简介 
  280.         | 公司简介 | 公司简介 | 公司简介 | 公司简介 </font></div></td>
  281.   </tr>
  282.   <tr> 
  283.     <td height="30"> <div align="center"><font size="2">Copyright &copy;乐趣工作室2rich.net 
  284.         客户服务中心信箱:howjoy@howjoy.com </font></div></td>
  285.   </tr>
  286. </table>
  287. </body>
  288. </html>