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
|
<?php $dir = "."; include_once($dir."/_common.php");
//$_POST['buyprice'] = preg_replace("/[^0-9]/", "", $_POST['buyprice']);
$mode_ok = "Y";
if($sel_del=='EDIT' && $mode_ok=='Y'){ // 상품 일괄 수정 $mode = "edit"; foreach($code_idx as $key=>$val){ $code = $codes[$val]; $sb_qty = preg_replace("/[^-0-9]/", "", $qty[$val]);
$pinfo = product_info_get($code);
$sql = "select * from stock_begin where pcode = '$code' and ocode = '{$configshop['office_code']}' "; $sb_info = sql_fetch($sql,$connect_j3); if($sb_info['nidx']!=''){ $sql = "update stock_begin set qty = '{$sb_qty}', data_updated = '".G5_TIME_YMDHIS."' where nidx = '{$sb_info['nidx']}' "; } else { $sql = "insert into stock_begin set yyyymm = 0, pcode = '{$code}', ocode = '{$configshop['office_code']}', scode = '1', qty = '{$sb_qty}', price = '{$pinfo['saleprice']}', remarks = '', data_created = '".G5_TIME_YMDHIS."' "; } mysql_query($sql,$connect_j3); $all_sql .= $sql;
if($sb_info['nidx']!=''){ update_del_log("stock_begin", "nidx", $sb_info['nidx'],""); // 업데이트 로그 처리 }
cs3_jego_cal($code); // 천년3 재고 계산 및 보정
} } else if($sel_del=='Y' && $mode_ok=='Y') { // 삭제 $mode = "delete"; $code_list = ""; foreach($code_idx as $key=>$val){ $code_list .= "{$codes[$val]},"; } if($mode_ok=='Y'){ $code_list = substr($code_list,0,strlen($code_list)-1);
update_del_log("stock_edit", "nidx", $code_list,"del"); // 삭제 로그 처리 $sql = "delete from stock_edit where nidx in ({$code_list}) "; $res = mysql_query($sql,$connect_j3); $all_sql .= $sql; } } else if($code!='' && $mode_ok=='Y'){ // 수정 $mode = "update";
$sql = "update stock_edit set dealdate = '{$dealdate}', pcode = '{$pcode}', ocode = '{$configshop['office_code']}', scode = '1', qty = '{$qty}', price = '{$price}', remarks = '{$remarks}', data_created = '".G5_TIME_YMDHIS."' where nidx = '{$code}' "; mysql_query($sql,$connect_j3); $all_sql .= $sql;
update_del_log("stock_edit", "nidx", $code,""); // 업데이트 로그 처리
cs3_jego_cal($code); // 천년3 재고 계산 및 보정 } else { $mode = "new";
$sql = "insert into stock_edit set dealdate = '{$dealdate}', pcode = '{$pcode}', ocode = '{$configshop['office_code']}', scode = '1', qty = '{$qty}', price = '{$price}', remarks = '{$remarks}', data_created = '".G5_TIME_YMDHIS."' "; mysql_query($sql,$connect_j3); $all_sql .= $sql;
cs3_jego_cal($code); // 천년3 재고 계산 및 보정 }
echo "<?php xml version='1.0' encoding='utf-8'?><output>"; echo "<mode>".$mode."</mode>"; echo "<mode_ok>".$mode_ok."</mode_ok>"; echo "<rtn_url>".$rtn_url."</rtn_url>"; echo "<msg>".$msg."</msg>"; echo "<sql>".$all_sql."</sql>"; echo "</output>";
?>
|