?? pingjiaok000.asp
字號:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="Function.asp"-->
<!--#include file="Odbc_connection.asp"-->
<%
On Error Resume Next
term=request.Form("addone_id")
course=request.Form("addtwo_id")
if term="請選擇教師開課學期" or course=Null or course="請選擇教師課程" then
response.write"<script>alert('請選擇開課學期和課程名稱!');location='pingjiaone.asp'</script>"
response.End()
end if
'''''''''''''----------------------------------------------------------------------------
'----------------不選擇學期和課程不能參加投票!!!!!!!!!!!!!!!!!!!!
depart=request.Form("depart")
teach=request.Form("teach")
strsql="select * from term where id="&term
set rs=db.execute(strsql)
term=cstr(rs("term"))
strsql="select * from TEACHERCOURSE where id="&course
set rs=db.execute(strsql)
course=cstr(rs("course"))
classok=rs("class1")
jishu=session("usertype") '--------------------
USERTYPE=session("usertype") '--------------------用戶的身份
shuliang=cint(session("jishu")) '--------------------for循環控制次數
userID=session("UserID")
IP=REQUEST.ServerVariables("REMOTE_ADDR") '------------返回用戶IP
Userclass=session("Userclass") '------------返回用戶所在班級
Userdepartment=session("Userdepartment") '----------用戶的系別
USERNAME=session("UserNAME")
'------------------------------------------------------------------------
'----------------------------------------------------------------------
for j=1 to shuliang
tt=request.Form("RAD"&j)&"*"&tt
next
LEN1=LEN(TT)
LEN1=LEN1-1
TT=LEFT(TT,LEN1)
'------------------------------------------------------------------------------------
strsql="select count(*) as total from TEACHERSCORE where term='"&term&"' and teacherid='"&teach&"' and course='"&course&"', and depart='"&depart&"' and userid='"&userid&"'"
set rs=db.execute(strsql)
total1=cint(rs("total"))
if total1>0 then
response.write"<script>alert('"&teach&"老師的"&total1&course&"\n您已經投過票了,不能重復投票"&"');location='pingjiaone.asp'</script>"
response.End()
end if
'----------------------------查看用戶是否選過了?????
'------------------------------------------------------------------------------------
db.begintrans
strsql="INSERT INTO TEACHERSCORE(TEACHERID,SCORE,USERID,USERTYPE,TERM,DEPART,COURSE,SUBMITDATE,IP,USERNAME)"
strsql=strsql&"values('"&teach&"','"&TT&"','"&userID&"',"&USERTYPE&",'"&term&"','"&depart&"','"&course&"',"&DATE()&",'"&IP&"','"&USERNAME&"')"
db.execute(strsql)
if db.errors.count=0 then
db.CommitTrans
response.write"<script>alert('評價填寫成功,歡迎再次參加!');location='pingjiaone.asp'</script>"
else
db.RollbackTrans
response.write"<script>alert('評價填寫中出現錯誤,請重新填寫!');location='pingjiaone.asp'</script>"
end if
'-------------------------------------------------------------------------------------------------------
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -