File: D:/web/secure/csl/bam/admin/update.asp
<%Option Explicit%>
<%
strCommand = Request.Form("cmd")
Session("MenuName") = "Update Bookings"
Session("MenuLink") = "update.asp"
%>
<!--#include virtual="bam1/dbfunctions.asp"-->
<!--#include virtual="bam1/commonutils.asp"-->
<!--#include file="apputils.asp"-->
<!--#include file="editutils.asp"-->
<!--#include file="heading.asp"-->
<!--#include file="authenticate.asp"-->
<%
' (SS,22/10/15) added CanUpdate
If gbAuthenticated And CanUpdate Then
Dim strSQL, strSearchValue, strHeading
Dim strDetailTable
Dim strBookingNo
Dim strBookingDate,strTitle, strFirstName, strSurname, strOrganisation
Dim strAddress1, strAddress2, strAddress3, strAddress4, strPostcode, strCountry, strTelephone, strMobile, strEmail
Dim strHotel, strCreditCardType, strCreditCardOther, strNameOnCard, strCreditCardNo, strExpiryMonth, strExpiryYear
Dim strAmountToCharge, strLastChange, strCancelled, strDateCancelled
Dim strFullName, strArrivalDate, strNoOfNights, strRoomType, strNonSmoking, strSharingWith, strSpecialRequirements
Dim i
Dim strSearchField
strBookingNo = Request.QueryString("BookingNo")
If strBookingNo = "" Then strBookingNo = Request.Form("BookingNo")
Dim gbIncludeDateValidation
gbIncludeDateValidation = False
' --- MAIN MENU ---
' (SS,11/01/02) show menu if ExitForm clicked when adding new Job
If strCommand = "Exit Form" And Request.Form("AddOrEdit") = "Add" And Request.Form("DetailTable") = "" Then
strCommand = "Menu"
End If
If strCommand = "" or strCommand = "Menu" or strCommand = "Enter" Then
%>
<br><br>
<Strong><font size="4">Update Bookings</font></Strong>
<table class="menu">
<tr><td> </td></tr>
<tr><td nowrap><a href="update.asp?cmd=SearchFor">Edit Bookings</a></td></tr>
<tr><td> </td></tr>
<tr><td nowrap><a href="update.asp?cmd=Add">Add New Bookings</a></td></tr>
<tr><td> </td></tr>
</table>
<%
End If
' --- EDIT --- '
Dim gbEditAllowed
gbEditAllowed = False
strSearchField = Request.QueryString("Field")
strSearchValue = Request.QueryString("value")
if strSearchValue = "" then strSearchValue = Request.Form("value")
strDetailTable = Request.Form("DetailTable")
' --- SAVE --- '
If strCommand = "Save Record" then
If strDetailTable = "BookingRooms" Then
SaveBookingRoom
Else
SaveBooking
End If
End If
' --- DELETE --- '
If strCommand = "Delete Record" then
If strDetailTable = "BookingRooms" Then
DeleteBookingRoom
Else
DeleteBooking
End If
End If
' --- CANCEL BOOKING --- '
If strCommand = "Cancel Booking" Then
CancelBooking
End If
' --- EMAIL BOOKING --- '
If strCommand = "Email Booking" Then
EmailBooking strBookingNo, ET_AMENDMENT ' (SS,7/12/14) added strBookingNo and replaced False with ET_AMENDMENT
strCommand = "View"
End If
' --- EMAIL CONFIRMATION --- '
If strCommand = "Email Confirmation" Then
EmailBooking strBookingNo, ET_CONFIRMATION ' (SS,7/12/14) added strBookingNo and replaced True with ET_CONFIRMATION
strCommand = "View"
End If
' if error occurred in Save or Delete above then change mode to "Add" or "Edit" as it was '
' so user can make the correction '
If gsADOErrors <> "" Then
If strDetailTable = "BookingRooms" Then
strCommand = "BookingRoom"
Else
strCommand = ""
End If
If Request.Form("AddOrEdit") = "Add" Then
strCommand = "Add" + strCommand
Else
strCommand = "Edit" + strCommand
End If
Else
' adding detail record and save pressed then stay in Add mode
' (SS,7/5/03) removed for this app
'If (strCommand = "Save Record") And (Request.Form("AddOrEdit") = "Add") And (strDetailTable = "BookingRooms") Then
' If strDetailTable = "BookingRooms" Then
' strCommand = "AddBookingRoom"
' Else
' strCommand = ""
' End If
'End If
End If
' --- EDIT ---
If strCommand = "AddBookingRoom" Or strCommand = "EditBookingRoom" Then
If strCommand = "AddBookingRoom" Then
strCommand = "Add"
Else
strCommand = "Edit"
End If
EditBookingRoom
Else
If (strCommand = "Add" Or strCommand = "Edit") Then
EditBooking
End If
End If
' if action was Save, Exit, Delete then go back to the view
If strCommand = "Exit Form" Or strCommand = "Save Record" Or strCommand = "Delete Record" Then
strCommand = "View"
strSearchField = Session("SearchField")
strSearchValue = Session("SearchValue")
End If
If strCommand = "Search" Then
SearchForJob
ElseIf strCommand = "SearchFor" Or strCommand = "Back" Then
If strCommand = "Back" Then
' restore the search for value for back
strSearchField = Session("SearchField")
strSearchValue = Session("SearchValue")
Else
' preserve the field and value for use later when restoring the search after back
Session("SearchField") = strSearchField
Session("SearchValue") = strSearchValue
End If
ListBookings
End If
If strCommand = "View" Then
ViewBooking
End If
End If 'If gbAuthenicated Then
%>
<!--#include file="footing.asp"-->