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
|
<?php include("./_common.php");
$site = '11';
if($depth!=''){
if($pcode!=''){ $pwhere = " and c_parent = '{$pcode}' "; } else { $pwhere = ""; }
$sql = "select * from zom_category where om_site = '{$site}' and c_depth = '{$depth}' {$pwhere} order by c_sort"; $res = mysql_query($sql,$connect_om); while($info = mysql_fetch_array($res)){ $c_array[] = $info; }
$html = ""; $html1 = "<select name='cate{$depth}_code' class='cate{$depth}_code_class'><option value=''>-선택-</option>"; $cnt = 0; foreach($c_array as $key=>$val){ $html .= "<option value='{$val['c_code']}'>{$val['c_name']}</option>"; $cnt++; } $html2 = "</select>";
if($cnt>0){ $html = $html1.$html.$html2; }
echo $html; } ?>
|