/home/mjc1/public_html/manage/productList.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
<?
    
include("./include/admin_include_header.php");

if(isset(
$_SESSION['ADMINID']) && ($_SESSION['ADMINID'] == "lys")){ 
    echo 
"
        <script>
            alert('Á¢±ÙÇÒ ¼ö Àִ ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.');
            history.go(-1);
        </script>"
;
}
?>


<script>
 function categoryChange(h){
   
   if(h == "01")  page =  "productList.php";
   else           page =  "productList.php";
     
   location.href =  page+"?categoryCh=" + h;
   
   }
</script>
<link rel='stylesheet' type='text/css' href='./css/new.css'>

        <div class="container">
            <div class="border_contents">

                <div class="admin_table" style="margin:0 0 50px;">
                    <h3 class="list_ttl">
                        »óǰµî·Ï
                        <span class="list_sub_ttl bgp">ÇÁ·Î±×·¥ / ¿ëÁö / Çϵå¿þ¾î »óǰ¸ñ·ÏÀ» º¸¿©ÁÝ´Ï´Ù.</span>
                    </h3>

                    <div class="searchArea searchAreaPlus">
                        <span class="searchAreaL"></span>
                        <span class="searchAreaR"></span>
                        <div class="search_tender requestSearchArea" style="width:400px;">
                            <dt class="bgp prod_list_ttl mr10">»óǰ¸®½ºÆ®</dt>
<?
    $cate1Qry     
=  " SELECT category_name,category_code FROM cate1 order by idx ";
    
$cate1Result  =    MYSQL_QUERY($cate1Qry);
    
    if( 
MYSQL_NUM_ROWS($cate1Result) > ){
    
        
$i 1
    
        WHILE ( 
$row1 MYSQL_FETCH_ARRAY($cate1Result) ){
?>
                            <dd class="prod_list_chk mr10"><input type='radio' name='category_code' value='<?=$row1[1];?>' onClick="categoryChange('<?=$row1[1];?>');" <? if( $categoryCh == $row1[1] ){ echo "checked";} ?> >&nbsp;<lable><?=$row1[0];?></lable></dd>
                            
<?    
        $i
++;
    }
}
?>
                        </div><!-- //searchBox_text -->
                    </div><!-- //searchBox -->
                    <!-- //°Ë»ö¹Ú½º -->

                    <div class="columnWarp">
                    <table class="columnTable">
                        <thead>
                            <tr class="bgp">
                                <th class="cateName" style="height:23px; line-height:23px;">Áߺзù¸í</th>
                                <th class="cateName" style="width:230px; height:23px; line-height:23px;">¼ÒºÐ·ù¸í</th>
                                <th class="cateName" style="width:200px; height:23px; line-height:23px;">»óǰ¸í</th>
                                <th class="cateName" style="width:100px; height:23px; line-height:23px;">Á¤Ç°</th>
                                <th class="cateName" style="width:100px; height:23px; line-height:23px;">ÀÓ´ë</th>
                                <th class="cateName" style="height:23px; line-height:23px;">°¡°Ý</th>
                            </tr>
                        </thead>
                        
                        <tbody>
<?     
    
if( isset($categoryCh) && $categoryCh !== "" ){
        
        
$_where_qry        =  " where cate1_code = '$categoryCh' order by idx ";   
         
    } else {
      
        
$_where_qry        =  " where cate1_code = '01' order by idx "
    }
    
    
$sql_middle        =   "select * from cate2  $_where_qry";
    
$result_middle     =   mysql_query($sql_middle);
    
$result_middle_num =   mysql_num_rows($result_middle);
                    
    
######################  ´ëºÐ·ù¿¡ ¼ÓÇÑ Áߺзù ¸®½ºÆ® 
    
if($result_middle_num 0) {         
    
        while(
$row_middle mysql_fetch_array($result_middle) ) {  
                    
$middlecode $row_middle['category_code'];
                    
$largecode  $row_middle['cate1_code'];
                
                    
$sql_small      "select * from cate3 where cate1_code='$largecode' and cate2_code='$middlecode' order by idx "
                    
$result_small   mysql_query($sql_small);
                    
$result_small_num mysql_num_rows($result_small);
                    
?>
                        <tr>
                            <th style="width:200px; border-right:1px solid #d1d7de;"><?=$row_middle['category_name']?></th>
                            <td colspan="5" style="border-bottom:0 none;">
<?
    
if( $result_small_num 0){
?>
                            <table class="smallTable">
<?    
    
while($row_small mysql_fetch_array($result_small) ) {  
        
$middlecode $row_small['cate2_code'];
        
$largecode =  $row_small['cate1_code'];
        
$smallcode =  $row_small['category_code'];
        
        
$category_nameArr      =    explode"->" ,$row_small['category_name']);
        
        
$productQry    =  " select * from Product WHERE category_code = '$largecode$middlecode$smallcode' order by idx ";        
        
$productResult =  mysql_query$productQry );    
        
$rowspan  =  mysql_num_rows($productResult);                    
?>
        <tr> 
          <td rowspan='<?=$rowspan;?>' style="width:230px; border-right:1px solid #d1d7de;"><?=$category_nameArr[0];?></td>
<?
      
    
while( $productRow    =  mysql_fetch_array($productResult)){
    
        if(
$productRow['ProductMode'] == "1") {
            
$dis_Mode1  =  "O";
            
$dis_Mode2  =  "X";
        } else {
            
$dis_Mode1  =  "X";
            
$dis_Mode2  =  "O";
        }

      echo 
"
                                    <td style='width:200px;'><a href='productEdit.php?idx=
$productRow[idx]&ProductCode=$productRow[ProductCode]'>$productRow[ProductName]</a></td>
                                    <td style='width:100px;'>
$dis_Mode1</td>
                                    <td style='width:100px;'>
$dis_Mode2</td>
                                    <td class='last' style='text-align:right;padding-right:20px;'>"
.number_format($productRow[PriceOpt1])."</td>
                                </tr>

        "
;
    }        
}
?>
                            </table>
<? ?>
                                    </td>
                                </tr>
<? ?>
                            </table>
                            </td>
                        </tr>
<? ?>
                        </tbody>
                    </table><!--//columnTable --> 
                    </div><!--//columnWarp -->


                </div><!-- //admin_table -->

                <p class="navi">°ü¸®ÀÚ¸ðµå > »óǰ°ü¸® > »óǰµî·Ï</p>

                <div class="footer">
                    <?    include("./include/admin_include_footer.php"); ?>
                </div><!-- //footer -->


            </div><!-- //border_contents -->
        </div><!-- //container -->
    </div><!-- //wrap -->

</body>
</html>