BDG Scenario 2

RequestOK.asp

<%@ LANGUAGE=VBScript Transaction=Required %>
<% ' Copyright 1998-1999 Microsoft Corporation. All rights reserved. %>
<% Option Explicit %>
<% Response.Buffer = TRUE %>
<% Response.Expires = 0 %>
<HTML>
<HEAD>
<TITLE>Request Item Response</TITLE>
<link type="text/css" rel="stylesheet" href="../_Themes/fm/theme.css">    

<SCRIPT LANGUAGE=VBSCRIPT>
<!--
   On Error Resume Next
   parent.request.style.display = "none"
   parent.requestok.style.display = ""
-->
</SCRIPT>

</HEAD>
<BODY BGCOLOR="FFFFFF" TEXT=000000 LINK=0099ff VLINK=800080 TOPMARGIN="0" LEFTMARGIN=0>

<% Dim szLogonName, szBibNumber, nBibNumber, szCustomerComment
    szLogonName = CStr(Request("Logon"))

    ' First get the Bib Number to work with.
    '
    szBibNumber = Request("bib")
    nBibNumber = CLng(szBibNumber)

    szCustomerComment = Request.Form("txtCustomerComment") 
    IF szCustomerComment = "" THEN
        szCustomerComment = Request("CustomerComment")
    END IF

   Dim Requestor, nBorrowerID, Position, Location, nWaitListLength
    SET Requestor = Server.CreateObject("CML.User")
    Requestor.ConnectionString = Application("FmLib_ConnectionString")
    
    nBorrowerID = Session("BorrowerID")
    If nBorrowerID = 0 Then
       nBorrowerID = Requestor.GetInfoFromTable(szLogonName)
       Session("BorrowerID") = nBorrowerID
       Session("Location") = Requestor.Location
    End If
    
    '--- Set delivery location from QueryString, if present
    Location = Request.QueryString("txtLocation")
    If Location = "" Then Location = Session("Location")
    
    Position = Requestor.Position(nBibNumber, nWaitListLength, nBorrowerID)
    If Position <= 0 Then
       Requestor.MakeRequest nBibNumber, Location, szCustomerComment, nBorrowerID
%>
<BR>
<BR>
    <TABLE class="standard" WIDTH="100%">
        <TR ALIGN="LEFT" VALIGN="TOP">
            <TD ALIGN="Center" VALIGN="TOP">
                <STRONG>Thank you <%= UCase(szLogonName) %>!</STRONG><BR>
                Your request has been entered.
            </TD>
        </TR>
    </TABLE>
<% Else %>
<BR>
<BR>
    <TABLE class="standard" WIDTH="100%">
        <TR ALIGN="LEFT" VALIGN="TOP">
            <TD ALIGN="Center" VALIGN="TOP">
                <STRONG>A request for <%= UCase(szLogonName) %> has already been entered.</STRONG><BR>
                Your request is #<%= Position %> of <%= nWaitListLength %>.
            </TD>
        </TR>
    </TABLE>
<% End If %>

<script Language=VBScript>
' Only show Close button if this is a stand-alone window
If parent Is self Then
   document.write "<br><br><div align=center>"
   document.write "<input type=button value=Close onClick=""javascript:top.window.close()"">"
   document.write "</div>"
End If
</script>

</BODY>
</HTML>