>
<%
Set DBConn=Server.CreateObject("ADODB.Connection")
DBConn.Open DB_LOGON_STRING
CrewId=Session("CrewId")+0
If CrewId=0 Then 'this is a new rego
SQL="SELECT COUNT(1) AS PreviousEntries From CrewList WHERE Name='"&SqlQuote(Session("Crewmember_Name"))&"'"
Set Prev=DBConn.Execute(SQL)
If Prev("PreviousEntries")>0 Then
Response.Write "'"&Session("Crewmember_Name")&"' has already registered."
Response.End
End If
SQL="SELECT MAX(CrewId) AS MaxCrewID From CrewList"
Set Max=DBConn.Execute(SQL)
' If Max("MaxCrewID") > 0 Then
' Response.Write "Max CrewId is '"&Max("MaxCrewID")&"'."
' Response.End
' End If
CrewId = Max("MaxCrewID") + 1
' SQL="INSERT INTO CrewList(Name) VALUES ('"&SqlQuote(Session("Crewmember_Name"))&"')"
SQL="INSERT INTO CrewList(CrewId, Name) VALUES ('"&SqlQuote(CrewId)&"', '"&SqlQuote(Session("Crewmember_Name"))&"')"
DBConn.Execute(SQL)
SQL="SELECT * FROM CrewList WHERE Name='"&SqlQuote(Session("Crewmember_Name"))&"'"
Set CrewIdSelect=DBConn.Execute(SQL)
CrewId=CrewIdSelect("CrewId")
Else 'its an update
SQL="UPDATE Crewlist SET Name='"&SqlQuote(Session("Crewmember_Name"))&"' WHERE CrewId="&CrewId
DBConn.Execute(SQL)
End If
StringFields=Array( _
"Comments", _
"Email", _
"Gender", _
"Postcode", _
"Primary_Phone", _
"Secondary_Phone", _
"State", _
"Street", _
"Suburb", _
"Pos_Foredeck", _
"Pos_Grinder", _
"Pos_Helm", _
"Pos_Jib_Trimmer", _
"Pos_Main_Trimmer", _
"Pos_Mast", _
"Pos_Sewer", _
"Pos_Tactician", _
"DOB" _
)
NumericFields=Array( _
"Weight", _
"Exp_Cruising", _
"Exp_Deliveries", _
"Exp_Harbour_Racing", _
"Exp_Offshore", _
"Exp_Short_Haul" _
)
ExperiencedFields=Array( _
)
BooleanFields=Array( _
"Avail_Cruising", _
"Avail_Deliveries", _
"Avail_Friday_Twilight", _
"Avail_Harbour", _
"Avail_Hobart", _
"Avail_Monday_Twilight", _
"Avail_Offshore", _
"Avail_Saturday", _
"Avail_Short_Haul", _
"Avail_Short_Notice", _
"Avail_Sunday", _
"Avail_Twilight", _
"Avail_Wednesday_Afternoon", _
"Avail_Wednesday_Twilight", _
"Avail_Weekend", _
"Qual_Auto_Helm", _
"Qual_C1", _
"Qual_C10", _
"Qual_C2", _
"Qual_C3", _
"Qual_C4", _
"Qual_C5", _
"Qual_C6", _
"Qual_C7", _
"Qual_C8", _
"Qual_C9", _
"Qual_Celestial", _
"Qual_Deisel_Maintenance", _
"Qual_First_Aid", _
"Qual_GPS", _
"Qual_Radio_Licence", _
"Qual_Sail_Repair", _
"Qual_Yachtmaster", _
"Qual_SSSC", _
"Smoker" _
)
'save the string values
SQL="UPDATE Crewlist SET "
For I=LBound(StringFields) To UBound(StringFields)
ThisField=StringFields(I)
S=Session(ThisField)
if (I>=1) Then
SQL=SQL&","
End If
SQL=SQL&ThisField&"='"&SQLQuote(S)&"' "
Next
SQL=SQL&" WHERE CrewId="&CrewId
DBConn.Execute(SQL)
'save the BOOLEAN values
SQL="UPDATE Crewlist SET "
For I=LBound(BooleanFields) To UBound(BooleanFields)
ThisField=BooleanFields(I)
If (Session(ThisField)="") Then
S="N"
ElseIf (Session(ThisField)="N") Then
S="N"
Else
S="Y"
End If
if (I>=1) Then
SQL=SQL&","
End If
SQL=SQL&ThisField&"='"&S&"' "
Next
SQL=SQL&" WHERE CrewId="&CrewId
'Response.Write(SQL)
DBConn.Execute(SQL)
'save the Numeric values
SQL="UPDATE Crewlist SET "
For I=LBound(NumericFields) To UBound(NumericFields)
ThisField=NumericFields(I)
If (IsNumeric(Session(ThisField))) Then
S=Session(ThisField)
Else
S="0"
End If
if (S="") Then
S="0"
End If
if (I>=1) Then
SQL=SQL&","
End If
SQL=SQL&ThisField&"="&S
Next
SQL=SQL&" WHERE CrewId="&CrewId
'Response.Write(SQL)
DBConn.Execute(SQL)
SQL="UPDATE Crewlist SET Visible='Y',Refreshed_Date=GETDATE() WHERE CrewId="&CrewId
DBConn.Execute(SQL)
Session.Abandon ' need to clear everything so someone can enter bulk transactions without having to exit browser
%>
Thank you for registering with the Pacific
Sailing Crew Registry. Your skills have been assessed as follows:
<%
ListingTypes=Array( _
"Offshore Racing", _
"Harbour Racing", _
"Cruising", _
"Delivery" _
)
Response.Write ""&Chr(10)
Response.Write "| Event Type | Your Suitability |
"&Chr(10)
For I=LBound(ListingTypes) To UBound(ListingTypes)
ThisListing=ListingTypes(I)
Response.Write "| "&ThisListing&" | "&Chr(10)
SQL=CrewRatingSQL(ThisListing,CrewId)
Set CrewMember=DBConn.Execute(SQL)
If CrewMember.EOF Then
Rating="Not Available"
Else
If CrewMember("Score")>10 Then
Rating="Qualified,Recommended"
ElseIf CrewMember("Score")>5 Then
Rating="Qualified"
Else
Rating="Not Assessed"
End If
End If
Response.Write ""&Rating&" |
"&Chr(10)
Next
Response.Write "
"&Chr(10)
%>
A suitability rating of 'not assessed' indicates that the Pacific Sailing School has
not certified your competencies in this area. For further information on how the Pacific
Sailing School can help you with crew positions or upgrade your skills please call us on
02 9326 2399 or email info@pacificsailingschool.com.au.
This registration will remain visible for 60 days. If you have an email address you
will be contacted automatically to confirm whether you would like to remain on the
register. If you do not have an email address, please call the Pacific Sailing School
office on 02 9326 2399 within 60 days.