<?php define('_JEXEC', 1); define('DS', DIRECTORY_SEPARATOR); define('JPATH_BASE', dirname(__FILE__)); require_once JPATH_BASE . DS . 'includes' . DS . 'defines.php'; require_once JPATH_BASE . DS . 'includes' . DS . 'framework.php'; include 'libraries/com_u_re/php/common_utils.php'; $config = new JConfig(); mysql_pconnect($config->host, $config->user, $config->password); mysql_select_db($config->db); mysql_query('SET NAMES "utf8"'); $cmd = "SELECT * FROM `iland4_bat_dong_san_vi` WHERE id=" . $_POST['id']; $excute = mysql_query($cmd); $info = mysql_fetch_assoc($excute); $tempImage = ilandCommonUtils::getPropertyThumbnail($_POST['id']); $gianguyencan = ilandCommonUtils::reFormatPrice($info['gia_nguyen_can']); if ($gianguyencan == 0) { $gianguyencan = "thương lượng"; } $giam2 = ilandCommonUtils::reFormatPrice($info['gia_m2']); if ($giam2 == 0) { $giam2 = "thương lượng"; } $info['img'] = JURI::base() . $tempImage['min_url']; //load template if ($info['duong_pho'] != '') { $phay = ', '; } if ($info['quan_huyen'] != '') { $phay1 = ', ';
function boSungThongTinBDS($propertyList, $templatePath, $moduleId, $tempalateName = NULL) { $propertyListCount = count($propertyList); for ($i = 0; $i < $propertyListCount; $i++) { // lay link va hinh anh thumbnail $tempImage = ilandCommonUtils::getPropertyThumbnail($propertyList[$i]['id']); $propertyList[$i]['image'] = $tempImage['min_url']; if (empty($propertyList[$i]['alias'])) { $propertyList[$i]['alias'] = unicode($propertyList[$i]['tieu_de']); } $propertyList[$i]['link'] = ilandCommonUtils::getPropertyLink($propertyList[$i]['alias'], $propertyList[$i]['id']); // lay template tien te $propertyList[$i]['tien_te_HTML'] = ilandCommonUtils::fetchCurrencyTemplate($propertyList[$i], $templatePath, $moduleId, $tempalateName); if (!empty($propertyList[$i]['ngay_dang'])) { $propertyList[$i]['ngay_dang'] = date('d-m-Y', $propertyList[$i]['ngay_dang']); } if (!empty($propertyList[$i]['ngay_chinh_sua'])) { $propertyList[$i]['ngay_chinh_sua'] = date('d-m-Y', $propertyList[$i]['ngay_chinh_sua']); } $propertyList[$i]['dia_chi'] = ilandCommonUtils::ketHopDiaChi($propertyList[$i]['so_nha'], $propertyList[$i]['duong_pho'], $propertyList[$i]['phuong_xa'], $propertyList[$i]['quan_huyen'], $propertyList[$i]['tinh_thanh']); $propertyList[$i]['gia_m2'] = ilandCommonUtils::reFormatPrice($propertyList[$i]['gia_m2']); $propertyList[$i]['gia_nguyen_can'] = ilandCommonUtils::reFormatPrice($propertyList[$i]['gia_nguyen_can']); /* if($propertyList[$i]['don_vi_dien_tich_id']==1||$propertyList[$i]['don_vi_dien_tich_id']==3){ $propertyList[$i]['gia_nguyen_can'] = ilandCommonUtils::layGiaNguyenCan( array('dien_tich_su_dung'=>$propertyList[$i]['dien_tich_su_dung'], 'gia'=>$propertyList[$i]['gia']) ); } else if($propertyList[$i]['don_vi_dien_tich_id']==2||$propertyList[$i]['don_vi_dien_tich_id']==4){ $propertyList[$i]['gia_m2'] = ilandCommonUtils::layGiaM2( array('dien_tich_su_dung'=>$propertyList[$i]['dien_tich_su_dung'], 'gia'=>$propertyList[$i]['gia']) ); } * */ $propertyList[$i]['gia'] = ilandCommonUtils::layGiaTien(array('don_vi_tien_id' => $propertyList[$i]['don_vi_tien_id'], 'don_vi_dien_tich_id' => $propertyList[$i]['don_vi_dien_tich_id'], 'gia' => $propertyList[$i]['gia'])); //$propertyList[$i]['gia'] = ilandCommonUtils::reFormatPrice($propertyList[$i]['gia']); $propertyList[$i]['luot_xem'] = ilandCommonUtils::demLuotXemBDS($propertyList[$i]['id']); } return $propertyList; }