} else { echo '<img class="img_left imgshadow" style="padding:4px; margin: 6px 10px 0 7px; border-color:' . $this->hgconf->bordercolor . '" src="' . JURI::base() . 'components/com_hotelguide/assets/images/no_thumb.gif"alt="NO IMAGE" />'; } echo '</div>' . "\n"; echo '</div>' . "\n"; echo '<div class="rightdes">' . "\n"; foreach ($item->hotels as $hotel) { $link = JRoute::_(hotelguideHelperRoute::getItemRoute($hotel->slug)); //$friendlyurl Extrae unicamente el url del hotel list($url_path, $friendlyurl) = explode(":", $link); echo '<div class="accordionitem"><a href="../' . $friendlyurl . '.html" style="color:#fff">' . stripslashes($hotel->title) . '</a>'; if ($hotel->starrate) { echo '<span style="padding:0 7px;"><img style="margin:0" src="' . JURI::base() . 'components/com_hotelguide/assets/images/' . $hotel->starrate . 'star.png" alt="Star Rate"/></span>'; } if ($hotel->price) { echo '<span style="position: absolute; right:5px; font-size:12px; font-weight:bold; color:' . $this->hgconf->pricecolor . ';">' . JText::_('HG_FROM') . ' ' . hg_html::getCurrency($hotel->id, $hotel->price); echo '</span>'; } echo '</div>'; } echo '<div style="clear:both;"></div>' . "\n"; if (count($item->hotels) > 0) { echo '<p style="text-align:right; margin-right:5px">'; $alllink = JRoute::_(hotelguideHelperRoute::getCityRoute($item->slug)); echo '<a href="' . $alllink . '" style="color:#fff">'; echo JText::sprintf('HG_SEE_ALL_ACCOMMODATIONS', $item->assignedhotels, $item->name); echo '</a></p>'; } else { echo '<p style="text-align:right; margin-right:5px">'; echo JText::_('HG_NO_ACCOMMODATION'); echo '</p>';
function getroomrate() { global $hgconf; $id = JRequest::getInt('id', 0); $yearnum = JRequest::getInt('year', 0); $monthnum = JRequest::getInt('month', 0); $todaynum = JRequest::getInt('today', 0); $model = $this->getModel('hotel'); //Le pase el parametro $yearnum a getRoom() para que me muestre resultados solo del ano consultado $rooms = $model->getRoom($id, $yearnum); $JApp =& JFactory::getApplication(); $JUser =& JFactory::getUser(); $JDate = JFactory::getDate(); $JDate->setOffset($JApp->getCfg('offset')); $time = mktime(0, 0, 0, $monthnum, $todaynum, $yearnum); $today = date('j', $time); $second = date('j', $time + 86400); $third = date('j', $time + 86400 * 2); $fourth = date('j', $time + 86400 * 3); $fifth = date('j', $time + 86400 * 4); $sixth = date('j', $time + 86400 * 5); $seventh = date('j', $time + 86400 * 6); $day = $JDate->_dayToString(date('w', $time), true); $month = $JDate->_monthToString(date('m', $time), true); $secondday = $JDate->_dayToString(date('w', $time + 86400), true); $thirdday = $JDate->_dayToString(date('w', $time + 86400 * 2), true); $fourthday = $JDate->_dayToString(date('w', $time + 86400 * 3), true); $fifthday = $JDate->_dayToString(date('w', $time + 86400 * 4), true); $sixthday = $JDate->_dayToString(date('w', $time + 86400 * 5), true); $seventhday = $JDate->_dayToString(date('w', $time + 86400 * 6), true); $output = ''; if ($hgconf->box == 'None') { $output .= '<div style="clear:both;padding-bottom:10px;"></div>' . "\n"; } else { $output .= hg_html::boxtop(); } $output .= '<h3 class="title">' . "\n"; $output .= JText::_('HG_CHOOSE_YOUR_ROOM_AND_RATE'); $output .= '</h3>' . "\n"; $room_no = count($rooms); $output .= '<div class="table">' . "\n"; $output .= '<div class="th"><div class="td" style="width: 19%; height:22px; line-height:24px; border-left: 1px solid #fff;">' . JText::_('HG_ROOM_TYPE') . '</div><div class="td" style="height:22px; line-height:12px;">' . $day . '<br/>' . $today . ' ' . $month . '</div><div class="td" style="height:22px; line-height:12px;">' . $secondday . '<br/>' . $second . ' ' . $JDate->_monthToString(date('m', mktime(0, 0, 0, $monthnum, $todaynum + 1, $yearnum)), true) . '</div><div class="td" style="height:22px; line-height:12px;">' . $thirdday . '<br/>' . $third . ' ' . $JDate->_monthToString(date('m', mktime(0, 0, 0, $monthnum, $todaynum + 2, $yearnum)), true) . '</div><div class="td" style="height:22px; line-height:12px;">' . $fourthday . '<br/>' . $fourth . ' ' . $JDate->_monthToString(date('m', mktime(0, 0, 0, $monthnum, $todaynum + 3, $yearnum)), true) . '</div><div class="td" style="height:22px; line-height:12px;">' . $fifthday . '<br/>' . $fifth . ' ' . $JDate->_monthToString(date('m', mktime(0, 0, 0, $monthnum, $todaynum + 4, $yearnum)), true) . '</div><div class="td" style="height:22px; line-height:12px;">' . $sixthday . '<br/>' . $sixth . ' ' . $JDate->_monthToString(date('m', mktime(0, 0, 0, $monthnum, $todaynum + 5, $yearnum)), true) . '</div><div class="td" style="height:22px; line-height:12px;">' . $seventhday . '<br/>' . $seventh . ' ' . $JDate->_monthToString(date('m', mktime(0, 0, 0, $monthnum, $todaynum + 6, $yearnum)), true) . '</div><div class="td" style="width:18%; height:22px; line-height:12px; margin-right:-3px;"></div><div style="clear: both;"></div></div>' . "\n"; for ($i = 0, $n = $room_no; $i < $n; $i++) { $beds = $rooms[$i]->beds; $bed_count = count($rooms[$i]->beds); if ($bed_count > 0) { //$output .= '<div class="ratetitle" style="margin-top:10px;"><strong>'.$rooms[$i]->title.'</strong></div>' . "\n"; if ($rooms[$i]->roomsoffer) { $output .= '<br /><span style="padding-right:5px;"><img src="' . JURI::base() . 'components/com_hotelguide/assets/images/specialoffer.png" alt="Special Offer"/></span><span style="font-size:11px; vertical-align:top; color:#6a71ff;">' . $this->rooms[$i]->roomsoffer . '</span><br />' . "\n"; } //$output .= '<div class="table">' . "\n"; //$output .= '<div class="th"><div class="td" style="width: 15%; height:22px; line-height:24px; border-left: 1px solid #fff;">'.JText::_('HG_BED_TYPES').'</div><div class="td" style="height:22px; line-height:12px;">'.$day.'<br/>'.$today.' '.$month.'</div><div class="td" style="height:22px; line-height:12px;">'.$secondday.'<br/>'.$second.' '.$JDate->_monthToString(date( 'm', mktime(0, 0, 0, $monthnum, $todaynum+1, $yearnum)), true).'</div><div class="td" style="height:22px; line-height:12px;">'.$thirdday.'<br/>'.$third.' '.$JDate->_monthToString(date( 'm', mktime(0, 0, 0, $monthnum, $todaynum+2, $yearnum)), true).'</div><div class="td" style="height:22px; line-height:12px;">'.$fourthday.'<br/>'.$fourth.' '.$JDate->_monthToString(date( 'm', mktime(0, 0, 0, $monthnum, $todaynum+3, $yearnum)), true).'</div><div class="td" style="height:22px; line-height:12px;">'.$fifthday.'<br/>'.$fifth.' '.$JDate->_monthToString(date( 'm', mktime(0, 0, 0, $monthnum, $todaynum+4, $yearnum)), true).'</div><div class="td" style="height:22px; line-height:12px;">'.$sixthday.'<br/>'.$sixth.' '.$JDate->_monthToString(date( 'm', mktime(0, 0, 0, $monthnum, $todaynum+5, $yearnum)), true).'</div><div class="td" style="height:22px; line-height:12px;">'.$seventhday.'<br/>'.$seventh.' '.$JDate->_monthToString(date( 'm', mktime(0, 0, 0, $monthnum, $todaynum+6, $yearnum)), true).'</div><div class="td" style="width:18%; height:22px; line-height:12px; margin-right:-3px;"></div><div style="clear: both;"></div></div>' . "\n"; for ($j = 0; $j < $bed_count; $j++) { $bed =& $beds[$j]; switch ($monthnum) { case 1: $rate = explode(",", $bed->rate1); $discount = explode(",", $bed->discount1); $room = explode(",", $bed->room1); $nextrate = explode(",", $bed->rate2); $nextdiscount = explode(",", $bed->discount2); break; case 2: $rate = explode(",", $bed->rate2); $discount = explode(",", $bed->discount2); $room = explode(",", $bed->room2); $nextrate = explode(",", $bed->rate3); $nextdiscount = explode(",", $bed->discount3); break; case 3: $rate = explode(",", $bed->rate3); $discount = explode(",", $bed->discount3); $room = explode(",", $bed->room3); $nextrate = explode(",", $bed->rate4); $nextdiscount = explode(",", $bed->discount4); break; case 4: $rate = explode(",", $bed->rate4); $discount = explode(",", $bed->discount4); $room = explode(",", $bed->room4); $nextrate = explode(",", $bed->rate5); $nextdiscount = explode(",", $bed->discount5); break; case 5: $rate = explode(",", $bed->rate5); $discount = explode(",", $bed->discount5); $room = explode(",", $bed->room5); $nextrate = explode(",", $bed->rate6); $nextdiscount = explode(",", $bed->discount6); break; case 6: $rate = explode(",", $bed->rate6); $discount = explode(",", $bed->discount6); $room = explode(",", $bed->room6); $nextrate = explode(",", $bed->rate7); $nextdiscount = explode(",", $bed->discount7); break; case 7: $rate = explode(",", $bed->rate7); $discount = explode(",", $bed->discount7); $room = explode(",", $bed->room7); $nextrate = explode(",", $bed->rate8); $nextdiscount = explode(",", $bed->discount8); break; case 8: $rate = explode(",", $bed->rate8); $discount = explode(",", $bed->discount8); $room = explode(",", $bed->room8); $nextrate = explode(",", $bed->rate9); $nextdiscount = explode(",", $bed->discount9); break; case 9: $rate = explode(",", $bed->rate9); $discount = explode(",", $bed->discount9); $room = explode(",", $bed->room9); $nextrate = explode(",", $bed->rate10); $nextdiscount = explode(",", $bed->discount19); break; case 10: $rate = explode(",", $bed->rate10); $discount = explode(",", $bed->discount10); $room = explode(",", $bed->room10); $nextrate = explode(",", $bed->rate11); $nextdiscount = explode(",", $bed->discount11); break; case 11: $rate = explode(",", $bed->rate11); $discount = explode(",", $bed->discount11); $room = explode(",", $bed->room11); $nextrate = explode(",", $bed->rate12); $nextdiscount = explode(",", $bed->discount12); break; case 12: $rate = explode(",", $bed->rate12); $discount = explode(",", $bed->discount12); $room = explode(",", $bed->room12); $nextrate = explode(",", $bed->rate1); $nextdiscount = explode(",", $bed->discount1); break; } $daysofmonth = count($rate) . "\n"; $leftdays = $daysofmonth - $today + 1; if ($leftdays < 7) { $rate = array_merge($rate, $nextrate); $discount = array_merge($discount, $nextdiscount); } if (max($discount) > 0) { if ($bed->breakfast == 2) { $output .= '<div class="tr"><div class="td" style="width: 19%; border-left: 1px solid #fff; text-align:left;"> ' . $bed->bedtype . '<br/>'; $output .= '<p style="color:#333acc; font-style:italic; font-weight:normal;"> ' . JText::_('HG_BREAKFAST_INCLUDED') . '</p></div>'; } else { $output .= '<div class="tr"><div class="td" style="width: 19%; font-weight:bold; line-height:40px; border-left: 1px solid #fff; text-align:left;"> ' . $bed->bedtype; $output .= '</div>'; } if ($rate[$today - 1]) { $output .= '<div class="td"><p style="text-decoration:line-through; text-align:center; margin:0;">' . hg_html::getCurrency($id, $rate[$today - 1]) . '</p>'; $newrate = $rate[$today - 1] * (100 - $discount[$today - 1]) / 100; $output .= '<p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $newrate) . '</p></div>'; } else { //Modifique esta linea para que me mostrara el mensaje Contact cuando el rate para un dia especifico este todo en todos //los campos en cero (0), esta de esta manera: $output .= JText::_('HG_CONTACT'); $output .= '<div class="td">' . JText::_('HG_CONTACT') . '</div>'; } $output .= '<div class="td">'; if ($rate[$today]) { $output .= '<p style="text-decoration:line-through; text-align:center; margin:0;">' . hg_html::getCurrency($id, $rate[$today]) . '</p>'; $newrate = $rate[$today] * (100 - $discount[$today]) / 100; $output .= '<p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $newrate) . '</p></div>'; } else { $output .= JText::_('HG_CONTACT') . '</div>'; } $output .= '<div class="td">'; if ($rate[$today + 1]) { $output .= '<p style="text-decoration:line-through; text-align:center; margin:0;">' . hg_html::getCurrency($id, $rate[$today + 1]) . '</p>'; $newrate = $rate[$today + 1] * (100 - $discount[$today + 1]) / 100; $output .= '<p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $newrate) . '</p></div>'; } else { $output .= JText::_('HG_CONTACT') . '</div>'; } $output .= '<div class="td">'; if ($rate[$today + 2]) { $output .= '<p style="text-decoration:line-through; text-align:center; margin:0;">' . hg_html::getCurrency($id, $rate[$today + 2]) . '</p>'; $newrate = $rate[$today + 2] * (100 - $discount[$today + 2]) / 100; $output .= '<p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $newrate) . '</p></div>'; } else { $output .= JText::_('HG_CONTACT') . '</div>'; } $output .= '<div class="td">'; if ($rate[$today + 3]) { $output .= '<p style="text-decoration:line-through; text-align:center; margin:0;">' . hg_html::getCurrency($id, $rate[$today + 3]) . '</p>'; $newrate = $rate[$today + 3] * (100 - $discount[$today + 3]) / 100; $output .= '<p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $newrate) . '</p></div>'; } else { $output .= JText::_('HG_CONTACT') . '</div>'; } $output .= '<div class="td">'; if ($rate[$today + 4]) { $output .= '<p style="text-decoration:line-through; text-align:center; margin:0;">' . hg_html::getCurrency($id, $rate[$today + 4]) . '</p>'; $newrate = $rate[$today + 4] * (100 - $discount[$today + 4]) / 100; $output .= '<p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $newrate) . '</p></div>'; } else { $output .= JText::_('HG_CONTACT') . '</div>'; } $output .= '<div class="td">'; if ($rate[$today + 5]) { $output .= '<p style="text-decoration:line-through; text-align:center; margin:0;">' . hg_html::getCurrency($id, $rate[$today + 5]) . '</p>'; $newrate = $rate[$today + 5] * (100 - $discount[$today + 5]) / 100; $output .= '<p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $newrate) . '</p></div>'; } else { $output .= JText::_('HG_CONTACT') . '</div>'; } $output .= '<div class="td" style="width: 18%; margin-right:-3px;">'; $output .= '<button class="button" type="button" id="bookingbutton" onclick="submitbutton(\'' . $rooms[$i]->hotel . '\', \'' . $rooms[$i]->id . '\', \'-1\', \'' . $bed->id . '\'); return false;">' . JText::_('HG_BOOK_NOW') . '</button><p style="padding:0 3px; color:#ffffff; font-style:italic; text-align:center;">'; if ($room[$today - 1] == 0) { } else { if ($room[$today - 1] == 1) { $output .= JText::sprintf('HG_LAST_CHANCE_ONLY_ROOM_LEFT', $room[$today - 1]); } else { if ($room[$today - 1] > 1 && $room[$today - 1] < 6) { $output .= JText::sprintf('HG_ONLY_ROOMS_LEFT', $room[$today - 1]); } else { } } } $output .= '</p>' . "\n"; $output .= '</div><div style="clear: both;"></div></div>' . "\n"; } else { if ($bed->breakfast == 2) { $output .= '<div class="tr"><div class="td" style="width: 19%; border-left: 1px solid #fff; text-align:left;"> ' . $bed->bedtype . '<br/>'; $output .= ' <span style="font-size:10px">' . JText::_('HG_BREAKFAST_INCLUDED') . '</span></div>'; } else { $output .= '<div class="tr"><div class="td" style="width: 19%; line-height:40px; border-left: 1px solid #fff; text-align:left;"> ' . $bed->bedtype; $output .= '</div>'; } if ($rate[$today - 1]) { $output .= '<div class="td"><p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $rate[$today - 1]) . '</p></div>'; } else { $output .= '<div class="td">' . JText::_('HG_CONTACT') . '</div>'; } if ($rate[$today]) { $output .= '<div class="td"><p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $rate[$today]) . '</p></div>'; } else { $output .= '<div class="td">' . JText::_('HG_CONTACT') . '</div>'; } if ($rate[$today + 1]) { $output .= '<div class="td"><p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $rate[$today + 1]) . '</p></div>'; } else { $output .= '<div class="td">' . JText::_('HG_CONTACT') . '</div>'; } if ($rate[$today + 2]) { $output .= '<div class="td"><p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $rate[$today + 2]) . '</p></div>'; } else { $output .= '<div class="td">' . JText::_('HG_CONTACT') . '</div>'; } if ($rate[$today + 3]) { $output .= '<div class="td"><p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $rate[$today + 3]) . '</p></div>'; } else { $output .= '<div class="td">' . JText::_('HG_CONTACT') . '</div>'; } if ($rate[$today + 4]) { $output .= '<div class="td"><p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $rate[$today + 4]) . '</p></div>'; } else { $output .= '<div class="td">' . JText::_('HG_CONTACT') . '</div>'; } if ($rate[$today + 5]) { $output .= '<div class="td"><p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $rate[$today + 5]) . '</p></div>'; } else { $output .= '<div class="td">' . JText::_('HG_CONTACT') . '</div>'; } $output .= '<div class="td" style="width: 18%; margin-right:-3px;">'; $output .= '<button class="button" type="button" id="bookingbutton" onclick="submitbutton(\'' . $rooms[$i]->hotel . '\', \'' . $rooms[$i]->id . '\', \'-1\', \'' . $bed->id . '\'); return false;">' . JText::_('HG_BOOK_NOW') . '</button><p style="padding:0 3px; color:#ffffff; font-style:italic; text-align:center;">'; if ($room[$today - 1] == 0) { } else { if ($room[$today - 1] == 1) { $output .= JText::sprintf('HG_LAST_CHANCE_ONLY_ROOM_LEFT', $room[$today - 1]); } else { if ($room[$today - 1] > 1 && $room[$today - 1] < 6) { $output .= JText::sprintf('HG_ONLY_ROOMS_LEFT', $room[$today - 1]); } else { } } } $output .= '</p>' . "\n"; $output .= '</div><div style="clear: both;"></div></div>' . "\n"; } } //$output .= '</div>' . "\n"; $output .= '<div class="slidebox">' . "\n"; if ($rooms[$i]->rate_details) { $output .= '<div class="left" style="padding-left: 5px;"><div class="slide_wrapper2">' . "\n"; $output .= '<fieldset class="layout" style="border:none">' . "\n"; $output .= '<legend style="font-size:11px"><a href="javascript:void(0)" style="color:#fff">' . JText::_('HG_RATE_DETAILS') . '</a></legend>' . "\n"; $output .= '<div class="slidevisible2" style="text-align:left;">' . "\n"; $output .= '<p style="font-size:11px">'; $output .= $rooms[$i]->rate_details; $output .= '</p>'; $output .= '</div>' . "\n"; $output .= '</fieldset>' . "\n"; $output .= '</div></div>' . "\n"; } if ($rooms[$i]->cancellation) { $output .= '<div class="right" style="padding-left: 5px;"><div class="slide_wrapper2">' . "\n"; $output .= '<fieldset class="layout" style="border:none">' . "\n"; $output .= '<legend style="font-size:11px"><a href="javascript:void(0)" style="color:#fff">' . JText::_('HG_CANCELLATION_POLICY') . '</a></legend>' . "\n"; $output .= '<div class="slidevisible2" style="text-align:left;">' . "\n"; $output .= '<p style="font-size:11px">'; $output .= $rooms[$i]->cancellation; $output .= '</p>'; $output .= '</div>' . "\n"; $output .= '</fieldset>' . "\n"; $output .= '</div></div>' . "\n"; } $output .= '</div>' . "\n"; $output .= '<div style="clear:both;"></div>' . "\n"; } $subrate_count = count($rooms[$i]->subrate); if ($subrate_count > 0) { for ($m = 0; $m < $subrate_count; $m++) { $beds = $rooms[$i]->subrate[$m]->beds; $bed_count = count($beds); if ($bed_count > 0) { //$output .= '<div class="ratetitle" style="margin-top:10px;"><strong>'.$rooms[$i]->title.' - '.$rooms[$i]->subrate[$m]->title.'</strong></div>' . "\n"; if ($rooms[$i]->roomsoffer) { $output .= '<br /><span style="padding-right:5px;"><img src="' . JURI::base() . 'components/com_hotelguide/assets/images/specialoffer.png" alt="Special Offer"/></span><span style="font-size:11px; vertical-align:top; color:#6a71ff;">' . $rooms[$i]->roomsoffer . '</span><br />' . "\n"; } $output .= '<div class="table">' . "\n"; $output .= '<div class="th"><div class="td" style="width: 19%; height:22px; line-height:24px; border-left: 1px solid #fff;">' . JText::_('HG_BED_TYPES') . '</div><div class="td" style="height:22px; line-height:12px;">' . $day . '<br/>' . $today . ' ' . $month . '</div><div class="td" style="height:22px; line-height:12px;">' . $secondday . '<br/>' . $second . ' ' . $JDate->_monthToString(date('m', mktime(0, 0, 0, $monthnum, $todaynum + 1, $yearnum)), true) . '</div><div class="td" style="height:22px; line-height:12px;">' . $thirdday . '<br/>' . $third . ' ' . $JDate->_monthToString(date('m', mktime(0, 0, 0, $monthnum, $todaynum + 2, $yearnum)), true) . '</div><div class="td" style="height:22px; line-height:12px;">' . $fourthday . '<br/>' . $fourth . ' ' . $JDate->_monthToString(date('m', mktime(0, 0, 0, $monthnum, $todaynum + 3, $yearnum)), true) . '</div><div class="td" style="height:22px; line-height:12px;">' . $fifthday . '<br/>' . $fifth . ' ' . $JDate->_monthToString(date('m', mktime(0, 0, 0, $monthnum, $todaynum + 4, $yearnum)), true) . '</div><div class="td" style="height:22px; line-height:12px;">' . $sixthday . '<br/>' . $sixth . ' ' . $JDate->_monthToString(date('m', mktime(0, 0, 0, $monthnum, $todaynum + 5, $yearnum)), true) . '</div><div class="td" style="height:22px; line-height:12px;">' . $seventhday . '<br/>' . $seventh . ' ' . $JDate->_monthToString(date('m', mktime(0, 0, 0, $monthnum, $todaynum + 6, $yearnum)), true) . '</div><div class="td" style="width:18%; height:22px; line-height:12px; margin-right:-3px;"></div><div style="clear: both;"></div></div>' . "\n"; for ($j = 0; $j < $bed_count; $j++) { $bed =& $beds[$j]; switch ($monthnum) { case 1: $rate = explode(",", $bed->rate1); $discount = explode(",", $bed->discount1); $room = explode(",", $bed->room1); $nextrate = explode(",", $bed->rate2); $nextdiscount = explode(",", $bed->discount2); break; case 2: $rate = explode(",", $bed->rate2); $discount = explode(",", $bed->discount2); $room = explode(",", $bed->room2); $nextrate = explode(",", $bed->rate3); $nextdiscount = explode(",", $bed->discount3); break; case 3: $rate = explode(",", $bed->rate3); $discount = explode(",", $bed->discount3); $room = explode(",", $bed->room3); $nextrate = explode(",", $bed->rate4); $nextdiscount = explode(",", $bed->discount4); break; case 4: $rate = explode(",", $bed->rate4); $discount = explode(",", $bed->discount4); $room = explode(",", $bed->room4); $nextrate = explode(",", $bed->rate5); $nextdiscount = explode(",", $bed->discount5); break; case 5: $rate = explode(",", $bed->rate5); $discount = explode(",", $bed->discount5); $room = explode(",", $bed->room5); $nextrate = explode(",", $bed->rate6); $nextdiscount = explode(",", $bed->discount6); break; case 6: $rate = explode(",", $bed->rate6); $discount = explode(",", $bed->discount6); $room = explode(",", $bed->room6); $nextrate = explode(",", $bed->rate7); $nextdiscount = explode(",", $bed->discount7); break; case 7: $rate = explode(",", $bed->rate7); $discount = explode(",", $bed->discount7); $room = explode(",", $bed->room7); $nextrate = explode(",", $bed->rate8); $nextdiscount = explode(",", $bed->discount8); break; case 8: $rate = explode(",", $bed->rate8); $discount = explode(",", $bed->discount8); $room = explode(",", $bed->room8); $nextrate = explode(",", $bed->rate9); $nextdiscount = explode(",", $bed->discount9); break; case 9: $rate = explode(",", $bed->rate9); $discount = explode(",", $bed->discount9); $room = explode(",", $bed->room9); $nextrate = explode(",", $bed->rate10); $nextdiscount = explode(",", $bed->discount19); break; case 10: $rate = explode(",", $bed->rate10); $discount = explode(",", $bed->discount10); $room = explode(",", $bed->room10); $nextrate = explode(",", $bed->rate11); $nextdiscount = explode(",", $bed->discount11); break; case 11: $rate = explode(",", $bed->rate11); $discount = explode(",", $bed->discount11); $room = explode(",", $bed->room11); $nextrate = explode(",", $bed->rate12); $nextdiscount = explode(",", $bed->discount12); break; case 12: $rate = explode(",", $bed->rate12); $discount = explode(",", $bed->discount12); $room = explode(",", $bed->room12); $nextrate = explode(",", $bed->rate1); $nextdiscount = explode(",", $bed->discount1); break; } // $rate = explode(",", $bed->rate2); // $discount = explode(",", $bed->discount2); // $room = explode(",", $bed->room2); $daysofmonth = count($rate) . "\n"; $leftdays = $daysofmonth - $today + 1; if ($leftdays < 8) { $rate = array_merge($rate, $nextrate); $discount = array_merge($discount, $nextdiscount); } if (max($discount) > 0) { if ($bed->breakfast == 2) { $output .= '<div class="tr"><div class="td" style="width: 19%; border-left: 1px solid #fff; text-align:left;"> ' . $bed->bedtype; $output .= '<p style="color:#333acc; font-style:italic; font-weight:normal;"> ' . JText::_('HG_BREAKFAST_INCLUDED') . '</p></div>'; } else { $output .= '<div class="tr"><div class="td" style="width: 19%; font-weight:bold; line-height:40px; border-left: 1px solid #fff; text-align:left;"> ' . $bed->bedtype; $output .= '</div>'; } if ($rate[$today - 1]) { $output .= '<div class="td"><p style="text-decoration:line-through; text-align:center; margin:0;">' . hg_html::getCurrency($id, $rate[$today - 1]) . '</p>'; $newrate = $rate[$today - 1] * (100 - $discount[$today - 1]) / 100; $output .= '<p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $newrate) . '</p></div>'; } else { $output .= JText::_('HG_CONTACT'); } $output .= '<div class="td">'; if ($rate[$today]) { $output .= '<p style="text-decoration:line-through; text-align:center; margin:0;">' . hg_html::getCurrency($id, $rate[$today]) . '</p>'; $newrate = $rate[$today] * (100 - $discount[$today]) / 100; $output .= '<p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $newrate) . '</p></div>'; } else { $output .= JText::_('HG_CONTACT'); } $output .= '<div class="td">'; if ($rate[$today + 1]) { $output .= '<p style="text-decoration:line-through; text-align:center; margin:0;">' . hg_html::getCurrency($id, $rate[$today + 1]) . '</p>'; $newrate = $rate[$today + 1] * (100 - $discount[$today + 1]) / 100; $output .= '<p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $newrate) . '</p></div>'; } else { $output .= JText::_('HG_CONTACT'); } $output .= '<div class="td">'; if ($rate[$today + 2]) { $output .= '<p style="text-decoration:line-through; text-align:center; margin:0;">' . hg_html::getCurrency($id, $rate[$today + 2]) . '</p>'; $newrate = $rate[$today + 2] * (100 - $discount[$today + 2]) / 100; $output .= '<p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $newrate) . '</p></div>'; } else { $output .= JText::_('HG_CONTACT'); } $output .= '<div class="td">'; if ($rate[$today + 3]) { $output .= '<p style="text-decoration:line-through; text-align:center; margin:0;">' . hg_html::getCurrency($id, $rate[$today + 3]) . '</p>'; $newrate = $rate[$today + 3] * (100 - $discount[$today + 3]) / 100; $output .= '<p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $newrate) . '</p></div>'; } else { $output .= JText::_('HG_CONTACT'); } $output .= '<div class="td">'; if ($rate[$today + 4]) { $output .= '<p style="text-decoration:line-through; text-align:center; margin:0;">' . hg_html::getCurrency($id, $rate[$today + 4]) . '</p>'; $newrate = $rate[$today + 4] * (100 - $discount[$today + 4]) / 100; $output .= '<p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $newrate) . '</p></div>'; } else { $output .= JText::_('HG_CONTACT'); } $output .= '<div class="td">'; if ($rate[$today + 5]) { $output .= '<p style="text-decoration:line-through; text-align:center; margin:0;">' . hg_html::getCurrency($id, $rate[$today + 5]) . '</p>'; $newrate = $rate[$today + 5] * (100 - $discount[$today + 5]) / 100; $output .= '<p style="font-size:1.2em; color:' . $hgconf->pricecolor . '; text-align:center; font-weight:bold;">' . hg_html::getCurrency($id, $newrate) . '</p></div>'; } else { $output .= JText::_('HG_CONTACT'); } $output .= '<div class="td" style="width: 18%; margin-right:-3px;">'; $output .= '<button class="button" type="button" id="bookingbutton" onclick="submitbutton(\'' . $rooms[$i]->hotel . '\', \'' . $rooms[$i]->id . '\', \'' . $rooms[$i]->subrate[$m]->id . '\', \'' . $bed->id . '\'); return false;">' . JText::_('HG_BOOK_NOW') . '</button><p style="padding:0 3px; color:#ffffff; font-style:italic; text-align:center;">'; if ($room[$today - 1] == 0) { $output .= JText::_('HG_NOT_AVAILABLE'); } else { if ($room[$today - 1] == 1) { $output .= JText::sprintf('HG_LAST_CHANCE_ONLY_ROOM_LEFT', $room[$today - 1]); } else { if ($room[$today - 1] > 1 && $room[$today - 1] < 6) { $output .= JText::sprintf('HG_ONLY_ROOMS_LEFT', $room[$today - 1]); } else { } } } $output .= '</p>' . "\n"; $output .= '</div></div>' . "\n"; } else { $output .= '<div class="tr" style="background:none"><div class="td" style="width: 19%; border-left: 1px solid #fff; text-align:left;"> ' . $bed->bedtype; if ($bed->breakfast == 2) { $output .= '<p style="padding-bottom:5px; line-height:26px; color:#333acc; font-style:italic; font-weight:normal;"> ' . JText::_('HG_BREAKFAST_INCLUDED') . '</p></div><div class="td" style="line-height:34px; font-weight:bold; color:' . $hgconf->pricecolor . ';">'; } else { $output .= '</div><div class="td" style="line-height:34px; font-weight:bold; color:' . $hgconf->pricecolor . ';">'; } if ($rate[$today - 1]) { $output .= hg_html::getCurrency($id, $rate[$today - 1]); } else { $output .= JText::_('HG_CONTACT'); } $output .= '</div><div class="td" style="line-height:34px; font-weight:bold; color:' . $hgconf->pricecolor . ';">'; if ($rate[$today]) { $output .= hg_html::getCurrency($id, $rate[$today]); } else { $output .= JText::_('HG_CONTACT'); } $output .= '</div><div class="td" style="line-height:34px; font-weight:bold; color:' . $hgconf->pricecolor . ';">'; if ($rate[$today + 1]) { $output .= hg_html::getCurrency($id, $rate[$today + 1]); } else { $output .= JText::_('HG_CONTACT'); } $output .= '</div><div class="td" style="line-height:34px; font-weight:bold; color:' . $hgconf->pricecolor . ';">'; if ($rate[$today + 2]) { $output .= hg_html::getCurrency($id, $rate[$today + 2]); } else { $output .= JText::_('HG_CONTACT'); } $output .= '</div><div class="td" style="line-height:34px; font-weight:bold; color:' . $hgconf->pricecolor . ';">'; if ($rate[$today + 3]) { $output .= hg_html::getCurrency($id, $rate[$today + 3]); } else { $output .= JText::_('HG_CONTACT'); } $output .= '</div><div class="td" style="line-height:34px; font-weight:bold; color:' . $hgconf->pricecolor . ';">'; if ($rate[$today + 4]) { $output .= hg_html::getCurrency($id, $rate[$today + 4]); } else { echo JText::_('HG_CONTACT'); } $output .= '</div><div class="td" style="line-height:34px; font-weight:bold; color:' . $hgconf->pricecolor . ';">'; if ($rate[$today + 5]) { $output .= hg_html::getCurrency($id, $rate[$today + 5]); } else { $output .= JText::_('HG_CONTACT'); } $output .= '</div><div class="td" style="line-height:14px; width: 22%; margin-right:-3px;">'; $output .= '<button class="button" type="button" id="bookingbutton" onclick="submitbutton(\'' . $rooms[$i]->hotel . '\', \'' . $rooms[$i]->id . '\', \'' . $rooms[$i]->subrate[$m]->id . '\', \'' . $bed->id . '\'); return false;">' . JText::_('HG_BOOK_NOW') . '</button><p style="padding:0 3px; color:#ffffff; font-style:italic; text-align:center;">'; if ($room[$today - 1] == 0) { } else { if ($room[$today - 1] == 1) { $output .= JText::sprintf('HG_LAST_CHANCE_ONLY_ROOM_LEFT', $room[$today - 1]); } else { if ($room[$today - 1] > 1 && $room[$today - 1] < 6) { $output .= JText::sprintf('HG_ONLY_ROOMS_LEFT', $room[$today - 1]); } else { } } } $output .= '</p>' . "\n"; $output .= '</div></div>' . "\n"; } } $output .= '</div>' . "\n"; $output .= '<div class="slidebox">' . "\n"; if ($rooms[$i]->subrate[$m]->rate_details) { $output .= '<div class="left"><div class="slide_wrapper2">' . "\n"; $output .= '<fieldset class="layout" style="border:none">' . "\n"; $output .= '<legend style="font-size:11px"><a href="javascript:void(0)" style="color:#fff">' . JText::_('HG_RATE_DETAILS') . '</a></legend>' . "\n"; $output .= '<div class="slidevisible2" style="text-align:left;">' . "\n"; $output .= '<p style="font-size:11px">'; $output .= $rooms[$i]->subrate[$m]->rate_details; $output .= '</p>'; $output .= '</div>' . "\n"; $output .= '</fieldset>' . "\n"; $output .= '</div></div>' . "\n"; } if ($rooms[$i]->subrate[$m]->cancellation) { $output .= '<div class="right"><div class="slide_wrapper2">' . "\n"; $output .= '<fieldset class="layout" style="border:none">' . "\n"; $output .= '<legend style="font-size:11px"><a href="javascript:void(0)" style="color:#fff">' . JText::_('HG_CANCELLATION_POLICY') . '</a></legend>' . "\n"; $output .= '<div class="slidevisible2" style="text-align:left;">' . "\n"; $output .= '<p style="font-size:11px">'; $output .= $rooms[$i]->subrate[$m]->cancellation; $output .= '</p>'; $output .= '</div>' . "\n"; $output .= '</fieldset>' . "\n"; $output .= '</div></div>' . "\n"; } $output .= '</div>' . "\n"; $output .= '<div style="clear:both;"></div>' . "\n"; } } } } $output .= '</div>' . "\n"; if ($hgconf->box == 'None') { $output .= '<div style="clear:both;padding-bottom:10px;"></div>' . "\n"; } else { $output .= hg_html::boxbottom(); } echo $output; }
function getroomrate_by_room($rooms, $checkin, $checkout, $id) { if (strtotime($checkin) < strtotime($checkout)) { if (!$rooms[0]->upon_request) { $monthnum = date('m', strtotime($checkin)); $beds = $rooms[0]->beds; $time = mktime(0, 0, 0, date('m', strtotime($checkin)), date('d', strtotime($checkin)), date('Y', strtotime($checkin))); $today = date('j', $time); $number_nights = hg_html::count_days(strtotime($checkin), strtotime($checkout)); $output .= '<br /><table width="100%" style="border-style: solid; border-collapse: collapse; border-width: 1px;">' . "\n"; $output .= '<thead><tr>' . "\n"; $output .= '<td width="60%" align="center" style="border-style: solid; border-width: 1px;"><strong>' . JText::_('HG_OCCUPANCY') . '</strong></td>' . "\n"; if ($number_nights == 1) { $output .= '<td align="center" style="border-style: solid; border-width: 1px;"><strong>' . JText::_('HG_RATE') . '</strong></td>' . "\n"; } else { $output .= '<td align="center" style="border-style: solid; border-width: 1px;"><strong>' . JText::sprintf('HG_AVERAGE_DAILY_RATE', $number_nights) . '</strong></td>' . "\n"; } $output .= '</tr></thead>' . "\n"; for ($i = 0; $i < count($beds); $i++) { $bed = $beds[$i]; switch ($monthnum) { case 1: $rate = explode(",", $bed->rate1); $discount = explode(",", $bed->discount1); $room = explode(",", $bed->room1); $nextrate = explode(",", $bed->rate2); $nextdiscount = explode(",", $bed->discount2); break; case 2: $rate = explode(",", $bed->rate2); $discount = explode(",", $bed->discount2); $room = explode(",", $bed->room2); $nextrate = explode(",", $bed->rate3); $nextdiscount = explode(",", $bed->discount3); break; case 3: $rate = explode(",", $bed->rate3); $discount = explode(",", $bed->discount3); $room = explode(",", $bed->room3); $nextrate = explode(",", $bed->rate4); $nextdiscount = explode(",", $bed->discount4); break; case 4: $rate = explode(",", $bed->rate4); $discount = explode(",", $bed->discount4); $room = explode(",", $bed->room4); $nextrate = explode(",", $bed->rate5); $nextdiscount = explode(",", $bed->discount5); break; case 5: $rate = explode(",", $bed->rate5); $discount = explode(",", $bed->discount5); $room = explode(",", $bed->room5); $nextrate = explode(",", $bed->rate6); $nextdiscount = explode(",", $bed->discount6); break; case 6: $rate = explode(",", $bed->rate6); $discount = explode(",", $bed->discount6); $room = explode(",", $bed->room6); $nextrate = explode(",", $bed->rate7); $nextdiscount = explode(",", $bed->discount7); break; case 7: $rate = explode(",", $bed->rate7); $discount = explode(",", $bed->discount7); $room = explode(",", $bed->room7); $nextrate = explode(",", $bed->rate8); $nextdiscount = explode(",", $bed->discount8); break; case 8: $rate = explode(",", $bed->rate8); $discount = explode(",", $bed->discount8); $room = explode(",", $bed->room8); $nextrate = explode(",", $bed->rate9); $nextdiscount = explode(",", $bed->discount9); break; case 9: $rate = explode(",", $bed->rate9); $discount = explode(",", $bed->discount9); $room = explode(",", $bed->room9); $nextrate = explode(",", $bed->rate10); $nextdiscount = explode(",", $bed->discount10); break; case 10: $rate = explode(",", $bed->rate10); $discount = explode(",", $bed->discount10); $room = explode(",", $bed->room10); $nextrate = explode(",", $bed->rate11); $nextdiscount = explode(",", $bed->discount11); break; case 11: $rate = explode(",", $bed->rate11); $discount = explode(",", $bed->discount11); $room = explode(",", $bed->room11); $nextrate = explode(",", $bed->rate12); $nextdiscount = explode(",", $bed->discount12); break; case 12: $rate = explode(",", $bed->rate12); $discount = explode(",", $bed->discount12); $room = explode(",", $bed->room12); $nextrate = explode(",", $bed->rate1); $nextdiscount = explode(",", $bed->discount1); break; } $rate = array_merge($rate, $nextrate); $discount = array_merge($discount, $nextdiscount); $sum_rate = 0; $room_no_available = false; for ($r = 0; $r < $number_nights; $r++) { if ($r == 1) { //Acumula los rates por dia $sum_rate = $rate[$today] + $sum_rate; //Verificando si existe algun dia con el rate en 0 if ($rate[$today] == 0.0) { $room_no_available = true; } } else { //Acumula los rates por dia $sum_rate = $rate[$today + ($r - 1)] + $sum_rate; //Verificando si existe algun dia con el rate en 0 if ($rate[$today + ($r - 1)] == 0.0) { $room_no_available = true; } } } //Media promedio de precios x dias de estadia $new_prom_rates = hg_html::getCurrency($id, $sum_rate / $number_nights); $output .= '<tr>' . "\n"; //Muestra el numero maximo de personas para la habitacion if ($bed->maxguest > 1) { $info_maxguest = JText::sprintf('HG_MAX_PERSONS', $bed->maxguest); } else { $info_maxguest = JText::_('HG_SINGLE_OCCUPANCY'); } $output .= '<td align="center" style="border-style: solid; border-width: 1px;">' . $info_maxguest . '</td>' . "\n"; if (!$room_no_available) { $output .= '<td align="center" style="border-style: solid; border-width: 1px;">' . $new_prom_rates . '</td>' . "\n"; } else { $output .= '<td align="center"style="border-style: solid; border-width: 1px;">' . JText::_('HG_NOT_AVAILABLE') . '</td>' . "\n"; } $output .= '</tr>' . "\n"; } $output .= '</table>' . "\n"; $output .= '<br /><div align="center"><a href="http://' . $_SERVER[SERVER_NAME] . '/reserve/reservation01.php?num=' . $rooms[0]->id_jpmoser . '&firstinput=' . date('F d, Y', strtotime($checkin)) . '&secondinput=' . date('F d, Y', strtotime($checkout)) . '&type_room1=' . $rooms[0]->id . '" style="height:25px; width: 150px; vertical-align: middle; display:block; line-height:25px;" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">Reserve</a></div>' . "\n"; echo $output; } else { echo '<br /><div align="justify">' . JText::_('HG_UPON REQUEST_MESSAGE') . '</div><br /><div align="center"><a href="http://' . $_SERVER[SERVER_NAME] . '/reserve/reservation01.php?num=' . $rooms[0]->id_jpmoser . '" style="height:25px; width: 150px; vertical-align: middle; display:block; line-height:25px;" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only">Send your Request</a></div>' . "\n"; } } }
} else { if ($hotels->featured == 4) { echo '<img src="' . JURI::base() . 'components/com_hotelguide/assets/images/deal.png" title="' . JTEXT::_('HG_DEAL') . '" alt="' . JTEXT::_('HG_DEAL') . '" />'; } } } } if ($hotels->featured > 0) { echo '<div class="trans" style="background:none">' . "\n"; } else { echo '<div class="inner">' . "\n"; } if ($hotels->price) { echo '<div class="ratingIcon" style="width:120px; background-color:' . $this->hgconf->priceboxcolor . '; border-color:' . $this->hgconf->pricebordercolor . ';">'; echo '<p style="font-size:11px; text-align:center;">' . JText::_('HG_PRICE_FROM') . '</P>'; echo '<p style="font-size:18px; font-weight:bold; text-align:center; color:' . $this->hgconf->pricecolor . ';">' . hg_html::getCurrency($hotels->id, $hotels->price); echo '<span style="font-size:12px;"> / ' . JText::_('HG_NIGHT'); echo '</span></p></div>' . "\n"; } if ($this->hgconf->showrating == 1) { echo '<div class="ratingIcon" style="width:120px; font-weight:bold; font-size:12px; text-align:center; background-color:' . $this->hgconf->priceboxcolor . '; border-color:' . $this->hgconf->pricebordercolor . ';">'; echo hg_html::categoryratingbar($hotels); echo '<p style="font-size:10px; font-weight:normal; text-align:center;">'; echo JTEXT::_('HG_USERS_RATING') . ' (' . $hotels->rate . ')'; echo '</P>'; echo '</div>'; } echo '</div>'; echo '</div>' . "\n"; echo '</div>' . "\n"; $i++;