상품개별삭제를 목록에서 일괄삭제로 변경 #218
This commit is contained in:
@ -4,24 +4,50 @@ include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
// 판매가격 일괄수정
|
||||
for ($i=0; $i<count($_POST['it_id']); $i++)
|
||||
{
|
||||
$sql = "update {$g4['shop_item_table']}
|
||||
set ca_id = '{$_POST['ca_id'][$i]}',
|
||||
it_name = '{$_POST['it_name'][$i]}',
|
||||
it_cust_price = '{$_POST['it_cust_price'][$i]}',
|
||||
it_price = '{$_POST['it_price'][$i]}',
|
||||
it_point = '{$_POST['it_point'][$i]}',
|
||||
it_stock_qty = '{$_POST['it_stock_qty'][$i]}',
|
||||
it_use = '{$_POST['it_use'][$i]}',
|
||||
it_order = '{$_POST['it_order'][$i]}'
|
||||
where it_id = '{$_POST['it_id'][$i]}' ";
|
||||
sql_query($sql);
|
||||
if (!count($_POST['chk'])) {
|
||||
alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요.");
|
||||
}
|
||||
|
||||
if ($_POST['act_button'] == "선택수정") {
|
||||
|
||||
auth_check($auth[$sub_menu], 'w');
|
||||
|
||||
for ($i=0; $i<count($_POST['chk']); $i++) {
|
||||
|
||||
// 실제 번호를 넘김
|
||||
$k = $_POST['chk'][$i];
|
||||
|
||||
$sql = "update {$g4['shop_item_table']}
|
||||
set ca_id = '{$_POST['ca_id'][$k]}',
|
||||
it_name = '{$_POST['it_name'][$k]}',
|
||||
it_cust_price = '{$_POST['it_cust_price'][$k]}',
|
||||
it_price = '{$_POST['it_price'][$k]}',
|
||||
it_point = '{$_POST['it_point'][$k]}',
|
||||
it_stock_qty = '{$_POST['it_stock_qty'][$k]}',
|
||||
it_use = '{$_POST['it_use'][$k]}',
|
||||
it_order = '{$_POST['it_order'][$k]}'
|
||||
where it_id = '{$_POST['it_id'][$k]}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
} else if ($_POST['act_button'] == "선택삭제") {
|
||||
|
||||
if ($is_admin != 'super')
|
||||
alert('상품 삭제는 최고관리자만 가능합니다.');
|
||||
|
||||
auth_check($auth[$sub_menu], 'd');
|
||||
|
||||
// _ITEM_DELETE_ 상수를 선언해야 itemdelete.inc.php 가 정상 작동함
|
||||
define('_ITEM_DELETE_', true);
|
||||
|
||||
for ($i=0; $i<count($_POST['chk']); $i++) {
|
||||
// 실제 번호를 넘김
|
||||
$k = $_POST['chk'][$i];
|
||||
|
||||
// include 전에 $it_id 값을 반드시 넘겨야 함
|
||||
$it_id = $_POST['it_id'][$k];
|
||||
include ('./itemdelete.inc.php');
|
||||
}
|
||||
}
|
||||
|
||||
//goto_url("./itemlist.php?sort1=$sort1&sort2=$sort2&sel_ca_id=$sel_ca_id&sel_field=$sel_field&search=$search&page=$page");
|
||||
goto_url("./itemlist.php?sca=$sca&sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&page=$page");
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user