} } } else { make_json_result(""); } break; } foreach ($sst as $key => $value) { $stre .= '<tr><td class="label">条形码</td><td><input type="hidden" name="txm_shu[]" value=' . $value . '>' . $value . '<td/><td><input type="text" name="tiaoxingm[]" value=""></td></tr>'; } make_json_result($stre); } elseif ($_REQUEST['act'] == 'get_attr') { check_authz_json('goods_manage'); $goods_id = empty($_GET['goods_id']) ? 0 : intval($_GET['goods_id']); $goods_type = empty($_GET['goods_type']) ? 0 : intval($_GET['goods_type']); $content = build_attr_html($goods_type, $goods_id, $bar_code); make_json_result($content); } elseif ($_REQUEST['act'] == 'drop_image') { check_authz_json('goods_manage'); $img_id = empty($_REQUEST['img_id']) ? 0 : intval($_REQUEST['img_id']); /* 删除图片文件 */ $sql = "SELECT img_url, thumb_url, img_original " . " FROM " . $GLOBALS['ecs']->table('goods_gallery') . " WHERE img_id = '{$img_id}'"; $row = $GLOBALS['db']->getRow($sql); if ($row['img_url'] != '' && is_file('../' . $row['img_url'])) { @unlink('../' . $row['img_url']); } if ($row['thumb_url'] != '' && is_file('../' . $row['thumb_url'])) { @unlink('../' . $row['thumb_url']); } if ($row['img_original'] != '' && is_file('../' . $row['img_original'])) { @unlink('../' . $row['img_original']);
/* 如果不是实体商品,删除相应虚拟商品记录 */ if ($goods['is_real'] != 1) { $sql = "DELETE FROM " . $ecs->table('virtual_card') . " WHERE goods_id = '{$goods_id}'"; if (!$db->query($sql, 'SILENT') && $db->errno() != 1146) { die($db->error()); } } clear_cache_files(); $url = 'goods.php?act=query&' . str_replace('act=drop_goods', '', $_SERVER['QUERY_STRING']); ecs_header("Location: {$url}\n"); exit; } elseif ($_REQUEST['act'] == 'get_attr') { check_authz_json('goods_manage'); $goods_id = empty($_GET['goods_id']) ? 0 : intval($_GET['goods_id']); $goods_type = empty($_GET['goods_type']) ? 0 : intval($_GET['goods_type']); $content = build_attr_html($goods_type, $goods_id); make_json_result($content); } elseif ($_REQUEST['act'] == 'drop_image') { check_authz_json('goods_manage'); $img_id = empty($_REQUEST['img_id']) ? 0 : intval($_REQUEST['img_id']); /* 删除图片文件 */ $sql = "SELECT img_url, thumb_url, img_original " . " FROM " . $GLOBALS['ecs']->table('goods_gallery') . " WHERE img_id = '{$img_id}'"; $row = $GLOBALS['db']->getRow($sql); if ($row['img_url'] != '' && is_file('../' . $row['img_url'])) { @unlink('../' . $row['img_url']); } if ($row['thumb_url'] != '' && is_file('../' . $row['thumb_url'])) { @unlink('../' . $row['thumb_url']); } if ($row['img_original'] != '' && is_file('../' . $row['img_original'])) { @unlink('../' . $row['img_original']);
$smarty->assign('form_act', $is_add ? 'insert' : ($_REQUEST['act'] == 'edit' ? 'update' : 'insert')); if ($_REQUEST['act'] == 'add' || $_REQUEST['act'] == 'edit') { $smarty->assign('is_add', true); } if (!$is_add) { $smarty->assign('member_price_list', get_member_price_list($_REQUEST['goods_id'])); } $smarty->assign('link_goods_list', $link_goods_list); $smarty->assign('group_goods_list', $group_goods_list); $smarty->assign('goods_article_list', $goods_article_list); $smarty->assign('img_list', $img_list); $smarty->assign('goods_type_list', goods_type_list($goods['goods_type'])); $smarty->assign('gd', gd_version()); $smarty->assign('thumb_width', $_CFG['thumb_width']); $smarty->assign('thumb_height', $_CFG['thumb_height']); $smarty->assign('goods_attr_html', build_attr_html($goods['goods_type'], $goods['goods_id'])); $volume_price_list = ''; if (isset($_REQUEST['goods_id'])) { $volume_price_list = get_volume_price_list($_REQUEST['goods_id']); } if (empty($volume_price_list)) { $volume_price_list = array('0' => array('number' => '', 'price' => '')); } $smarty->assign('volume_price_list', $volume_price_list); /* 显示商品信息页面 */ assign_query_info(); $res['main'] = $smarty->fetch('add_goods.htm'); die($json->encode($res)); } elseif ($_REQUEST['act'] == 'check_goods_sn') { //print_r($_REQUEST);die; $goods_sn = trim($_REQUEST['goods_sn']);