⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 appendlist.asp

📁 酷虎网同学录V1.0
💻 ASP
📖 第 1 页 / 共 2 页
字号:

sub confirm()
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("Exclamation",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="delete">
    <table cellpadding=0 cellspacing=0 border=0 width=350 bgcolor=<%=TableborderColor%> align=center>
        <tr>
            <td>
                <table cellpadding=5 cellspacing=1 border=0 width=100%>
    <tr align="center"> 
      <td width="100%" bgcolor=<%=TabletitleColor%>><font color="<%=TableFontColor%>"><b>同学录提示信息</b></font></td>
    </tr>
    <tr> 
      <td width="100%" bgcolor=<%=TablebodyColor2%> class=mp align=center valign=center><font color="<%=TableContentColor%>"><br>
<img src=images/question1.gif>&nbsp您是否真的要删除同学<font color="#cc0000"><b><%=rs("name")%></b></font>的信息?<br><br></font>
      </td>
    </tr>
    <tr align="center"> 
      <td width="100%" bgcolor=<%=TabletitleColor%>>
<input style="WIDTH: 80px; HEIGHT: 20px" type="submit" value="确认" name="submit">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input style="WIDTH: 80px; HEIGHT: 20px" type="button" value="取消"
             onclick="javascript:history.go(-1)">
      </td>
    </tr>  
    </table>   </td></tr></table></form>
<%
end if
set rs=nothing

end sub


sub delete()

appendid=request.form("appendid")

if appendid="" then
	errmsg=errmsg+"<br>"+"<li>没有操作请求,您正试图进行非法操作!"
	founderr=true
	call error("Exclamation",errmsg)
	exit sub
end if

sql="select collector from [append] where id="&appendid
set rs=conn.execute(sql)
if rs(0)<>membername and not sysadmin and isclassadmin(0)=false then
	errmsg=errmsg+"<br>"+"<li>操作失败!您没有操作权限!"
	founderr=true
	call error("Exclamation",errmsg)
	exit sub
end if

sql="update [student] set point=point+"&pDelAppend&" where userid='"&rs(0)&"'"
conn.execute(sql)

sql="delete from [append] where id="&appendid
conn.execute(sql)
set rs=nothing
stitle="删除同学信息"
smsg="删除同学信息成功!"
call success(stitle,smsg)




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("Exclamation",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">&nbsp;修改附加通信录</td></tr>
<tr bgcolor=<%=tablebodycolor2%>>
	<td height="13" align=center>同学姓名&nbsp;</td>
	<td><input size="30" name="name" maxlength=16 value=<%=htmlencode(rs("name"))%>></td>
</tr>
<tr bgcolor=<%=tablebodycolor2%>>
	<td height="13" align=center>联系电话&nbsp;</td>
	<td><input size="30" name="telephone"  value=<%=htmlencode(rs("telephone"))%>></td>
</tr>
<tr bgcolor=<%=tablebodycolor2%>>
	<td align=center>通信地址&nbsp;</td>
	<td><input size="30" name="address"  value=<%=htmlencode(rs("address"))%>></td>
</tr>
<tr bgcolor=<%=tablebodycolor2%>>
	<td align=center>邮政编码&nbsp;</td>
	<td><input size="30" name="zipcode" maxlength=6  value=<%=htmlencode(rs("zipcode"))%>></td>
</tr>
<tr bgcolor=<%=tablebodycolor2%>>
	<td valign="center" align=center>其他信息&nbsp;</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>&nbsp;注意:只有你和班级管理员才有权修改和删除你录入的通信资料!</td>
</tr>
<tr bgcolor=<%=tabletitlecolor%>>
	<td height="30" align="center" colspan=2>
	<input style="WIDTH: 80px; HEIGHT: 20px" type="submit" value="提交修改(S)" name="submit">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input style="WIDTH: 80px; HEIGHT: 20px" type="reset" value="重新填写(R)"
              name="reset"> </td>
</tr>
</table>
</form>
</body>
</html>

<%
end if
set rs=nothing
end sub


sub modify()

appendid=request.form("appendid")

if appendid="" then
	errmsg=errmsg+"<br>"+"<li>没有操作请求,您正试图进行非法操作!"
	founderr=true
	call error("Exclamation",errmsg)
	exit sub
end if

sql="select collector from [append] where id="&appendid
set rs=conn.execute(sql)
if rs(0)<>membername and not sysadmin and isclassadmin(0)=0 then
	errmsg=errmsg+"<br>"+"<li>操作失败!您没有操作权限!"
	founderr=true
	call error("Exclamation",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
	stitle="修改同学信息"
	smsg="修改同学信息成功!"
	call success(stitle,smsg)

end if

end sub

function chkinput()

if chkpost=false then
	ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法,请不要从同学录外部提交信息。"
	call error("Critical",errmsg)
	chkinput=false
	exit function
end if


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("Information",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("Information",errmsg)
	chkinput=false
else
	chkinput=true
end if
end function

%></td>
	</tr>
</table>

<%call footer%>





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -