コード例 #1
0
ファイル: goods.php プロジェクト: nanhuacrab/ecshop
     if (isset($GLOBALS['shop_id']) && $GLOBALS['shop_id'] > 0) {
         foreach ($img_list as $key => $gallery_img) {
             $gallery_img[$key]['img_url'] = get_image_path($gallery_img['goods_id'], $gallery_img['img_original'], false, 'gallery');
             $gallery_img[$key]['thumb_url'] = get_image_path($gallery_img['goods_id'], $gallery_img['img_original'], true, 'gallery');
         }
     } else {
         foreach ($img_list as $key => $gallery_img) {
             $gallery_img[$key]['thumb_url'] = '../' . (empty($gallery_img['thumb_url']) ? $gallery_img['img_url'] : $gallery_img['thumb_url']);
         }
     }
 }
 /* 拆分商品名称样式 */
 $goods_name_style = explode('+', empty($goods['goods_name_style']) ? '+' : $goods['goods_name_style']);
 $smarty->assign('FCKeditor', returnfck('goods_desc', $goods['goods_desc']));
 $goods['riji'] = returnfck('riji', $goods['riji']);
 $goods['ways'] = returnfck('ways', $goods['ways']);
 /* 模板赋值 */
 $smarty->assign('code', $code);
 $smarty->assign('ur_here', $is_add ? empty($code) ? $_LANG['02_goods_add'] : $_LANG['51_virtual_card_add'] : ($_REQUEST['act'] == 'edit' ? $_LANG['edit_goods'] : $_LANG['copy_goods']));
 $smarty->assign('action_link', list_link($is_add, $code));
 $smarty->assign('goods', $goods);
 $smarty->assign('goods_name_color', $goods_name_style[0]);
 $smarty->assign('goods_name_style', $goods_name_style[1]);
 $smarty->assign('cat_list', cat_list(0, $goods['cat_id']));
 $smarty->assign('brand_list', get_brand_list());
 $smarty->assign('unit_list', get_unit_list());
 $smarty->assign('user_rank_list', get_user_rank_list());
 $smarty->assign('weight_unit', $is_add ? '1' : ($goods['goods_weight'] >= 1 ? '1' : '0.001'));
 $smarty->assign('cfg', $_CFG);
 $smarty->assign('form_act', $is_add ? 'insert' : ($_REQUEST['act'] == 'edit' ? 'update' : 'insert'));
 if ($_REQUEST['act'] == 'add' || $_REQUEST['act'] == 'edit') {
コード例 #2
0
ファイル: system_taocan.php プロジェクト: nanhuacrab/ecshop
    foreach ($glist1 as $k => $g) {
        $goodsid = unserialize($g['gids']);
        $gnums = unserialize($g['gnums']);
        $glist2 = $db->getAll("select g.goods_name,g.shop_price,g.goods_id from " . $ecs->table("goods") . "  g where g.goods_id " . db_create_in($goodsid) . " ");
        foreach ($glist2 as $gg) {
            foreach ($goodsid as $j => $id) {
                if ($gg['goods_id'] == $id) {
                    $gg['goods_num'] = $gnums[$j];
                    $nglist[$g['id']][] = $gg;
                }
            }
        }
    }
    include_once ROOT_PATH . 'includes/fckeditor/fckeditor.php';
    // 包含 html editor 类文件$smarty->assign('brand_list', get_brand_list());
    $kindeditor = returnfck('desc', $taocan['descs']);
    $smarty->assign('FCKeditor', $kindeditor);
    //这里前面的 FCKEditor 不要变
    $smarty->assign('nglist', $nglist);
    $smarty->assign('taocan', $taocan);
    $smarty->assign('form_act', 'update');
    $smarty->display("systemtc_info.htm");
}
if ($_REQUEST['act'] == 'insert') {
    $tname = $_POST['tname'];
    $tprice = trim($_POST['tprice']);
    $desc = empty($_POST['desc']) ? '' : $_POST['desc'];
    include_once ROOT_PATH . '/includes/cls_image.php';
    $image = new cls_image($_CFG['bgcolor']);
    foreach ($_FILES['tpic']['tmp_name'] as $key => $value) {
        if ($value != 'none' && $value) {