widgetName = JText::translate('VBO_W_NEXTRES_TITLE'); $this->widgetDescr = JText::translate('VBO_W_NEXTRES_DESCR'); $this->widgetId = basename(__FILE__, '.php'); /** * Define widget and icon and style name. * * @since 1.15.0 (J) - 1.5.0 (WP) */ $this->widgetIcon = ''; $this->widgetStyleName = 'light-orange'; } public function render(?VBOMultitaskData $data = null) { $dbo = JFactory::getDbo(); $today_end_ts = mktime(23, 59, 59, date("n"), date("j"), date("Y")); $q = "SELECT `o`.`id`,`o`.`custdata`,`o`.`status`,`o`.`days`,`o`.`checkin`,`o`.`checkout`,`o`.`roomsnum`,`o`.`country`,`o`.`type`,(SELECT CONCAT_WS(' ',`or`.`t_first_name`,`or`.`t_last_name`) FROM `#__vikbooking_ordersrooms` AS `or` WHERE `or`.`idorder`=`o`.`id` LIMIT 1) AS `nominative`,(SELECT SUM(`or`.`adults`) FROM `#__vikbooking_ordersrooms` AS `or` WHERE `or`.`idorder`=`o`.`id`) AS `tot_adults`,(SELECT SUM(`or`.`children`) FROM `#__vikbooking_ordersrooms` AS `or` WHERE `or`.`idorder`=`o`.`id`) AS `tot_children` FROM `#__vikbooking_orders` AS `o` WHERE `o`.`status`!='cancelled' AND `o`.`checkin`>".$today_end_ts." AND `o`.`closure`=0 ORDER BY `o`.`checkin` ASC LIMIT 10;"; $dbo->setQuery($q); $nextreservations = $dbo->loadAssocList(); if (!$nextreservations) { return; } ?>

widgetIcon; ?>

$next) { $totpeople_str = $next['tot_adults']." ".($next['tot_adults'] > 1 ? JText::translate('VBMAILADULTS') : JText::translate('VBMAILADULT')).($next['tot_children'] > 0 ? ", ".$next['tot_children']." ".($next['tot_children'] > 1 ? JText::translate('VBMAILCHILDREN') : JText::translate('VBMAILCHILD')) : ""); $room_names = array(); foreach (VikBooking::loadOrdersRoomsData($next['id']) as $rr) { $room_names[] = $rr['room_name']; } if ($next['roomsnum'] == 1) { $roomstr = '' . ($room_names ? $room_names[0] : '') . ''; } else { $roomstr = ''.$next['roomsnum'].''; } if ($next['status'] == 'confirmed') { $ord_status = ''.JText::translate('VBCONFIRMED').''; } elseif ($next['status'] == 'standby') { $ord_status = ''.JText::translate('VBSTANDBY').''; } else { $ord_status = ''.JText::translate('VBCANCELLED').''; } if (!empty($next['type']) && !strcasecmp($next['type'], 'overbooking')) { $ord_status .= '
' . JText::translate('VBO_BTYPE_OVERBOOKING') . '
'; } $nominative = strlen((string) $next['nominative']) > 1 ? $next['nominative'] : VikBooking::getFirstCustDataField($next['custdata']); $country_flag = ''; if (is_file(VBO_ADMIN_PATH . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . 'countries' . DIRECTORY_SEPARATOR . $next['country'] . '.png')) { $country_flag = ''; } ?>
datesep, $this->df), $next['checkin']) . ' - ×' . $next['days']; ?>