예제 #1
0
 function fetchCurrencyTemplate($property, $templatePath, $moduleId, $template_tien_te = NULL)
 {
     if (!empty($property['don_vi_tien'])) {
         $donViTienChinh = $property['don_vi_tien'];
     } else {
         // TODO: Set default don vi tien theo ngon ngu hoac theo cau hinh.
         $donViTienChinh = 'VND';
     }
     $donViTienList = U_ReModelProperties::layDanhSachDonViTien();
     $donViTienArr = array();
     foreach ($donViTienList as $dv) {
         $donViTienArr[$dv['ten']] = $dv['ti_gia'];
     }
     if (isset($template_tien_te) || trim($template_tien_te) != NULL) {
         $tienTemplate = $template_tien_te;
     } else {
         $tienTemplate = U_ReConfig::getValueByKey('PROPERTY', 'tien_template');
     }
     $tiGiaChinh = $donViTienArr[$donViTienChinh];
     $giaArr = array();
     foreach ($donViTienArr as $key => $value) {
         $giaArr[$key] = $property['gia'] * $tiGiaChinh / $value;
         $giaArr[$key] = round($giaArr[$key], 2);
     }
     // truong hop dac biet
     $giaArr['VND'] = ilandCommonUtils::reFormatPrice($giaArr['VND']);
     $donviChinh = ilandCommonUtils::layGiaTien(array('don_vi_tien_id' => $property['don_vi_tien_id'], 'don_vi_dien_tich_id' => $property['don_vi_dien_tich_id'], 'gia' => $property['gia']));
     // $giaChinh = $giaArr[$donViTienChinh];
     $giaChinh = $donviChinh;
     $template = new JView();
     $template->addTemplatePath($templatePath);
     $template->assignRef('giaArr', $giaArr);
     $template->assignRef('id', $property['id']);
     $template->assignRef('donViTienChinh', $donViTienChinh);
     $template->assignRef('giaChinh', $giaChinh);
     $template->assignRef('moduleId', $moduleId);
     $template->assignRef('don_vi_dien_tich_id', $property['don_vi_dien_tich_id']);
     $template->setLayout($tienTemplate);
     return $template->loadTemplate();
 }
예제 #2
0
 function compareProperty($ids)
 {
     $maxIndex = count($ids) - 1;
     $where = ' id IN (';
     for ($i = 0; $i < $maxIndex; $i++) {
         $where .= $ids[$maxIndex] . ',';
     }
     $where .= $ids[$maxIndex];
     $where .= ')';
     global $u_reGlobalConfig;
     $returnField = $u_reGlobalConfig['PROPERTY']['du_lieu_so_sanh_bat_dong_san'];
     $listData = U_ReModelProperties::getListProperties($returnField, $where, 1, '', $maxIndex + 1);
     // load template
     $templateName = JFactory::getApplication()->getTemplate();
     $templatePath = JPATH_THEMES . DS . $templateName . DS . "html" . DS . "com_u_re" . DS . "properties";
     $this->addTemplatePath($templatePath);
     $this->setLayout($u_reGlobalConfig['PROPERTY']['compare_template']);
     $this->assignRef('data', $listData);
     parent::display();
 }
예제 #3
0
 function saveDangKyMuaThue()
 {
     // save
     U_ReModelProperties::saveDangKyMuaThue();
     // redirect to response page
     $currentTemplate = JFactory::getApplication()->getTemplate();
     $templatePath = JPATH_THEMES . DS . $currentTemplate . DS . "html" . DS . "com_u_re" . DS . "properties";
     $this->addTemplatePath($templatePath);
     //$this->setLayout( $u_reGlobalConfig['PROPERTY']['mua_thue_template'] );
     $this->setLayout('dang_ky_mua_thue_complete');
     parent::display();
 }
예제 #4
0
 function updateLuotXem()
 {
     $id = JRequest::getVar('cid', array(0), '', 'array');
     $language = ilandCommonUtils::getLanguage();
     $propertiesModel = new U_ReModelProperties();
     $propertiesModel->setLuotXem($id[0], $language);
 }
예제 #5
0
if (isset($user->approved) && $user->approved == "0") {
    $op = 1;
}
echo "<input type=\"button\" onclick=\"submitForm( {$op} ,'1', '{$lang}' )\" name=\"save_review\" class=\"button1\" value=\" " . JText::_('SAVE_REVIEW') . " \" />";
echo $strbreak;
// [47]
echo "<input type=\"button\" onclick=\"submitForm( {$op} ,'2', '{$lang}')\" name=\"save_published\" class=\"button1\" value=\" " . JText::_('SAVE_PUBLISHED') . " \" />";
echo $strbreak;
// [48]
echo "<input type=\"button\" onclick=\"submitForm( {$op} ,'3', '{$lang}' )\" name=\"save_draft\" class=\"button1\" value=\" " . JText::_('SAVE_DRAFT') . " \" />";
echo $strbreak;
// [49]
echo "<input type=\"button\" onclick=\"onChangeAddress()\" value=\" " . JText::_('UPDATE_MAP') . " \" />";
echo $strbreak;
// [50]
echo U_ReModelProperties::fetchTienIchTemplate($tienIchIds, $templatePath, $templateName, true, $lang);
echo $strbreak;
// [51]
echo JText::_('TINH_THANH');
echo $strbreak;
// [52]
echo JText::_('QUAN_HUYEN');
echo $strbreak;
// [53]
echo JText::_('LOAI_HINH_GIAO_DICH');
echo $strbreak;
// [54]
echo JText::_('LOAI_BDS');
echo $strbreak;
// [55]
echo JText::_('CHIEU_DAI');
예제 #6
0
 function saveDangKyMuaThue()
 {
     $ngaydang = '' . time();
     $id = JRequest::getVar('id', '');
     $datas_vi = array('ten_nguoi_lien_he' => JRequest::getVar('ho_ten', '', 'POST'), 'mo_ta_chi_tiet' => JRequest::getVar('nhu_cau', '', 'POST', 'string', JREQUEST_ALLOWRAW), 'dien_thoai_nguoi_lien_he' => JRequest::getVar('dien_thoai', '', 'POST'), 'dia_chi_nguoi_lien_he' => JRequest::getVar('dia_chi', '', 'POST'), 'hien_thi_ra_ngoai' => '1', 'ngay_dang' => $ngaydang, 'loai_giao_dich_id' => JRequest::getVar('loai', '3', 'POST'), 'alias' => JRequest::getVar('alias', '', 'POST'));
     $datas_vi['tieu_de'] = ilandCommonUtils::getShortDescription($datas_vi['mo_ta_chi_tiet'], 100);
     // set default sef
     if (empty($datas_vi['alias'])) {
         $datas_vi['alias'] = str_replace(' ', '-', $datas_vi['tieu_de']);
     }
     if (!empty($datas_vi['mo_ta_chi_tiet'])) {
         $datas_vi['mo_ta_chi_tiet'] = ilandCommonUtils::stripWordContent($datas_vi['mo_ta_chi_tiet']);
     }
     if ($id) {
         //tieng viet
         if (isset($datas_vi['ma_so']) && ($datas_vi['ma_so'] == '0' || $datas_vi['ma_so'] == '')) {
             $datas_vi['ma_so'] = '' . $id;
         }
         $DataValue = array_values($datas_vi);
         $DataKey = array_keys($datas_vi);
         $i = 0;
         $Keyvalue = '';
         foreach ($DataKey as $data) {
             $Keyvalue .= ",";
             $Keyvalue .= $data;
             $Keyvalue .= " = ";
             $Keyvalue .= "'{$DataValue[$i]}'";
             $i++;
         }
         $paramvi = substr($Keyvalue, 1);
         U_ReModelProperties::getUpdateProperties($id, $paramvi, 'vi');
     } else {
         //	them bds
         // them tieng viet
         if (isset($datas_vi['ma_so']) && ($datas_vi['ma_so'] == '0' || $datas_vi['ma_so'] == '')) {
             $datas_vi['ma_so'] = '' . ilandCommonUtils::layMaSo();
         }
         $DataKey = array_keys($datas_vi);
         $Keyvalue = '';
         foreach ($DataKey as $Datavalue) {
             $Keyvalue .= ',';
             $Keyvalue .= $Datavalue;
         }
         $paramvi = substr($Keyvalue, 1);
         $insertId = U_ReModelProperties::themBDS($paramvi, $datas_vi, 'vi');
     }
 }
예제 #7
0
    }
    // tinh lai offet & limit cua tin thuong
    if ($currentPage == 1) {
        $newCurrentPage = 1;
        $newLimit = $limit - count($dataEs);
    } else {
        if ($currentPage > 1) {
            $soTinThuong = $currentPage * $limit - $countEs;
            $newCurrentPage = floor($soTinThuong / $limit) + 1;
            $newLimit = $soTinThuong - ($newCurrentPage - 1) * $limit;
            if ($newLimit == 0) {
                $newLimit = $limit;
            }
        }
    }
    $dataFull = U_ReModelProperties::getListProperties($returnField, $conditionParam . $pr1, $newCurrentPage, $ordering, $newLimit);
} else {
    $dataFull = $dataEs;
}
if (!empty($dataEs)) {
    if (count($dataEs) >= $limit) {
        $data = $dataEs;
    } else {
        $data = array_merge($dataEs, $dataFull[3]);
    }
} else {
    $data = $dataFull[3];
}
// khong su dung cach count total page nay nua
// $count = count( $data );
$currentTemplate = JFactory::getApplication()->getTemplate();