-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasket_quick.php
52 lines (46 loc) · 1.15 KB
/
basket_quick.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
<?php
$Dir="../";
include_once($Dir."lib/init.php");
include_once($Dir."lib/lib.php");
include_once($Dir."lib/shopdata.php");
// 주문타입별 장바구니 테이블
$basket = "tblbasket_quick";
$basketWhere = "id='".$_ShopInfo->getMemid()."'";
//초기화
$sql = "DELETE FROM ".$basket." WHERE and ".$basketWhere;
mysql_query($sql,get_db_conn());
$date=date("YmdHis");
//옵션
for($i=0;$i<count($_POST['opt_productcode']);$i++){
$productcode = "";
$productcode = $_POST['opt_productcode'][$i];
$sql = "
productcode='$productcode',
quantity='{$_POST[opt_quantity][$i]}',
date='$date',
id='{$_ShopInfo->getMemid()}',
com_idx='{$_POST[opt_comidx][$i]}'
";
mysql_query("INSERT tblbasket_quick SET ".$sql,get_db_conn());
}
//비옵션
for($i=0;$i<count($_POST['quantity']);$i++){
$productcode = "";
$productcode = $_POST['itemcode'][$i];
if($_POST['quantity'][$i]!=''){
$sql = "
productcode='$productcode',
quantity='{$_POST['quantity'][$i]}',
date='$date',
id='{$_ShopInfo->getMemid()}'
";
mysql_query("INSERT tblbasket_quick SET ".$sql,get_db_conn());
}
}
echo json_encode(array(
"result" => "ok_quick",
"code" => 7000,
"msg" => ""
));
exit;
?>