📄 thelthy.asp
字号:
<!--#include file="conn1.asp"-->
<%
id=request("id")
if id<>"" then
sql="select * from student where id="& id
set rs=conn.execute (sql)
else
sname=request("sname")
if sname<>"" then
bm=request("bm")
age=request("age")
'response.write(age)
'response.end
high=request("high")
weight=request("weight")
light1=request("light1")
light2=request("light2")
pblood1=request("pblood1")
pblood2=request("pblood2")
lblood=request("lblood")
illh=request("illh")
tp="教师"
document=request("document")
if sname<>"" then '如果用户的姓名已录入,显示;否则添加用户信息!
Set rs = Server.CreateObject("adodb.recordset") '如果用户的姓名已录入,显示;否则添加用户信息!
sql="select * from student where sname='"& sname &"'"
rs.open sql,conn,1,3
if not rs.eof then
rs("sname")=sname
rs("grade")=grade
rs("classes")=classes
rs("age")=age
rs("high")=high
rs("weight")=weight
rs("light1")=light1
rs("light2")=light2
rs("pblood1")=pblood1
rs("pblood2")=pblood2
rs("lblood")=lblood
rs("illh")=illh
rs.update
td="恭喜你,信息修改成功!"
else
td="恭喜你,信息添加成功"
sql="insert into student (sname,bm,age,high,weight,light1,light2,pblood1,pblood2,lblood,illh,tp,document)"
sql=sql & " values('"& sname &"','" & bm & "','" & age & "','"& high &"','"& weight &"','"& light1 &"','"& light2 &"','"& pblood1 &"','"& pblood2 &"','"& lblood &"','"& illh &"','"& tp &"','"& document &"')"
conn.execute sql
end if
end if
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css">
<title>教师健康档案</title>
<style type="text/css">
<!--
body {
background-color: #d6dff7;
}
.style1 {color: #990000}
-->
</style>
<script language="javascript">
function check(){
if(form1.sname.value==""){
alert("教师姓名不能为空!");
form1.sname.focus;
return false;
}
else if(form1.bm.value==-1){
alert("请选择所属部门!");
form1.bm.focus;
return false;
}
else {
return true;
}
}
</script>
</head>
<body>
<table width="413" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="534"></td>
</tr>
<tr>
<td><form name="form1" method="post" action="thelthy.asp" onsubmit="return check()">
<table width="530" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="32"> </td>
</tr>
<tr>
<td width="506">>>>>>录入 ----> <a href="helthy.asp">学生健康档案 </a> ----> <a href="thelthy.asp" class="aaaa">教师健康档案</a> </td>
</tr>
<tr>
<td><hr size="1"align="left" noshade></td>
</tr>
<tr>
<td> </td>
</tr>
</tr>
<%if id<>"" then%>
<%if not rs.eof then%>
<tr>
<td align="center" valign="top"><table width="441" border="1" cellpadding="0" cellspacing="0" bordercolor="#BFCDF2">
<tr>
<td width="407" height="32"> 姓 名:
<input name="sname" type="text" id="sname" value="<%=rs("sname")%>">
</td>
</tr>
<tr>
<td height="31"> 部 门:
<select name="bm" >
<option value="幼儿园"<%if rs("bm")="幼儿园" then%> selected <%end if%>>幼儿园</option>
<option value="小学部"<%if rs("bm")="小学部" then%> selected <%end if%>>小学部</option>
<option value="初中部"<%if rs("bm")="初中部" then%> selected <%end if%>>初中部</option>
<option value="高中部"<%if rs("bm")="高中部" then%> selected <%end if%>>高中部</option>
<option value="餐厅"<%if rs("bm")="餐厅" then%> selected <%end if%>>餐厅</option>
<option value="行政部"<%if rs("bm")="行政部" then%> selected <%end if%>>行政部</option>
<option value="其它"<%if rs("bm")="其它" then%> selected <%end if%>>其它</option>
</select>
</td>
</tr>
</tr>
<tr>
<td height="31"> 年 龄:
<input name="age" type="text" size="10" value="<%=rs("age")%>"></td>
</tr>
<tr>
<td height="33"> 血 型:<%=rs("lblood")%>
<select name="lblood" id="select4">
<option value="未知" <%if rs("lblood")="未知" then%> selected <%end if%>>未知</option >
<option value="A型"<%if rs("lblood")="A型" then%> selected <%end if%>>A</option >
<option value="B型"<%if trim(rs("lblood"))="B型" then%> selected <%end if%>>B</option >
<option value="AB型"<%if rs("lblood")="AB型" then%> selected <%end if%>>AB</option>
<option value="O型"<%if rs("lblood")="O型" then%> selected <%end if%>>O</option>
<option value="X型"<%if rs("lblood")="X型" then%> selected <%end if%>>其它</option>
</select></td>
</tr>
<tr>
<td height="30"> 体 重:
<input name="weight" type="text" id="weight" size="10" value="<%=rs("weight")%>">
KG 身 高:
<input name="high" type="text" id="high" size="10" value="<%=rs("high")%>">
CM</td>
</tr>
<tr>
<td height="33"> 血 压:
<input name="pblood1" type="text" id="plblood12" size="8" value="<%=rs("pblood1")%>">
----
<input name="pblood2" type="text" id="pblood22" size="8" value="<%=rs("pblood2")%>"></td>
</tr>
<tr>
<td height="33"> 视力:左
<input name="light1" type="text" id="light1" size="10" value="<%=rs("light1")%>">
右
<input name="light2" type="text" id="light2" size="10" value="<%=rs("light2")%>">
</td>
</tr>
<tr>
<td height="31"> 已 付:
<input name="yf" type="text" id="yf" size="10">
未 付:
<input name="wf" type="text" id="wf" size="10">
元</td>
</tr>
<tr>
<td height="18" valign="top"> 传染病病史:</td>
</tr>
<tr>
<td height="83" align="center" valign="top">
<textarea name="illh" cols="50" rows="5" id="illh"><%=rs("illh")%></textarea></td>
</tr>
<tr>
<td height="28"> 备 注:</td>
</tr>
<tr>
<td height="85" align="center">
<textarea name="document" cols="50" rows="5" id="textarea"><%=rs("document")%>
</textarea></td>
</tr>
<tr>
<td align="center" valign="top"><input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置"></td>
</tr>
<%else%>
<tr>
<td align="center" valign="top"> 对不起!您的选择有误请重试!</td>
</tr>
<%end if %>
<%else%>
<tr>
<td align="center" valign="top"><table width="441" border="1" cellpadding="0" cellspacing="0" bordercolor="#BFCDF2">
<tr>
<td width="407" height="32"> 姓 名:
<input name="sname" type="text" id="sname">
</td>
</tr>
<tr>
<td height="31"> 部 门:
<select name="bm" >
<option value="-1" selected>请选择</option>
<option value="-1">-------</option>
<option value="幼儿园">幼儿园</option>
<option value="小学部">小学部</option>
<option value="初中部">初中部</option>
<option value="高中部">高中部</option>
<option value="餐厅">餐厅</option>
<option value="行政部">行政部</option>
<option value="其它">其它</option>
</select>
</td>
</tr>
<tr>
<td height="31"> 年 龄:
<input name="age" type="text" size="10"></td>
</tr>
<tr>
<td height="33"> 血 型:
<select name="lblood" id="select4">
<option value="未知" selected>请选择</option>
<option value="A型">A</option>
<option value="B型">B</option>
<option value="AB型">AB</option>
<option value="O型">O</option>
<option value="X型">其它</option>
</select></td>
</tr>
<tr>
<td height="30"> 体 重:
<input name="weight" type="text" id="weight" size="10">
KG 身 高:
<input name="high" type="text" id="high" size="10">
CM</td>
</tr>
<tr>
<td height="33"> 血 压:
<input name="pblood1" type="text" id="plblood12" size="8">
----
<input name="pblood2" type="text" id="pblood22" size="8"></td>
</tr>
<tr>
<td height="33"> 视力:左
<input name="light1" type="text" id="light1" size="10">
右
<input name="light2" type="text" id="light2" size="10">
</td>
</tr>
<tr>
<td height="31"> 已 付:
<input name="yf" type="text" id="yf" size="10">
未 付:
<input name="wf" type="text" id="wf" size="10">
元</td>
</tr>
<tr>
<td height="18" valign="top"> 传染病病史:</td>
</tr>
<tr>
<td height="83" align="center" valign="top">
<textarea name="illh" cols="50" rows="5" id="illh"></textarea></td>
</tr>
<tr>
<td height="28"> 备 注:</td>
</tr>
<tr>
<td height="85" align="center">
<textarea name="document" cols="50" rows="5" id="textarea"></textarea></td>
</tr>
<tr>
<td align="center" valign="top"><input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置"></td>
</tr><%end if %>
</table></td>
</tr>
<tr>
<td height="43" align="center"><%=td%></td>
</tr>
<tr>
<td align="center"><!--#include file="foot.asp"--></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -