#262 이벤트 폼에서 이벤트 상품 관리할 수 있도록 수정

This commit is contained in:
chicpro
2013-07-24 18:46:35 +09:00
parent 8817be4eac
commit c14fdb36de
3 changed files with 186 additions and 0 deletions

View File

@ -51,6 +51,10 @@ else if ($w == "d")
@unlink(G4_DATA_PATH."/event/{$ev_id}_h");
@unlink(G4_DATA_PATH."/event/{$ev_id}_t");
// 이벤트상품삭제
$sql = " delete from {$g4['shop_event_item_table']} where ev_id = '$ev_id' ";
sql_query($sql);
$sql = " delete from {$g4['shop_event_table']} where ev_id = '$ev_id' ";
sql_query($sql);
}
@ -61,6 +65,24 @@ if ($w == "" || $w == "u")
if ($_FILES['ev_himg']['name']) upload_file($_FILES['ev_himg']['tmp_name'], $ev_id."_h", G4_DATA_PATH."/event");
if ($_FILES['ev_timg']['name']) upload_file($_FILES['ev_timg']['tmp_name'], $ev_id."_t", G4_DATA_PATH."/event");
// 등록된 이벤트 상품 먼저 삭제
$sql = " delete from {$g4['shop_event_item_table']} where ev_id = '$ev_id' ";
sql_query($sql);
// 이벤트 상품등록
$item = explode(',', $ev_item);
$count = count($item);
for($i=0; $i<$count; $i++) {
$it_id = $item[$i];
if($it_id) {
$sql = " insert into {$g4['shop_event_item_table']}
set ev_id = '$ev_id',
it_id = '$it_id' ";
sql_query($sql);
}
}
goto_url("./itemeventform.php?w=u&amp;ev_id=$ev_id");
}
else