📄 helthy.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
grade=request("grade")
classes=request("classes")
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")
yf=request("yf")
wf=request("wf")
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,grade,classes,age,high,weight,light1,light2,pblood1,pblood2,lblood,illh,tp,document)"
sql=sql & " values('"& sname &"','" & grade & "','" & classes & "','" & age & "','"& high &"','"& weight &"','"& light1 &"','"& light2 &"','"& pblood1 &"','"& pblood2 &"','"& lblood &"','"& illh &"','"& tp &"','"& document &"')"
conn.execute sql
end if
end if
end if
end if 'if id<>""r的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;
}
.style2 {color: #990000}
-->
</style>
<script language="javascript">
function check(){
if(form1.sname.value==""){
alert("学生姓名不能为空!");
form1.sname.focus;
return false;
}
else if(form1.grade.value==-1){
alert("请选择学生的年级!");
form1.grade.focus;
return false;
}
else if(form1.classes.value==-1){
alert("请选择学生的班级!");
form1.classes.focus;
return false;
}
//else if(unEscape(form1.age.value)==65){
//alert("学生年龄输入错误!");
//form1.age.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="helthy.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" class="botton">学生健康档案 </a> ----> <a href="thelthy.asp">教师健康档案 </a></td>
</tr>
<tr>
<td><hr size="1"align="left" noshade></td>
</tr>
<tr>
<td> </td>
</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="38"> 年 级:
<select name="select" id="select">
<option value="幼儿小班" <%if rs("grade")="幼儿小班" then%>
selected
<%end if%>>幼儿小班</option>
<option value="幼儿中班" <%if rs("grade")="幼儿中班" then%>
selected
<%end if%>>幼儿中班</option>
<option value="幼儿大班" <%if rs("grade")="幼儿大班" then%>
selected
<%end if%>>幼儿大班</option>
<option value="学前班" <%if rs("grade")="学前班" then%>
selected
<%end if%>>学前班</option>
<option value="一年级"
<%if rs("grade")="一年级" then%>
selected
<%end if%>
>一年级</option>
<option value="二年级"
<%if rs("grade")="二年级" then%>
selected
<%end if%>
>二年级</option>
<option value="三年级"
<%if rs("grade")="三年级" then%>
selected
<%end if%>
>三年级</option>
<option value="四年级"
<%if rs("grade")="四年级" then%>
selected
<%end if%>
>四年级</option>
<option value="五年级"
<%if rs("grade")="五年级" then%>
selected
<%end if%>
>五年级</option>
<option value="六年级"
<%if rs("grade")="六年级" then%>
selected
<%end if%>
>六年级</option>
<option value="初一"
<%if rs("grade")="初一" then%>
selected
<%end if%>
>初一</option>
<option value="初二"
<%if rs("grade")="初二" then%>
selected
<%end if%>
>初二</option>
<option value="初三"
<%if rs("grade")="初三" then%>
selected
<%end if%>
>初三</option>
<option value="高一"
<%if rs("grade")="高一" then%>
selected
<%end if%>
>高一</option>
<option value="高二"
<%if rs("grade")="高二" then%>
selected
<%end if%>
>高二</option>
<option value="高三"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -