쇼핑몰 전체검색 페이지 스킨페이지 생성
This commit is contained in:
@ -13,13 +13,14 @@ $where[] = " (a.ca_id = b.ca_id and a.it_use = 1 and b.ca_use = 1) ";
|
||||
|
||||
$search_all = true;
|
||||
// 상세검색 이라면
|
||||
if (isset($_GET['qname']) || isset($_GET['qexplan']) || isset($_GET['qid']))
|
||||
if (isset($_GET['qname']) || isset($_GET['qexplan']) || isset($_GET['qid']) || isset($_GET['qbasic']))
|
||||
$search_all = false;
|
||||
|
||||
$q = utf8_strcut(get_search_string(trim($_GET['q'])), 30, "");
|
||||
$qname = isset($_GET['qname']) ? trim($_GET['qname']) : '';
|
||||
$qexplan = isset($_GET['qexplan']) ? trim($_GET['qexplan']) : '';
|
||||
$qid = isset($_GET['qid']) ? trim($_GET['qid']) : '';
|
||||
$qbasic = isset($_GET['qbasic']) ? trim($_GET['qbasic']) : '';
|
||||
$qcaid = isset($_GET['qcaid']) ? preg_replace('#[^a-z0-9]#i', '', trim($_GET['qcaid'])) : '';
|
||||
$qfrom = isset($_GET['qfrom']) ? preg_replace('/[^0-9]/', '', trim($_GET['qfrom'])) : '';
|
||||
$qto = isset($_GET['qto']) ? preg_replace('/[^0-9]/', '', trim($_GET['qto'])) : '';
|
||||
@ -35,18 +36,20 @@ if (isset($_GET['qorder'])) {
|
||||
$qorder = '';
|
||||
}
|
||||
|
||||
if(!($qname || $qexplan || $qid))
|
||||
if(!($qname || $qexplan || $qid || $qbasic))
|
||||
$search_all = true;
|
||||
|
||||
// 검색범위 checkbox 처리
|
||||
$qname_check = false;
|
||||
$qexplan_check = false;
|
||||
$qid_check = false;
|
||||
$qbasic_check = false;
|
||||
|
||||
if($search_all) {
|
||||
$qname_check = true;
|
||||
$qexplan_check = true;
|
||||
$qid_check = true;
|
||||
$qbasic_check = true;
|
||||
} else {
|
||||
if($qname)
|
||||
$qname_check = true;
|
||||
@ -54,6 +57,8 @@ if($search_all) {
|
||||
$qexplan_check = true;
|
||||
if($qid)
|
||||
$qid_check = true;
|
||||
if($qbasic)
|
||||
$qbasic_check = true;
|
||||
}
|
||||
|
||||
if ($q) {
|
||||
@ -70,6 +75,8 @@ if ($q) {
|
||||
$concat[] = "a.it_explan2";
|
||||
if ($search_all || $qid)
|
||||
$concat[] = "a.it_id";
|
||||
if ($search_all || $qbasic)
|
||||
$concat[] = "a.it_basic";
|
||||
$concat_fields = "concat(".implode(",' ',",$concat).")";
|
||||
|
||||
$detail_where[] = $concat_fields." like '%$word%' ";
|
||||
@ -111,135 +118,23 @@ $sql = " select COUNT(*) as cnt $sql_common $sql_where ";
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
$total_page = ceil($total_count / $items); // 전체 페이지 계산
|
||||
?>
|
||||
|
||||
$sql = " select b.ca_id, b.ca_name, count(*) as cnt $sql_common $sql_where group by b.ca_id order by b.ca_id ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
<!-- 검색 시작 { -->
|
||||
<div id="ssch">
|
||||
|
||||
<!-- 상세검색 항목 시작 { -->
|
||||
<div id="ssch_frm">
|
||||
<form name="frmdetailsearch">
|
||||
<input type="hidden" name="qsort" id="qsort" value="<?php echo $qsort ?>">
|
||||
<input type="hidden" name="qorder" id="qorder" value="<?php echo $qorder ?>">
|
||||
<input type="hidden" name="qcaid" id="qcaid" value="<?php echo $qcaid ?>">
|
||||
<div>
|
||||
<strong>검색범위</strong>
|
||||
<input type="checkbox" name="qname" id="ssch_qname" <?php echo $qname_check?'checked="checked"':'';?>> <label for="ssch_qname">상품명</label>
|
||||
<input type="checkbox" name="qexplan" id="ssch_qexplan" <?php echo $qexplan_check?'checked="checked"':'';?>> <label for="ssch_qexplan"><span class="sound_only">상품</span>설명</label>
|
||||
<input type="checkbox" name="qid" id="ssch_qid" <?php echo $qid_check?'checked="checked"':'';?>> <label for="ssch_qid"><span class="sound_only">상품</span>코드</label><br>
|
||||
</div>
|
||||
<div>
|
||||
<strong>상품가격 (원)</strong>
|
||||
<label for="ssch_qfrom" class="sound_only">최소 가격</label>
|
||||
<input type="text" name="qfrom" value="<?php echo $qfrom; ?>" id="ssch_qfrom" class="frm_input"> ~
|
||||
<label for="ssch_qto" class="sound_only">최대 가격</label>
|
||||
<input type="text" name="qto" value="<?php echo $qto; ?>" id="ssch_qto" class="frm_input"> 까지<br>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ssch_q" class="ssch_lbl">검색어</label>
|
||||
<input type="text" name="q" value="<?php echo $q; ?>" id="ssch_q" class="frm_input" maxlength="30">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
<p>
|
||||
상세검색을 선택하지 않거나, 상품가격을 입력하지 않으면 전체에서 검색합니다.<br>
|
||||
검색어는 최대 30글자까지, 여러개의 검색어를 공백으로 구분하여 입력 할수 있습니다.
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<ul id="ssch_sort">
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_sum_qty', 'desc'); return false;">판매많은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_price', 'asc'); return false;">낮은가격순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_price', 'desc'); return false;">높은가격순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_use_avg', 'desc'); return false;">평점높은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_use_cnt', 'desc'); return false;">후기많은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_update_time', 'desc'); return false;">최근등록순</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="ssch_ov">
|
||||
검색 결과 <b><?php echo $total_count; ?></b>건
|
||||
</div>
|
||||
</div>
|
||||
<!-- } 상세검색 항목 끝 -->
|
||||
|
||||
<!-- 검색된 분류 시작 { -->
|
||||
<div id="ssch_cate">
|
||||
<ul>
|
||||
<?php
|
||||
$sql = " select b.ca_id, b.ca_name, count(*) as cnt $sql_common $sql_where group by b.ca_id order by b.ca_id ";
|
||||
$result = sql_query($sql);
|
||||
$total_cnt = 0;
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
echo "<li><a href=\"#\" onclick=\"set_ca_id('{$row['ca_id']}'); return false;\">{$row['ca_name']} (".$row['cnt'].")</a></li>\n";
|
||||
$total_cnt += $row['cnt'];
|
||||
}
|
||||
echo '<li><a href="#" onclick="set_ca_id(\'\'); return false;">전체분류 <span>('.$total_cnt.')</span></a></li>'.PHP_EOL;
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- } 검색된 분류 끝 -->
|
||||
|
||||
<!-- 검색결과 시작 { -->
|
||||
<div>
|
||||
<?php
|
||||
// 리스트 유형별로 출력
|
||||
define('G5_SHOP_CSS_URL', G5_MSHOP_SKIN_URL);
|
||||
$list_file = G5_MSHOP_SKIN_PATH.'/'.$default['de_mobile_search_list_skin'];
|
||||
if (file_exists($list_file)) {
|
||||
$list = new item_list($list_file, $default['de_mobile_search_list_mod'], $default['de_mobile_search_list_row'], $default['de_mobile_search_img_width'], $default['de_mobile_search_img_height']);
|
||||
$list->set_query(" select * $sql_common $sql_where {$order_by} limit $from_record, $items ");
|
||||
$list->set_is_page(true);
|
||||
$list->set_mobile(true);
|
||||
$list->set_view('it_img', true);
|
||||
$list->set_view('it_id', false);
|
||||
$list->set_view('it_name', true);
|
||||
$list->set_view('it_basic', true);
|
||||
$list->set_view('it_cust_price', false);
|
||||
$list->set_view('it_price', true);
|
||||
$list->set_view('it_icon', true);
|
||||
$list->set_view('sns', true);
|
||||
echo $list->run();
|
||||
}
|
||||
else
|
||||
{
|
||||
$i = 0;
|
||||
$error = '<p class="sct_nofile">'.$list_file.' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</p>';
|
||||
}
|
||||
|
||||
if ($i==0)
|
||||
{
|
||||
echo '<div>'.$error.'</div>';
|
||||
}
|
||||
|
||||
$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;
|
||||
echo get_paging($config['cf_mobile_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'].'?'.$query_string.'&page=');
|
||||
?>
|
||||
</div>
|
||||
<!-- } 검색결과 끝 -->
|
||||
|
||||
</div>
|
||||
<!-- } 검색 끝 -->
|
||||
|
||||
<script>
|
||||
function set_sort(qsort, qorder)
|
||||
{
|
||||
var f = document.frmdetailsearch;
|
||||
f.qsort.value = qsort;
|
||||
f.qorder.value = qorder;
|
||||
f.submit();
|
||||
$categorys = array();
|
||||
// 검색된 분류를 배열에 저장
|
||||
while($row = sql_fetch_array($result)){
|
||||
$categorys[] = $row;
|
||||
}
|
||||
|
||||
function set_ca_id(qcaid)
|
||||
{
|
||||
var f = document.frmdetailsearch;
|
||||
f.qcaid.value = qcaid;
|
||||
f.submit();
|
||||
}
|
||||
</script>
|
||||
$search_skin = G5_MSHOP_SKIN_PATH.'/search.skin.php';
|
||||
|
||||
if(!file_exists($search_skin)) {
|
||||
echo str_replace(G5_PATH.'/', '', $search_skin).' 스킨 파일이 존재하지 않습니다.';
|
||||
} else {
|
||||
include_once($search_skin);
|
||||
}
|
||||
|
||||
<?php
|
||||
include_once(G5_MSHOP_PATH.'/_tail.php');
|
||||
?>
|
||||
|
||||
127
mobile/skin/shop/basic/search.skin.php
Normal file
127
mobile/skin/shop/basic/search.skin.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
?>
|
||||
<!-- 검색 시작 { -->
|
||||
<div id="ssch">
|
||||
|
||||
<!-- 상세검색 항목 시작 { -->
|
||||
<div id="ssch_frm">
|
||||
<form name="frmdetailsearch">
|
||||
<input type="hidden" name="qsort" id="qsort" value="<?php echo $qsort ?>">
|
||||
<input type="hidden" name="qorder" id="qorder" value="<?php echo $qorder ?>">
|
||||
<input type="hidden" name="qcaid" id="qcaid" value="<?php echo $qcaid ?>">
|
||||
<div>
|
||||
<strong>검색범위</strong>
|
||||
<input type="checkbox" name="qname" id="ssch_qname" <?php echo $qname_check?'checked="checked"':'';?>> <label for="ssch_qname">상품명</label>
|
||||
<input type="checkbox" name="qexplan" id="ssch_qexplan" <?php echo $qexplan_check?'checked="checked"':'';?>> <label for="ssch_qexplan"><span class="sound_only">상품</span>설명</label>
|
||||
<input type="checkbox" name="qid" id="ssch_qid" <?php echo $qid_check?'checked="checked"':'';?>> <label for="ssch_qid"><span class="sound_only">상품</span>코드</label>
|
||||
<input type="checkbox" name="qbasic" id="ssch_qbasic" value="1" <?php echo $qbasic_check?'checked="checked"':'';?>> <label for="ssch_qbasic">기본설명</label><br>
|
||||
</div>
|
||||
<div>
|
||||
<strong>상품가격 (원)</strong>
|
||||
<label for="ssch_qfrom" class="sound_only">최소 가격</label>
|
||||
<input type="text" name="qfrom" value="<?php echo $qfrom; ?>" id="ssch_qfrom" class="frm_input"> ~
|
||||
<label for="ssch_qto" class="sound_only">최대 가격</label>
|
||||
<input type="text" name="qto" value="<?php echo $qto; ?>" id="ssch_qto" class="frm_input"> 까지<br>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ssch_q" class="ssch_lbl">검색어</label>
|
||||
<input type="text" name="q" value="<?php echo $q; ?>" id="ssch_q" class="frm_input" maxlength="30">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
<p>
|
||||
상세검색을 선택하지 않거나, 상품가격을 입력하지 않으면 전체에서 검색합니다.<br>
|
||||
검색어는 최대 30글자까지, 여러개의 검색어를 공백으로 구분하여 입력 할수 있습니다.
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<ul id="ssch_sort">
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_sum_qty', 'desc'); return false;">판매많은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_price', 'asc'); return false;">낮은가격순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_price', 'desc'); return false;">높은가격순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_use_avg', 'desc'); return false;">평점높은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_use_cnt', 'desc'); return false;">후기많은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_update_time', 'desc'); return false;">최근등록순</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="ssch_ov">
|
||||
검색 결과 <b><?php echo $total_count; ?></b>건
|
||||
</div>
|
||||
</div>
|
||||
<!-- } 상세검색 항목 끝 -->
|
||||
|
||||
<!-- 검색된 분류 시작 { -->
|
||||
<div id="ssch_cate">
|
||||
<ul>
|
||||
<?php
|
||||
$total_cnt = 0;
|
||||
foreach( $categorys as $row ){
|
||||
echo "<li><a href=\"#\" onclick=\"set_ca_id('{$row['ca_id']}'); return false;\">{$row['ca_name']} (".$row['cnt'].")</a></li>\n";
|
||||
$total_cnt += $row['cnt'];
|
||||
}
|
||||
echo '<li><a href="#" onclick="set_ca_id(\'\'); return false;">전체분류 <span>('.$total_cnt.')</span></a></li>'.PHP_EOL;
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- } 검색된 분류 끝 -->
|
||||
|
||||
<!-- 검색결과 시작 { -->
|
||||
<div>
|
||||
<?php
|
||||
// 리스트 유형별로 출력
|
||||
define('G5_SHOP_CSS_URL', G5_MSHOP_SKIN_URL);
|
||||
$list_file = G5_MSHOP_SKIN_PATH.'/'.$default['de_mobile_search_list_skin'];
|
||||
if (file_exists($list_file)) {
|
||||
$list = new item_list($list_file, $default['de_mobile_search_list_mod'], $default['de_mobile_search_list_row'], $default['de_mobile_search_img_width'], $default['de_mobile_search_img_height']);
|
||||
$list->set_query(" select * $sql_common $sql_where {$order_by} limit $from_record, $items ");
|
||||
$list->set_is_page(true);
|
||||
$list->set_mobile(true);
|
||||
$list->set_view('it_img', true);
|
||||
$list->set_view('it_id', false);
|
||||
$list->set_view('it_name', true);
|
||||
$list->set_view('it_basic', true);
|
||||
$list->set_view('it_cust_price', false);
|
||||
$list->set_view('it_price', true);
|
||||
$list->set_view('it_icon', true);
|
||||
$list->set_view('sns', true);
|
||||
echo $list->run();
|
||||
}
|
||||
else
|
||||
{
|
||||
$i = 0;
|
||||
$error = '<p class="sct_nofile">'.$list_file.' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</p>';
|
||||
}
|
||||
|
||||
if ($i==0)
|
||||
{
|
||||
echo '<div>'.$error.'</div>';
|
||||
}
|
||||
|
||||
$query_string = 'qname='.$qname.'&qexplan='.$qexplan.'&qid='.$qid.'&qbasic='.$qbasic;
|
||||
if($qfrom && $qto) $query_string .= '&qfrom='.$qfrom.'&qto='.$qto;
|
||||
$query_string .= '&qcaid='.$qcaid.'&q='.urlencode($q);
|
||||
$query_string .='&qsort='.$qsort.'&qorder='.$qorder;
|
||||
echo get_paging($config['cf_mobile_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'].'?'.$query_string.'&page=');
|
||||
?>
|
||||
</div>
|
||||
<!-- } 검색결과 끝 -->
|
||||
|
||||
</div>
|
||||
<!-- } 검색 끝 -->
|
||||
|
||||
<script>
|
||||
function set_sort(qsort, qorder)
|
||||
{
|
||||
var f = document.frmdetailsearch;
|
||||
f.qsort.value = qsort;
|
||||
f.qorder.value = qorder;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
function set_ca_id(qcaid)
|
||||
{
|
||||
var f = document.frmdetailsearch;
|
||||
f.qcaid.value = qcaid;
|
||||
f.submit();
|
||||
}
|
||||
</script>
|
||||
151
shop/search.php
151
shop/search.php
@ -18,13 +18,14 @@ $where[] = " (a.ca_id = b.ca_id and a.it_use = 1 and b.ca_use = 1) ";
|
||||
|
||||
$search_all = true;
|
||||
// 상세검색 이라면
|
||||
if (isset($_GET['qname']) || isset($_GET['qexplan']) || isset($_GET['qid']))
|
||||
if (isset($_GET['qname']) || isset($_GET['qexplan']) || isset($_GET['qid']) || isset($_GET['qbasic']))
|
||||
$search_all = false;
|
||||
|
||||
$q = utf8_strcut(get_search_string(trim($_GET['q'])), 30, "");
|
||||
$qname = isset($_GET['qname']) ? trim($_GET['qname']) : '';
|
||||
$qexplan = isset($_GET['qexplan']) ? trim($_GET['qexplan']) : '';
|
||||
$qid = isset($_GET['qid']) ? trim($_GET['qid']) : '';
|
||||
$qbasic = isset($_GET['qbasic']) ? trim($_GET['qbasic']) : '';
|
||||
$qcaid = isset($_GET['qcaid']) ? preg_replace('#[^a-z0-9]#i', '', trim($_GET['qcaid'])) : '';
|
||||
$qfrom = isset($_GET['qfrom']) ? preg_replace('/[^0-9]/', '', trim($_GET['qfrom'])) : '';
|
||||
$qto = isset($_GET['qto']) ? preg_replace('/[^0-9]/', '', trim($_GET['qto'])) : '';
|
||||
@ -40,18 +41,20 @@ if (isset($_GET['qorder'])) {
|
||||
$qorder = '';
|
||||
}
|
||||
|
||||
if(!($qname || $qexplan || $qid))
|
||||
if(!($qname || $qexplan || $qid || $qbasic))
|
||||
$search_all = true;
|
||||
|
||||
// 검색범위 checkbox 처리
|
||||
$qname_check = false;
|
||||
$qexplan_check = false;
|
||||
$qid_check = false;
|
||||
$qbasic_check = false;
|
||||
|
||||
if($search_all) {
|
||||
$qname_check = true;
|
||||
$qexplan_check = true;
|
||||
$qid_check = true;
|
||||
$qbasic_check = true;
|
||||
} else {
|
||||
if($qname)
|
||||
$qname_check = true;
|
||||
@ -59,6 +62,8 @@ if($search_all) {
|
||||
$qexplan_check = true;
|
||||
if($qid)
|
||||
$qid_check = true;
|
||||
if($qbasic)
|
||||
$qbasic_check = true;
|
||||
}
|
||||
|
||||
if ($q) {
|
||||
@ -75,6 +80,8 @@ if ($q) {
|
||||
$concat[] = "a.it_explan2";
|
||||
if ($search_all || $qid)
|
||||
$concat[] = "a.it_id";
|
||||
if ($search_all || $qbasic)
|
||||
$concat[] = "a.it_basic";
|
||||
$concat_fields = "concat(".implode(",' ',",$concat).")";
|
||||
|
||||
$detail_where[] = $concat_fields." like '%$word%' ";
|
||||
@ -117,136 +124,22 @@ $row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
$total_page = ceil($total_count / $items); // 전체 페이지 계산
|
||||
|
||||
if ($is_admin) {
|
||||
echo '<div class="sit_admin"><a href="'.G5_ADMIN_URL.'/shop_admin/configform.php#anc_scf_etc'.'" class="btn_admin">검색 설정</a></div>';
|
||||
}
|
||||
?>
|
||||
$sql = " select b.ca_id, b.ca_name, count(*) as cnt $sql_common $sql_where group by b.ca_id order by b.ca_id ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
<!-- 검색 시작 { -->
|
||||
<div id="ssch">
|
||||
|
||||
<!-- 상세검색 항목 시작 { -->
|
||||
<div id="ssch_frm">
|
||||
<form name="frmdetailsearch">
|
||||
<input type="hidden" name="qsort" id="qsort" value="<?php echo $qsort ?>">
|
||||
<input type="hidden" name="qorder" id="qorder" value="<?php echo $qorder ?>">
|
||||
<input type="hidden" name="qcaid" id="qcaid" value="<?php echo $qcaid ?>">
|
||||
<div>
|
||||
<strong>검색범위</strong>
|
||||
<input type="checkbox" name="qname" id="ssch_qname" value="1" <?php echo $qname_check?'checked="checked"':'';?>> <label for="ssch_qname">상품명</label>
|
||||
<input type="checkbox" name="qexplan" id="ssch_qexplan" value="1" <?php echo $qexplan_check?'checked="checked"':'';?>> <label for="ssch_qexplan">상품설명</label>
|
||||
<input type="checkbox" name="qid" id="ssch_qid" value="1" <?php echo $qid_check?'checked="checked"':'';?>> <label for="ssch_qid">상품코드</label>
|
||||
</div>
|
||||
<div>
|
||||
<strong>상품가격 (원)</strong>
|
||||
<label for="ssch_qfrom" class="sound_only">최소 가격</label>
|
||||
<input type="text" name="qfrom" value="<?php echo $qfrom; ?>" id="ssch_qfrom" class="frm_input" size="10"> ~
|
||||
<label for="ssch_qto" class="sound_only">최대 가격</label>
|
||||
<input type="text" name="qto" value="<?php echo $qto; ?>" id="ssch_qto" class="frm_input" size="10"> 까지
|
||||
</div>
|
||||
<div>
|
||||
<label for="ssch_q" class="ssch_lbl">검색어</label>
|
||||
<input type="text" name="q" value="<?php echo $q; ?>" id="ssch_q" class="frm_input" size="40" maxlength="30">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
<p>
|
||||
상세검색을 선택하지 않거나, 상품가격을 입력하지 않으면 전체에서 검색합니다.<br>
|
||||
검색어는 최대 30글자까지, 여러개의 검색어를 공백으로 구분하여 입력 할수 있습니다.
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<ul id="ssch_sort">
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_sum_qty', 'desc'); return false;">판매많은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_price', 'asc'); return false;">낮은가격순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_price', 'desc'); return false;">높은가격순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_use_avg', 'desc'); return false;">평점높은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_use_cnt', 'desc'); return false;">후기많은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_update_time', 'desc'); return false;">최근등록순</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="ssch_ov">
|
||||
검색 결과 <b><?php echo $total_count; ?></b>건
|
||||
</div>
|
||||
</div>
|
||||
<!-- } 상세검색 항목 끝 -->
|
||||
|
||||
<!-- 검색된 분류 시작 { -->
|
||||
<div id="ssch_cate">
|
||||
<ul>
|
||||
<?php
|
||||
$sql = " select b.ca_id, b.ca_name, count(*) as cnt $sql_common $sql_where group by b.ca_id order by b.ca_id ";
|
||||
$result = sql_query($sql);
|
||||
$total_cnt = 0;
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
echo "<li><a href=\"#\" onclick=\"set_ca_id('{$row['ca_id']}'); return false;\">{$row['ca_name']} (".$row['cnt'].")</a></li>\n";
|
||||
$total_cnt += $row['cnt'];
|
||||
}
|
||||
echo '<li><a href="#" onclick="set_ca_id(\'\'); return false;">전체분류 <span>('.$total_cnt.')</span></a></li>'.PHP_EOL;
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- } 검색된 분류 끝 -->
|
||||
|
||||
<!-- 검색결과 시작 { -->
|
||||
<div>
|
||||
<?php
|
||||
// 리스트 유형별로 출력
|
||||
$list_file = G5_SHOP_SKIN_PATH.'/'.$default['de_search_list_skin'];
|
||||
if (file_exists($list_file)) {
|
||||
define('G5_SHOP_CSS_URL', G5_SHOP_SKIN_URL);
|
||||
$list = new item_list($list_file, $default['de_search_list_mod'], $default['de_search_list_row'], $default['de_search_img_width'], $default['de_search_img_height']);
|
||||
$list->set_query(" select * $sql_common $sql_where {$order_by} limit $from_record, $items ");
|
||||
$list->set_is_page(true);
|
||||
$list->set_view('it_img', true);
|
||||
$list->set_view('it_id', true);
|
||||
$list->set_view('it_name', true);
|
||||
$list->set_view('it_basic', true);
|
||||
$list->set_view('it_cust_price', false);
|
||||
$list->set_view('it_price', true);
|
||||
$list->set_view('it_icon', true);
|
||||
$list->set_view('sns', true);
|
||||
echo $list->run();
|
||||
}
|
||||
else
|
||||
{
|
||||
$i = 0;
|
||||
$error = '<p class="sct_nofile">'.$list_file.' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</p>';
|
||||
}
|
||||
|
||||
if ($i==0)
|
||||
{
|
||||
echo '<div>'.$error.'</div>';
|
||||
}
|
||||
|
||||
$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;
|
||||
echo get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'].'?'.$query_string.'&page=');
|
||||
?>
|
||||
</div>
|
||||
<!-- } 검색결과 끝 -->
|
||||
|
||||
</div>
|
||||
<!-- } 검색 끝 -->
|
||||
|
||||
<script>
|
||||
function set_sort(qsort, qorder)
|
||||
{
|
||||
var f = document.frmdetailsearch;
|
||||
f.qsort.value = qsort;
|
||||
f.qorder.value = qorder;
|
||||
f.submit();
|
||||
$categorys = array();
|
||||
// 검색된 분류를 배열에 저장
|
||||
while($row = sql_fetch_array($result)){
|
||||
$categorys[] = $row;
|
||||
}
|
||||
|
||||
function set_ca_id(qcaid)
|
||||
{
|
||||
var f = document.frmdetailsearch;
|
||||
f.qcaid.value = qcaid;
|
||||
f.submit();
|
||||
}
|
||||
</script>
|
||||
$search_skin = G5_SHOP_SKIN_PATH.'/search.skin.php';
|
||||
|
||||
if(!file_exists($search_skin)) {
|
||||
echo str_replace(G5_PATH.'/', '', $search_skin).' 스킨 파일이 존재하지 않습니다.';
|
||||
} else {
|
||||
include_once($search_skin);
|
||||
}
|
||||
|
||||
<?php
|
||||
include_once('./_tail.php');
|
||||
?>
|
||||
|
||||
130
skin/shop/basic/search.skin.php
Normal file
130
skin/shop/basic/search.skin.php
Normal file
@ -0,0 +1,130 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
?>
|
||||
<?php if ($is_admin) { //관리자이면 ?>
|
||||
<div class="sit_admin"><a href="<?php echo G5_ADMIN_URL; ?>'/shop_admin/configform.php#anc_scf_etc'.'" class="btn_admin">검색 설정</a></div>
|
||||
<?php } ?>
|
||||
<!-- 검색 시작 { -->
|
||||
<div id="ssch">
|
||||
|
||||
<!-- 상세검색 항목 시작 { -->
|
||||
<div id="ssch_frm">
|
||||
<form name="frmdetailsearch">
|
||||
<input type="hidden" name="qsort" id="qsort" value="<?php echo $qsort ?>">
|
||||
<input type="hidden" name="qorder" id="qorder" value="<?php echo $qorder ?>">
|
||||
<input type="hidden" name="qcaid" id="qcaid" value="<?php echo $qcaid ?>">
|
||||
<div>
|
||||
<strong>검색범위</strong>
|
||||
<input type="checkbox" name="qname" id="ssch_qname" value="1" <?php echo $qname_check?'checked="checked"':'';?>> <label for="ssch_qname">상품명</label>
|
||||
<input type="checkbox" name="qexplan" id="ssch_qexplan" value="1" <?php echo $qexplan_check?'checked="checked"':'';?>> <label for="ssch_qexplan">상품설명</label>
|
||||
<input type="checkbox" name="qid" id="ssch_qid" value="1" <?php echo $qid_check?'checked="checked"':'';?>> <label for="ssch_qid">상품코드</label>
|
||||
<input type="checkbox" name="qbasic" id="ssch_qbasic" value="1" <?php echo $qbasic_check?'checked="checked"':'';?>> <label for="ssch_qbasic">기본설명</label>
|
||||
</div>
|
||||
<div>
|
||||
<strong>상품가격 (원)</strong>
|
||||
<label for="ssch_qfrom" class="sound_only">최소 가격</label>
|
||||
<input type="text" name="qfrom" value="<?php echo $qfrom; ?>" id="ssch_qfrom" class="frm_input" size="10"> ~
|
||||
<label for="ssch_qto" class="sound_only">최대 가격</label>
|
||||
<input type="text" name="qto" value="<?php echo $qto; ?>" id="ssch_qto" class="frm_input" size="10"> 까지
|
||||
</div>
|
||||
<div>
|
||||
<label for="ssch_q" class="ssch_lbl">검색어</label>
|
||||
<input type="text" name="q" value="<?php echo $q; ?>" id="ssch_q" class="frm_input" size="40" maxlength="30">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
<p>
|
||||
상세검색을 선택하지 않거나, 상품가격을 입력하지 않으면 전체에서 검색합니다.<br>
|
||||
검색어는 최대 30글자까지, 여러개의 검색어를 공백으로 구분하여 입력 할수 있습니다.
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<ul id="ssch_sort">
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_sum_qty', 'desc'); return false;">판매많은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_price', 'asc'); return false;">낮은가격순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_price', 'desc'); return false;">높은가격순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_use_avg', 'desc'); return false;">평점높은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_use_cnt', 'desc'); return false;">후기많은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_update_time', 'desc'); return false;">최근등록순</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="ssch_ov">
|
||||
검색 결과 <b><?php echo $total_count; ?></b>건
|
||||
</div>
|
||||
</div>
|
||||
<!-- } 상세검색 항목 끝 -->
|
||||
|
||||
<!-- 검색된 분류 시작 { -->
|
||||
<div id="ssch_cate">
|
||||
<ul>
|
||||
<?php
|
||||
$total_cnt = 0;
|
||||
foreach( $categorys as $row ){
|
||||
if( empty($row) ) continue;
|
||||
echo "<li><a href=\"#\" onclick=\"set_ca_id('{$row['ca_id']}'); return false;\">{$row['ca_name']} (".$row['cnt'].")</a></li>\n";
|
||||
$total_cnt += $row['cnt'];
|
||||
}
|
||||
echo '<li><a href="#" onclick="set_ca_id(\'\'); return false;">전체분류 <span>('.$total_cnt.')</span></a></li>'.PHP_EOL;
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- } 검색된 분류 끝 -->
|
||||
|
||||
<!-- 검색결과 시작 { -->
|
||||
<div>
|
||||
<?php
|
||||
// 리스트 유형별로 출력
|
||||
$list_file = G5_SHOP_SKIN_PATH.'/'.$default['de_search_list_skin'];
|
||||
if (file_exists($list_file)) {
|
||||
define('G5_SHOP_CSS_URL', G5_SHOP_SKIN_URL);
|
||||
$list = new item_list($list_file, $default['de_search_list_mod'], $default['de_search_list_row'], $default['de_search_img_width'], $default['de_search_img_height']);
|
||||
$list->set_query(" select * $sql_common $sql_where {$order_by} limit $from_record, $items ");
|
||||
$list->set_is_page(true);
|
||||
$list->set_view('it_img', true);
|
||||
$list->set_view('it_id', true);
|
||||
$list->set_view('it_name', true);
|
||||
$list->set_view('it_basic', true);
|
||||
$list->set_view('it_cust_price', false);
|
||||
$list->set_view('it_price', true);
|
||||
$list->set_view('it_icon', true);
|
||||
$list->set_view('sns', true);
|
||||
echo $list->run();
|
||||
}
|
||||
else
|
||||
{
|
||||
$i = 0;
|
||||
$error = '<p class="sct_nofile">'.$list_file.' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</p>';
|
||||
}
|
||||
|
||||
if ($i==0)
|
||||
{
|
||||
echo '<div>'.$error.'</div>';
|
||||
}
|
||||
|
||||
$query_string = 'qname='.$qname.'&qexplan='.$qexplan.'&qid='.$qid.'&qbasic='.$qbasic;
|
||||
if($qfrom && $qto) $query_string .= '&qfrom='.$qfrom.'&qto='.$qto;
|
||||
$query_string .= '&qcaid='.$qcaid.'&q='.urlencode($q);
|
||||
$query_string .='&qsort='.$qsort.'&qorder='.$qorder;
|
||||
echo get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'].'?'.$query_string.'&page=');
|
||||
?>
|
||||
</div>
|
||||
<!-- } 검색결과 끝 -->
|
||||
|
||||
</div>
|
||||
<!-- } 검색 끝 -->
|
||||
|
||||
<script>
|
||||
function set_sort(qsort, qorder)
|
||||
{
|
||||
var f = document.frmdetailsearch;
|
||||
f.qsort.value = qsort;
|
||||
f.qorder.value = qorder;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
function set_ca_id(qcaid)
|
||||
{
|
||||
var f = document.frmdetailsearch;
|
||||
f.qcaid.value = qcaid;
|
||||
f.submit();
|
||||
}
|
||||
</script>
|
||||
127
theme/basic/mobile/skin/shop/basic/search.skin.php
Normal file
127
theme/basic/mobile/skin/shop/basic/search.skin.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
?>
|
||||
<!-- 검색 시작 { -->
|
||||
<div id="ssch">
|
||||
|
||||
<!-- 상세검색 항목 시작 { -->
|
||||
<div id="ssch_frm">
|
||||
<form name="frmdetailsearch">
|
||||
<input type="hidden" name="qsort" id="qsort" value="<?php echo $qsort ?>">
|
||||
<input type="hidden" name="qorder" id="qorder" value="<?php echo $qorder ?>">
|
||||
<input type="hidden" name="qcaid" id="qcaid" value="<?php echo $qcaid ?>">
|
||||
<div>
|
||||
<strong>검색범위</strong>
|
||||
<input type="checkbox" name="qname" id="ssch_qname" <?php echo $qname_check?'checked="checked"':'';?>> <label for="ssch_qname">상품명</label>
|
||||
<input type="checkbox" name="qexplan" id="ssch_qexplan" <?php echo $qexplan_check?'checked="checked"':'';?>> <label for="ssch_qexplan"><span class="sound_only">상품</span>설명</label>
|
||||
<input type="checkbox" name="qid" id="ssch_qid" <?php echo $qid_check?'checked="checked"':'';?>> <label for="ssch_qid"><span class="sound_only">상품</span>코드</label>
|
||||
<input type="checkbox" name="qbasic" id="ssch_qbasic" value="1" <?php echo $qbasic_check?'checked="checked"':'';?>> <label for="ssch_qbasic">기본설명</label><br>
|
||||
</div>
|
||||
<div>
|
||||
<strong>상품가격 (원)</strong>
|
||||
<label for="ssch_qfrom" class="sound_only">최소 가격</label>
|
||||
<input type="text" name="qfrom" value="<?php echo $qfrom; ?>" id="ssch_qfrom" class="frm_input"> ~
|
||||
<label for="ssch_qto" class="sound_only">최대 가격</label>
|
||||
<input type="text" name="qto" value="<?php echo $qto; ?>" id="ssch_qto" class="frm_input"> 까지<br>
|
||||
</div>
|
||||
<div>
|
||||
<label for="ssch_q" class="ssch_lbl">검색어</label>
|
||||
<input type="text" name="q" value="<?php echo $q; ?>" id="ssch_q" class="frm_input" maxlength="30">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
<p>
|
||||
상세검색을 선택하지 않거나, 상품가격을 입력하지 않으면 전체에서 검색합니다.<br>
|
||||
검색어는 최대 30글자까지, 여러개의 검색어를 공백으로 구분하여 입력 할수 있습니다.
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<ul id="ssch_sort">
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_sum_qty', 'desc'); return false;">판매많은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_price', 'asc'); return false;">낮은가격순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_price', 'desc'); return false;">높은가격순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_use_avg', 'desc'); return false;">평점높은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_use_cnt', 'desc'); return false;">후기많은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_update_time', 'desc'); return false;">최근등록순</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="ssch_ov">
|
||||
검색 결과 <b><?php echo $total_count; ?></b>건
|
||||
</div>
|
||||
</div>
|
||||
<!-- } 상세검색 항목 끝 -->
|
||||
|
||||
<!-- 검색된 분류 시작 { -->
|
||||
<div id="ssch_cate">
|
||||
<ul>
|
||||
<?php
|
||||
$total_cnt = 0;
|
||||
foreach( $categorys as $row ){
|
||||
echo "<li><a href=\"#\" onclick=\"set_ca_id('{$row['ca_id']}'); return false;\">{$row['ca_name']} (".$row['cnt'].")</a></li>\n";
|
||||
$total_cnt += $row['cnt'];
|
||||
}
|
||||
echo '<li><a href="#" onclick="set_ca_id(\'\'); return false;">전체분류 <span>('.$total_cnt.')</span></a></li>'.PHP_EOL;
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- } 검색된 분류 끝 -->
|
||||
|
||||
<!-- 검색결과 시작 { -->
|
||||
<div>
|
||||
<?php
|
||||
// 리스트 유형별로 출력
|
||||
define('G5_SHOP_CSS_URL', G5_MSHOP_SKIN_URL);
|
||||
$list_file = G5_MSHOP_SKIN_PATH.'/'.$default['de_mobile_search_list_skin'];
|
||||
if (file_exists($list_file)) {
|
||||
$list = new item_list($list_file, $default['de_mobile_search_list_mod'], $default['de_mobile_search_list_row'], $default['de_mobile_search_img_width'], $default['de_mobile_search_img_height']);
|
||||
$list->set_query(" select * $sql_common $sql_where {$order_by} limit $from_record, $items ");
|
||||
$list->set_is_page(true);
|
||||
$list->set_mobile(true);
|
||||
$list->set_view('it_img', true);
|
||||
$list->set_view('it_id', false);
|
||||
$list->set_view('it_name', true);
|
||||
$list->set_view('it_basic', true);
|
||||
$list->set_view('it_cust_price', false);
|
||||
$list->set_view('it_price', true);
|
||||
$list->set_view('it_icon', true);
|
||||
$list->set_view('sns', true);
|
||||
echo $list->run();
|
||||
}
|
||||
else
|
||||
{
|
||||
$i = 0;
|
||||
$error = '<p class="sct_nofile">'.$list_file.' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</p>';
|
||||
}
|
||||
|
||||
if ($i==0)
|
||||
{
|
||||
echo '<div>'.$error.'</div>';
|
||||
}
|
||||
|
||||
$query_string = 'qname='.$qname.'&qexplan='.$qexplan.'&qid='.$qid.'&qbasic='.$qbasic;
|
||||
if($qfrom && $qto) $query_string .= '&qfrom='.$qfrom.'&qto='.$qto;
|
||||
$query_string .= '&qcaid='.$qcaid.'&q='.urlencode($q);
|
||||
$query_string .='&qsort='.$qsort.'&qorder='.$qorder;
|
||||
echo get_paging($config['cf_mobile_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'].'?'.$query_string.'&page=');
|
||||
?>
|
||||
</div>
|
||||
<!-- } 검색결과 끝 -->
|
||||
|
||||
</div>
|
||||
<!-- } 검색 끝 -->
|
||||
|
||||
<script>
|
||||
function set_sort(qsort, qorder)
|
||||
{
|
||||
var f = document.frmdetailsearch;
|
||||
f.qsort.value = qsort;
|
||||
f.qorder.value = qorder;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
function set_ca_id(qcaid)
|
||||
{
|
||||
var f = document.frmdetailsearch;
|
||||
f.qcaid.value = qcaid;
|
||||
f.submit();
|
||||
}
|
||||
</script>
|
||||
127
theme/basic/skin/shop/basic/search.skin.php
Normal file
127
theme/basic/skin/shop/basic/search.skin.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
||||
?>
|
||||
<!-- 검색 시작 { -->
|
||||
<div id="ssch">
|
||||
|
||||
<!-- 상세검색 항목 시작 { -->
|
||||
<div id="ssch_frm">
|
||||
<form name="frmdetailsearch">
|
||||
<input type="hidden" name="qsort" id="qsort" value="<?php echo $qsort ?>">
|
||||
<input type="hidden" name="qorder" id="qorder" value="<?php echo $qorder ?>">
|
||||
<input type="hidden" name="qcaid" id="qcaid" value="<?php echo $qcaid ?>">
|
||||
<div>
|
||||
<strong>검색범위</strong>
|
||||
<input type="checkbox" name="qname" id="ssch_qname" value="1" <?php echo $qname_check?'checked="checked"':'';?>> <label for="ssch_qname">상품명</label>
|
||||
<input type="checkbox" name="qexplan" id="ssch_qexplan" value="1" <?php echo $qexplan_check?'checked="checked"':'';?>> <label for="ssch_qexplan">상품설명</label>
|
||||
<input type="checkbox" name="qid" id="ssch_qid" value="1" <?php echo $qid_check?'checked="checked"':'';?>> <label for="ssch_qid">상품코드</label>
|
||||
<input type="checkbox" name="qbasic" id="ssch_qbasic" value="1" <?php echo $qbasic_check?'checked="checked"':'';?>> <label for="ssch_qbasic">기본설명</label>
|
||||
</div>
|
||||
<div>
|
||||
<strong>상품가격 (원)</strong>
|
||||
<label for="ssch_qfrom" class="sound_only">최소 가격</label>
|
||||
<input type="text" name="qfrom" value="<?php echo $qfrom; ?>" id="ssch_qfrom" class="frm_input" size="10"> ~
|
||||
<label for="ssch_qto" class="sound_only">최대 가격</label>
|
||||
<input type="text" name="qto" value="<?php echo $qto; ?>" id="ssch_qto" class="frm_input" size="10"> 까지
|
||||
</div>
|
||||
<div>
|
||||
<label for="ssch_q" class="ssch_lbl">검색어</label>
|
||||
<input type="text" name="q" value="<?php echo $q; ?>" id="ssch_q" class="frm_input" size="40" maxlength="30">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
<p>
|
||||
상세검색을 선택하지 않거나, 상품가격을 입력하지 않으면 전체에서 검색합니다.<br>
|
||||
검색어는 최대 30글자까지, 여러개의 검색어를 공백으로 구분하여 입력 할수 있습니다.
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<ul id="ssch_sort">
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_sum_qty', 'desc'); return false;">판매많은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_price', 'asc'); return false;">낮은가격순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_price', 'desc'); return false;">높은가격순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_use_avg', 'desc'); return false;">평점높은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_use_cnt', 'desc'); return false;">후기많은순</a></li>
|
||||
<li><a href="#" class="btn01" onclick="set_sort('it_update_time', 'desc'); return false;">최근등록순</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="ssch_ov">
|
||||
검색 결과 <b><?php echo $total_count; ?></b>건
|
||||
</div>
|
||||
</div>
|
||||
<!-- } 상세검색 항목 끝 -->
|
||||
|
||||
<!-- 검색된 분류 시작 { -->
|
||||
<div id="ssch_cate">
|
||||
<ul>
|
||||
<?php
|
||||
$total_cnt = 0;
|
||||
foreach( $categorys as $row ){
|
||||
if( empty($row) ) continue;
|
||||
echo "<li><a href=\"#\" onclick=\"set_ca_id('{$row['ca_id']}'); return false;\">{$row['ca_name']} (".$row['cnt'].")</a></li>\n";
|
||||
$total_cnt += $row['cnt'];
|
||||
}
|
||||
echo '<li><a href="#" onclick="set_ca_id(\'\'); return false;">전체분류 <span>('.$total_cnt.')</span></a></li>'.PHP_EOL;
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- } 검색된 분류 끝 -->
|
||||
|
||||
<!-- 검색결과 시작 { -->
|
||||
<div>
|
||||
<?php
|
||||
// 리스트 유형별로 출력
|
||||
$list_file = G5_SHOP_SKIN_PATH.'/'.$default['de_search_list_skin'];
|
||||
if (file_exists($list_file)) {
|
||||
define('G5_SHOP_CSS_URL', G5_SHOP_SKIN_URL);
|
||||
$list = new item_list($list_file, $default['de_search_list_mod'], $default['de_search_list_row'], $default['de_search_img_width'], $default['de_search_img_height']);
|
||||
$list->set_query(" select * $sql_common $sql_where {$order_by} limit $from_record, $items ");
|
||||
$list->set_is_page(true);
|
||||
$list->set_view('it_img', true);
|
||||
$list->set_view('it_id', true);
|
||||
$list->set_view('it_name', true);
|
||||
$list->set_view('it_basic', true);
|
||||
$list->set_view('it_cust_price', false);
|
||||
$list->set_view('it_price', true);
|
||||
$list->set_view('it_icon', true);
|
||||
$list->set_view('sns', true);
|
||||
echo $list->run();
|
||||
}
|
||||
else
|
||||
{
|
||||
$i = 0;
|
||||
$error = '<p class="sct_nofile">'.$list_file.' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</p>';
|
||||
}
|
||||
|
||||
if ($i==0)
|
||||
{
|
||||
echo '<div>'.$error.'</div>';
|
||||
}
|
||||
|
||||
$query_string = 'qname='.$qname.'&qexplan='.$qexplan.'&qid='.$qid.'&qbasic='.$qbasic;
|
||||
if($qfrom && $qto) $query_string .= '&qfrom='.$qfrom.'&qto='.$qto;
|
||||
$query_string .= '&qcaid='.$qcaid.'&q='.urlencode($q);
|
||||
$query_string .='&qsort='.$qsort.'&qorder='.$qorder;
|
||||
echo get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'].'?'.$query_string.'&page=');
|
||||
?>
|
||||
</div>
|
||||
<!-- } 검색결과 끝 -->
|
||||
|
||||
</div>
|
||||
<!-- } 검색 끝 -->
|
||||
|
||||
<script>
|
||||
function set_sort(qsort, qorder)
|
||||
{
|
||||
var f = document.frmdetailsearch;
|
||||
f.qsort.value = qsort;
|
||||
f.qorder.value = qorder;
|
||||
f.submit();
|
||||
}
|
||||
|
||||
function set_ca_id(qcaid)
|
||||
{
|
||||
var f = document.frmdetailsearch;
|
||||
f.qcaid.value = qcaid;
|
||||
f.submit();
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user