Esempio n. 1
0
    /* 提示信息 */
    $link[] = array('text' => $_LANG['back_list'], 'href' => 'category.php?act=list');
    sys_msg($_LANG['catedit_succed'], 0, $link);
}
/*------------------------------------------------------ */
//-- 批量转移商品分类页面
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'move') {
    /* 权限检查 */
    admin_priv('cat_drop');
    $cat_id = !empty($_REQUEST['cat_id']) ? intval($_REQUEST['cat_id']) : 0;
    /* 模板赋值 */
    $smarty->assign('ur_here', $_LANG['move_goods']);
    $smarty->assign('action_link', array('href' => 'category.php?act=list', 'text' => $_LANG['03_category_list']));
    //$smarty->assign('cat_select', cat_list(0, $cat_id, true));
    /*ccx 2015-03-18 代理商显示代理商自己的商品分类 start */
    $smarty->assign('cat_select', cat_list_ccx(0, 0, true));
    /*ccx 2015-03-18 代理商显示代理商自己的商品分类 end */
    $smarty->assign('form_act', 'move_cat');
    /* 显示页面 */
    assign_query_info();
    $smarty->display('category_move.htm');
}
/*------------------------------------------------------ */
//-- 处理批量转移商品分类的处理程序
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'move_cat') {
    /* 权限检查 */
    admin_priv('cat_drop');
    $cat_id = !empty($_POST['cat_id']) ? intval($_POST['cat_id']) : 0;
    $target_cat_id = !empty($_POST['target_cat_id']) ? intval($_POST['target_cat_id']) : 0;
Esempio n. 2
0
function agency_goods_list()
{
    /* 过滤查询 */
    $code = empty($_REQUEST['extension_code']) ? '' : trim($_REQUEST['extension_code']);
    $code = $code == 'virtual_card' ? 'virtual_card' : '';
    $cat_id = isset($_POST['cat_id']) ? intval($_POST['cat_id']) : 0;
    $brand_id = isset($_POST['brand_id']) ? intval($_POST['brand_id']) : 0;
    $keyword = isset($_POST['keyword']) ? trim($_POST['keyword']) : '';
    $GLOBALS['smarty']->assign('action_link', list_link($is_add, $code));
    //$GLOBALS['smarty']->assign('cat_list',     cat_list(0, $cat_id)); // 注释 2015-03-19 代理商跟主站的分类分开
    /*ccx 2015-03-18 代理商显示代理商自己的商品分类 start */
    $GLOBALS['smarty']->assign('cat_list', cat_list_ccx(0, $cat_id));
    /*ccx 2015-03-18 代理商显示代理商自己的商品分类 end */
    $GLOBALS['smarty']->assign('brand_list', get_brand_list());
    $GLOBALS['smarty']->assign('search_keyword', $keyword);
    $GLOBALS['smarty']->assign('brand_id', $brand_id);
    $filter = array();
    $filter['cat_id'] = $cat_id;
    $filter['brand_id'] = $brand_id;
    $filter['keyword'] = $keyword;
    $filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'goods_id' : trim($_REQUEST['sort_by']);
    $filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
    $where = ' WHERE is_delete = 0 and admin_agency_id = 0 ';
    if ($code) {
        $where .= " AND is_real = 0 ";
    } else {
        $where .= " AND is_real = 1 ";
    }
    if ($cat_id > 0) {
        $where .= " AND cat_id = '{$cat_id}' ";
    }
    if ($brand_id > 0) {
        $where .= " AND brand_id = '{$brand_id}' ";
    }
    if ($keyword) {
        $where .= ' AND goods_name like \'%' . mysql_real_escape_string($keyword) . '%\'' . ' OR goods_sn like \'%' . $keyword . '%\'';
    }
    $admin_agency_id = admin_agency_id();
    if ($admin_agency_id) {
        $where .= " AND (SELECT goods_id FROM " . $GLOBALS['ecs']->table('goods') . " WHERE admin_agency_id = {$admin_agency_id} and host_goods_id = g.goods_id limit 1) is null";
    }
    /* 获得总记录数据 */
    $sql = 'SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('goods') . ' as g' . $where;
    $filter['record_count'] = $GLOBALS['db']->getOne($sql);
    $filter = page_and_size($filter);
    /* 获得商品数据 */
    $arr = array();
    $sql = 'SELECT goods_id,goods_name,goods_sn,shop_price,costing_price' . ' FROM ' . $GLOBALS['ecs']->table('goods') . ' as g ' . $where . ' ORDER BY goods_id desc ';
    $res = $GLOBALS['db']->selectLimit($sql, $filter['page_size'], $filter['start']);
    while ($rows = $GLOBALS['db']->fetchRow($res)) {
        $arr[] = $rows;
    }
    //是否已添加
    foreach ($arr as $good_k => $good_v) {
        $goods_id_arr[] = $good_v['goods_id'];
        $goods_price_arr[] = $good_v['shop_price'];
    }
    $filter['goods_id_arr'] = json_encode($goods_id_arr);
    $filter['goods_price_arr'] = json_encode($goods_price_arr);
    //dump($arr);
    return array('goods_res' => $arr, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
}
Esempio n. 3
0
function get_sysnav()
{
    global $_LANG;
    /*ccx 2015-04-02 屏蔽,只显示商品分类
      $sysmain = array(
          array($_LANG['view_cart'],'flow.php'),
          array($_LANG['pick_out'],'pick_out.php'),
          array($_LANG['group_buy_goods'],'group_buy.php'),
          array($_LANG['snatch'],'snatch.php'),
          array($_LANG['tag_cloud'],'tag_cloud.php'),
          array($_LANG['user_center'],'user.php'),
          array($_LANG['wholesale'], 'wholesale.php'),
          array($_LANG['activity'], 'activity.php'),
          array($_LANG['myship'], 'myship.php'),
          array($_LANG['message_board'], 'message.php'),
          array($_LANG['quotation'], 'quotation.php'),
          );
      $sysmain[] = array('-','-');
      
      //ccx 2015-04-02 主站和分站商品分类区分来显示 
      $catlist = array_merge(cat_list(0, 0, false), array('-'), article_cat_list(0, 0, false));
       ** end */
    //ccx 2015-04-02 修改函数  cat_list函数修改为 cat_list_ccx函数
    $catlist = array_merge(cat_list_ccx(0, 0, false));
    foreach ($catlist as $key => $val) {
        $val['view_name'] = $val['cat_name'];
        for ($i = 0; $i < $val['level']; $i++) {
            $val['view_name'] = '&nbsp;&nbsp;&nbsp;&nbsp;' . $val['view_name'];
        }
        $val['url'] = str_replace('&amp;', '&', $val['url']);
        $val['url'] = str_replace('&', '&amp;', $val['url']);
        $sysmain[] = array($val['cat_name'], $val['url'], $val['view_name']);
    }
    return $sysmain;
}