<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <%Option Explicit%> <% 'If the user is already logged in, then redirect him to the logged in chat room If Session("UserLoggedIn") Then Server.Transfer("/ChatRoom/ChatRoom.asp") 'Declare the variables needed Dim Page, rsPageDetails, Content, rsChatRoomStats, CounselorCount, PatientCount 'Open the connection to the database OpenDatabase 'Set the title of the page to be read Page = "Beating Alcohol Chat Room" 'Read the details of the page Set rsPageDetails = DSource.Execute("SELECT * FROM [Site Content] WHERE [Page] = '" & Page & "'") 'Check if the page details were found or not If rsPageDetails.EOF Then 'Report the error Session("Message") = "Invalid page requested or page not found." Response.Redirect("Messages.asp") End If 'Store the content Title = Trim(rsPageDetails("Title")) Content = Trim(rsPageDetails("Content")) 'Close the open recordset rsPageDetails.Close 'Retrieve the chat room stats Set rsChatRoomStats = DSource.Execute("SELECT COUNT([User ID]) AS [Counselor Count] FROM [Chat Room Users] WHERE ([User ID] NOT IN (SELECT [User ID] FROM Users WHERE ([User Type] = '" & USERTYPEPATIENT & "')))") If rsChatRoomStats.EOF Then 'Report the error Session("Message") = "The chat room is currently unavailable. Please check again later." Server.Transfer("Messages.asp") End If CounselorCount = CInt(Trim(rsChatRoomStats("Counselor Count"))) rsChatRoomStats.Close Set rsChatRoomStats = DSource.Execute("SELECT COUNT([User ID]) AS [Patient Count] FROM [Chat Room Users] WHERE ([User ID] IN (SELECT [User ID] FROM Users WHERE ([User Type] = '" & USERTYPEPATIENT & "')))") If rsChatRoomStats.EOF Then 'Report the error Session("Message") = "The chat room is currently unavailable. Please check again later." Server.Transfer("Messages.asp") End If PatientCount = CInt(Trim(rsChatRoomStats("Patient Count"))) rsChatRoomStats.Close %> <% = Title %>
<% = Content %>
CHAT ROOM LOGIN
Username
Password
 
 

CHAT ROOM REGISTRATION
First Name
Last Name
Email Address
 
Username
Password
Retype Password
 
<% If Session("Message") <> "" Then %> <% 'Clear the message Session("Message") = "" End If %>