<% call openConn ("nothingtoit_7051") 'open a connection%> <% if request("action") = "" then 'this means they're here for the first time%>

Modify a Particular Class

This page will allow you to make updates to a particular class on a particular date and time.

Select a class, date and time combination: 

<%elseif request("action") = "step2" THEN 'they have already fulfilled the form, now they want to modify the class instance classdatetimeid = request.form("class_datetime_id") response.write "

Modify a Particular Class

" 'get the name of the class back... SQLstr = "SELECT [class_tbl].[class_name], [class_datetime_tbl].[class_datetime_id]" SQLstr = SQLstr & "FROM class_tbl INNER JOIN class_datetime_tbl ON [class_tbl].[class_id] " SQLstr = SQLstr & "=[class_datetime_tbl].[class_id] WHERE class_datetime_tbl.class_datetime_id = "&classdatetimeid&";" call openRS(SQLstr) response.write ""&rs("class_name") & "

" call closeRS 'get the information for that particular class... SQLstr = "SELECT * FROM class_datetime_tbl WHERE class_datetime_id = "&classdatetimeid&";" call openRS2(SQLstr) response.write "" response.write "
" response.write "" response.write "

Class date and time: 

" response.write "Class capacity: 

" response.write "Class enrolled: 

" instID = rs2("instructor_id") SQLstr = "SELECT * FROM instructor_tbl;" call openRS3(SQLstr) response.write "Class instructor: 

" call closeRS3 response.write "Class is sold out: 

" else response.write " >

" end if response.write "

" call closeRS2 Response.write "
" elseif request("action") = "modify" then 'they have already fulfilled the 2nd form, now they want to modify the class instance to the db classid = cint(request.form("classid")) classdatetime = cdate(request.form("classdatetime")) classcapacity = cint(request.form("classcapacity")) instructorid = cint(request.form("classinstructorid")) classenrolled = cint(request.form ("classenrolled")) classstatus = cbool(request.form ("classstatus")) response.write "

Modify a Particular Class

" SQLcmd = "UPDATE class_datetime_tbl SET instructor_id ="&instructorid&", class_datetime='"&classdatetime&"', class_capacity="&classcapacity&", class_enrolled="&classenrolled&", class_status="&classstatus&" WHERE class_datetime_id = "&classid&";" call openCMD(SQLcmd) Response.write "

The class instance has been modified in the database.

" end if%> <% call cleanup %>