function listing_count(buffer, pageNo, totalPages, firstIndex, lastIndex, totalResults, totalMapSearchCount) {
buffer.append('
');
if (totalMapSearchCount != null && totalMapSearchCount > 200) {
buffer.append('
검색된 처음 200개의 리스팅만 표시됨. 지도를 확대나 축소하시거나 검색 조건을 재조정하세요.
');
}
pageLinks(buffer, pageNo, totalPages);
var str = '${3} 중의 ${1}-${2} 리스팅';
str = str.replace('$\{1\}', firstIndex);
str = str.replace('$\{2\}', lastIndex);
str = str.replace('$\{3\}', totalResults);
buffer.append('
'+str+'
');
buffer.append('
');
}
function pageLinks(buffer, pageNo, totalPages) {
buffer.append('');
buffer.append('');
buffer.append('');
if (pageNo > 1) {
buffer.append(' ');
} else {
buffer.append(' ');
}
buffer.append(' | ');
buffer.append('');
var minPage = pageNo - 5;
if (minPage <= 0) {
minPage = 1;
}
var maxPage = pageNo + 5;
if (maxPage > totalPages) { maxPage = totalPages; }
buffer.append('');
for (var i = minPage; i <= maxPage; i++) {
if (i == pageNo) {
buffer.append('' + pageNo + '');
} else {
buffer.append(' ' + i + ' ');
}
}
buffer.append('');
buffer.append(' | ');
buffer.append('');
if (pageNo < totalPages) {
buffer.append(' ');
} else {
buffer.append(' ');
}
buffer.append(' | ');
buffer.append('
');
}
function create_results_page(firstIndex, listings, pageNo, totalPages, lastIndex, totalResults) {
var buffer = new StringBuffer();
if (listings != null && listings.length > 0) {
buffer.append('');
buffer.append('');
buffer.append('');
buffer.append('');
listing_count(buffer, pageNo, totalPages, firstIndex, lastIndex, totalResults);
buffer.append('
');
} else {
buffer.append('');
buffer.append('');
buffer.append('리스팅중에 당신의 검색 기준에 맞는 것이 없습니다');
buffer.append('
');
}
return buffer.toString();
}