/home/mjc1/public_html/mjmall/customerfaq.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<? 
include_once("./_common.php");
include(
"./include/common/header.php"); ?>

<?
    
if(!isset($_REQUEST['mode'])) $mode "";
    if(!isset(
$_REQUEST['Code'])) $Code "";
    if(!isset(
$_REQUEST['searchCode'])) $searchCode "";
    if(!isset(
$_REQUEST['keyword'])) $keyword "";
    if(!isset(
$_REQUEST['SearchMswQry'])) $SearchMswQry "";
    if(!isset(
$_REQUEST['SearchMswQry2'])) $SearchMswQry2 "";
    if(!isset(
$_REQUEST['total_sql'])) $total_sql "";
    if(!isset(
$_REQUEST['pg'])) $pg "";
    if(!isset(
$_REQUEST['uid'])) $uid "";
    if(!isset(
$_REQUEST['SearchMsw1'])) $SearchMsw1 "";
    if(!isset(
$_REQUEST['SearchMsw2'])) $SearchMsw2 "";
    if(!isset(
$_REQUEST['retValue'])) $retValue "";

/*
    if( isset($uid) && $uid !== ""){

    if( !isset(${"faqBoardUid_".$uid}) ){

      $hitSel     =  " SELECT hit FROM faqBoard WHERE uid = '$uid' ";
      $hitResult  =    mysql_query($hitSel);
      $hitRow     =    mysql_fetch_array($hitResult);
      $plus_hit   =    $hitRow[0] + 1;
      
      $hitUp  =  " UPDATE faqBoard SET hit = '$plus_hit' WHERE uid = '$uid' ";
                    MYSQL_QUERY($hitUp );
      
      setcookie("faqBoardUid_$uid",$uid,0);
      }  
    }*/
?>

<script>
function programCh(t){
    location.href  =  'customerfaq.php?SearchMsw1='+t;   
}

function programCh2(t){
    location.href  =  'customerfaq.php?SearchMsw2='+t;   
}

function Search(){
    searchFrm.submit();
}
</script>

    <div class="location">
        <div class="wrap">
            <a href="./mall.php" class="home"><span class="screen_out">Home</span></a>
            <span>></span><a href="./cscenter.php"><span class="depth1">°í°´¼¾ÅÍ</span></a>
            <span>></span><span class="depth2">ÀÚÁÖ¹¯´ÂÁú¹®</span>
        </div><!-- //wrap -->
    </div><!-- //location -->

    <div class="wrap">
        <div class="contents">

            <? include("./include/cscenter/sub_lnb.php"); ?>



<?
    
if( isset($uid) && $uid !== ""){

    
$oneQry     =   " select * from faqBoard WHERE uid = '$uid' ";
    
$oneResult  =     mysql_query($oneQry);

    
$oneRow     =     mysql_fetch_array($oneResult);
        
$content nl2br(stripslashes($oneRow['content']));
?>
            <div class="boardSection">
                <!-- »ó¼¼ ±Û ³»¿ë -->
                <table class="reviewTable">
                    <caption>´äº¯±Û</caption>
                    <colgroup>
                        <col style="width:185px;"><col style="width:805px;">
                    </colgroup>
                    <tr> 
                        <th><?=$oneRow['uid'];?></th>
                        <td><?=stripcslashes($oneRow['subject']);?></td>
                    </tr>
                    <tr>
                        <td colspan="2"><?=$content;?></td>
                    </tr>
                </table>                     
                                 
                <div class="qnaBtn1"><a href="customerfaq.php">±Û¸ñ·Ï</a></div>

            </div><!-- //boardSection -->
<?     ?>    




<? if (!isset($_REQUEST['uid'])) { //ùÆäÀÌÁö¿¡¼­¸¸ º¸ÀÓ 

    
if( isset($keyword) && $keyword !== ""){
        if( 
$searchCode == '1')  $Code =  " and (a.subject like '%$keyword%' or a.content like '%$keyword%') ";        
        if( 
$searchCode == '2')  $Code =  " and a.subject like '%$keyword%' ";
        if( 
$searchCode == '3')  $Code =  " and a.content like '%$keyword%' ";
    }
        
    if( isset(
$SearchMsw1) && $SearchMsw1 !== "all" && $SearchMsw1 !== "" ){
        
$SearchMswQry   =   " and  a.cate1 = '$SearchMsw1' "
    }

    if( isset(
$SearchMsw2) && $SearchMsw2 !== "all" && $SearchMsw2 !== "" ){
        
$SearchMswQry2   =   " and  a.cate2 = '$SearchMsw2' "
    }
?>

            <form name="searchFrm" method="post">
            <div class="deliverySearch">
                <div class="SearchSection">
                <dl>
                    <dt>±¸ºÐ</dt>
                    <dd>
                        <select name="searchCode">
                            <option value="1"  <? if($searchCode == '1'){ echo "selected"; } ?>>Á¦¸ñ+³»¿ë</option>
                            <option value="2"  <? if($searchCode == '2'){ echo "selected"; } ?>>Á¦¸ñ</option>
                        </select>
                        </dd>
                    </dl>

                    <dl>
                        <dt>°Ë»ö¾î</dt>
                        <dd><input type="text" name="keyword" size="20" value='<?=$keyword;?>'></dd>
                    </dl>
                    <p class="searchBtn"><a href='javascript:Search();'>°Ë»ö</a></p>

                    <input type='hidden' name='mode' value='search'>
                </div><!-- //SearchSection -->
            </div><!-- //deliverySearch -->
            </form>

            <!-- Ãß°¡ Å×À̺í -->
            <div class="faqTab">
                <? include("./include/cscenter/faq_top.php"); ?>
            </div><!-- faqTab -->

<? ?><!-- Ã¹ÆäÀÌÁö¿¡¼­¸¸ º¸ÀÓ ³¡ -->

            <div class="deliverySection">
                <table class="deliveryTable">
                    <!--caption>ÀÚÁÖ¹¯´ÂÁú¹®</caption-->
                    <colgroup>
                        <col style="width:150px;"><col style="width:200px;">
                        <col style="width:490px;"><col style="width:150px;">
                    <colgroup>
                    <tr> 
                        <th>¹øÈ£</th>
                        <th>ºÐ·ù</th>
                        <th>Á¦¸ñ</th>
                        <th>Á¶È¸¼ö</th>
                    </tr>
<?


    $total_sql  
.=   " SELECT a.uid,a.subject,a.hit,lpad(a.thread, 6,'0') as gongcount,c.name
                            FROM faqBoard a
                            INNER JOIN  faq_cate2 c ON a.cate2 = c.code
                            WHERE a.uid >  0 
                            
$Code $SearchMswQry $SearchMswQry2
                            AND a.fave = 1"
;
                            
    
$result      mysql_query($total_sql) or die (mysql_error());
    
$nTotalCount mysql_num_rows($result);
    
$nPage       ceil($nTotalCount $cm_nCount);
    if (
$pg == ""$pg 1;
    
$nFrom = ($pg 1) * $cm_nCount;

    
$sql    $total_sql "  order by gongcount desc, a.uid DESC limit $nFrom$cm_nCount ";

    
$result mysql_query($sql) or die (mysql_error());

    if( 
mysql_num_rows($result) > ){ 
        while (
$faqRow =  mysql_fetch_array($result)){ 

?>         
                    <tr <? if($faqRow[0] == $uid ){ echo "bgcolor=#fbf5ee";} else{ echo "bgcolor=ffffff";}?>
                        <td><?=$faqRow[0];?></td>
                        <td><?=$faqRow[4];?></td>
                        <td><a href='customerfaq.php?uid=<?=$faqRow[0];?>&pg=<?=$pg;?>&SearchMsw1=<?=$SearchMsw1;?>'><?=$faqRow[1];?></a></td>
                        <td><?=$faqRow[2];?></td>
                    </tr>

<?    }  }  ?>   
                        
                </table>
                    
                <div><?=pageListing($pg$nPage$cm_nCount"customerfaq.php?pg=" $mode$searchCode ,$keyword ,$SearchMsw1 )?></div>

            </div><!-- //deliverySection -->


        </div><!-- //contents -->
    </div><!-- //wrap -->

<? include("./include/common/footer.php"); ?>