function display($tpl = null) { global $option, $mainframe; $model =& $this->getModel(); $menu =& JMenu::getInstance('site'); $item = $menu->getActive(); $params =& $menu->getParams($item->id); //get controller $controller = new VnffhotelController(); $cityid = $params->get('cityid', '1'); $cityid = JRequest::getVar('cityid', $cityid); //if($cityid==1) $hotels = $model->getHotelsByCity($cityid); $pagination = $model->getPagination(); for ($i = 0; $i < count($hotels); $i++) { $hotels[$i]->images = $model->getHotelImages($hotels[$i]->hotel_ID, 'm'); if (count($hotels[$i]->images) == 0) { $image->image_Name = "noimage.png"; $hotels[$i]->images[0] = $image; } $hotels[$i]->shortDes = $controller->cutDes($hotels[$i]->Overview, 30); $hotels[$i]->linkToHotel = $controller->linkToHotel($hotels[$i]->hotel_ID); } //get controller $mainframe->setPageTitle(JTEXT::_("HOTELS IN") . " " . $hotels[0]->city_Name); //echo $hotels[0]->images[0]->image_Name; //echo $hotels[0]->city_ID."hehehejhe"; $this->assignRef('hotels', $hotels); $this->assignRef('pagination', $pagination); $this->assignRef('controller', $controller); //echo $this->cutDes("thang nay khung qua di thoi"); parent::display($tpl); }
function display($tpl = null) { global $option, $mainframe; $model =& $this->getModel(); //$menu =& JMenu::getInstance('site'); // $item = $menu->getActive(); // $params =& $menu->getParams($item->id); //get controller $controller = new VnffhotelController(); //echo substr("h_sdfsdf_sfssf", -3); $mainframe->setPageTitle(JTEXT::_("PROMOTIONS LIST")); //$cityid = $params->get('cityid', '32'); $hotels = $model->getHotelsPromotion(); $pagination = $model->getPagination(); for ($i = 0; $i < count($hotels); $i++) { $hotels[$i]->images = $model->getHotelImages($hotels[$i]->hotel_ID, 'm'); if (count($hotels[$i]->images) == 0) { $image->image_Name = "noimage.png"; $hotels[$i]->images[0] = $image; } $hotels[$i]->shortDes = $controller->cutDes($hotels[$i]->Overview, 30); $hotels[$i]->linkToHotel = $controller->linkToHotel($hotels[$i]->hotel_ID, "4"); } //get controller //echo $hotels[0]->images[0]->image_Name; //echo $hotels[0]->city_ID."hehehejhe"; $this->assignRef('hotels', $hotels); $this->assignRef('pagination', $pagination); $this->assignRef('controller', $controller); //echo $this->cutDes("thang nay khung qua di thoi"); parent::display($tpl); }
function display($tpl = null) { global $option, $mainframe; $model =& $this->getModel(); $menu =& JMenu::getInstance('site'); $item = $menu->getActive(); $params =& $menu->getParams($item->id); //get controller $controller = new VnffhotelController(); $hotel_keywords = JRequest::getVar('hotel_keywords', ''); $destination = JRequest::getVar('destination', '-1'); $stars = JRequest::getVar('stars', '-1'); $prices = JRequest::getVar('prices', '0_9999'); //$cityid = $params->get('cityid', '32'); $hotels = $model->getHotels($hotel_keywords, $destination, $stars, $prices); $pagination = $model->getPagination(); $cities = $model->getCities(); $mainframe->setPageTitle(JTEXT::_("SEARCH")); for ($i = 0; $i < count($hotels); $i++) { $hotels[$i]->images = $model->getHotelImages($hotels[$i]->hotel_ID, 'm'); if (count($hotels[$i]->images) == 0) { $image->image_Name = "noimage.png"; $hotels[$i]->images[0] = $image; } $hotels[$i]->shortDes = $controller->cutDes($hotels[$i]->Overview, 30); $hotels[$i]->linkToHotel = $controller->linkToHotel($hotels[$i]->hotel_ID); $hotels[$i]->hotel_Name = str_ireplace($hotel_keywords, '<span id="hightlight" >' . $hotel_keywords . '</span>', $hotels[$i]->hotel_Name); } //echo $hotels[0]->images[0]->image_Name; //echo $hotels[0]->city_ID."hehehejhe"; $this->assignRef('hotels', $hotels); $this->assignRef('cities', $cities); $this->assignRef('pagination', $pagination); $this->assignRef('controller', $controller); //echo $this->cutDes("thang nay khung qua di thoi"); parent::display($tpl); }