📄 cmanad.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改毕业设计选题</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
body {
background-image: url(image/bg_002.gif);
}
-->
</style></head>
<script language="JavaScript" type="text/JavaScript">
function checkSmall()
{
if (document.form2.coId.value=="")
{
alert("毕业设计课题号不能为空!");
document.form2.cId.focus();
return false;
}
else if (document.form2.coName.value=="")
{
alert("毕业设计课题名不能为空!");
document.form2.coName.focus();
return false;
}
else if (document.form2.credit.value=="")
{
alert("学分不能为空!");
document.form2.credit.focus();
return false;
}
else if (document.form2.period.value=="")
{
alert("学时不能为空!");
document.form2.period.focus();
return false;
}
else if (document.form2.cNumAll.value=="")
{
alert("可选人数不能为空!");
document.form2.cNumAll.focus();
return false;
}
}
function setD()
{
document.forms[0].coId.disabled = true;
}
</script>
<body onload="setD()">
<%
String loginNum=(String)session.getAttribute("lnum");
String name=(String)session.getAttribute("name");
session.setAttribute("lnum",loginNum);
session.setAttribute("name",name);
String tId=null;
%>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"><br>
<form name="form2" method="post" action="cManaDInfo.jsp?coId=<%=request.getParameter("coId") %>" onsubmit="return checkSmall()">
<table width="350" border="0" align="center" cellpadding="0" cellspacing="2" class="border">
<tr bgcolor="#999999" class="title">
<td height="25" colspan="2" align="center"><strong>更改毕业设计课题</strong></td>
</tr>
<tr class="tdbg">
<td width="126" height="22" bgcolor="#C0C0C0"><div align="left"><strong>所属院系:</strong></div></td>
<td width="218" bgcolor="#E3E3E3">
<div align="left">
<select name="depName">
<%
try{
Connection connd=null;
Statement stmtd=null;
ResultSet rsd=null;
String dName=null;
String dId=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connd=DriverManager.getConnection("jdbc:odbc:xk","sa","");
String sqld="select * from department";
stmtd=connd.createStatement();
rsd=stmtd.executeQuery(sqld);
while(rsd.next())
{
dId=rsd.getString("dId");
dName=rsd.getString("dName");
out.print("<option value='"+dId+"'>"+dName+"</option>");
}
rsd.close();connd.close();stmtd.close();}
catch(Exception e){out.print(e);}
%>
</select>
</div></td>
</tr>
<tr class="tdbg">
<%
String coName1=null;
float credit1=0;
float period1=0;
String cTime1=null;
String cPlace1 = null;
int cNumAll1=0;
String intro1=null;
String coId1 =null;
coId1=request.getParameter("coId");
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Statement stmt=null;
ResultSet rs=null;
Connection conn=null;
conn=DriverManager.getConnection("jdbc:odbc:xk","sa","");
String sql="select * from course where coId='"+coId1+"'";
stmt=conn.createStatement();
rs=stmt.executeQuery(sql);
if(rs.next())
{
coName1=rs.getString(2);
credit1=rs.getFloat(4);
period1=rs.getFloat(5);
cTime1=rs.getString(6);
cPlace1=rs.getString(7);
cNumAll1=rs.getInt(8);
intro1=rs.getString("cIntro");
rs.close();conn.close();stmt.close();
}
}
catch(Exception e){out.print(e);}
%>
<td width="126" height="22" bgcolor="#C0C0C0"><div align="left"><strong>课题号:</strong></div></td>
<td bgcolor="#E3E3E3">
<div align="left">
<input name="coId" type="text" value="<%=coId1%>" id="coId" size="20" maxlength="30">
</div></td>
</tr>
<tr class="tdbg">
<td width="126" height="22" bgcolor="#C0C0C0"><div align="left"><strong>课题名:</strong></div></td>
<td bgcolor="#E3E3E3">
<div align="left">
<input name="coName" type="text" value="<%=coName1%>" id="coName" size="20" maxlength="30">
</div></td>
</tr>
<tr class="tdbg">
<td width="126" height="22" bgcolor="#C0C0C0"><div align="left"><strong>教师:</strong></div></td>
<td bgcolor="#E3E3E3">
<div align="left">
<select name="tId" id="tId">
<%
try{
Connection connd=null;
Statement stmtd=null;
ResultSet rsd=null;
String tName=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connd=DriverManager.getConnection("jdbc:odbc:xk","sa","");
String sqlt="select tId,tName from teacher where tId='"+name+"'";
stmtd=connd.createStatement();
rsd=stmtd.executeQuery(sqlt);
while(rsd.next())
{
tId=rsd.getString("tId");
tName=rsd.getString("tName");
out.print("<option value='"+tId+"'>"+tName+"</option>");
}
rsd.close();connd.close();stmtd.close();}
catch(Exception e){out.print(e);}
%>
</select>
</div></td>
</tr>
<tr class="tdbg">
<td width="126" height="22" bgcolor="#C0C0C0"><div align="left"><strong>学分:</strong></div></td>
<td bgcolor="#E3E3E3">
<div align="left">
<input name="credit" type="text" value="<%=credit1%>" id="credit" size="20" maxlength="30">
</div></td>
</tr>
<tr class="tdbg">
<td width="126" height="22" bgcolor="#C0C0C0"><div align="left"><strong>学时:</strong></div></td>
<td bgcolor="#E3E3E3">
<div align="left">
<input name="period" type="text"value="<%=period1%>" id="period" size="20" maxlength="30">
</div></td>
</tr>
<tr class="tdbg">
<td width="126" height="22" bgcolor="#C0C0C0"><div align="left"><strong>具体时间:</strong></div></td>
<td bgcolor="#E3E3E3">
<div align="left">
<input name="cTime" type="text" id="cTime" value="<%=cTime1%>" size="20" maxlength="30">
</div></td>
</tr>
<tr class="tdbg">
<td width="126" height="22" bgcolor="#C0C0C0"><div align="left"><strong>指导地点:</strong></div></td>
<td bgcolor="#E3E3E3">
<div align="left">
<input name="cPlace" type="text" value="<%=cPlace1%>"id="cPlace" size="20" maxlength="30">
</div></td>
</tr>
<tr class="tdbg">
<td width="126" height="22" bgcolor="#C0C0C0"><div align="left"><strong>可选人数:</strong></div></td>
<td bgcolor="#E3E3E3">
<div align="left">
<input name="cNumAll" type="text" value="<%=cNumAll1%>"id="cNumAll" size="20" maxlength="30">
</div></td>
</tr>
<tr class="tdbg">
<td width="126" height="22" bgcolor="#C0C0C0"><div align="left"><strong>课题简介:</strong></div></td>
<td bgcolor="#E3E3E3">
<div align="left">
<TEXTAREA class=textarea id=intro name=intro rows=5
cols=30><%=intro1%></TEXTAREA>
</div></td>
</tr>
<tr class="tdbg">
<td height="22" align="center" bgcolor="#C0C0C0"> </td>
<td height="22" align="center" bgcolor="#E3E3E3">
<div align="left">
<input name="Add" type="submit" value=" 修 改 ">
</div></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -