if ($resmaster->cfg->get('VACANCY')) { $vacancy = $room->vacancy; $numAvailable = $vacancy; $detailedReport = $resmaster->cfg->get('DETAVREP'); for ($i=0; $i<$numdays; $i++) { $numreserved = 0; $chkdate = date('Y-m-d H:i:s', mktime('23', '59', '00', $mtin[1], $mtin[2]+$i, $mtin[0])); $chkdate2 = date('Y-m-d H:i:s', mktime('00', '01', '00', $mtin[1], $mtin[2]+$i, $mtin[0])); $database->setQuery("SELECT quantity FROM #__res_reservations WHERE rid='".$rid."' AND (checkin <= '".$chkdate."') AND (checkout >= '".$chkdate2."')"); if ($rows = $database->loadResultArray()) { foreach ($rows as $row) { $numreserved = $numreserved + $row; } } $av = $vacancy - $numreserved; if ($av < $numAvailable) { $numAvailable = $av; } if ($detailedReport) { $icon = ($av >0) ? 'tick.png' : 'publish_x.png'; echo '<img src="'.$mainframe->getCfg('live_site').'/administrator/images/'.$icon.'" border="0" alt="availability report" /> '; echo mosFormatDate($chkdate, '', '0').': <strong>'.$numreserved.'</strong> '.$resmaster->lng->RESERVED.', <strong>'.($vacancy - $numreserved).'</strong> '.$resmaster->lng->AVAILABLE.'<br />'._LEND; } } }
if ($resmaster->cfg->get('VACANCY')) { $vacancy = $room->vacancy; $numAvailable = $vacancy; $database->setQuery("SELECT * FROM #__res_hotels WHERE hid='".$hid."' AND published='1'", '#__', 1, 0); $database->loadObject($hotel); $checkin_hour = explode(':',$hotel->checkintime); $checkout_hour = explode(':',$hotel->checkouttime); $detailedReport = $resmaster->cfg->get('DETAVREP'); for ($i=0; $i<$numdays; $i++) { $numreserved = 0; //$chkdate = date('Y-m-d H:i:s', mktime('23', '59', '00', $mtin[1], $mtin[0]+$i, $mtin[2])); //$chkdate2 = date('Y-m-d H:i:s', mktime('00', '01', '00', $mtin[1], $mtin[0]+$i, $mtin[2])); $chkdate2 = date('Y-m-d H:i:s', mktime($checkin_hour[0], '00', '00', $mtin[1], $mtin[0]+$i, $mtin[2])); $chkdate = date('Y-m-d H:i:s', mktime($checkout_hour[0], '00', '00', $mtout[1], $mtout[0]+$i, $mtout[2])); $database->setQuery("SELECT quantity FROM #__res_reservations WHERE rid='".$rid."' AND (checkin <= '".$chkdate."') AND (checkout >= '".$chkdate2."')"); if ($rows = $database->loadResultArray()) { foreach ($rows as $row) { $numreserved = $numreserved + $row; } } $av = $vacancy - $numreserved; if ($av < $numAvailable) { $numAvailable = $av; } if ($detailedReport) { $icon = ($av >0) ? 'tick.png' : 'publish_x.png'; echo '<img src="'.$mainframe->getCfg('live_site').'/administrator/images/'.$icon.'" border="0" alt="availability report" /> '; echo mosFormatDate($chkdate2, '', '0').': <strong>'.$numreserved.'</strong> '.$resmaster->lng->RESERVED.', <strong>'.($vacancy - $numreserved).'</strong> '.$resmaster->lng->AVAILABLE.'<br />'._LEND; } } }