<!--#include virtual="/includes/topofpage.asp"-->

<%
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
		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 & "'"
				If End_Date = "0/0/0" Then SearchDate = SearchDate & ", @End_Date='" & Start_Date & "'"

			'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=""
			Start_Date = Date()
			End_Date = Date()
			SearchDate = " @Start_Date = '" & Start_Date & "', @End_Date='" & End_Date & "'"
		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"> Available Lodging Report<BR>
            <FONT size=1>Report From <%=Start_Date%> to <%=End_Date%></FONT></P></td>
          <td>
            <P align=right><FONT size=1>    
            </FONT>&nbsp;</P></td></tr></table></font></p>
        <%'Setting PMT Type Report Variable
			Dim SQL_Merch, RS_Merch, Total_Price, Total_Price_PMT_Type, PMT_Type, Amount, Price_Disp
			Total_Price = 0
		%>
	  <P></P>
      <HR id=HR1>
      <%' Getting Groups with Merchandise
		Dim SQL_Groups, RS_Groups
		
		SQL_Groups = "exec Get_Lodging_Groups"
		
		Set RS_Groups = Conn.Execute(SQL_Groups)
		If RS_Groups.eof Then      
      %>
		      No Groups for Reporting are Available.
      <%Else
			Do while not RS_Groups.eof
      %>  
      <FONT face=Verdana><STRONG><EM><FONT size=4><%=RS_Groups("Group_Name")%>&nbsp;<FONT Size=1>(<%=RS_Groups("Group_ID")%>)</FONT></FONT></EM></STRONG></FONT><BR>
      <TABLE style="LEFT: 4px; WIDTH: 99%; TOP: 246px" cellSpacing=1 cellPadding=1 width="99%" align=center background="" border=0>
        <TBODY>
		<%
			Total_Price_PMT_Type = 0

			SQL_Merch = "Exec Get_Inventory_By_Group @Group_ID='" & RS_Groups("Group_ID") & "'," & SearchDate 
			'Response.Write SQL_Merch
			Set RS_Merch=Conn.Execute(SQL_Merch)
			If RS_Merch.eof Then
		%>
		<TR>
          <TD colSpan="9" aling="center"><STRONG>No Transactions to Report for Specified Dates</STRONG></TD>
        </TR>
		<%	Else %>
        <TR>
          <TD align=middle><FONT face=Verdana size=2><U><STRONG>Date</STRONG></U></FONT></TD>
          <TD align=middle><U><STRONG><FONT face=Verdana size=2>RM Type</FONT></STRONG></U></TD>
          <TD align=middle><FONT face=Verdana size=2><STRONG><U>RM Package</U></STRONG></FONT></TD>
          <TD align=middle><FONT face=Verdana size=2><U><STRONG>Item ID</STRONG></U></FONT></TD>
          <TD align=middle><FONT face=Verdana size=2><U><STRONG>Net</STRONG></U></FONT></TD>
          <TD align=middle><U><STRONG><FONT face=Verdana size=2>Club</FONT></U></STRONG></TD>
          <TD align=middle><FONT face=Verdana size=2><U><STRONG>Web</STRONG></U></FONT></TD>
          <TD align=middle><FONT face=Verdana size=2><U><STRONG>Pref</STRONG></U></FONT></TD>
          <TD align=middle><U><STRONG><FONT face=Verdana size=2>Blackout</FONT></U></STRONG></TD>
          <TD align=middle><FONT face=Verdana size=2><U><STRONG>Allocated/<BR>Available</STRONG></U></FONT></TD>
		</TR>		
		<%
			Do while not RS_Merch.eof
		%>
        <TR>
          <TD align=left><FONT face=Verdana size=1> <%=RS_Merch("Date")%></FONT><FONT face=Verdana size=1><BR></FONT></TD>
          <TD align=left><FONT face=Verdana size=1> <%=RS_Merch("RM_Type")%><BR></FONT></TD>
          <TD align=left><FONT face=Verdana size=1> <%=RS_Merch("Amenity_PKG")%><BR></FONT></TD>
          <TD align=middle><FONT face=Verdana size=1> <%=RS_Merch("Inventory_List_ID")%><BR></FONT></TD>
          <TD align=middle><FONT face=Verdana size=1> <%Response.Write FormatCurrency(RS_Merch("Rate_SNGL"),2,-2,-2,-2)%><BR></FONT></TD>
          <TD align=middle><FONT face=Verdana size=1> <%Response.Write FormatCurrency(RS_Merch("Cost_Club_SNGL"),2,-2,-2,-2)%><BR></FONT></TD>
          <TD align=middle><FONT face=Verdana size=1> <% Response.Write FormatCurrency(RS_Merch("Cost_Web_SNGL"),2,-2,-2,-2)%><BR></FONT></TD>
          <TD align=middle><FONT face=Verdana size=1> <% Response.Write FormatCurrency(RS_Merch("Cost_Pref_SNGL"),2,-2,-2,-2)%><BR></FONT></TD>          
          <TD align=middle><FONT face=Verdana size=1> <%If RS_Merch("Blackout_Exempt") = False Or isNull(RS_Merch("Blackout_Exempt")) Then Response.Write "No" Else Response.Write "Yes" End If%><BR></FONT></TD>
          <TD align=middle><FONT face=Verdana size=1> <%=RS_Merch("Allocation")%>             / <%If RS_Merch("Allocation")<> RS_Merch("Available") Then %><STRONG> <FONT Color=green><%End IF%><%=RS_Merch("Available")%><BR></FONT></STRONG></FONT></TD></TR>
		<% ' End List Table
				RS_Merch.movenext
				Loop
			'End If
			RS_Merch.Close
		%>
      <%	End If%>
      </TBODY>
      </TABLE>
      <%
			RS_Groups.MoveNext
	  %>
	  <HR id=HR1>
	  <%		      
			Loop
		End IF
		RS_Groups.Close
	  %>
      </FONT></EM></STRONG></FONT></td></tr></table><BR></P>
</body>
</html>
