📄 appendlist.asp
字号:
end if
sql="select collector from [append] where id="&appendid
set rs=conn.execute(sql)
if rs(0)<>membername and bisystemadmin=false and isclassadmin(0)=false then
errmsg=errmsg+"<br>"+"<li>操作失败!您没有操作权限!"
founderr=true
call error(errmsg)
exit sub
end if
sql="delete from [append] where id="&appendid
conn.execute(sql)
sql="update [student] set point=point+"&pDelAppend&" where userid='"&rs(0)&"'"
conn.execute(sql)
set rs=nothing
call endconnection()
call delsuccess()
end sub
sub delsuccess()
%>
<br><br>
<table cellpadding=0 cellspacing=0 border=0 width=75% align=center bgcolor=<%=tablebordercolor%>>
<tr>
<td>
<table cellpadding=3 cellspacing=1 border=0 width=100%>
<tr align="center">
<td width="100%" bgcolor=<%=tabletitlecolor%>>成功:删除同学信息</td>
</tr>
<tr align="center">
<td width="100%" bgcolor=<%=tablebodycolor2%>><br> 删除同学信息成功!</b><br><br>
</td>
</tr>
<tr align="center">
<td width="100%" bgcolor=<%=tabletitlecolor%>>
<a href="javascript:history.go(-1)"> << 返回上一页</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
end sub
sub editform()
appendID=request("id")
set rs=conn.execute("select * from [append] where id="&appendID)
if rs.eof or rs.bof then
errmsg=errmsg+"<br>"+"<li>非法操作,该教师的信息不存在"
call error(errmsg)
else
%>
<br><br>
<script language="JavaScript" src="script/jsfun.js"></script>
<form style="MARGIN: 0px" name="frmteach" action="appendlist.asp" method="post"
onsubmit="return submitonce(this)">
<input type="hidden" name="appendid" value="<%=appendID%>">
<input type="hidden" name="action" value="modify">
<table border="0"
cellspacing="1" width="400" cellpadding="6" bgcolor="<%=tablebordercolor%>" align=center>
<tr bgcolor=<%=tabletitlecolor%>>
<td colspan=2 align=center><img height="35" src="images/icon04.gif" width="35" align="absMiddle"> 修改附加通信录</td></tr>
<tr bgcolor=<%=tablebodycolor2%>>
<td height="13" align=center>同学姓名 </td>
<td><input size="30" name="name" maxlength=16 value=<%=htmlencode(rs("name"))%>></td>
</tr>
<tr bgcolor=<%=tablebodycolor2%>>
<td height="13" align=center>联系电话 </td>
<td><input size="30" name="telephone" value=<%=htmlencode(rs("telephone"))%>></td>
</tr>
<tr bgcolor=<%=tablebodycolor2%>>
<td align=center>通信地址 </td>
<td><input size="30" name="address" value=<%=htmlencode(rs("address"))%>></td>
</tr>
<tr bgcolor=<%=tablebodycolor2%>>
<td align=center>邮政编码 </td>
<td><input size="30" name="zipcode" maxlength=6 value=<%=htmlencode(rs("zipcode"))%>></td>
</tr>
<tr bgcolor=<%=tablebodycolor2%>>
<td valign="center" align=center>其他信息 </td>
<td><textarea rows="4" cols="30" name="other" value=<%=htmlencode(rs("other"))%>></textarea></td>
</tr>
<tr bgcolor=<%=tablebodycolor1%>>
<td colspan=2 valign=center><img src=images/passwd.gif> 注意:只有你和班级管理员才有权修改和删除你录入的通信资料!</td>
</tr>
<tr bgcolor=<%=tabletitlecolor%>>
<td height="30" align="center" colspan=2>
<input style="WIDTH: 80px; HEIGHT: 20px" type="submit" value="提交修改(S)" name="submit">
<input style="WIDTH: 80px; HEIGHT: 20px" type="reset" value="重新填写(R)"
name="reset"> </td>
</tr>
</table>
</form>
</body>
</html>
<%
end if
set rs=nothing
call endconnection()
end sub
sub modify()
appendid=request.form("appendid")
if appendid="" then
errmsg=errmsg+"<br>"+"<li>没有操作请求,您正试图进行非法操作!"
founderr=true
call error(errmsg)
exit sub
end if
sql="select collector from [append] where id="&appendid
set rs=conn.execute(sql)
if rs(0)<>membername and bisystemadmin=false and isclassadmin(0)=false then
errmsg=errmsg+"<br>"+"<li>操作失败!您没有操作权限!"
founderr=true
call error(errmsg)
exit sub
end if
set rs=nothing
if chkinput=true then
name=trim(request.form("name"))
telephone=trim(request.form("telephone"))
address=trim(request.form("address"))
zipcode=trim(request.form("zipcode"))
other=rtrim(request.form("other"))
rem adddate=year(date())&"年"&month(date())&"月"&day(date())&"日"
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from [append] where id="&clng(appendid)
rs.open sql,conn,1,3
rs("name")=name
rs("collector")=membername
if telephone<>"" then rs("telephone")=telephone
if address<>"" then rs("address")=address
if zipcode<>"" then rs("zipcode")=zipcode
if other<>"" then rs("other")=other
rs.update
rs.close
sql="update [student] set point=point+"&pEditAppend&" where userid='"&membername&"'"
conn.execute(sql)
set rs=nothing
call endconnection()
call editsuccess()
end if
end sub
function chkinput()
name=trim(request.form("name"))
if name="" then
errmsg=errmsg+"<br>"+"<li>请输入同学姓名"
founderr=true
elseif strlength(name)<4 or strlength(name)>8 then
errmsg=errmsg+"<br>"+"<li>同学姓名输入有误"
founderr=true
elseif not isChinese(name) then
errmsg=errmsg+"<br>"+"<li>同学姓名应为汉字"
founderr=true
end if
if founderr=true then
call error(errmsg)
chkinput=false
exit function
end if
telephone=trim(request.form("telephone"))
address=trim(request.form("address"))
if telephone="" and address="" then
errmsg=errmsg+"<br>"+"<li>对不起,您至少应留下一种与该同学联系的通信方式!"
founderr=true
end if
if telephone<>"" and not IsValidTel(telephone) then
errmsg=errmsg+"<br>"+"<li>电话号码输入错误"
founderr=true
end if
zipcode=trim(request.form("zipcode"))
if address<>"" and zipcode="" then
errmsg=errmsg+"<br>"+"<li>请输入邮政编码"
founderr=true
end if
if zipcode<>"" and (strLength(zipcode)<>6 or not isinteger(zipcode)) then
errmsg=errmsg+"<br>"+"<li>邮政编码输入错误"
founderr=true
end if
if founderr=true then
call error(errmsg)
chkinput=false
else
chkinput=true
end if
end function
sub editsuccess()
%>
<br><br>
<table cellpadding=0 cellspacing=0 border=0 width=75% align=center bgcolor=<%=tablebordercolor%>>
<tr>
<td>
<table cellpadding=3 cellspacing=1 border=0 width=100%>
<tr align="center">
<td width="100%" bgcolor=<%=tabletitlecolor%>>成功:修改同学信息</td>
</tr>
<tr align="center">
<td width="100%" bgcolor=<%=tablebodycolor2%>><br> 修改同学信息成功!</b><br><br>
</td>
</tr>
<tr align="center">
<td width="100%" bgcolor=<%=tabletitlecolor%>>
<a href="javascript:history.go(-1)"> << 返回上一页</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
end sub
%>
<!--#INCLUDE FILE="footer.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -