Example #1
0
function lay_du_lieu($table)
{
    $language = '';
    if ($language == NULL) {
        $language = ilandCommonUtils::getLanguage();
    }
    $propertyModel = new U_reModelProperties();
    $projectModel = new U_ReModelProjects();
    switch ($table) {
        case 'loai_giao_dich':
            return $propertyModel->layDanhSachLoaiGiaoDich($language);
        case 'huong':
            return $propertyModel->layDanhSachHuong($language);
        case 'loai_bds':
            return $propertyModel->layDanhSachLoaiBatDongSan($language);
        case 'tinh_thanh':
            return $propertyModel->layDanhSachTinhThanh($language);
        case 'quan_huyen':
            if (JRequest::getVar('tinh_thanh_id')) {
                $townId = JRequest::getVar('tinh_thanh_id');
            } else {
                // $townId = U_ReConfig::getValueByKey( 'COMMON', 'tinh_thanh_mac_dinh' );
                if (isset($_SESSION['tmp'])) {
                    $townId = $_SESSION['tmp']['tinh_thanh_id'];
                } else {
                    $townId = 0;
                }
            }
            return $propertyModel->layDanhSachQuanHuyen($townId, 'vi');
        case 'phuong_xa':
            if (JRequest::getVar('quan_huyen_id')) {
                $quanHuyenId = JRequest::getVar('quan_huyen_id');
            } else {
                $quanHuyenId = U_ReConfig::getValueByKey('COMMON', 'quan_huyen_mac_dinh');
            }
            return $propertyModel->layDanhSachPhuongXa($quanHuyenId);
        case 'duong_pho':
            if (JRequest::getVar('quan_huyen_id')) {
                $quanHuyenId = JRequest::getVar('quan_huyen_id');
            } else {
                $quanHuyenId = U_ReConfig::getValueByKey('COMMON', 'quan_huyen_mac_dinh');
            }
            return $propertyModel->layDanhSachDuongPho($quanHuyenId);
        case 'nhom_du_an':
            return $nhomduan = $projectModel->laynhomduan($language);
        case 'tien_ich':
            return $propertyModel->layDanhSachTienIch($language);
        case 'du_an':
            $ix_quan_huyen_id = JRequest::getVar('quan_huyen_id', 0);
            $ix_tinh_thanh_id = JRequest::getVar('tinh_thanh_id', 0);
            return $projectModel->laydanhsachduan($ix_quan_huyen_id, $ix_tinh_thanh_id);
    }
}
 function getSelectAdvantage($language, $advantage)
 {
     $html = '';
     $rows = U_reModelProperties::layDanhSachTienIch($language);
     $advantages = array();
     if (!empty($advantage)) {
         $advantages = explode('-', $advantage);
     }
     foreach ($rows as $k => $row) {
         $checked = '';
         if (in_array($row['id'], $advantages)) {
             $checked = 'checked="checked"';
         }
         $html .= '<label class="advantage">' . PHP_EOL . '<input type="checkbox" id="advantages[' . $k . ']" name="advantagedValue[' . $k . ']" value="' . $row['id'] . '" ' . $checked . ' />' . PHP_EOL . $row['ten'] . PHP_EOL . '</label>' . PHP_EOL;
     }
     return $html;
 }