상품검색 오류 수정
This commit is contained in:
@ -23,7 +23,17 @@ $qid = isset($_GET['qid']) ? trim($_GET['qid']) : '';
|
|||||||
$qcaid = isset($_GET['qcaid']) ? trim($_GET['qcaid']) : '';
|
$qcaid = isset($_GET['qcaid']) ? trim($_GET['qcaid']) : '';
|
||||||
$qfrom = isset($_GET['qfrom']) ? preg_replace('/[^0-9]/', '', trim($_GET['qfrom'])) : '';
|
$qfrom = isset($_GET['qfrom']) ? preg_replace('/[^0-9]/', '', trim($_GET['qfrom'])) : '';
|
||||||
$qto = isset($_GET['qto']) ? preg_replace('/[^0-9]/', '', trim($_GET['qto'])) : '';
|
$qto = isset($_GET['qto']) ? preg_replace('/[^0-9]/', '', trim($_GET['qto'])) : '';
|
||||||
$qsort = trim($_GET['qsort']);
|
if (isset($_GET['qsort'])) {
|
||||||
|
$qsort = trim($_GET['qsort']);
|
||||||
|
$qsort = preg_replace("/[\<\>\'\"\\\'\\\"\%\=\(\)\s]/", "", $qsort);
|
||||||
|
} else {
|
||||||
|
$qsort = '';
|
||||||
|
}
|
||||||
|
if (isset($_GET['qorder'])) {
|
||||||
|
$qorder = preg_match("/^(asc|desc)$/i", $qorder) ? $qorder : '';
|
||||||
|
} else {
|
||||||
|
$qorder = '';
|
||||||
|
}
|
||||||
|
|
||||||
// 검색범위 checkbox 처리
|
// 검색범위 checkbox 처리
|
||||||
$qname_check = false;
|
$qname_check = false;
|
||||||
@ -71,7 +81,7 @@ if ($q) {
|
|||||||
if ($qcaid)
|
if ($qcaid)
|
||||||
$where[] = " a.ca_id like '$qcaid%' ";
|
$where[] = " a.ca_id like '$qcaid%' ";
|
||||||
|
|
||||||
if ($qfrom || $qto)
|
if ($qfrom && $qto)
|
||||||
$where[] = " a.it_price between '$qfrom' and '$qto' ";
|
$where[] = " a.it_price between '$qfrom' and '$qto' ";
|
||||||
|
|
||||||
$sql_where = " where " . implode(" and ", $where);
|
$sql_where = " where " . implode(" and ", $where);
|
||||||
@ -198,7 +208,9 @@ $total_page = ceil($total_count / $items); // 전체 페이지 계산
|
|||||||
echo '<div>'.$error.'</div>';
|
echo '<div>'.$error.'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$query_string .= 'ca_id='.$ca_id.'&q='.urlencode($q);
|
$query_string = 'qname='.$qname.'&qexplan='.$qexplan.'&qid='.$qid;
|
||||||
|
if($qfrom && $qto) $query_string .= '&qfrom='.$qfrom.'&qto='.$qto;
|
||||||
|
$query_string .= '&qcaid='.$qcaid.'&q='.urlencode($q);
|
||||||
$query_string .='&qsort='.$qsort.'&qorder='.$qorder;
|
$query_string .='&qsort='.$qsort.'&qorder='.$qorder;
|
||||||
echo get_paging($config['cf_mobile_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$query_string.'&page=');
|
echo get_paging($config['cf_mobile_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$query_string.'&page=');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -28,7 +28,17 @@ $qid = isset($_GET['qid']) ? trim($_GET['qid']) : '';
|
|||||||
$qcaid = isset($_GET['qcaid']) ? trim($_GET['qcaid']) : '';
|
$qcaid = isset($_GET['qcaid']) ? trim($_GET['qcaid']) : '';
|
||||||
$qfrom = isset($_GET['qfrom']) ? preg_replace('/[^0-9]/', '', trim($_GET['qfrom'])) : '';
|
$qfrom = isset($_GET['qfrom']) ? preg_replace('/[^0-9]/', '', trim($_GET['qfrom'])) : '';
|
||||||
$qto = isset($_GET['qto']) ? preg_replace('/[^0-9]/', '', trim($_GET['qto'])) : '';
|
$qto = isset($_GET['qto']) ? preg_replace('/[^0-9]/', '', trim($_GET['qto'])) : '';
|
||||||
$qsort = trim($_GET['qsort']);
|
if (isset($_GET['qsort'])) {
|
||||||
|
$qsort = trim($_GET['qsort']);
|
||||||
|
$qsort = preg_replace("/[\<\>\'\"\\\'\\\"\%\=\(\)\s]/", "", $qsort);
|
||||||
|
} else {
|
||||||
|
$qsort = '';
|
||||||
|
}
|
||||||
|
if (isset($_GET['qorder'])) {
|
||||||
|
$qorder = preg_match("/^(asc|desc)$/i", $qorder) ? $qorder : '';
|
||||||
|
} else {
|
||||||
|
$qorder = '';
|
||||||
|
}
|
||||||
|
|
||||||
// 검색범위 checkbox 처리
|
// 검색범위 checkbox 처리
|
||||||
$qname_check = false;
|
$qname_check = false;
|
||||||
@ -76,7 +86,7 @@ if ($q) {
|
|||||||
if ($qcaid)
|
if ($qcaid)
|
||||||
$where[] = " a.ca_id like '$qcaid%' ";
|
$where[] = " a.ca_id like '$qcaid%' ";
|
||||||
|
|
||||||
if ($qfrom || $qto)
|
if ($qfrom && $qto)
|
||||||
$where[] = " a.it_price between '$qfrom' and '$qto' ";
|
$where[] = " a.it_price between '$qfrom' and '$qto' ";
|
||||||
|
|
||||||
$sql_where = " where " . implode(" and ", $where);
|
$sql_where = " where " . implode(" and ", $where);
|
||||||
@ -205,7 +215,9 @@ if ($is_admin) {
|
|||||||
echo '<div>'.$error.'</div>';
|
echo '<div>'.$error.'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$query_string .= 'ca_id='.$ca_id.'&q='.urlencode($q);
|
$query_string = 'qname='.$qname.'&qexplan='.$qexplan.'&qid='.$qid;
|
||||||
|
if($qfrom && $qto) $query_string .= '&qfrom='.$qfrom.'&qto='.$qto;
|
||||||
|
$query_string .= '&qcaid='.$qcaid.'&q='.urlencode($q);
|
||||||
$query_string .='&qsort='.$qsort.'&qorder='.$qorder;
|
$query_string .='&qsort='.$qsort.'&qorder='.$qorder;
|
||||||
echo get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$query_string.'&page=');
|
echo get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$query_string.'&page=');
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user