Network Examination Room (9) (turn) taddsub.asp

Source: Internet
Author: User
Tags join modify servervariables variable
Network <%@ language=vbscript%>
<%
If Request.ServerVariables ("http_method") = "Get" Then
' If you request a page as a GET, set the page number to 1
Page=1
End If
Set Rec=server. CreateObject ("Adodb.recordset")
Rec. activeconnection= "Dsn=testsys"
Rec. Source= "SELECT * from Subinfo where teachid= '" & Session ("Teachid") & "'"
' Find out the records of all teachid= current teacher numbers in the schedule
Rec. Open, 1,3
If Request.ServerVariables ("http_method") = "POST" Then
Page=cint (Request.Form ("page"))
If Request.Form ("submit") = "Join" Then
' Request to join a new course
Rec. AddNew
Rec ("Teachid") =session ("Teachid")
Rec ("sub") =request.form ("SubName")
Rec ("Testtime") =request.form ("Testtime")
Rec ("Testnum") =request.form ("Testnum")
Rec. Update
End If
If Request.Form ("submit") = "Modify" Then
' Request to process a course change
Rec. Pagesize=1
' Set the page number to the current page
Rec. Absolutepage=page
' Change according to the content of the course submitted
Rec ("Teachid") =session ("Teachid")
Rec ("sub") =request.form ("SubName")
Rec ("Testtime") =request.form ("Testtime")
Rec ("Testnum") =request.form ("Testnum")
Rec. Update
Page=cint (Request.Form ("page"))
ElseIf Request.Form ("submit") = "previous One" then
' If you want to display the previous record, then page number-1
Page=page-1
Else
' Required to display the following record, page +1
Page=page+1
End If
End If
If not rec. BOF and not rec. EOF Then
' If the course record is not empty
Rec. Pagesize=1
' Set the current record position according to the page number
Rec. Absolutepage=page
' Get course information based on current record
Subname=rec ("Sub")
Testtime=rec ("Testtime")
Testnum=rec ("Testnum")
If Page>1 Then
' If the page number >1, the string variable prebut= ' false ', depending on the variable
' Set the button in the Window_onload event (id=submit3,value= "previous")
' Disabled value determines whether the push button is available
' The following nextbut and revisebut variables act like
Prebut= "false"
Else
' If the current page number <0 set prebut= ' true ' Set ' previous ' button not available
Prebut= "true"
End If
If CInt (page) <rec. PageCount Then
' Current page number < maximum page number, set ' after ' button available
Nextbut= "false"
Else
' Set ' after ' button not available
Nextbut= "true"
End If
' Modify the button available
Revisebut= "false"
Else
Revisebut= "true"
Prebut= "true"
Nextbut= "true"
End If
Dim PageCount ' Total number of current courses
Pagecount=rec. PageCount
Rec. Close
Set rec=nothing
%>
<meta name= "Generator" content=&



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.