상품개별삭제를 목록에서 일괄삭제로 변경 #218
This commit is contained in:
@ -10,102 +10,6 @@ if ($w == '' || $w == 'u')
|
||||
else if ($w == 'd')
|
||||
auth_check($auth[$sub_menu], "d");
|
||||
|
||||
// 상품삭제
|
||||
// 메세지출력후 주문개별내역페이지로 이동
|
||||
function itemdelete($it_id)
|
||||
{
|
||||
global $g4, $is_admin;
|
||||
|
||||
$sql = " select it_explan, it_mobile_explan, it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10
|
||||
from {$g4['shop_item_table']} where it_id = '$it_id' ";
|
||||
$it = sql_fetch($sql);
|
||||
|
||||
// 상품 이미지 삭제
|
||||
$dir_list = array();
|
||||
for($i=1; $i<=10; $i++) {
|
||||
$file = G4_DATA_PATH.'/item/'.$it['it_img'.$i];
|
||||
if(is_file($file) && $it['it_img'.$i]) {
|
||||
@unlink($file);
|
||||
$dir = dirname($file);
|
||||
delete_item_thumbnail($dir, basename($file));
|
||||
|
||||
if(!in_array($dir, $dir_list))
|
||||
$dir_list[] = $dir;
|
||||
}
|
||||
}
|
||||
|
||||
// 이미지디렉토리 삭제
|
||||
for($i=0; $i<count($dir_list); $i++) {
|
||||
if(is_dir($dir_list[$i]))
|
||||
rmdir($dir_list[$i]);
|
||||
}
|
||||
|
||||
// 상, 하단 이미지 삭제
|
||||
@unlink(G4_DATA_PATH."/item/$it_id"."_h");
|
||||
@unlink(G4_DATA_PATH."/item/$it_id"."_t");
|
||||
|
||||
// 장바구니 삭제
|
||||
$sql = " delete from {$g4['shop_cart_table']} where it_id = '$it_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 이벤트삭제
|
||||
$sql = " delete from {$g4['shop_event_item_table']} where it_id = '$it_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 사용후기삭제
|
||||
$sql = " delete from {$g4['shop_item_ps_table']} where it_id = '$it_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 상품문의삭제
|
||||
$sql = " delete from {$g4['shop_item_qa_table']} where it_id = '$it_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 관련상품삭제
|
||||
$sql = " delete from {$g4['shop_item_relation_table']} where it_id = '$it_id' or it_id2 = '$it_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// HTML 내용에서 에디터에 올라간 이미지의 경로를 얻어 삭제함
|
||||
//------------------------------------------------------------------------
|
||||
$imgs = get_editor_image($it['it_explan']);
|
||||
|
||||
for($i=0;$i<count($imgs[1]);$i++) {
|
||||
$p = parse_url($imgs[1][$i]);
|
||||
if(strpos($p['path'], "/data/") != 0)
|
||||
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
|
||||
else
|
||||
$data_path = $p['path'];
|
||||
|
||||
$destfile = G4_PATH.$data_path;
|
||||
|
||||
if(is_file($destfile))
|
||||
@unlink($destfile);
|
||||
}
|
||||
|
||||
$imgs = get_editor_image($it['it_mobile_explan']);
|
||||
|
||||
for($i=0;$i<count($imgs[1]);$i++) {
|
||||
$p = parse_url($imgs[1][$i]);
|
||||
if(strpos($p['path'], "/data/") != 0)
|
||||
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
|
||||
else
|
||||
$data_path = $p['path'];
|
||||
|
||||
$destfile = G4_PATH.$data_path;
|
||||
|
||||
if(is_file($destfile))
|
||||
@unlink($destfile);
|
||||
}
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
|
||||
// 상품 삭제
|
||||
$sql = " delete from {$g4['shop_item_table']} where it_id = '$it_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
|
||||
@mkdir(G4_DATA_PATH."/item", 0707);
|
||||
@chmod(G4_DATA_PATH."/item", 0707);
|
||||
|
||||
@ -428,6 +332,7 @@ else if ($w == "u")
|
||||
where it_id = '$it_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
/*
|
||||
else if ($w == "d")
|
||||
{
|
||||
if ($is_admin != 'super')
|
||||
@ -443,6 +348,7 @@ else if ($w == "d")
|
||||
|
||||
itemdelete($it_id);
|
||||
}
|
||||
*/
|
||||
|
||||
if ($w == "" || $w == "u")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user