<%@ Language=VBScript %> <% on error resume next Server.Execute("../Common/Dbase/connection.asp") %> <% if (session("student") = "" )then 'response.Write " No session established.You need to start from the home page. Please proceed from the home page." 'Response.End end if %> <% ' *********** This is the code included by Srini ****** 'Session variable name not yet decided, hence code left commented. 'if(Session("UserName"))="" then 'response.Redirect("first.asp") 'end if dim instruct_id dim instructor_id dim inst_code inst_code ="" inst_code = request.QueryString ("institute") dim institution_code institution_code = Clng (inst_code) instructor_id = Clng(request.QueryString ("instructorid")) request.QueryString ("instructorid ") %> IT Fundamentals



<% ' Case 1 'If no institution is selected, then disable the dropdown. if institution_code = 0 then%> <% end if %> <% if institution_code > 0 then%> <% end if %> <% ' Control is directed to this loop when the page is requested for the first time i.e., ' there is no query string value to retrieve ' The value of inctructor ID is taken from the first record of the [InstitutionInstructor] ' table. ' The instructor ID is used then to retrieve the classes pertaining to that instructor ' from the [Classes]table. %> <% ' Case 1 ' instructor_id is initialized through the querystring from change_checkbox2() if (institution_code = 0) and (instructor_id = 0) then %> <% end if %> <% ' Control is directed to this section when changes ' are made to the institution drop down list if institution_code > 0 then if instructor_id = 0 then %> <% end if end if %> <% ' Control is passed on to this section when the instructor is chosen from the instructor ' dropdown list.Classes change accordingly. if (institution_code > 0) and (instructor_id > 0) then SQL4 = "SELECT * FROM Classes WHERE InstructorID="& instructor_id result4.open SQL4,connection %> <% end if result.Close result2.Close result3.Close result4.Close result9.Close result10.Close set result = nothing set result2 = nothing set result3 = nothing set result4 = nothing set result9 = nothing set result10 = nothing %>

<% If (EnablePassword=true) then%> <%else%>   <%end if%>
Select your institution:
Select your instructor:
<% SQL2 = "SELECT * FROM [InstitutionInstructor] WHERE InstitutionID =" &institution_code result2.open SQL2,connection dim instructor_no instructor_no = result2(1) 'If there are more than one instructors in [InstitutionInstructor] table 'each of them are displayed in the instructor dropdown list box %> <% 'if there are no instructors, then disable the dropdown and display an alert. if (result2.EOF) then %> There are no instructors registered for this institution.
You can register as an independent student by clicking here. <%else%>
Select class:
<%if result4.EOF then%> The Instructor has not yet created a class for you to enroll in.
Did you choose the correct instructor from the list? If not, go back to the dropdown list.
If there is no class to enrol in, please enroll as an independent student by clicking here. <%else EnablePassword=true %>
Enter the class password:
Enter the class password: