/home/mjc1/public_html/emillennium/product_reg.inc.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
<?php
$dir 
".";
include_once(
$dir."/_common.php");
if(
$code!=''){
    
$sql "select * from product_m a left join product_d b on a.code = b.pcode where 1=1 and a.code = '{$code}' and ocode = 1 ";
    
$res mysql_query($sql,$connect_e1000y);
    
$cinfo mysql_fetch_array($res);
}

// 분류명 가져오기
$sql "select a.* from product_category a where 1=1 and lv = 2
"
;
$result      =    mysql_query($sql,$connect_e1000y);
while(
$cus_info=mysql_fetch_array($result)){
    
$cate_array[] = $cus_info;
}

// 상품그룹 가져오기
$sql "select a.* from product_category2 a where 1=1 order by code
"
;
$result      =    mysql_query($sql,$connect_e1000y);
while(
$cus_info=mysql_fetch_array($result)){
    
$cate2_array[] = $cus_info;
}
?>
<form name='product_reg_form' method='post' action=''>
<input type='hidden' name='qstr' value=''>
<input type='hidden' name='code' value='<?php echo $cinfo['code'];?>'>

<div class='cust_modal1'>
    <h4>기본정보</h4>
    <table class="order-sheet table-top-border">
        <caption class="screen_out">기본정보</caption>
        <colgroup>
            <col style="width:100px;"><col style="width:200px;">
            <col style="width:100px;"><col style="width:200px;">
        </colgroup>

        <tbody>
        <tr>
            <th>코드</th>
            <td colspan=3>
                <input type='text' name='code1' class='input_readonly width_80' value='<?php echo $cinfo['code1'];?>' maxlength=6>
<?php
    
if($code==''){
        echo 
"<input type='checkbox' name='code_auto' value='1' checked> 코드자동";
    }
?>
            </td>
        </tr>
        <tr>
            <th>상품명</th>
            <td colspan=3><input type='text' name='name' class='width_500' value='<?php echo $cinfo['name'];?>'></td>
        </tr>
        <tr>
            <th>규격</th>
            <td colspan=3><input type='text' name='norm' class='width_500' value='<?php echo $cinfo['norm'];?>'></td>
        </tr>
        <tr>
            <th>분류</th>
            <td colspan=3>
                <select name='prod_cate_code' style='width:200px;'>
<?php
    
foreach($cate_array as $key=>$val){
        if(
$val['code']==$cinfo['prod_cate_code']){ $selected "selected"; } else { $selected ""; }
        echo 
"<option value='{$val['code']}$selected>{$val['name']}</option>";
    }
?>
                </select>
            </td>
        </tr>
        <tr>
            <th>상품그룹</th>
            <td colspan=3>
                <select name='prod_cate_code2' style='width:200px;'>
<?php
    
foreach($cate2_array as $key=>$val){
        if(
$val['code']==$cinfo['prod_cate_code2']){ $selected "selected"; } else { $selected ""; }
        echo 
"<option value='{$val['code']}$selected>{$val['name']}</option>";
    }
?>
                </select>&nbsp;<input type='button' value='+' class='group-add-btn'>
            </td>
        </tr>
        <tr>
            <th>바코드</th>
            <td><input type='text' name='pce_bcode1' class='' value='<?php echo $cinfo['pce_bcode1'];?>' ></td>
            <th>부가세</th>
            <td>
                <?php echo taxyn_select($cinfo['tax_yn']);?>
            </td>
        </tr>
        <tr>
            <th>무게</th>
            <td><input type='text' name='prod_wt' class='' value='<?php echo $cinfo['prod_wt'];?>' ></td>
            <th>단위</th>
            <td><input type='text' name='unit' class='' value='<?php echo $cinfo['unit'];?>' ></td>
        </tr>
        <tr>
            <th>비고</th>
            <td colspan=3><input type='text' name='remarks' class='width_500' value='<?php echo $cinfo['remarks'];?>'></td>
        </tr>
    </table>
</div>

<div class='cust_modal2'>
    <h4>단가 정보</h4>
    <table class="order-sheet table-top-border">
        <caption class="screen_out">단가 정보</caption>
        <colgroup>
            <col style="width:100px;"><col style="width:230px;">
            <col style="width:100px;"><col style="width:230px;">
        </colgroup>

        <tbody>
        <tr>
            <th>매입단가</th>
            <td><input type='text' name='buyprice' class='number_class' value='<?php echo number_format($cinfo['buyprice']);?>'></td>
            <th>매출단가</th>
            <td><input type='text' name='saleprice' class='number_class' value='<?php echo number_format($cinfo['saleprice']);?>'></td>
        </tr>
    </table>
</div>
</form>
<script>
$(function(){
    $(".group-add-btn").click(function(){ // 상품그룹 추가 버튼
        $.get("product_group.inc.php",function(rtn){
            $("#modal_member_box2").html(rtn).dialog({
                resizable: true, height:550, width:640, modal: true, title:"상품그룹 [관리]",
                buttons: {
                    저장: function() {
                        group_form_save(); // inc안에 있음
                    },
                    닫기: function() {
                        $( this ).dialog( "close" );
                    }
                }
            });
        });
    });

    $(".input_readonly").attr("readonly",true);
    $("input[name='comp_name']").focus();
})

</script>
<div id="modal_member_box2" title="거래처수정" style="display:none;width:100%; height:100%; padding-top:3px;padding-left:3px;background-color:#FFFFFF;position:relative;"></div>