function getSelectBox($table, $name, $title, $checked, $onchange = NULL, $townId = NULL, $style = NULL, $class = NULL, $language = NULL) { /* echo "<pre>"; print_r( $name.'----'.$class ); echo "</pre>"; */ if ($language == NULL) { $language = ilandCommonUtils::getLanguage(); } // TODO: remove hardcode language // $language = 'en'; // print_r($language); $propertyModel = new U_reModelProperties(); $projectModel = new U_ReModelProjects(); switch ($table) { case 'loai_giao_dich': $rows = $propertyModel->layDanhSachLoaiGiaoDich($language); //print_r($rows); //exit; break; case 'phap_ly': $rows = $propertyModel->layDanhSachPhapLy($language); break; case 'vi_tri': $rows = $propertyModel->layDanhSachTienIch('1', $language); // print_r($rows); // exit; break; case 'huong': $rows = $propertyModel->layDanhSachHuong($language); break; case 'don_vi_dien_tich': $temp = 1; if ($checked == 3 || $checked == 4) { $temp = 2; } $rows = $propertyModel->layDanhSachDonViDienTich($language, $temp); break; case 'loai_bds': $rows = $propertyModel->layDanhSachLoaiBatDongSan($language); break; case 'tinh_thanh': $rows = $propertyModel->layDanhSachTinhThanh($language); break; case 'quan_huyen': $rows = $propertyModel->layDanhSachQuanHuyen($townId, $language); break; case 'loai_tien_ich': $DBConfig = ilandCommonUtils::getSiteDBConfig(); $rows = iland4_layDanhSachLoaiTienIch($DBConfig, $language); break; case 'loai_du_an': // $rows = $propertyModel->layDanhSachLoaiBatDongSan($language); $rows = $projectModel->laynhomduan($language); break; case 'nha_moi_gioi': // $rows = $propertyModel->layDanhSachLoaiBatDongSan($language); $realtorData = $projectModel->laynhamoigioi($language); $rows = $realtorData[3]; // print_r($rows); // exit; break; case 'phuong_xa': // get quan huyen id $rows = $propertyModel->layDanhSachPhuongXa($townId); break; case 'duong_pho': $rows = $propertyModel->layDanhSachDuongPho($townId); break; case 'nhom_du_an': // $rows = $projectModel->laynhomduan($language); // break; $nhomduan = $projectModel->laydanhsachduan(); $rows = $nhomduan[3]; break; case 'du_an': $rows = $projectModel->laydanhsachduan($townId); break; } /* case 'jea_type' : $rows = getTypeList($language); break; case 'jea_town' : $rows = getTownList(U_ReUtils::getSiteConfig(), $language); break; case 'jea_area' : $rows = getAreaList(U_ReUtils::getSiteConfig(), $Town_id, $language); break; case 'jea_project_type' : $rows = getProjectTypeList(U_ReUtils::getSiteConfig(), $language); break; */ if (empty($class)) { $class = "class='inputbox'"; } $html = ''; $html .= "<select name='" . $name . "' id='" . $name . "' onchange='" . $onchange . "' " . $class . $style . ">"; if (!empty($title)) { $html .= "<option value='0'>{$title}</option>"; } if (!empty($rows)) { foreach ($rows as $row) { $selected = ''; $selected = $row["id"] == $checked ? 'selected = selected' : ''; $html .= "<option value={$row['id']} {$selected} >{$row['ten']}</option>"; } } $html .= "</select>"; return $html; }