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

📄 stati_comp.jsp

📁 《jsp案例开发》这本书的源代码。包括源代码和相关的具体配置操作步骤。非常不错
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%@ page    language="java"    contentType="text/html; charset=GBK"    import="imis.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.util.*,java.sql.*,java.io.*"%><%    request.setCharacterEncoding("GBK");    session=request.getSession();    userStruct user=(userStruct)session.getAttribute("user");    if(user==null){    response.sendRedirect("../../login.html");    }  else if(user.userAccess.intValue()!=9&&user.userAccess.intValue()!=6&&user.userAccess.intValue()!=7&&user.userAccess.intValue()!=12)          response.sendRedirect("../../error/access.html");  else{    %><%String devtype=request.getParameter("devtype");    if(devtype!=null)    {    session.setAttribute("devtype",devtype);    }String manu = request.getParameter("manu");    if(manu!=null)    {    session.setAttribute("manu",manu);    }String contract = request.getParameter("contract");   if(contract!=null)    {   session.setAttribute("contract",contract);   } Collection collect=(Collection)session.getAttribute("stati_c"); if(collect==null) {%>      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">      <HTML><HEAD>      <TITLE>MSA Office</TITLE>      <META http-equiv=Content-Type content="text/html; charset=gb_2312-80">      <META content="MSHTML 5.50.4134.600" name=GENERATOR>      <link rel="stylesheet" href="../../css/msa.css" type="text/css">      <script language="JavaScript" src="../../public/js/table_display.js"></script>      <script language="JavaScript" src="../../public/js/stati_menu.js"></script>      <script language="javascript" src="../../public/util/openSelect.js"></script>      <script language="javascript" src="../../public/js/getdate.js"></script><script language="javascript">  function selecttype(){      document.location="?contract="+document.form1.contract.value+"&&devtype="+document.form1.devtype.value+"&&manu="+document.form1.manu.value;  }  function selectmanu(){        document.location="?contract="+document.form1.contract.value+"&&devtype="+document.form1.devtype.value+"&&manu="+document.form1.manu.value;  }  function selectcontract(){       document.location="?contract="+document.form1.contract.value+"&&devtype="+document.form1.devtype.value+"&&manu="+document.form1.manu.value;  }</script>       <script language="javascript">      init1();      </script>      <SCRIPT>      window.onload=init      </SCRIPT>      </HEAD>      <BODY class="bg" topMargin=20 leftmargin="0" marginwidth="0" marginheight="0" onclick="h_cele_date()">      <DIV align=center>          <TABLE class=outter cellSpacing=0 cellPadding=0 width=700 border=0>            <TR>              <TD><IMG height=4 src="../../MacOS/lefttop.gif" width=6></TD>              <TD background=../../MacOS/top.gif colSpan=3><IMG height=4            src="../../MacOS/top.gif" width=1></TD>              <TD><IMG height=4 src="../../MacOS/righttop.gif"></TD>            </TR>            <TR>              <TD vAlign=top background=../../MacOS/lwing.gif rowSpan=3><IMG height=18            src="../../MacOS/left.gif" width=6></TD>              <TD vAlign=top background=../../MacOS/titlebg.gif width="16"> <DIV><img src="../../MacOS/logo.gif" width="16" height="16" border="0" ></DIV></TD>              <TD vAlign=top noWrap align=center width="100%"          background=../../MacOS/titlebg.gif><SPAN            style="BACKGROUND-COLOR: #cecece"><FONT class=strong> MSA - OFFICE </font></SPAN></TD>              <TD><IMG height=18 src="../../MacOS/right_b2.gif" width=18 border="0"></TD>              <TD vAlign=top background=../../MacOS/rwing.gif rowSpan=3><IMG height=18            src="../../MacOS/right.gif" width=7></TD>            </TR>            <TR>              <TD background=../../MacOS/hr.gif colSpan=3><IMG height=2            src="../../MacOS/hr.gif" width=1></TD>            </TR>            <TR>              <TD colSpan=3 align="center" valign="top"><br> <table width="700" border="1" cellspacing="1" bordercolor="#666666">                  <tr bgcolor="#FAFAFA">                    <td valign="top">                    <table class=title cellspacing=1 cellpadding=2 width="100%" border=0>                      <form name="form1" method="post" action="stati_comp_q.jsp">                      <tr bgcolor="#fafafa">                       <td>                       设备类型:                       <select name="devtype" onChange="selecttype()"> <%String va="-1";String ta="---请选择---";String dte=devtype;if(dte!=null){if(!dte.equals("-1")){if(dte.equals("1")){va="1";ta="VTS备件";}if(dte.equals("2")){va="2";ta="航标设备及备件";}if(dte.equals("3")){va="3";ta="AIS系统及备件";}if(dte.equals("4")){va="4";ta="测绘设备及备件";}if(dte.equals("5")){va="5";ta="其他";}}}%>                       <option value="<%=va%>"><%=ta%></option>                       <option value="1">VTS备件</option>                       <option value="2">航标设备及备件</option>                       <option value="3">AIS系统及备件</option>                       <option value="4">测绘设备及备件</option>                       <option value="5">其他</option>                       </select> &nbsp;&nbsp;<font class="strong" > 厂商名称:</font>      <select name="manu" onChange="selectmanu()"><%va="-1";ta="---请选择---";String manf=manu;if(manf!=null){if(!manf.equals("-1")){va=manf;ta=manf;}}%>      <option value="<%=va%>"><%=ta%></option><%  Collection mc=new ArrayList();       Context ctxm = new InitialContext();       Object refm = ctxm.lookup("OtherController");       OtherControllerHome otherControllerHome = (OtherControllerHome) PortableRemoteObject.narrow(refm, OtherControllerHome.class);       OtherController otherController = otherControllerHome.create();       mc = otherController.getManuAll();       Iterator mi=mc.iterator();       while(mi.hasNext())       {       ManufactureJBean manuj = new ManufactureJBean();       manuj = (ManufactureJBean)mi.next();%>    <option value="<%=manuj.name%>"><%=manuj.name%></option><%       }%></select><br><font class="strong" >合同名称:</font><select name="contract" onChange="selectcontract()"><%va="-1";ta="---请选择---";String conname=contract;if(conname!=null){if(!conname.equals("-1")){va=conname;ta=conname;}}%><option value="<%=va%>"><%=ta%></option><%  Context conctx = new InitialContext();         //look up jndi name         Object conref = conctx.lookup("ContractController");         //cast to Home interface         ContractControllerHome contractControllerHome = (ContractControllerHome) PortableRemoteObject.narrow(conref, ContractControllerHome.class);         ContractController contractController = contractControllerHome.create();         Collection c = new ArrayList();         c = contractController.getAll();         Iterator ii = c.iterator(); Vector name = new Vector();         while(ii.hasNext())         {       ContractJBean cjb = new ContractJBean();       cjb = (ContractJBean)ii.next();       name.addElement(cjb.contractname);         } for(int l=0;l<name.size()-1;l++)   for(int k=l+1;k<name.size();k++)         {     if(name.elementAt(l).equals(name.elementAt(k)))       {             name.remove(k);             k--;          }           }for(int l=0;l<name.size();l++){%><option value="<%=name.elementAt(l)%>"><%=name.elementAt(l)%> </option><%}%></select>&nbsp;&nbsp;<font class="strong" > 设备型号:</font><input name="devmodel" type="text" class="file" size="20" readonly><input type="hidden" name="planTypeId" readonly  value="" ><input type="button" value="  " name="Submit323" class="button_select" onClick="javascript:addList( new Array(document.form1.planTypeId,document.form1.devmodel),'model.jsp' )">                      &nbsp;&nbsp;<input type="submit" value="  确  定  " class="file">                      &nbsp;&nbsp;<input type="button" value="  还  原  " class="file" onclick="location='stati_comp.jsp'">                        </td>                      </tr>                       </form>                     </table>                     <hr>                      <table class=title cellspacing=1 cellpadding=2 width="100%" border=0>                      <form name="form5" method="post" action="">                        <caption align=center><font size="4" >分析比较</font></caption>                        <tr align=middle bgcolor="#fafafa">                          <td width="15%"><strong><font  class="strong">设备类型</font></strong></td>                          <td width="15%"><strong><font  class="strong">设备名称</font></strong></td>                          <td width="15%"><strong><font  class="strong">设备型号</font></strong></td>                          <td width="10%"><strong><font  class="strong">所属厂商</font></strong></td>                          <td width="10%"><strong><font  class="strong">合同编号</font></strong></td>                          <td width="10%"><strong><font  class="strong">引进日期</font></strong></td>                          <td width="15%"><strong><font  class="strong">性能参数</font></strong></td>                          <td width="10%"><strong><font  class="strong">设备状态</font></strong></td>                        </tr>                       </form>                    </table>                  </tr>                </table>                <p><img src="../../images/msalogo.gif" width="272" height="50">                <table width="100%" border="0" cellspacing="0" cellpadding="0">                  <tr>                    <td height="3"><img src="a.gif" width="1" height="1"></td>                  </tr>                  <tr>                    <td background="../../MacOS/hr.gif"><img src="../../MacOS/hr.gif" width="1" height="2"></td>                  </tr>                  <tr>                    <td height="3"><img src="a.gif" width="1" height="1"></td>                  </tr>                </table>                <table width="100%" border="0" cellspacing="0" cellpadding="0">                  <tr>                    <td> <div align="right"><a href="../../help.htm" target="blank" style="cursor:help" title="使用帮助"><img src="../../MacOS/help.gif" width="16" height="16" border="0">HELP</a></div></td>                  </tr>                </table></TD>            </TR>            <TR>              <TD><IMG height=7 src="../../MacOS/leftbottom.gif" width=6></TD>              <TD background=../../MacOS/bottom.gif colSpan=3><IMG height=7            src="../../MacOS/bottom.gif" width=1></TD>              <TD><IMG height=7 src="../../MacOS/rightbottom.gif"      width=7></TD>            </TR>          </TABLE>          <BR>          <TABLE cellSpacing=1 cellPadding=2 width="300" border=0>            <TBODY>              <TR>                <TD align=center><FONT class=footer>Orient Super Net NMIE-OFFICE System 1.0                  </FONT></TD>              </TR>            </TBODY>          </TABLE>      </DIV></BODY></HTML><%}else{  EquipmentDetailsStruct eqd = null;  Context ctx=new InitialContext();    Object ref=ctx.lookup("EquipmentControllerEJB");    EquipmentControllerEJBHome eqHome=(EquipmentControllerEJBHome) PortableRemoteObject.narrow(ref,EquipmentControllerEJBHome.class);  EquipmentControllerEJB eqController = eqHome.create();  EquipmentJBean eqj=new EquipmentJBean();     Iterator i=collect.iterator();     int count=0;     int pagecount=0;     int pages=0;     int pagesize=20;     while(i.hasNext()){     count++;     i.next();     }     if(count%pagesize==0)     pagecount=count/pagesize;     else pagecount=count/pagesize+1;     String strpages=request.getParameter("pages");     if(strpages==null)         pages=1;     else {         pages=new Integer(strpages).intValue();         if(pages<=0)         pages=1;     }     Iterator rs =collect.iterator();     int m;     for(m=1;m<=(pages-1)*pagesize;m++){         rs.next();      }%>      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">      <HTML><HEAD>      <TITLE>MSA Office</TITLE>      <META http-equiv=Content-Type content="text/html; charset=gb_2312-80">      <META content="MSHTML 5.50.4134.600" name=GENERATOR>      <link rel="stylesheet" href="../../css/msa.css" type="text/css">      <script language="JavaScript" src="../../public/js/table_display.js"></script>      <script language="JavaScript" src="../../public/js/stati_menu.js"></script>      <script language="javascript" src="../../public/util/openSelect.js"></script>      <script language="javascript" src="../../public/js/getdate.js"></script><script language="javascript">  function selecttype(){      document.location="?contract="+document.form1.contract.value+"&&devtype="+document.form1.devtype.value+"&&manu="+document.form1.manu.value;  }  function selectmanu(){        document.location="?contract="+document.form1.contract.value+"&&devtype="+document.form1.devtype.value+"&&manu="+document.form1.manu.value;  }

⌨️ 快捷键说明

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