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

📄 listhx.jsp

📁 “JSP数据库项目案例导航”一书从第一章到第十一章各章实例的源程序文件以及数据库文件。 注意: 1. 本书中的案例提供的数据库环境不同
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@page import="java.util.*,java.text.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id='db' scope='request' class='Base.DataBean.DefaultDataBean' />
<jsp:useBean id='dealstring' scope='request' class='com.util.DealString' />
<%	
	com.util.DealString ds = new com.util.DealString();
	com.db.CommonBean myBean = new com.db.CommonBean();
%>
<html>
<head>
<link rel=stylesheet href="../index.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>横向项目</title>
</head>
<body>
<%
//取得本年横向项目
String strThisId = ds.toString((String)db.getAttributeStr("people.id"));
String sql = "";

sql = " select * from kjc2_crossproject "
	+ " where hzbz='1' "
	+ " and (zywcr='"+strThisId+"' "
	+ " or zywcr like '"+strThisId+",%' "
	+ " or zywcr like '%,"+strThisId+",%' "
	+ " or zywcr like '%,"+strThisId+"') "
	+ " order by jtsj desc ";
Vector vecth = (Vector)myBean.getDataBySql(sql);
%>

<table width="100%" height="20"  border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td>&nbsp;</td>
    </tr>
  </table>
  <table width="100%"  border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="25">&nbsp;</td>
      <td width="790">
			<table width="100%"  border="0" cellpadding="0" cellspacing="0">
			  <tr>
				<td width="10">&nbsp;</td>
				<td width="*"><table width="100%" height="20"  border="0" cellpadding="0" cellspacing="0">
					<tr>
					  <td height="20" class="title_s"><img src="../pics/login.gif" width=50>&nbsp;欢迎您>><%=(String)session.getAttribute("NAME")%> </td>
					</tr>
					<tr>
					  <td height="5" bgcolor="#C8F8BA" colspan=2></td>
					</tr>
					<tr>
					  <td height="1" bgcolor="#2E990F" colspan=2></td>
					</tr>
				</table></td>
				<td width="30">&nbsp;</td>
			  </tr>
			</table>
	</td>

    </tr>
  </table>
  <table width="100%"  border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="40">&nbsp;</td>
      <td width="910">
		<br>
		<table class="main_w" width="100%"  border="1" cellpadding="4" cellspacing="0" bordercolor="FFFFFF" bgcolor="E8FCE2">
          <tr bgcolor="#FFFFFF" class="title_s">
            <td  colspan="6"><div align="center">全部横向项目</div></td>
          </tr>
          <tr>
            <td height="20" class="title_s">序号</td>
            <td height="20" class="title_s">项目名称</td>
<!--             <td height="20" class="title_s">登记号</td>
            <td height="20" class="title_s">合同号</td>
 -->            <td height="20" class="title_s">项目类型</td>
            <td height="20" class="title_s">项目负责人</td>
            <td height="20" class="title_s">开始时间</td>
            <td height="20" class="title_s">结题时间</td>
          </tr>
			<%
			int sizeh = vecth.size();
			for(int i=0;i<sizeh;i++){
				Hashtable hashh = (Hashtable)vecth.get(i);
				String str_id = ds.toString((String)hashh.get("id"));
				String str_Djh = ds.toString((String)hashh.get("djh"));
				String str_Hth = ds.toString((String)hashh.get("hth"));
				String str_xmmc = ds.toString((String)hashh.get("xmmc"));
				String str_Xmlx = ds.toString((String)hashh.get("xmlx"));
				String str_XmlxName = ds.toString((String)myBean.toName("kjc2_code","id","code_value",str_Xmlx));

				String str_Ktlyd = ds.toString((String)hashh.get("ktlyd"));
				String str_Xy = ds.toString((String)hashh.get("xy"));
				/*String str_Xys[] = str_Xy.split(",");
				str_Xy = "";
				for(int j=0;j<str_Xys.length;j++){
					String strtemp = ds.toString((String)myBean.toName("kjc_college","id","name",str_Xys[j]));
					if(str_Xy.equals("")) str_Xy += strtemp;
					else str_Xy += ","+strtemp;
				}*/

				String str_Xmfzr = ds.toString((String)hashh.get("xmfzr"));//逗号分割人员表id
				String str_Xmfzrs[] = str_Xmfzr.split(",");
				str_Xmfzr = "";
				for(int j=0;j<str_Xmfzrs.length;j++){
					String strtemp = ds.toString((String)myBean.toName("kjc_people","id","name",str_Xmfzrs[j]));
					if(str_Xmfzr.equals("")) str_Xmfzr += strtemp;
					else str_Xmfzr += ","+strtemp;
				}

				String str_Zywcr = ds.toString((String)hashh.get("zywcr"));//逗号分割人员表id
				String str_wcrxh = ds.toString((String)hashh.get("wcrxh"));//1,3,4
				/*String str_Zywcrs[] = str_Zywcr.split(",");
				String str_wcrxhs[] = str_wcrxh.split(",");
				str_Zywcr = "";
				for(int j=0;j<str_Zywcrs.length;j++){
					String strtemp = ds.toString((String)myBean.toName("kjc_people","id","name",str_Zywcrs[i]));
					if(str_Zywcr.equals("")) str_Zywcr += strtemp+"("+str_wcrxhs[j]+")";
					else str_Zywcr += ","+strtemp+"("+str_wcrxhs[j]+")";
				}*/
				String str_Yjscjr = ds.toString((String)hashh.get("yjscjr"));
				String str_kssj = ds.toString((String)hashh.get("kssj"));
				String str_Jtsj = ds.toString((String)hashh.get("jtsj"));
			%>
				  <tr>
					<td><%=i+1%></td>
					<td><a href="../kjc2_manage/view1.jsp?projectid=<%=str_id%>"><%=str_xmmc%></a></td>
					<td><%=str_XmlxName%></td>
					<td><%=str_Xmfzr%></td>
					<td><%=str_kssj%></td>
					<td><%=str_Jtsj%></td>
				  </tr>
			<%
			}
			%>
			<%if(sizeh==0){%>
				  <tr>
					<td colspan=6 align=center>没有横向项目!</td>
				  </tr>
			<%}%>
      </table>
  </td>
      <td width="50">&nbsp;</td>
    </tr>
  </table>
</body>
</html>
<%
myBean.closeConn ( ) ;
%>

⌨️ 快捷键说明

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