djgjohng
Posts: 28
|
| Posted: 09/25/2006, 2:00 AM |
|
Hi,
I have searched for countless hours to find examples in the Help and Forum for the problems I am having in creating a calendar style report with no success. Have tried every example that has any bearing on what I am trying to do.
It is for hotel reservations.
If I could create a calendar that would repeat down once for each room and across the page for up to 31 days and that shows 'events' being bookings I would have the solution. But that does not appear to be an option. So this approach is to use a report with 'dates' across the top and the rooms down the left grouped by room type. In the detail section I have a label in each date column where I want to store the count value as follows.
PROBLEM 1:
//bookeddates_bookings_room1_CountBk1_BeforeShow @53-58220481
function bookeddates_bookings_room1_CountBk1_BeforeShow(& $sender)
{
$bookeddates_bookings_room1_CountBk1_BeforeShow = true;
$Component = & $sender;
$Container = CCGetParentContainer($sender);
global $bookeddates_bookings_room1; //Compatibility
//End bookeddates_bookings_room1_CountBk1_BeforeShow
//Retrieve Value for Control @77-E5364985
global $bookeddates_bookings_room1;
global $DBAccomLink_Front;
$search_date = CCGetFromGet("s_start",date('d/m/Y'));
$ddnum = substr($search_date,0,2);
$mmnum = substr($search_date,4,2);
$yynum = substr($search_date,7,4);
$fdate = $yynum = "-" + $mmnum + "-" + $ddnum;
$db = new clsDBAccomLink_Front();
$this_room = $bookeddates_bookings_room1->RoomID->GetValue();
$SQL = "SELECT COUNT BookingID FROM bookeddates WHERE RoomID=".$this_room." and BookedDate=".$fdate;
$DoSQL = $db->CountSQL = ($SQL);
$Result = $db->query($DoSQL);
$db->close();
$Container->CountBk1->SetValue($Result);
//End Retrieve Value for Control
There are records in the database that fit the criteria but no result appears.
PROBLEM 2:
Each cell is to display a different image or background color depending on the above record count.
Any cell that has a value > 0 needs to be an active link to pop-up details of any bookings for that room on that day.
Assistance would be greatly appreciated.
JohnG
|
 |
 |
|