文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>级联和控制光标位置

级联和控制光标位置

时间:2007-08-28  来源:little_cat

<%@ page contentType="text/html;charset=gb2312"%>
<%@ page language="java" import="java.lang.*,java.util.*,java.net.*,java.sql.*,Form.*"%>
<%@ include file="session.jsp"%>
<html>
<head>
<title>故障申报</title>
<style type=text/css>
<!--
 TD,BODY{FONT-SIZE: 10pt; cursor: url(arrow.ani)}
 TD,BODY{font-family: simsun,宋体,楷体}
-->
</style>
<META HTTP-EQUIV=Content-Type CONTENT="text/html; charset=gb2312">
</head>
<body>
<%
request.setCharacterEncoding("gb2312");
response.setContentType("text/html;charset=gb2312");
String ids=(String)session.getValue("id_s");
String names=(String)session.getValue("name_s");
Info info=new Info();
java.util.Date utildate=new java.util.Date();
long time=utildate.getTime();
String id="0";
String status="";
try
    {
        //String spath = "D://__办公系统数据库/ApplycationDataSets.mdb";
        //String dbpath =  application.getRealPath(spath);
        String dbname = "";
        String user = "";
        String url ="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=D://__办公系统数据库/ApplycationDataSets.mdb";
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection conn= DriverManager.getConnection(url);
        Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
        String sql = "select id,status from buginfo where userid='"+ids+"' order by id desc";
        ResultSet rs;
        rs=stmt.executeQuery(sql);
        if(rs.next())
  {
    id=rs.getString("id").trim();
    status=rs.getString("status");
  }
   conn.close();
    }catch(Exception e){
 out.print("<p>&nbsp;</p><p>&nbsp;</p>");
out.print(info.print("数据库连接错误!,错误信息如下:<br>"+e.getMessage()+"<br><br><a href=student.jsp>请返回</a>"));
}
if((time-Double.valueOf(id))<7186800.0)
{
out.print("<p>&nbsp;</p><p>&nbsp;</p>");
out.print(info.print("对不起,  同一帐号2小时内不得再次提交任何故障申报!<br><br><a href=student.jsp>请返回</a>"));
}//判断时间是否超过两小时
else{
if(status.equals("已解决(未确认)"))
{
 out.print("<p>&nbsp;</p><p>&nbsp;</p>");
 out.print(info.print("您上次提交的故障申报已解决,请先确认再提交本次申报!<br><br><a href=student.jsp>请返回</a>"));
}
else{
String title=request.getParameter("title");
if(title==null) title="0";
//out.print(title);
String description=request.getParameter("description");
if(description==null) description="";
String school=request.getParameter("school");
if(school==null) school="0";
//out.print(school);
String buildinggroup=request.getParameter("buildinggroup");
if(buildinggroup==null) buildinggroup="0";
//out.print(buildinggroup);
String building=request.getParameter("building");
if(building==null) building="0";
//out.print(building);
String room=request.getParameter("room");
if(room==null) room="0";
//out.print(room);
%>
<br>
<center>
<p style="font-size:12pt; font-weight:bold; color:#473C8B;">故障申报</p>
</center>
<p>
<table width=70% align=center border=1 bordercolor=#6A5ACD cellspacing=0 cellpadding=1 bgcolor=#F5F5F5 bordercolorlight=#6A5ACD>
<tr><td>
<table width=100% align=center border=1 bgcolor=#F5F5F5 bordercolor=#EDEDED cellspacing=0 cellpadding=1>
<th><table width=99% border=1 bgcolor=#EEC900 cellspacing=1><tr><td bgcolor=#EBEBEB width=5%></td><td bgcolor=#EEE8AA width=5%></td><td align=center height=20><b>请说明故障信息<b></td><td bgcolor=#EEE8AA width=5%></td><td bgcolor=#EBEBEB width=5%></td></tr></table></th>
<tr>
<td>
<form action="bugapplyok.jsp" method="post" name="form1">
<table width="99%" bgcolor=#FFFFFF border=1 bordercolor=#F4F4F4 cellspacing=0 align=center>
<tr>
<td width=20%>&nbsp;用户ID</td>
<td width=35%><input type="text" name="userid" value=<%=ids%> readonly=true>
</td>
<td width=45%>登陆帐号,不可修改</td>
</tr>
<tr>
<td width=20%>&nbsp;用户姓名</td>
<td width=35%><input type="text" name="username" value=<%=names%> readonly=true>
</td>
<td width=45%>用户姓名,不可修改</td>
</tr>
<tr>
<td width=20%>&nbsp;故障主题</td>
<td width=35%>
<select name="title" size=1>
<option value=0 selected>&nbsp;请选择故障主题&nbsp;</option>
<%
String type="";
try
    {
        //String spath = "D://__办公系统数据库/BasicDataSets.mdb";
        //String dbpath =  application.getRealPath(spath);
        String dbname = "";
        String user = "";
        String url ="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=D://__办公系统数据库/BasicDataSets.mdb";
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection conn= DriverManager.getConnection(url);
        Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
        String sql = "select * from bugtype";
        ResultSet rs;
        rs=stmt.executeQuery(sql);
        while(rs.next())
  {
    type=rs.getString("type");
    if(type.equals(title))
    {
%>
<option value=<%=title%> selected>&nbsp;<%=title%></option>
<%
}else{
%>
<option value=<%=type%>>&nbsp;<%=type%></option>
<%
}
  }
  conn.close();
 }catch(Exception e){
 out.print("<p>&nbsp;</p><p>&nbsp;</p>");
out.print(info.print("数据库连接错误!,错误信息如下:<br>"+e.getMessage()+"<br><br><a href=student.jsp>请返回</a>"));
   }
%>
</select></td>
<td width=45%>如果选项中没有相符的主题,请选择其他</td>
</tr>
<tr>
<td width=20%>&nbsp;故障现象</td>
<td width=35%>
<textarea rows=8 cols=29 name=description><%=description%></textarea></td>
<td width=45%>详细描述故障现象,并说明故障信息点(如靠门、靠窗)</td>
</tr>
<tr>
<td width=20%>&nbsp;选择校区</td>
<td width=35%>
<select name="school" size=1 onChange=change()>
<%
if(school.equals("磬苑校区"))
{
%>
<option value=0>&nbsp;请选择校区&nbsp;</option>
<option value="磬苑校区" selected>&nbsp;磬苑校区&nbsp;</option>
<option value="龙河校区">&nbsp;龙河校区&nbsp;</option>
<%
}else if(school.equals("龙河校区"))
{
%>
<option value=0>&nbsp;请选择校区&nbsp;</option>
<option value="磬苑校区">&nbsp;磬苑校区&nbsp;</option>
<option value="龙河校区" selected>&nbsp;龙河校区&nbsp;</option>
<%
}else if(school.equals("0"))
{
%>
<option value=0 selected>&nbsp;请选择校区&nbsp;</option>
<option value="磬苑校区">&nbsp;磬苑校区&nbsp;</option>
<option value="龙河校区">&nbsp;龙河校区&nbsp;</option>
<%
}
%>
</td>
<td width=45%>请选择校区</td>
</tr>
<tr>
<td width=20%>&nbsp;选择楼群</td>
<td width=35%>
<select name="buildinggroup" size=1 onChange=change()>
<option value=0 selected>&nbsp;请选择楼群&nbsp;</option>
<%
String group="";
try
    {
        //String spath = "D://__办公系统数据库/BasicDataSets.mdb";
        //String dbpath = application.getRealPath(spath);
        String dbname = "";
        String user = "";
        String url ="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=D://__办公系统数据库/BasicDataSets.mdb";
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection conn= DriverManager.getConnection(url);
        Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
        String sql = "select * from buildinggrouplist where school='"+school+"'";
        ResultSet rs;
        rs=stmt.executeQuery(sql);
        while(rs.next())
  {
    group=rs.getString("buildinggroup");
    if(group.equals(buildinggroup)){
%>
<option value=<%=buildinggroup%> selected>&nbsp;<%=buildinggroup%></option>
<%
}else{
%>
<option value=<%=group%>>&nbsp;<%=group%></option>
<%
}
  }//end while
  conn.close();
 }catch(Exception e){
 out.print("<p>&nbsp;</p><p>&nbsp;</p>");
out.print(info.print("数据库连接错误!,错误信息如下:<br>"+e.getMessage()+"<br><br><a href=student.jsp>请返回</a>"));
   }
%>
</select></td>
<td width=45%>请选择楼群</td>
</tr>
<tr>
<td width=20%>&nbsp;选择楼号</td>
<td width=35%>
<select name="building" size=1 onChange=change()>
<option value=0 selected>&nbsp;请选择楼号&nbsp;</option>
<%
String louhao="";
try
    {
        //String spath = "D://__办公系统数据库/BasicDataSets.mdb";
        //String dbpath = application.getRealPath(spath);
  String dbname = "";
        String user = "";
        String url ="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=D://__办公系统数据库/BasicDataSets.mdb";
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection conn= DriverManager.getConnection(url);
        Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
        String sql = "select * from buildinglist where buildinggroup='"+buildinggroup+"'";
        ResultSet rs;
        rs=stmt.executeQuery(sql);
        while(rs.next())
  {
    louhao=rs.getString("building");
    if(louhao.equals(building)){
%>
<option value=<%=building%> selected>&nbsp;<%=building%></option>
<%
}else{
%>
<option value=<%=louhao%>>&nbsp;<%=louhao%></option>
<%
}
  }//end while
  conn.close();
 }catch(Exception e){
 out.print("<p>&nbsp;</p><p>&nbsp;</p>");
out.print(info.print("数据库连接错误!,错误信息如下:<br>"+e.getMessage()+"<br><br><a href=student.jsp>请返回</a>"));
   }
%>
</select></td>
<td width=45%>请选择楼号</td>
</tr>
<tr>
<td width=20%>&nbsp;选择寝室</td>
<td width=35%>
<select name="room" size=1 onChange=change()>
<option value=0 selected>&nbsp;请选择寝室&nbsp;</option>
<%
String qinshi="";
try
    {
        //String spath = "D://__办公系统数据库/BasicDataSets.mdb";
        //String dbpath = application.getRealPath(spath);
  String dbname = "";
        String user = "";
        String url ="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=D://__办公系统数据库/BasicDataSets.mdb";
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection conn= DriverManager.getConnection(url);
        Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
        String sql = "select room from building where school='"+school+"' and buildinggroup='"+buildinggroup+"' and building='"+building+"'";
        ResultSet rs;
        rs=stmt.executeQuery(sql);
        while(rs.next())
  {
    qinshi=rs.getString("room");
    if(qinshi.equals(room)){
%>
<option value=<%=room%> selected>&nbsp;<%=room%></option>
<%
}else{
%>
<option value=<%=qinshi%>>&nbsp;<%=qinshi%></option>
<%
}
  }//end while
  conn.close();
 }catch(Exception e){
 out.print("<p>&nbsp;</p><p>&nbsp;</p>");
out.print(info.print("数据库连接错误!,错误信息如下:<br>"+e.getMessage()+"<br><br><a href=student.jsp>请返回</a>"));
   }
%>
</select></td>
<td width=45%>请选择寝室</td>
</tr>
<tr>
<td width=20%>&nbsp;选择信息点</td>
<td width=35%>
<select name="port" size=1>
<option value=0 selected>&nbsp;选择信息点&nbsp;</option>
<option value="D1">&nbsp;D1&nbsp;</option>
<option value="D2">&nbsp;D2&nbsp;</option>
</select></td>
<td width=45%>请选择信息点</td>
</tr>
<tr>
<td width=20%>&nbsp;联系电话</td>
<td width=35%><input type="text" name="contact">
</td>
<td width=45%>请填写正确号码,以便与您联系</td>
</tr>
</table>
</td>
</tr>
<tr height=20><td align=center><input type="button" value=" 提交 " name=button1 OnClick='CheckData()'>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name=reset value=" 重填 ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=student.jsp>返回主页</a></td></tr>
</table>
</form>
</table>
<br>
<table align=center>
<tr><td height=20 align=center><font color=green>安徽大学网络中心<br>2007年7月</font></td></tr>
</table>
<%
}//end else (status.equals("已解决(未确认)"))
}//end else ((time-Double.valueOf(id))<7186800.0)
%>
</body>
</html>
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载