Beispiel #1
0
/**
 * ShopEx licence
 *
 * @copyright  Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn)
 * @license  http://ecos.shopex.com/license/gpl GPL License
 */
function widget_goods(&$setting, &$render)
{
    $limit = intval($setting['limit']) > 0 ? intval($setting['limit']) : 6;
    $goods =& app::get('b2c')->model('goods');
    $goods->defaultCols = 'bn,name,cat_id,price,store,marketable,brand_id,weight,d_order,uptime,type_id';
    $goods->appendCols = 'goods_id,thumbnail_pic,brief,mktprice,image_default_id';
    $config = app::get('b2c')->getConf('site.save_price');
    $data['onSelect'] = $setting['onSelect'] ? $setting['onSelect'] : 0;
    $setting['max_length'] = $setting['max_length'] ? $setting['max_length'] : 35;
    $setting['view'] = app::get('b2c')->getConf('gallery.default_view');
    $imageDefault = app::get('image')->getConf('image.set');
    $search =& app::get('b2c')->model('search');
    $setting['str'] = $search->encode($filter);
    $setting['restrict'] = $setting['restrict'] ? $setting['restrict'] : 'on';
    $order = $setting['goods_orderby'] ? orderBy($setting['goods_orderby']) : null;
    if ($setting['columNum'] > 1) {
        for ($i = 0; $i < $setting['columNum']; $i++) {
            parse_str($setting['adjunct']['items'][$i], $filter[$i]);
            $filter[$i] = getFilter($filter[$i]);
            $result['link'][$i - 1] =& kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'gallery', 'act' => $setting['view'], 'args' => array($str_cat_id, $search->encode($filter[$i]), $setting['goods_orderby'] ? $setting['goods_orderby'] : 0)));
            $result['goods'][] = $goods->getList(null, $filter[$i], 0, $limit, $order['sql']);
            $result['defaultImage'] = $imageDefault['S']['default_image'];
            unset($filter[$i]);
        }
        return $result;
    } else {
        parse_str($setting['adjunct']['items'][0], $filter);
        $filter = getFilter($filter);
        $result['link'] =& kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'site_gallery', 'act' => $setting['view'], 'args' => array(implode(",", (array) $filter['cat_id']), $search->encode($filter), $setting['goods_orderby'] ? $setting['goods_orderby'] : 0)));
        $result['goods'] = $goods->getList('*', $filter, 0, $limit, $order['sql']);
        $result['defaultImage'] = $imageDefault['S']['default_image'];
        return $result;
    }
}
/**
 * ShopEx licence
 *
 * @copyright  Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn)
 * @license  http://ecos.shopex.com/license/gpl GPL License
 */
function widget_rankinglist(&$setting, &$smarty)
{
    $limit = intval($setting['limit']) ? intval($setting['limit']) : 10;
    $maxlength = intval($setting['maxlength']) ? intval($setting['maxlength']) : 55;
    //$setting['fontStyle']=type_check2($setting['fontStyle']);
    //$setting['fontStyle2']=type_check2($setting['fontStyle2']);
    $order = array($setting['ranking'], 'DESC');
    $viewer = app::get('b2c')->getConf('gallery.default_view');
    $o = app::get('b2c')->model('goods');
    $oSearch = app::get('b2c')->model('search');
    $rk['view_w_count'] = 4;
    $rk['view_count'] = 5;
    $rk['buy_count'] = 6;
    $rk['buy_w_count'] = 7;
    $rk['comments_count'] = 8;
    parse_str($setting['filter'], $filter);
    $filter['marketable'] = 'true';
    $filter['disabled'] = 'false';
    $setting['link'] = kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'site_gallery', 'act' => 'index', 'full' => 1, array($filter['cat_id'], $oSearch->encode($filter), $rk[$setting['ranking']] ? $rk[$setting['ranking']] : 0)));
    //$result=$o->getList("*",$filter,0,$limit,$c,$order);
    if (!empty($setting['ranking'])) {
        $result = $o->getList("*", $filter, 0, $limit, $order);
    } else {
        $result = $o->getList("*", $filter, 0, $limit);
    }
    return $result;
}
/**
 * ShopEx licence
 *
 * @copyright  Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn)
 * @license  http://ecos.shopex.com/license/gpl GPL License
 */
function widget_goods_show(&$setting, &$render)
{
    $o =& app::get('b2c')->model('goods');
    $limit = intval($setting['limit']) > 0 ? intval($setting['limit']) : 6;
    $orderby = $setting['goods_orderby'] ? $o->orderBy($setting['goods_orderby']) : null;
    $filter = gs_getFilter($setting['g_filter']);
    if (!is_array($filter['cat_id']) && $filter['cat_id']) {
        $filter['cat_id'] = array($filter['cat_id']);
    }
    if (!$filter['cat_id']) {
        unset($filter['cat_id']);
    }
    if ($filter['type_id'] && !is_array($filter['type_id'])) {
        $filter['type_id'] = array($filter['type_id']);
    }
    if ($filter['pricefrom']) {
        $filter['price'][0] = $filter['pricefrom'];
    }
    if ($filter['priceto']) {
        if (!$filter['price'][0]) {
            $filter['price'][0] = 0;
        }
        $filter['price'][1] = $filter['priceto'];
    }
    $result = $o->getList('*', $filter, 0, $limit, $orderby['sql']);
    if ('on' == $setting['showMore']) {
        $oSearch =& app::get('b2c')->model('search');
        $act =& app::get('b2c')->getConf('gallery.default_view');
        $result['link'] =& kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'gallery', 'act' => $act, 'args' => array(implode(",", $filter['cat_id']), $oSearch->encode($filter), $setting['goods_orderby'] ? $setting['goods_orderby'] : 0)));
    }
    return $result;
}
function getTreeList($pid = 0, $listMark = 'all')
{
    $var_pid = $pid;
    $var_listMark = $listMark;
    $a = kernel::database();
    if ($listMark == 'all') {
        $aCat = $a->select('SELECT cat_name,cat_id,o.parent_id AS pid,o.p_order,o.cat_path,o.is_leaf AS cls,o.type_id as type
                    FROM sdb_b2c_goods_cat o WHERE o.disabled=\'false\' ORDER BY o.cat_path,o.p_order,o.cat_id');
        foreach ($aCat as $k => $row) {
            if ($row['cat_path'] != '' && $row['cat_path'] != ',') {
                $aCat[$k]['cat_path'] = substr($row['cat_path'], 1);
            }
        }
    } else {
        if ($pid === 0) {
            $sqlWhere = '(parent_id IS NULL OR parent_id=' . intval($pid) . ')';
        } else {
            $sqlWhere = 'parent_id=' . intval($pid);
        }
        $sqlWhere .= " AND o.disabled='false'";
        $aCat = $a->select('SELECT cat_name, cat_id, o.parent_id AS pid, o.p_order, o.cat_path, o.is_leaf AS cls,o.type_id, t.name AS type_name FROM sdb_b2c_goods_cat o
                    LEFT JOIN sdb_b2c_goods_type t ON o.type_id = t.type_id
                    WHERE ' . $sqlWhere . ' ORDER BY o.cat_path,o.p_order,o.cat_id');
        foreach ($aCat as $k => $row) {
            $aCat[$k]['pid'] = intval($aCat[$k]['pid']);
            if ($row['cat_path'] == '' || $row['cat_path'] == ',') {
                $aCat[$k]['step'] = 1;
            } else {
                $aCat[$k]['step'] = substr_count($row['cat_path'], ',') + 1;
            }
            $aCat[$k]['url'] =& kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'gallery', 'act' => $render->app->getConf('gallery.default_view'), 'args' => array($aCat[$k]['cat_id']), null, $app->base_url()));
        }
    }
    return $aCat;
}
/**
 * ShopEx licence
 *
 * @copyright  Copyright (c) 2005-2010 ShopEx Technologies Inc. (http://www.shopex.cn)
 * @license  http://ecos.shopex.cn/ ShopEx License
 */
function theme_widget_nav($setting, &$smarty)
{
    define('IN_SHOP', true);
    //当前的链接地址
    $cur_url = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
    $result = app::get('site')->model('menus')->select()->where('hidden = ?', 'false')->order('display_order ASC')->instance()->fetch_all();
    //菜单链接
    foreach ($result as $k => &$v) {
        if (!empty($v['custom_url'])) {
            $v['url'] = $v['custom_url'];
        } else {
            $v['url'] = kernel::router()->gen_url(array('app' => $v['app'], 'ctl' => $v['ctl'], 'act' => $v['act'], 'args' => $v['params'], 'full' => 1));
        }
        //菜单高亮
        if (stripos($v['url'], $cur_url) && 'site_ctl_default' != get_class($smarty)) {
            $v['hilight'] = true;
        }
        //首页菜单高亮
        if ('site_ctl_default' == get_class($smarty) && $v['app'] == 'site' && $v['ctl'] == 'default') {
            $v['hilight'] = true;
        }
    }
    $setting['max_leng'] = $setting['max_leng'] ? $setting['max_leng'] : 7;
    $setting['showinfo'] = $setting['showinfo'] ? $setting['showinfo'] : app::get('b2c')->_("更多");
    return $result;
}
Beispiel #6
0
 public function active_top_html()
 {
     /** 获取证书,企业号的验证 **/
     $active_url = kernel::router()->app->base_url(1) . '/index.php?app=entermembercenter&ctl=register';
     $render = kernel::single('base_render');
     $render->pagedata['active_url'] = $active_url;
     return $render->fetch('desktop_active_top.html', 'entermembercenter');
 }
Beispiel #7
0
 public function editor()
 {
     $id = $this->_request->get_get('node_id');
     $info = kernel::single('content_article_node')->get_node($id);
     if (!$info['homepage']) {
         die;
     }
     $this->pagedata['detail'] = $info;
     $this->pagedata['shopadmin'] = kernel::router()->app->base_url(1);
     $this->pagedata['theme'] = kernel::single('site_theme_base')->get_default();
     $this->pagedata['site_url'] = app::get('site')->router()->gen_url(array('app' => 'content', 'ctl' => 'site_article', 'act' => 'i', 'arg0' => $info['node_id']));
     $this->singlepage('admin/node/single/editor.html');
 }
Beispiel #8
0
 public function editor()
 {
     $article_id = $this->_request->get_get('article_id');
     $detail = kernel::single('content_article_detail')->get_detail($article_id);
     if ($detail['indexs']['type'] != 2) {
         die;
     }
     $this->pagedata['detail'] = $detail;
     $this->pagedata['shopadmin'] = kernel::router()->app->base_url(1);
     $this->pagedata['theme'] = kernel::single('site_theme_base')->get_default();
     $this->pagedata['site_url'] = app::get('site')->router()->gen_url(array('app' => 'content', 'ctl' => 'site_article', 'act' => 'index', 'arg0' => $detail['indexs']['article_id']));
     $this->singlepage('admin/article/single/editor.html');
 }
Beispiel #9
0
 public function codecheck()
 {
     //if ($_POST['auth_code'] && preg_match("/^\d{19}$/", substr($_POST['auth_code'], 1)))
     if ($_POST['auth_code']) {
         $code = kernel::single('desktop_cert_certcheck');
         $result = $code->check_code($_POST['auth_code']);
         if ($result['res'] == 'succ' && $result) {
             $activation_arr = $_POST['auth_code'];
             app::get('desktop')->setConf('activation_code', $activation_arr);
             $objArr = kernel::servicelist("desktop.cert.succ");
             foreach ($objArr as $obj) {
                 if (method_exists($obj, 'notify')) {
                     $obj->notify($result);
                 }
             }
             header('Location:' . kernel::router()->app->base_url(1));
             exit;
         } else {
             switch ($result['msg']) {
                 case 'key_false_ac':
                     $auth_error_msg = '激活码类型不对!';
                     break;
                 case 'key_false_times':
                     $auth_error_msg = '失败:您已经连续6次提交失败,为了您的网店安全,请3小时后再次尝试|';
                     break;
                 case 'key_false_key':
                     $auth_error_msg = '无效的激活码,请您重新输入激活码以便正常使用。';
                     break;
                 case 'key_false_actived':
                     $auth_error_msg = '您的激活码已经失效,请您重新输入激活码以便正常使用。';
                     break;
                 case 'key_false_oem':
                     $auth_error_msg = '您的网店License与输入的激活码类型不一,请联系激活码销售商!';
                     break;
                 case 'key_false_type_1':
                     $auth_error_msg = '您的网店License与输入的激活码类型不一,请联系激活码销售商!';
                     break;
                 case 'key_false_type_2':
                     $auth_error_msg = '您的网店License与输入的激活码类型不一,请联系激活码销售商!';
                     break;
                 case 'certificate_id_is_false':
                     $auth_error_msg = '您的网店License与输入的激活码类型不一,请联系激活码销售商!';
                     break;
             }
             die($this->error_view($auth_error_msg));
         }
         header("Location: index.php");
         exit;
     }
 }
Beispiel #10
0
    function logout($backurl = 'index.php')
    {
        $this->begin('javascript:Cookie.dispose("basicloginform_password");Cookie.dispose("basicloginform_autologin");
					   location="' . kernel::router()->app->base_url(1) . '"');
        $this->user->login();
        $this->user->logout();
        $auth = pam_auth::instance(pam_account::get_account_type($this->app->app_id));
        foreach (kernel::servicelist('passport') as $k => $passport) {
            if ($auth->is_module_valid($k, $this->app->app_id)) {
                $passport->loginout($auth, $backurl);
            }
        }
        kernel::single('base_session')->destory();
        $this->end('true', app::get('desktop')->_('已成功退出系统,正在转向...'));
        /* $this->redirect('');*/
    }
Beispiel #11
0
 public function editor()
 {
     $id = $this->_request->get_get('id');
     $level = $this->_request->get_get('level');
     $flag = $this->_request->get_get('flag');
     $theme = $this->_request->get_get('theme') ? $this->_request->get_get('theme') : '';
     header('Content-Type: text/html; charset=utf-8');
     $this->path[] = array('text' => app::get('site')->_('挂件实例编辑'));
     $this->pagedata['level'] = $level;
     $this->pagedata['flag'] = $flag;
     $this->pagedata['theme'] = $theme;
     $this->pagedata['shopadmin'] = kernel::router()->app->base_url(1);
     if ($id > 0) {
         $this->pagedata['instance'] = app::get('site')->model('widgets_proinstance')->select()->where('widgets_id = ?', $id)->instance()->fetch_row();
         $this->pagedata['theme'] = $this->pagedata['instance']['flag'];
     }
     return $this->singlepage('admin/widget/editor.html');
 }
Beispiel #12
0
 function active()
 {
     if ($_GET['ent_id'] && $_GET['ent_ac'] && $_GET['ent_sign'] && $_GET['ent_email']) {
         //判断数据是否是中心过来的
         if (md5($_GET['ent_id'] . $_GET['ent_ac'] . 'ShopEXUser') == $_GET['ent_sign']) {
             //检测企业帐号是否正确
             base_enterprise::set_version();
             base_enterprise::set_token();
             if (!base_enterprise::is_valid('json', $_GET['ent_id'])) {
                 header("Content-type: text/html; charset=utf-8");
                 $active_url = kernel::router()->app->base_url(1) . '/index.php?app=entermembercenter&ctl=register';
                 header('Location:' . $active_url);
                 exit;
             } else {
                 $arr_enterprise = array('ent_id' => $_GET['ent_id'], 'ent_ac' => $_GET['ent_ac'], 'ent_email' => $_GET['ent_email']);
                 base_enterprise::set_enterprise_info($arr_enterprise);
                 if (!base_certificate::certi_id() || !base_certificate::token()) {
                     $flag = base_certificate::register();
                 }
                 if (!$flag) {
                     header("Content-type: text/html; charset=utf-8");
                     $active_url = kernel::router()->app->base_url(1) . '/index.php?app=entermembercenter&ctl=register';
                     header('Location:' . $active_url);
                     exit;
                 }
                 if (!base_shopnode::node_id() && base_certificate::certi_id() && base_certificate::token()) {
                     $obj_buildin = kernel::single('base_shell_buildin');
                     $obj_buildin->command_active_node_id('ceti_node_id');
                 }
             }
         }
     } else {
         header("Content-type: text/html; charset=utf-8");
         $active_url = kernel::router()->app->base_url(1) . '/index.php?app=entermembercenter&ctl=register';
         header('Location:' . $active_url);
         exit;
     }
     $url = kernel::router()->gen_url(array(), 1);
     $url = base64_encode($url);
     $login_html = 'index.php?ctl=passport&act=index&url=' . $url;
     header("Content-type: text/html; charset=utf-8");
     header('Location:' . $login_html);
     exit;
 }
Beispiel #13
0
 public function editor()
 {
     $theme = $this->_request->get_get('theme');
     $file = $this->_request->get_get('file');
     header('Content-Type: text/html; charset=utf-8');
     $this->path[] = array('text' => app::get('site')->_('模板可视化编辑'));
     $this->pagedata['views'] = kernel::single('site_theme_base')->get_view($theme);
     $this->pagedata['widgetsLib'] = kernel::single('site_theme_widget')->get_libs($theme);
     $this->pagedata['list'] = kernel::single('site_theme_tmpl')->get_edit_list($theme);
     $this->pagedata['types'] = kernel::single('site_theme_tmpl')->get_name();
     $this->pagedata['theme'] = $theme;
     $this->pagedata['view'] = $file;
     $this->pagedata['viewname'] = kernel::single('site_theme_tmpl')->get_list_name($file);
     $this->pagedata['shopadmin'] = kernel::router()->app->base_url(1);
     $this->pagedata['site_url'] = app::get('site')->base_url(1);
     $this->pagedata['pagehead_active'] = 'preview';
     $this->pagedata['save_url'] = kernel::router()->app->base_url(1) . '?app=site&ctl=admin_theme_widget&act=do_preview';
     $this->pagedata['preview_url'] = app::get('site')->base_url(1);
     return $this->singlepage('admin/theme/widget/editor.html');
 }
Beispiel #14
0
 public function read()
 {
     $this->begin(kernel::router()->gen_url(array('app' => 'desktop', 'ctl' => 'rpcnotify', 'act' => 'index')));
     $id = $_POST['id'];
     $is_selected_all = $_POST['isSelectedAll'];
     if (!$id && !$is_selected_all) {
         $this->end(false, app::get('desktop')->_('操作失败'));
     }
     if ($id) {
         foreach ((array) $id as $val) {
             $data = array('status' => 'true', 'id' => $val);
             $flag = app::get('base')->model('rpcnotify')->save($data);
             if ($flag == false) {
                 break;
             }
         }
     } else {
         $data = array('status' => 'true');
         $filter = array();
         $flag = app::get('base')->model('rpcnotify')->update($data, $filter);
     }
     $this->end($flag, $flag ? app::get('desktop')->_('操作成功') : app::get('desktop')->_('操作失败'));
 }
Beispiel #15
0
 /**
 * 根据条件获取商品信息
 * @param array $filter (所有条件都可选)
 *  array(
        'goodsId' => array(1,2)/1,  //商品ID
        'priceFrom' => 5,           //价格区间(低)
        'priceTo' => 100,           //价格区间(高)
        'typeId' => 2,              //商品类型ID
        'catId' => array(1,2)/1,    //商品分类ID
        'brandId' => array(1,2)/1,  //商品品牌ID
        'goodsOrderBy' => 1,        //商品排序
        'goodsNum' => 12,           //总商品数(xo最多20)
    ),
 */
 public function getGoodsList($filter, $platform = 'site')
 {
     if (isset($_COOKIE['MLV'])) {
         if (!cachemgr::get('member_lv_disCount' . $_COOKIE['MLV'], $dis_count)) {
             cachemgr::co_start();
             $member_level = $_COOKIE['MLV'];
             (array) ($arr = $this->app->model('member_lv')->getList('dis_count', array('member_lv_id' => $member_level)));
             $dis_count = $arr[0]['dis_count'];
             cachemgr::set('member_lv_disCount' . $_COOKIE['MLV'], $dis_count, cachemgr::co_end());
         }
     }
     $objLvprice = $this->app->model('goods_lv_price');
     $goods = $this->app->model('goods');
     $objProduct = $this->app->model('products');
     $objgoodscat = $this->app->model('goods_cat');
     $config = $this->app->getConf('site.save_price');
     $imageDefault = app::get('image')->getConf('image.set');
     $search = $this->app->model('search');
     $orderBy = $filter['goodsOrderBy'] ? $filter['goodsOrderBy'] : 0;
     $order = $filter['goodsOrderBy'] ? $this->_getOrderBy($filter['goodsOrderBy'], false) : null;
     $limit = intval($filter['goodsNum']) > 0 ? intval($filter['goodsNum']) : 6;
     //$limit      = ($limit > 20) ? 20 : $limit;
     $result = array();
     unset($filter['goodsOrderBy']);
     unset($filter['goodsNum']);
     $_filter = $this->_getFilter($filter);
     $result['goodsMoreLink'] = kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'site_gallery', 'act' => 'index', 'args' => array(implode(",", (array) $filter['catId']), $search->encode($filter), $orderBy)));
     $goodsList = $goods->getList('*', $_filter, 0, $limit, $order['sql']);
     if (!empty($_filter['goods_id'])) {
         $goods_temp = array();
         foreach ($_filter['goods_id'] as $k => $v) {
             foreach ($goodsList as $row) {
                 if ($v == $row['goods_id']) {
                     $goods_temp[$k] = $row;
                 }
             }
         }
         unset($goodsList);
         $goodsList = $goods_temp;
         unset($goods_temp);
     }
     if (is_array($goodsList) && $goodsList) {
         foreach ($goodsList as $key => $value) {
             $gids[] = $value['goods_id'];
             $catIds[] = intval($value['cat_id']);
         }
     }
     if ($gids) {
         if ($catIds) {
             $catsData = $objgoodscat->getList('cat_id,cat_name', array('cat_id' => $catIds));
             foreach ($catsData as $row) {
                 $goodsCats[$row['cat_id']] = $row['cat_name'];
             }
         }
         if ($member_level) {
             $lv_price_data = $objLvprice->getList('goods_id,price', array('goods_id' => $gids, 'level_id' => $member_level));
             foreach ($lv_price_data as $row) {
                 $goodsLvPrice[$row['goods_id']] = $row['price'];
             }
         }
     }
     if (is_array($goodsList) && $goodsList) {
         foreach ($goodsList as $pk => $pv) {
             if (empty($pv['mktprice']) || $pv['mktprice'] == '0') {
                 $pv['mktprice'] = $objProduct->getRealMkt($pv['price']);
             }
             $pv['cat_name'] = $goodsCats[$pv['cat_id']];
             // add for member price
             #$lv_price = $objLvprice->getList('price',array('goods_id'=>$pv['goods_id'],'level_id'=>$member_level));
             $lv_price[0] = $goodsLvPrice[$pv['goods_id']];
             if (isset($dis_count)) {
                 if (is_array($lv_price) && count($lv_price) > 0) {
                     $lv_price = end($lv_price);
                     $pv['memprice'] = $lv_price['price'];
                 } else {
                     $pv['memprice'] = $pv['price'] * $dis_count;
                 }
                 if (intval($pv['price']) != 0) {
                     $pv['dis_count'] = (1 - $pv['memprice'] / $pv['price']) * 100;
                 } else {
                     $pv['dis_count'] = 0;
                 }
             } else {
                 $pv['dis_count'] = 0;
                 $pv['memprice'] = false;
             }
             if (empty($pv['image_default_id'])) {
                 $pv['l_pic'] = base_storager::modifier($imageDefault['L']['default_image']);
                 $pv['m_pic'] = base_storager::modifier($imageDefault['M']['default_image']);
                 $pv['s_pic'] = base_storager::modifier($imageDefault['S']['default_image']);
             } else {
                 $pv['l_pic'] = base_storager::modifier($pv['image_default_id'], 'l');
                 $pv['m_pic'] = base_storager::modifier($pv['image_default_id'], 'm');
                 $pv['s_pic'] = base_storager::modifier($pv['image_default_id'], 's');
             }
             $result['goodsRows'][$pv['goods_id']] = $this->_getOutData($pv);
         }
     }
     if ($gids) {
         $productData = $objProduct->getList('goods_id,product_id,marketable', array('goods_id' => $gids, 'is_default' => 'true'));
         foreach ($productData as $k => $val) {
             $_return['goodsRows'][$val['goods_id']]['products'][] = $val;
             $result['goodsRows'][$val['goods_id']]['goodsLink'] = $this->getGoodsLink($val['product_id'], $platform);
         }
     }
     return $result;
 }
Beispiel #16
0
 public function swf_upload()
 {
     $this->pagedata['ssid'] = kernel::single('base_session')->sess_id();
     $this->pagedata['swf_loc'] = kernel::router()->app->res_url;
     $this->pagedata['upload_max_filesize'] = kernel::single('wap_theme_install')->ini_get_size('upload_max_filesize');
     $this->display('admin/theme/manage/swf_upload.html');
 }
            ?>
" <?php 
            if ($this->_vars['item']['target_blank'] == 'true') {
                ?>
target="_blank"<?php 
            }
            ?>
><?php 
            echo $this->_vars['item']['title'];
            ?>
</a></li>
    <?php 
        } else {
            ?>
    <li><a href="<?php 
            echo kernel::router()->gen_url(array('app' => $this->_vars['item']['app'], 'ctl' => $this->_vars['item']['ctl'], 'act' => $this->_vars['item']['act'], 'args' => $this->_vars['item']['params'], 'full' => 1));
            ?>
" <?php 
            if ($this->_vars['item']['target_blank'] == 'true') {
                ?>
target="_blank"<?php 
            }
            ?>
><?php 
            echo $this->_vars['item']['title'];
            ?>
</a></li>
    <?php 
        }
    }
}
<?php

exit;
?>
a:3:{s:5:"value";s:1436:"<?php 
$this->__view_helper_model['base_view_helper'] = kernel::single('base_view_helper');
?>
<form action="<?php 
echo kernel::router()->gen_url(array('app' => b2c, 'ctl' => site_search, 'act' => result));
?>
" method="post" class="SearchBar  searchBar_<?php 
echo $this->_vars['widget_id'];
?>
" >
<div class="search_label">
     <input type="text" name="name[]" value="<?php 
echo $this->_vars['data']['search_key'];
?>
" autocompleter="associate_autocomplete_goods:name,goods_id" ac_options="{}" class="inputstyle keywords"  />
     <input type="submit" value="<?php 
$this->_tag_stack[] = array('t', array('app' => 'b2c'));
$this->__view_helper_model['base_view_helper']->block_t(array('app' => 'b2c'), null, $this);
ob_start();
?>
搜索<?php 
$_block_content = ob_get_contents();
ob_end_clean();
$_block_content = $this->__view_helper_model['base_view_helper']->block_t($this->_tag_stack[count($this->_tag_stack) - 1][1], $_block_content, $this);
echo $_block_content;
array_pop($this->_tag_stack);
$_block_content = '';
[退出]<?php 
$_block_content = ob_get_contents();
ob_end_clean();
$_block_content = $this->__view_helper_model['base_view_helper']->block_t($this->_tag_stack[count($this->_tag_stack) - 1][1], $_block_content, $this);
echo $_block_content;
array_pop($this->_tag_stack);
$_block_content = '';
?>
</a>
</span>
<script>
var e = Cookie.read('UNAME')?Cookie.read('UNAME'):'';
/*
	new Request({
		url:'<?php 
echo kernel::router()->gen_url(array('app' => b2c, 'ctl' => site_passport, 'act' => getuname));
?>
',
		method:'post',
		onComplete:function(e){
		*/
			if(e){
				$("uname_<?php 
echo $this->_vars['widgets_id'];
?>
").innerHTML = e;
				$("memberBar_<?php 
echo $this->_vars['widgets_id'];
?>
").setStyle('display','block');
				if($("loginBar_<?php 
Beispiel #20
0
 /**
 * 根据条件获取商品信息
 * @param array $filter (所有条件都可选)
 *  array(
        'goodsId' => array(1,2)/1,  //商品ID
        'priceFrom' => 5,           //价格区间(低)
        'priceTo' => 100,           //价格区间(高)
        'typeId' => 2,              //商品类型ID
        'catId' => array(1,2)/1,    //商品分类ID
        'brandId' => array(1,2)/1,  //商品品牌ID
        'goodsOrderBy' => 1,        //商品排序
        'goodsNum' => 12,           //总商品数(最多20)
    ),
 */
 public function getGoodsList($filter)
 {
     if (isset($_COOKIE['MLV'])) {
         $member_level = $_COOKIE['MLV'];
         (array) ($arr = $this->app->model('member_lv')->getList('dis_count', array('member_lv_id' => $member_level)));
         $dis_count = $arr[0]['dis_count'];
     }
     $objLvprice =& $this->app->model('goods_lv_price');
     $goods =& $this->app->model('goods');
     $objProduct =& $this->app->model('products');
     $config = $this->app->getConf('site.save_price');
     //$imageDefault   = app::get('image')->getConf('image.set');
     $search =& $this->app->model('search');
     $orderBy = $filter['goodsOrderBy'] ? $filter['goodsOrderBy'] : 0;
     $order = $filter['goodsOrderBy'] ? $this->_getOrderBy($filter['goodsOrderBy'], false) : null;
     $limit = intval($filter['goodsNum']) > 0 ? intval($filter['goodsNum']) : 6;
     //$limit      = ($limit > 20) ? 20 : $limit;
     $result = array();
     unset($filter['goodsOrderBy']);
     unset($filter['goodsNum']);
     unset($filter['goodsOrderBy']);
     unset($filter['goodsNum']);
     $_filter = $this->_getFilter($filter);
     $result['goodsMoreLink'] =& kernel::router()->gen_url(array('app' => 'b2c', 'ctl' => 'site_gallery', 'act' => 'index', 'args' => array(implode(",", (array) $filter['catId']), $search->encode($filter), $orderBy)));
     $goodsList = $goods->getList('*', $_filter, 0, $limit, $order['sql']);
     if (!empty($_filter['goods_id'])) {
         $goods_temp = array();
         foreach ($_filter['goods_id'] as $k => $v) {
             foreach ($goodsList as $row) {
                 if ($v == $row['goods_id']) {
                     $goods_temp[$k] = $row;
                 }
             }
         }
         unset($goodsList);
         $goodsList = $goods_temp;
         unset($goods_temp);
     }
     if (is_array($goodsList) && $goodsList) {
         foreach ($goodsList as $pk => $pv) {
             if (empty($pv['mktprice']) || $pv['mktprice'] == '0') {
                 $pv['mktprice'] = $objProduct->getRealMkt($pv['price']);
             }
             $cat = $goods->db->selectrow("SELECT cat_name FROM sdb_b2c_goods_cat WHERE cat_id = " . intval($pv['cat_id']));
             $pv['cat_name'] = $cat['cat_name'];
             // add for member price
             $lv_price = $objLvprice->getList('price', array('goods_id' => $pv['goods_id'], 'level_id' => $member_level));
             if (isset($dis_count)) {
                 if (count($lv_price) > 0) {
                     $lv_price = end($lv_price);
                     $pv['memprice'] = $lv_price['price'];
                 } else {
                     $pv['memprice'] = $pv['price'] * $dis_count;
                 }
                 if (intval($pv['price']) != 0) {
                     $pv['dis_count'] = (1 - $pv['memprice'] / $pv['price']) * 100;
                 } else {
                     $pv['dis_count'] = 0;
                 }
             } else {
                 $pv['dis_count'] = 0;
                 $pv['memprice'] = false;
             }
             $imageUrl = $this->get_image_url($pv['image_default_id']);
             $pv['l_pic'] = $imageUrl['url_lager'];
             $pv['m_pic'] = $imageUrl['url_middle'];
             $pv['s_pic'] = $imageUrl['url_small'];
             $pv['_link_'] = $this->getGoodsLink($pv['goods_id']);
             $result['goodsRows'][$pv['goods_id']] = $this->_getOutData($pv);
         }
     }
     return $result;
 }
Beispiel #21
0
 function redirect($url)
 {
     $arr_url = parse_url($url);
     if ($arr_url['scheme'] && $arr_url['host']) {
         header('Location: ' . $url);
     } else {
         header('Location: ' . kernel::router()->app->base_url(1) . $url);
     }
     //
 }
Beispiel #22
0
    /**
     * 抛出数据给rpc,抛出点页面的底部
     * @param null
     * @return null
     */
    public function print_footer()
    {
        /**
         * 得到页面的属性,app,controller and action
         */
        $obj_base_component_request = kernel::single('base_component_request');
        $ctl_name = $obj_base_component_request->get_ctl_name();
        $act_name = $obj_base_component_request->get_act_name();
        $app_name = $obj_base_component_request->get_app_name();
        /**
         * app version
         */
        $obj_apps = app::get('base')->model('apps');
        $rows = $obj_apps->getList('local_ver', array('app_id' => $app_name));
        $app_ver = $rows[0]['local_ver'];
        $RSC_RPC = $this->app->getConf('site.rsc_rpc.url');
        // 开始抛出符合条件数据
        if ($this->app->getConf('site.rsc_rpc') && $RSC_RPC && ($certificate = base_certificate::certi_id())) {
            $RSC_RPC_STR = '<script>
            withBrowserStore(function(store){
                function randomChar(l)
                {
                    var  x="0123456789qwertyuioplkjhgfdsazxcvbnm";
                    var  tmp="";
                    for(var i=0;i<  l;i++)
                    {
                    tmp  +=  x.charAt(Math.ceil(Math.random()*100000000)%x.length);
                    }
                    return  tmp;
                }

                var lf = decodeURI(window.location.href);
                var pagetitle = document.title;
                var new_hs = "";
                var pos = lf.indexOf("#r-");
                var pos2 = lf.indexOf("%23r-");
                var stats = "";
                var rsc_rpc_url = "' . $RSC_RPC . '";
                var certi_id = "' . $certificate . '";
                var js_session_id = "' . md5(md5(kernel::single("base_session")->sess_id())) . '";
                var page_type = "' . urlencode($app_name) . ':' . urlencode($ctl_name) . ':' . urlencode($act_name) . '";
                var app_version = "ecos_' . $app_name . '(' . $app_ver . ')";
                var rstimestamp = "' . time() . '";

                if(pos!=-1||pos2!=-1)
                {
                    if(pos2!=-1){
                    pos=pos2+2;
                    }
                    new_hs=lf.substr(pos+1);
                }

                var old_hs = Cookie.read("S[SHOPEX_ADV_HS]");
                if(new_hs && old_hs!=new_hs)
                {
                    Cookie.set("S[SHOPEX_ADV_HS]",new_hs);
                }

                var shopex_stats = JSON.decode(Cookie.read("S[SHOPEX_STATINFO]"));
                if (shopex_stats)
                {
                    Cookie.write("S[SHOPEX_STATINFO]","",{path:"/"});
                }

                Object.each(shopex_stats,function(value, key){
                    stats += "&" + key + "=" + value;
                });

                if (!stats && Browser.Plugins.Flash.version)
                {
                    new Request({
                        url:"' . kernel::router()->gen_url(array('app' => 'stats', 'ctl' => 'site_statsajax', 'act' => 'index')) . '",
                        method:"post",
                        data:"method=getkvstore",
                        onSuccess:function(response){
                            response = JSON.decode(response);
                            var res = response;
                            if (res){
                                page_type="order:index";
                            }
                            Object.each(res,function(value, key){
                                stats += "&" + key + "=" + value;
                            });

                            store.get("jsapi",function(data){
                                var script = document.createElement("script");

                                var _src = rsc_rpc_url + "/jsapi?certi_id="+certi_id+"&_dep="+js_session_id+"&pt=" + page_type + "&app="+app_version+"&uid="+(encodeURIComponent(Cookie.read("S[MEMBER]") || "").split("-")[0])+"&ref="+encodeURIComponent(document.referrer)+"&sz="+JSON.encode(window.getSize())+"&hs="+encodeURIComponent(Cookie.read("S[SHOPEX_ADV_HS]") || new_hs)+"&rt="+ rstimestamp + stats + "&_pagetitle=" + pagetitle;
                                if(data){
                                    try{
                                    data = JSON.decode(data);
                                    }catch(e){}

                                    if($type(data)=="object"){
                                        _src +="&"+Hash.toQueryString(data);
                                    }else if($type(data)=="string"){
                                        _src +="&"+data;
                                    }
                                }

                                script.setAttribute("src",_src);
                                document.head.appendChild(script);

                            });
                        }
                    }).send();
                }
                else
                {
                    store.get("jsapi",function(data){
                        var script = document.createElement("script");

                        var _src = rsc_rpc_url + "/jsapi?certi_id="+certi_id+"&_dep="+js_session_id+"&pt=" + page_type + "&app="+app_version+"&uid="+(encodeURIComponent(Cookie.read("S[MEMBER]") || "").split("-")[0])+"&ref="+encodeURIComponent(document.referrer)+"&sz="+JSON.encode(window.getSize())+"&hs="+encodeURIComponent(Cookie.read("S[SHOPEX_ADV_HS]") || new_hs)+"&rt="+ rstimestamp + stats + "&_pagetitle=" + pagetitle;
                        if(data){
                            try{
                            data = JSON.decode(data);
                            }catch(e){}

                            if($type(data)=="object"){
                                _src +="&"+Hash.toQueryString(data);
                            }else if($type(data)=="string"){
                                _src +="&"+data;
                            }
                        }

                        script.setAttribute("src",_src);
                        document.head.appendChild(script);
                    });
                }

            });
            </script>';
        }
        return $RSC_RPC_STR;
    }
Beispiel #23
0
 public function codecheck()
 {
     //if ($_POST['auth_code'] && preg_match("/^\d{19}$/", substr($_POST['auth_code'], 1)))
     if ($_POST['auth_code']) {
         $code = kernel::single('desktop_cert_certcheck');
         $shopexIdUrl = app::get('base')->getConf('certificate_code_url');
         if ($shopexIdUrl && $shopexIdUrl != kernel::base_url(1)) {
             $result['res'] = 'false';
         } else {
             $result = $code->check_code($_POST['auth_code']);
         }
         if ($result['res'] == 'succ' && $result) {
             $activation_arr = $_POST['auth_code'];
             app::get('desktop')->setConf('activation_code', $activation_arr);
             if (!app::get('base')->getConf('certificate_code_url')) {
                 app::get('base')->setConf('certificate_code_url', kernel::base_url(1));
             }
             $objArr = kernel::servicelist("desktop.cert.succ");
             foreach ($objArr as $obj) {
                 if (method_exists($obj, 'notify')) {
                     $obj->notify($result);
                 }
             }
             header('Location:' . kernel::router()->app->base_url(1));
             exit;
         } else {
             switch ($result['msg']) {
                 case 'key_false_type':
                     $auth_error_msg = '激活码类型不对!';
                     break;
                 case 'key_false_ac':
                     $auth_error_msg = '验证标签错误!';
                     break;
                 case 'key_false_expir':
                     $auth_error_msg = '此激活码大于最大有效期限制!';
                     break;
                 case 'key_false_times':
                     $auth_error_msg = '失败:您已经连续6次提交失败,为了您的网店安全,请3小时后再次尝试|';
                     break;
                 case 'key_false_key':
                     $auth_error_msg = '无效的激活码,请您重新输入激活码以便正常使用。';
                     break;
                 case 'key_false_actived':
                     $auth_error_msg = '您的激活码已经失效,请您重新输入激活码以便正常使用。';
                     break;
                 case 'key_false_oem':
                     $auth_error_msg = '您的网店License与输入的激活码类型不一,请联系激活码销售商!';
                     break;
                 case 'key_false_type_1':
                     $auth_error_msg = '您的网店License与输入的激活码类型不一,请联系激活码销售商!';
                     break;
                 case 'key_false_type_2':
                     $auth_error_msg = '您的网店License与输入的激活码类型不一,请联系激活码销售商!';
                     break;
                 case 'certificate_id_is_false':
                     $auth_error_msg = ' 您的网店证书有误,请查证!';
                     break;
                 case 'temp_key_false':
                     $auth_error_msg = '临时激活码激活失败,此站点已经用正式激活码激活过了,不能再用临时激活码';
                     break;
                 case 'active_key_false':
                     $auth_error_msg = '激活错误,此激活码已被使用或者激活码输入错误';
                     break;
             }
             die($this->error_view($auth_error_msg));
         }
         header("Location: index.php");
         exit;
     }
 }