<!--#include file="../includes/resifunctions.asp" -->

<%
Dim SQLTrans, Itinerary_ID, sqlPayment, Payment_Type

Set RSTrans = Server.CreateObject("ADODB.Recordset")
SQLTrans = "Select T.Transaction_ID, T.Itinerary_ID, T.CreateDate, T.Payment_Type, CD.Name_First, CD.Name_Last, CD.Address_1, CD.City, CD.State, CD.Country, CD.Zip, U.User_Name "
SQLTrans = SQLTrans & "from Transactions T Inner Join (Users U Inner Join Contact_Detail CD On U.Contact_ID = CD.Contact_ID) on T.Contact_ID = U.User_ID "
SQLTrans = SQLTrans & "Where T.Transaction_ID = '" & Request("Transaction_ID") & "' And T.Contact_ID = '" & Request("UserID") & "'"
RSTrans.Open SQLTrans, Conn

Itinerary_ID = RSTrans("Itinerary_ID")

Set rsPayment = Server.CreateObject("ADODB.Recordset")
sqlPayment = "Select Payment_Type From Payment_Type Where Payment_Type_ID = '" & RSTrans("Payment_Type") & "'"
rsPayment.Open sqlPayment, Conn

Payment_Type = rsPayment("Payment_Type")

rsPayment.Close()
Set rsPayment = Nothing

%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="/Style-sheets/attraction-set.css" type="text/css">
<link rel="stylesheet" href="/Style-sheets/atrraction-set.css" type="text/css">
<link rel="stylesheet" href="/Style-sheets/headline.css" type="text/css">

</head>

<body bgcolor="#FFFFFF" text="#000000"onLoad="window.print()">
<table width="500" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td colspan="3" class="headline-prnt" align="center">Purchase Receipt</td>
  </tr>
  <tr> 
    <td colspan="3" class="headline-prnt" align="left">Tropical Palms FunResort</td>
  </tr>
  <tr> 
    <td class="headline-prnt" bgcolor="#FFFFFF" colspan="2">2650 Holiday Trail
<br>
      Kissimmee, Florida 34746<br>      
      1-800-64-PALMS<br>
      1-800-647-2567<br>
    </td>
    <td class="statement-subhds-prnt" bgcolor="#FFFFFF" width="20%">&nbsp;</td>
  </tr>
  <tr> 
    <td class="statement-subhds-prnt" bgcolor="#FFFFFF" width="37%">&nbsp;</td>
    <td class="statement-subhds-prnt" bgcolor="#FFFFFF" width="43%">&nbsp;</td>
    <td class="statement-subhds-prnt" bgcolor="#FFFFFF" width="20%">&nbsp;</td>
  </tr>
  <tr> 
    <td colspan="3" bgcolor="#FFFFFF"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="26%" class="statement-subhds-prnt">Transaction #:</td>
          <td width="74%" class="statement-detail-prnt"><%=RSTrans("Transaction_ID")%></td>
        </tr>
        <tr> 
          <td width="26%" class="statement-subhds-prnt">Itinerary #:</td>
          <td width="74%" class="statement-detail-prnt"><%=RSTrans("Itinerary_ID")%></td>
        </tr>
        <tr> 
          <td width="26%" class="statement-subhds-prnt">Purchase Date:</td>
          <td width="74%" class="statement-detail-prnt"><%=RSTrans("CreateDate")%></td>
        </tr>
        <tr> 
          <td width="26%" class="statement-subhds-prnt">&nbsp;</td>
          <td width="74%" class="statement-subhds-prnt">&nbsp;</td>
        </tr>
        <tr> 
          <td width="26%" class="statement-subhds-prnt">Customer:</td>
          <td width="74%" class="statement-detail-prnt"><%=RSTrans("Name_First") & " " & RSTrans("Name_Last")%></td>
        </tr>
        <tr> 
          <td width="26%" class="statement-subhds-prnt">&nbsp;</td>
          <td width="74%" class="statement-detail-prnt"><%=RSTrans("Address_1")%></td>
        </tr>
        <tr> 
          <td width="26%" class="statement-subhds-prnt">&nbsp;</td>
          <td width="74%" class="statement-detail-prnt"><%=RSTrans("City")%>, <%=RSTrans("State")%>, 
            <%=RSTrans("Country")%> <%=RSTrans("Zip")%></td>
        </tr>
        <tr> 
          <td width="26%" class="statement-subhds-prnt">Payment Type:</td>
          <td width="74%" class="statement-detail-prnt"><%=Payment_Type%></td>
        </tr>
        <tr> 
          <td width="26%" class="statement-subhds-prnt">&nbsp;</td>
          <td width="74%" class="statement-subhds-prnt">&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>

                                <tr> 
                                  <td colspan="3" class="headline-prnt" bgcolor="#FFFFFF">Hotel:</td>
                                </tr>
                                <%
                     			Dim SQLEntity, Entity_Name, sqlDetails

								Set RSEntity = Server.CreateObject("ADODB.Recordset")
								SQLEntity = "Select E.Name, ED.Address_1, ED.City, ED.State, ED.Zip From Entity E Inner Join Entity_Detail ED on E.Entity_ID = ED.Entity_ID "
								SQLEntity = SQLEntity & "Where E.Entity_ID = '7476'"
								RSEntity.Open SQLEntity, Conn	
								Entity_Name = RSEntity("Name") & "<br>" & RSEntity("Address_1") & "<br>" & RSEntity("City") & " " & RSEntity("State") & " " & RSEntity("Zip")
								RSEntity.Close()
								Set RSEntity = Nothing
								Set rsDetails = server.CreateObject("ADODB.Recordset")
								sqlDetails = "Select * From Itinerary_Detail_Vars Where Itinerary_ID = '" & rsTrans("Itinerary_ID") & "'"
								rsDetails.Open sqlDetails, Conn				
 							Dim FirstDate, LastDate
 							FirstDate = CDate(rsDetails("Arrival_Date"))
 							LastDate = CDate(DateAdd("d", rsDetails("Stay"), rsDetails("Arrival_Date")))
                                
                                 %>
              <tr> 
                <td class="statement-detail" colspan=2 bgcolor="#FFFFFF"><strong><u>&nbsp;<%=Entity_Name%></u></strong></td>
              </tr>
              <tr bgcolor="#FFFFFF"> 
                <td colspan="2" class="statement-detail">&nbsp;<%=WeekDayName(WeekDay(FirstDate), True, 1) & " " & FormatDateTime(FirstDate, 2)%> 
                  - <%=WeekDayName(WeekDay(LastDate), True, 1) & " " & FormatDateTime(LastDate, 2)%></td>
                <td width="94" class="statement-detail"></td>
              </tr>
              <%For q = 0 to (GetTransCount(Itinerary_ID))%>
              <tr bgcolor="#FFFFFF"> 
                <td colspan="2" class="statement-detail"><%=RoomType(Itinerary_ID, q, 7476)%></td>
                <td width="94" class="statement-detail"><%=FormatCurrency(GetCostByTrans(Itinerary_ID, q))%></td>
              </tr>
              <%Next%>
              <tr bgcolor="#FFFFFF"> 
                <td colspan="2" class="statement-detail" height="9">&nbsp;Sales 
                  &amp; Room Tax</td>
                <td width="94" class="statement-detail" height="9"><%=FormatCurrency(CCur(LodgingTax(Itinerary_ID)))%></td>
              </tr>
              <tr bgcolor="#FFFFFF"> 
                <td width="164">&nbsp;</td>
                <td width="211">&nbsp;</td>
                <td width="94">&nbsp;</td>
              </tr>
              <tr bgcolor="#FFFFFF"> 
                <td class="statement-subhds" width="164">&nbsp;</td>
                <td class="statement-subhds" width="211">Total 
									 Charged to your Account:</td>
                <td width="94" class="statement-subhds"><%=FormatCurrency(CCur(CartTotalwTax(Itinerary_ID)))%></td>
              </tr>
              <tr bgcolor="#FFFFFF"> 
                <td colspan="2" class="statement-subhds">&nbsp;</td>
                <td width="94" class="statement-subhds">&nbsp;</td>
              </tr>
                                  <tr> 
    <td colspan="2" class="statement-subhds" bgcolor="#FFFFFF">&nbsp;</td>
    <td width="20%" class="statement-subhds" bgcolor="#FFFFFF"><a href="javascript:void(0)" onClick="self.close();return false">Close 
      Window</a></td>
  </tr>
</table>
</body>
</html>
