/home/mjc1/public_html/onlinecs/mobile/loadData.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
<? session_start(); ?>
<?
include_once("./_common.php");
if(( 
$id == "" ) && ( $sid == "" )) { 
    echo 
"<script>alert('e수발주 로그인 후에 이용가능합니다.');location.href = 'index.php';</script>"
}

include(
"../commonST.php");

$charSet_sql "set names utf8";      
mysql_query($charSet_sql);   

$optionqry "SELECT optname, optvalue FROM options";
$optresult mysql_query($optionqry);
while(
$optrow mysql_fetch_array($optresult)){
    if(
$optrow['optname'] == "ON지정상품분류")                $optcate     $optrow['optvalue'];    
}

$optcate_cnt "0";
if(
$optcate=='1'){ // 거래처별 상품분류지정 상품이 몇개인지 체크 없을경우 거래처별 상품분류지정 상품옵션 무력화하기 위함
    
$sql "select count(*) as cnt from custpclassmatch where ccode = '{$cuscode}' ";
    
$res mysql_query($sql);
    
$info mysql_fetch_array($res);

    
$optcate_cnt $info['cnt'];
}
//echo $sql;
?>

<SCRIPT LANGUAGE='JavaScript'> 

cnt = 0;
<?

 $Lsub 
substr($mvalue,0,2);
 
$sub $Lsub."999999";

 
$mqry "SELECT * FROM pclass WHERE plevel ='1' AND fullpath BETWEEN '{$mvalue}' AND '{$sub}'";

 
$resultm mysql_query($mqry);
 
$total mysql_affected_rows()+1//중분류 다음으로 오게 하기 위한 +1처리
?>

//    parent.category.sub.length = <?=$total?>;    //셀렉트박스 길이

    var objYears = parent.document.getElementById("sub");
    while(objYears.length > 1) objYears.remove(1);
<? 
    $i 
1;
    while(
$data mysql_fetch_array($resultm)){
        if(!isset(
$data['name'])) $data['name'] = "";
        if(!isset(
$data['fullpath'])) $data['fullpath'] = "";
?>

    var objOption = parent.document.createElement("option");
    objOption.text =  "<?=$data['name']?>";
    objOption.value =  "<?=$data['fullpath']?>";
    objYears.options.add(objOption);

//    parent.document.getElementById('sub')[<?=$i?>].text = '<?=$data[name]?>';
//    parent.document.getElementById('sub')[<?=$i?>].value = '<?=$data[fullpath]?>';
// ff
//    parent.category.sub.options[<?=$i?>].text = '<?=$data[name]?>';
//    parent.category.sub.options[<?=$i?>].value = '<?=$data[fullpath]?>';

// ie
//    parent.category.sub.options[<?=$i?>].text = '<?=$data[name]?>';
//    parent.category.sub.options[<?=$i?>].value = '<?=$data[fullpath]?>';
//    parent.location.href = "popcategory.php?idx=<?=$idx?>&nidx=<?=$nidx?>&mvalue="+mvalue;
//    insert();

<? 
    $i
++;

?>
//    alert('증가');
</script>
<!--------------------중분류 카테고리 처리 완료 --------------------->

<?
    $i 
1;
    if(
$optcate_cnt>"0"){
        
$Lqry "SELECT a.* FROM  pclass a inner join custpclassmatch b on a.code = b.pccode and b.ccode = '{$cuscode}' WHERE plevel = '2' AND fullpath BETWEEN '{$mvalue}' AND '{$sub}'";
    } else {
        
$Lqry "SELECT * FROM  pclass WHERE plevel = '2' AND fullpath BETWEEN '{$mvalue}' AND '{$sub}'";
    }
    
//echo $Lqry; exit;
    
$Lresult mysql_query($Lqry);
    while(
$Ldata mysql_fetch_array($Lresult)){
?>
<SCRIPT LANGUAGE='JavaScript'> 
    
    parent.insertform('tb_list',0); 
    parent.document.getElementsByName('leftcode')[<?=$i?>].value = "<?=$Ldata['fullpath']?>";
    parent.document.getElementsByName('leftname')[<?=$i?>].value = "<?=$Ldata['name']?>";
    //parent.document.getElementsByName('leftname2')[<?=$i?>].text = "<?=$Ldata['name']?>";
    parent.document.getElementsByName('leftname2')[<?=$i?>].innerHTML = "<?=$Ldata['name']?>";


</script>
<?
     $i
++;
    }
?>
<script>
    parent.cate_li_init();
</script>