/home/mjc1/public_html/j3demo/shopm/sch_item.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
include_once("./_common.php");

$kword_list add_search_list_get(6);

if(
$app_id=='jaeshim1439'){ // 현동몰일경우 다르게
    
include("./sch_item.inc1.php");
} else {
?>
    <!-- 상단메뉴고정 -->
    <header class="relative height40 align_c gray_line_b bg_white">
        <h1 class="l_height40 txt17">검색</h1>
        <a class="absolute ab_top_left block p5 box30 close_sch_item"><img src="<?php echo $j3_imgm_url;?>/ico_back.png" alt="이전" class="box_full"></a>
    </header>
    <!-- //상단메뉴고정 -->

    <div id="container">
        <div class="relative block m15 height40 custom_line25 bg_white">
<form name='total_search_form' id='total_search_form' method='get' action='<?php echo "{$j3_shop_url}/search.php";?>' >
            <label class="absolute ab_top_left p3 width40 box32 total_search_btn"><img src="<?php echo $j3_imgm_url;?>/ico_search_s.png" alt="검색" class="box_full"></label>
            <input id="sch_str" name='skey' type="text" placeholder="검색어를 입력하세요." class="ml40 width_80 height40 none_line">
</form>
        </div>

        <div class="m15 gray_line">
<style>
.tab_nav .on {color:#fff;font-weight:600;background:#00bbb6;}
</style>
            <ul class="tab_nav">
                <a rel="tab1" value="1" class="on float_l width_50 height40 l_height40 gray2 txt14 align_c bg_gray">추천검색어</a>
                <a rel="tab2" value="2" class="float_l width_50 height40 l_height40 gray2 txt14 align_c bg_gray">최근검색어</a>
            </ul>
            <div id="item_tab1" class="tab_cont bg_white" style="display:block;">
                <ul>
                    <!-- 마지막엔 선 없음 -->
<?php
    $cnt 
0;
    foreach(
$kword_list as $key=>$val){
        if(
count($kword_list)-1==$cnt){    $glb "  ";    } else { $glb " gray_line_b "; } // 마지막라인엔 줄이 없음
?>
                    <li class="<?php echo $glb;?>"><a href="<?php echo "{$j3_shop_url}/search.php?skey={$val['k_word']}";?>" class="relative block p_0_5 width_90 height40 gray3 l_height40 txt14 bg_white over_h"><?php echo $val['k_word'];?></a></li>
<?php
        $cnt
++;
    }
?>
                </ul>
            </div>
            <div id="item_tab2" class="tab_cont bg_white" style="display:none;">
                <!-- 검색내용이 있을 때 -->
<?php
    $ss_sk 
$_SESSION['search_keyword'];
    if(
count($ss_sk)>0){
?>
                <ul class='recent_search_class'>
    <?php
        
for($i=count($ss_sk)-1;$i>=count($ss_sk)-6;$i--){
            if(
$ss_sk[$i]==''){ continue; }
    
?>
                    <li class="gray_line_b"><a href="<?php echo "{$j3_shop_url}/search.php?skey={$ss_sk[$i]}";?>" class="relative block p_0_5 width_90 height40 l_height40 txt14 bg_white over_h"><?php echo $ss_sk[$i];?></a></li>
    <?php
        
}
    
?>
                </ul>
<?php
    
} else {
?>
                <!-- 검색내용이 없을 때 -->
                <ul>
                    <li class="s_height250 gray2 align_c l_height250">내용없음</li>
                </ul>
<?php
    
}
?>
            </div>
        </div>
<?php
}
?>
<script>
function total_search(){
    $form_obj = $("#total_search_form");
    $skey = $form_obj.find("#sch_str").val();
    if($skey==''){ alert('검색어를 입력해주세요.'); return; }
<?php
if($app_id=='europe0515'){ // 유럽상사일경우 검색조건 다르게 처리될수 있도록 처리
?>
    if($skey.length<6){
        alert('6자리 이상 규격번호를 입력하시기 바랍니다.'); return;
    }
<?php
}
?>
    document.total_search_form.submit();
}

$(function(){
    $(".total_search_btn").click(function(){
        total_search();
    });
    $("#sch_str").keypress(function(){
        if(event.keyCode=='13')    {
            total_search();
        }
    });

    $(".tab_nav a").click(function () {
        var tab_id = $(this).attr("value");
        $(".tab_cont").hide();
        $("#item_tab"+tab_id).show();
    });    

    if(''!=''){
        show_next_tab('');
    }

    $(".tab_nav a").click(function(){
        $(".tab_nav a").removeClass("on");
        $(this).addClass("on").css("border-bottom","1px solid #fff");
    });

    $(".close_sch_item").click(function(){
        $(".sch_itm_open").click();    
    });

    $(".recent_search_class li:last").removeClass('gray_line_b'); // 최근검색어 마지막 li에 클래스 빼준다.
});
function show_next_tab(v){
    $(".tab_cont").hide();
    $("#item_tab"+v).show();
    $("html,body").animate({scrollTop:0},100);
}
</script>
    </div>