Merge branch 'master' of github.com:gnuboard/yc4s
This commit is contained in:
@ -38,6 +38,14 @@ $sql = " insert {$g4['shop_item_table']}
|
||||
$sql_common ";
|
||||
sql_query($sql);
|
||||
|
||||
// 선택/추가 옵션 copy
|
||||
$opt_sql = " insert ignore into {$g4['shop_item_option_table']} ( io_id, io_type, it_id, io_price, io_stock_qty, io_noti_qty, io_use )
|
||||
select io_id, io_type, '$new_it_id', io_price, io_stock_qty, io_noti_qty, io_use
|
||||
from {$g4['shop_item_option_table']}
|
||||
where it_id = '$it_id'
|
||||
order by io_no asc ";
|
||||
sql_query($opt_sql);
|
||||
|
||||
// html 에디터로 첨부된 이미지 파일 복사
|
||||
if($cp['it_explan']) {
|
||||
$matchs = get_editor_image($cp['it_explan']);
|
||||
|
||||
@ -21,14 +21,25 @@ function itemdelete($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);
|
||||
delete_item_thumbnail(dirname($file), basename($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");
|
||||
|
||||
@ -14,8 +14,6 @@ if($it['it_id']) {
|
||||
if(mysql_num_rows($result))
|
||||
$po_run = true;
|
||||
} else if(!empty($_POST)) {
|
||||
$po_run = true;
|
||||
|
||||
$opt1_subject = trim($_POST['opt1_subject']);
|
||||
$opt2_subject = trim($_POST['opt2_subject']);
|
||||
$opt3_subject = trim($_POST['opt3_subject']);
|
||||
@ -23,6 +21,14 @@ if($it['it_id']) {
|
||||
$opt1_val = trim($_POST['opt1']);
|
||||
$opt2_val = trim($_POST['opt2']);
|
||||
$opt3_val = trim($_POST['opt3']);
|
||||
|
||||
if(!$opt1_subject || !$opt1_val) {
|
||||
echo '옵션1과 옵션1 항목을 입력해 주십시오.';
|
||||
exit;
|
||||
}
|
||||
|
||||
$po_run = true;
|
||||
|
||||
$opt1_count = $opt2_count = $opt3_count = 0;
|
||||
|
||||
if($opt1_val) {
|
||||
|
||||
@ -9,8 +9,15 @@ if($it['it_id']) {
|
||||
if(mysql_num_rows($result))
|
||||
$ps_run = true;
|
||||
} else if(!empty($_POST)) {
|
||||
$ps_run = true;
|
||||
$subject_count = count($_POST['subject']);
|
||||
$supply_count = count($_POST['supply']);
|
||||
|
||||
if(!$subject_count || !$supply_count) {
|
||||
echo '추가옵션명과 추가옵션항목을 입력해 주십시오.';
|
||||
exit;
|
||||
}
|
||||
|
||||
$ps_run = true;
|
||||
}
|
||||
|
||||
if($ps_run) {
|
||||
|
||||
Reference in New Issue
Block a user