<%@ Language=VBScript %>
<%
Dim Page 
Page = ""

Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open Application("conn_string")

If (UCase(Request.ServerVariables("REQUEST_METHOD")) = "POST" And Request.Form("page") = "0") Then
	If Request.Form("Admin_Group_ID") <> "" Then
		Session("Admin_Group_ID") = Request.Form("Admin_Group_ID")
	End If
	
	If Session("Admin_Group_ID") = "" Then
		Session("Admin_Group_ID") = "0"
	End If
End If

Dim SQLName, RSName
SQLName = "get_entity_from_group @Group_ID='" & Session("Admin_Group_ID") & "'"
Set RSName=Conn.Execute(SQLName)
%>
<%	'Get dates from previous page
	Dim Start_Date_Day, Start_Date_Month, Start_Date_Year, Start_Date
	Dim End_Date_Day, End_Date_Month, End_Date_Year, End_Date
	
		Start_Date_Day = Request.Form("Start_Day")
		Start_Date_Month = Request.Form("Start_Month")
		Start_Date_Year = Request.Form("Start_Year")
		Start_Date = Start_Date_Month & "/" & Start_Date_Day & "/" & Start_Date_Year
				
		End_Date_Day = Request.Form("End_Day")
		End_Date_Month = Request.Form("End_Month")
		End_Date_Year = Request.Form("End_Year")
		End_Date = End_Date_Month & "/" & End_Date_Day & "/" & End_Date_Year

	' Debug Code
	'Response.Write Start_Date & "<BR>"
	'Response.Write End_Date & "<BR>"
	' End Debug Code
	
	'Setting Date Search String for Report
		' ** Execute Get_Activity_Report_Lodging @Start_Date ='10/1/2001', @End_Date = '10/31/2001' **
		Dim SearchDate
		If Start_Date <> "0/0/0" Then
			If Start_Date_Day <> "0" Then
				SearchDate = " @Start_Date='" & Start_Date & "'"
				If End_Date <> "0/0/0" Then
					SearchDate = SearchDate & ", @End_Date='" & End_Date & "'"
				End If
			'If no day is specified, the procedure only will run for the month selected.
			Else
				Start_Date_Day = "1"
				Start_Date = Start_Date_Month & "/" & Start_Date_Day & "/" & Start_Date_Year
				SearchDate = " @Start_Date='" & Start_Date & "'"
				
				End_Date = DateAdd("d",-1,DateAdd("m",1,(Start_Date_Month & "/1/" & Start_Date_Year)))
				SearchDate = SearchDate & ", @End_Date='" & End_Date & "'"
				
				' Debug Code
				'Response.Write Start_Date & "<BR>"
				'Response.Write End_Date
				' End Debug Code
			End If
		Else
			SearchDate = ""
		End IF	
%>

<html>
<STYLE>
BODY {SCROLLBAR-FACE-COLOR: #5e5ebe; SCROLLBAR-HIGHLIGHT-COLOR: #5e5ebe; SCROLLBAR-SHADOW-COLOR: #5e5ebe; SCROLLBAR-3DLIGHT-COLOR: #5e5ebe; SCROLLBAR-ARROW-COLOR:  #6666CC; SCROLLBAR-TRACK-COLOR: #E3E3E3; SCROLLBAR-DARKSHADOW-COLOR: #666666; }
</STYLE>
<head>
<title>Daily Activity Report</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
<link rel="stylesheet" href="../Style-sheets/standard-input-form.css" type="text/css">
<link rel="stylesheet" href="/Style-sheets/headline.css" type="text/css">
<link rel="stylesheet" href="/Style-sheets/galley-text-indent.css" type="text/css">
</head>
<body bgcolor="#ffffff" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/icon-return-to-main-2.gif','images/icon-submit-changes-2.gif','images/icon-continue-wizard-2.gif','images/icon-view-amentiy-package-2.gif','images/icon-edit-amentiy-package-2.gif','images/icon-clone-amentiy-package-2.gif','images/icon-package-assignment-2.gif')">
<P>
<table cellSpacing="0" cellPadding="0" width="750" height="900" align="center" border="1" id="TABLE1" borderColor="#000099">
  
  <tr>
    <td vAlign="top" align="left">
      <p><font face="Verdana">
      <table cellSpacing="0" cellPadding="0" width="90%" align="center" border="0">
        
        <tr>
          <td width="250" vAlign="top" align="left">
          <td width="250">
            <P align=center>Vacation In Florida<BR><FONT size=1>5770 W. Irlo 
            Bronson Memorial HWY</FONT><BR><FONT size=1>Suite 
            129</FONT><BR><FONT size=1>Kissimmee, Florida 34746</FONT><BR><FONT 
            size=1>1-866-YOU-BOOK</FONT><BR></P></td>
          <td width="250" aling="center"></td>
        </tr>
        <tr>
          <td></td>
          <td>
            <p align="center"><FONT size=2>Itemized 
            Transaction</FONT>  </p></td>
          <td><FONT size=1>
            <P align=right><FONT size=1>Generated on <%=FormatDateTime(Date(),2)%> <BR>at <%=FormatDateTime(Time(),3)%></FONT></P></FONT></td></tr>
        <tr>
          <td></td>
          <td>
            <p align="center">Inventory Activity Report</p></td>
          <td>
            <P align=right><FONT size=1>    
            </FONT>&nbsp;</P></td></tr></table></font></p>
      <p><FONT face=Verdana><STRONG><EM><FONT 
      size=4>Lodging</FONT></EM></STRONG> </FONT>
      <table cellSpacing="1" cellPadding="1" width="99%" align="center" border="0" 
      style="LEFT: 4px; WIDTH: 99%; TOP: 246px" background="">
        <TBODY>
        <tr>
          <td align="middle"><FONT size=2 
            face=Verdana><u><strong>Date</strong></u></FONT></td>
          <TD align="middle"><U><STRONG><FONT face=Verdana 
            size=2>Sale</FONT></STRONG></U></TD>
          <TD align="middle"><FONT size=2 
            face=Verdana><STRONG><U>Trans_ID</U></STRONG></FONT></TD>
          <td align="middle"><FONT size=2 
            face=Verdana><u><strong>Room Description</strong></u></FONT></td>
          <td align="middle"><FONT size=2 
            face=Verdana><u><strong>RN</strong></u></FONT></td>
          <TD align="middle"><u><STRONG><FONT face=Verdana 
            size=2>Guest</FONT> </u></STRONG></TD>
          <td align="middle"><FONT size=2 
            face=Verdana><u><strong> PMT</strong></u></FONT></td>
          <TD align="middle"><U><STRONG><FONT face=Verdana 
            size=2>Auth Code</FONT></U></STRONG></TD>
          <td align="middle"><FONT size=2 
            face=Verdana><u><strong>Price</strong></u></FONT></td>
        </tr>
        <%'Getting Lodging Report Data
			Dim SQLLodging, RSLodging, Total_Price, Total_Price_Lodg, Price_Lodg
			
			SQLLodging = "Execute Get_Activity_Report_Lodging " & SearchDate
			Set RSLodging=Conn.Execute(SQLLodging)
			if RSLodging.eof then
		%>
		<tr>
			<TD colSpan="9" aling="center"><strong>No Lodging Transactions to Report for Specified Dates</strong></TD></tr>
		</tr>
		<%Else 
			Do while not RSLodging.eof
		%>
        <tr>
          <td align="middle">
            <P><FONT size=1 
            face=Verdana> <%=RSLodging("Trans_Date")%></FONT><FONT size=1 face=Verdana><BR> <BR></FONT></P></td>
          <TD><FONT size=1 
            face=Verdana> <%=RSLodging("Sale")%><BR> <BR></FONT></TD>
          <TD align="middle"><FONT size=1 
            face=Verdana> <%=RSLodging("Transaction_ID")%><BR> <BR></FONT></TD>
          <td><FONT face=Verdana>
            <FONT size=1> <%=RSLodging("Group_Name")%></FONT><BR>
            <FONT size=1> <%=RSLodging("Room_Name")%>                          :  <%=RSLodging("Item_Date")%></FONT></FONT>
          </td>
          <td align="middle"><FONT size=1 
            face=Verdana> <%=RSLodging("Quantity")%><BR> <BR></FONT></td>
          <TD align=left><FONT size=1 
            face=Verdana> <%=RSLodging("User_Name")%><BR> <BR></FONT></TD>
          <td align="left"><FONT size=1 
            face=Verdana> <%=RSLodging("Payment_Abbr")%><BR> <BR></FONT></td>
          <TD align=right><FONT size=1 
            face=Verdana> <%=RSLodging("Auth_Code")%><BR> <BR></FONT></TD>
          <td align="right"><FONT size=1 
            face=Verdana><%Set Price_Lodg=RSLodging("Total_Qty_Price")%><% Response.Write FormatCurrency(Price_Lodg,2,-2,-2,-2)%><BR> <BR></FONT></td>
        </tr>
		<% ' End List Table
					Total_Price_Lodg = 0 + Total_Price_Lodg + Price_Lodg
					RSLodging.movenext
				Loop
			End If
			RSLodging.Close
			Total_Price = 0 + Total_Price_Lodg
		%>
        <tr>
          <td><font size="1" 
            face=Verdana></font></td>
          <TD><FONT face=Verdana></FONT></TD>
          <TD><FONT face=Verdana></FONT></TD>
          <td><font size="1" 
            face=Verdana></font></td>
          <td><font size="1" 
            face=Verdana></font></td>
          <TD align=right><FONT face=Verdana></FONT></TD>
          <td align="right"><FONT face=Verdana></FONT></td>
          <TD align=right><FONT face=Verdana><STRONG><FONT 
            size=1>Totals:</FONT></STRONG><BR></FONT></TD>
          <td align="right"><FONT face=Verdana><font size="1"><strong><%Response.Write FormatCurrency(Total_Price,2,-2,-2,-2)%></strong></font><BR></FONT></td>
        </tr></table></P><STRONG><EM><FONT size=4></FONT></EM></STRONG>
      <P><FONT face=Verdana><STRONG><EM><FONT 
      size=4>Merchandise</FONT></EM></STRONG> </FONT>
      <TABLE style="LEFT: 4px; WIDTH: 99%; TOP: 246px" cellSpacing=1 
      cellPadding=1 width="99%" align=center background="" border=0>
        
        <TR>
          <TD align=middle><FONT size=2 
            face=Verdana><U><STRONG>Date</STRONG></U></FONT></TD>
          <TD align=middle><U><STRONG><FONT face=Verdana 
            size=2>Sale</FONT></STRONG></U></TD>
          <TD align=middle><FONT 
          size=2 
            face=Verdana><STRONG><U>Trans_ID</U></STRONG></FONT></TD>
          <TD align=middle><FONT 
            size=2 
            face=Verdana><U><STRONG>Description</STRONG></U></FONT></TD>
          <TD align=middle><FONT size=2 
            face=Verdana><U><STRONG>QTY</STRONG></U></FONT></TD>
          <TD align=middle><U><STRONG><FONT face=Verdana 
            size=2>Guest</FONT> 
            </U></STRONG></TD>
          <TD align=middle><FONT size=2 
            face=Verdana><U><STRONG> 
          PMT</STRONG></U></FONT></TD>
          <TD align=middle><STRONG><U><FONT face=Verdana size=2>Auth 
            Code</FONT></U></STRONG></TD>
          <TD align=middle><FONT size=2 
            face=Verdana><U><STRONG>Price</STRONG></U></FONT></TD></TR>
          <%'Getting Merchandise Report Data
				Dim SQLMerch, RSMerch, Total_Price_Merch, Price_Merch
						
				SQLMerch = "Execute Get_Activity_Report_Merchandise"  & SearchDate
				Set RSMerch=Conn.Execute(SQLMerch)
				if RSMerch.eof then
			%>
			<tr>
				<TD colSpan="9" aling="center"><strong>No Merchandise Transactions to Report for Specified Dates</strong></TD></tr></TR>
			<%Else 
				Do while not RSMerch.eof
			%>
        <TR>
          <TD align=middle><FONT size=1 
            face=Verdana> <%=RSMerch("Trans_Date")%><BR></FONT></TD>
          <TD><FONT size=1 
            face=Verdana> <%=RSMerch("Sale")%><BR></FONT></TD>
          <TD align=middle><FONT size=1 
            face=Verdana> <%=RSMerch("Transaction_ID")%><BR></FONT></TD>
          <TD><FONT size=1 
            face=Verdana> <%=RSMerch("Group_Name")%>                                                            ,  <%=RSMerch("Item_Description")%><BR></FONT></TD>
          <TD align=middle><FONT size=1 
            face=Verdana>1<BR></FONT></TD>
          <TD align=left><FONT size=1 
            face=Verdana> <%=RSMerch("User_Name")%><BR></FONT></TD>
          <TD align=left><FONT size=1 
            face=Verdana>  <%=RSMerch("Payment_Abbr")%><BR></FONT></TD>
          <TD align=right><FONT face=Verdana size=1> <%=RSMerch("Auth_Code")%></FONT></TD>
          <TD align=right><FONT size=1 
            face=Verdana><%Set Price_Merch=RSMerch("Total_Price")%><% Response.Write FormatCurrency(Price_Merch,2,-2,-2,-2)%><BR></FONT></TD></TR>
       		<% ' End List Table
						Total_Price_Merch = 0 + Total_Price_Merch + Price_Merch
						RSMerch.movenext
					Loop
				End If
				RSMerch.Close
				Total_Price = 0 + Total_Price + Total_Price_Merch
			%>
		 <TR>
          <TD><FONT size=1 
            face=Verdana></FONT></TD>
          <TD><FONT face=Verdana size=1></FONT></TD>
          <TD><FONT face=Verdana size=1></FONT></TD>
          <TD><FONT size=1 
            face=Verdana></FONT></TD>
          <TD><FONT size=1 
            face=Verdana></FONT></TD>
          <TD align=right><FONT face=Verdana 
            size=1></FONT></TD>
          <TD align=right><FONT size=1></FONT></TD>
          <TD align=right><FONT size=1><STRONG><FONT 
            face=Verdana>Totals:</FONT></STRONG><BR></FONT></TD>
          <TD align=right><FONT face=Verdana 
            size=1><STRONG><%Response.Write FormatCurrency(Total_Price_Merch,2,-2,-2,-2)%></STRONG></FONT></TD>
         </TR>
        </TABLE>
      </P>
      <P align=right><FONT face=Verdana size=2><STRONG>Report Transaction Total: <%Response.Write FormatCurrency(Total_Price,2,-2,-2,-2)%></STRONG></FONT></P></TD></TR></TBODY></TABLE></P>

</body>
</html>
