function boSungThongTinDuAn($projectList)
 {
     $projectListCount = count($projectList);
     for ($i = 0; $i < $projectListCount; $i++) {
         // lay link va hinh anh thumbnail
         $projectList[$i]['luot_xem'] = ilandCommonUtils::demLuotXemDuAn($projectList[$i]['id']);
     }
     return $projectList;
 }
Example #2
0
 function displayProjectDetail($id)
 {
     $this->assignRef('lang', ilandCommonUtils::getLanguage());
     $this->assignRef('SiteDBConfig', ilandCommonUtils::getSiteDBConfig());
     // global config
     global $u_reGlobalConfig;
     // get data
     $projectModel = new U_ReModelProjects();
     $projectData = $projectModel->getProjectById($id, $this->lang, $this->SiteDBConfig);
     // get template
     //$templateName = JFactory::getApplication()->getTemplate();
     //$templatePath = JPATH_THEMES . DS . $templateName . DS . "html" . DS . "com_u_re". DS . "projects";
     echo "<pre>";
     print_r($projectData);
     echo "</pre>";
     exit;
     ilandCommonUtils::themLuotXemDuAn($id);
     $projectData['luot_xem'] = ilandCommonUtils::demLuotXemDuAn($id);
     $hien_thi_luot_xem = 0;
     if ($u_reGlobalConfig['COMMON']['luot_xem_bds'] == 1) {
         $hien_thi_luot_xem = 1;
     } else {
         $hien_thi_luot_xem = 0;
     }
     $this->assign('hien_thi_luot_xem', $hien_thi_luot_xem);
     $templatePath = "templates/" . $u_reGlobalConfig['DB']['template'] . "/html/com_u_re/projects/";
     $this->addTemplatePath($templatePath);
     // hardcode template name
     $this->setLayout($u_reGlobalConfig['PROJECT']['detail_template']);
     // assign template
     // status 0 => trang chi tiet bat dong san
     $this->assign('status', 0);
     $this->assign('googlemapDisplay', $u_reGlobalConfig['MAP']['property_map_function_on']);
     $this->assign('googlemapEnable', $u_reGlobalConfig['MAP']['property_map_function_enable']);
     // hien thi cho chinh
     $mainImage = ilandCommonUtils::getProjectMainImage($id);
     // hien thi cho trinh dien anh
     $subImages = ilandCommonUtils::getProjectSubImages($id);
     $imageData = array();
     $imageData['mainImage'] = $mainImage;
     $imageData['subImages'] = $subImages;
     $imageData['status'] = 0;
     // chi tiet bds front end
     $imageData['title'] = $projectData['ten'];
     $imageTemplateName = 'image_block';
     $imageBlockHTML = ilandCommonUtils::fetchImageBlockTemplate($templatePath, $imageTemplateName, $imageData);
     $this->assignRef('imageBlockHTML', $imageBlockHTML);
     // get comment
     $commentHTML = ilandCommonUtils::getComment($id, 'duan');
     $this->assignRef('commentHTML', $commentHTML);
     $this->status = 0;
     /*
      * Get same properties
      *  - Get id
      *  - Get current page
      */
     // mặc định là trang 1
     $currentPage = 1;
     $this->assignRef('row', $projectData);
     $document =& JFactory::getDocument();
     if ($this->escape($projectData['tieu_de_trang']) == NULL || trim($projectData['tieu_de_trang']) == '') {
         $page_title = ucfirst(JText::sprintf($projectData['ten'] . ', ' . $this->escape($projectData['dia_chi'])));
     } else {
         $page_title = ucfirst($this->escape($projectData['tieu_de_trang']));
     }
     if ($this->escape($projectData['tu_khoa_trang']) == NULL || trim($projectData['tu_khoa_trang']) == '') {
         $page_keywords = $u_reGlobalConfig['SEO']['tu_khoa_trang_mac_dinh'];
     } else {
         $page_keywords = ucfirst($this->escape($projectData['tu_khoa_trang']));
     }
     $document->setMetaData('keywords', $page_keywords);
     if ($this->escape($projectData['mo_ta_trang']) == NULL || trim($projectData['mo_ta_trang']) == '') {
         $page_description = $u_reGlobalConfig['SEO']['mo_ta_trang_mac_dinh'];
     } else {
         $page_description = ucfirst($this->escape($projectData['mo_ta_trang']));
     }
     $document->setMetaData('description', $page_description);
     $mainframe =& JFactory::getApplication();
     $pathway =& $mainframe->getPathway();
     $pathway->addItem($page_title);
     $document->setTitle($page_title);
     $this->layDuAnLienQuan($id);
     parent::display();
 }