当前位置: 首页>>代码示例>>PHP>>正文


PHP ecm_json_encode函数代码示例

本文整理汇总了PHP中ecm_json_encode函数的典型用法代码示例。如果您正苦于以下问题:PHP ecm_json_encode函数的具体用法?PHP ecm_json_encode怎么用?PHP ecm_json_encode使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ecm_json_encode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_order_form

 function get_order_form($store_id)
 {
     $data = array();
     $template = 'order.form.html';
     $visitor =& env('visitor');
     /* 获取我的收货地址 */
     $data['my_address'] = $this->_get_my_address($visitor->get('user_id'));
     $data['addresses'] = ecm_json_encode($data['my_address']);
     $data['regions'] = $this->_get_regions();
     /* 默认地址 */
     $addr_default = array();
     foreach ($data['my_address'] as $key => $val) {
         if ($val['is_default']) {
             $addr_default = $data['my_address'][$key];
             break;
         }
     }
     $data['addr_default'] = $addr_default;
     /* 配送方式 */
     $data['shipping_methods'] = $this->_get_shipping_methods($store_id);
     if (empty($data['shipping_methods'])) {
         $this->_error('no_shipping_methods');
         return false;
     }
     $data['shippings'] = ecm_json_encode($data['shipping_methods']);
     foreach ($data['shipping_methods'] as $shipping) {
         $data['shipping_options'][$shipping['shipping_id']] = $shipping['shipping_name'];
     }
     return array('data' => $data, 'template' => $template);
 }
开发者ID:junnyboyqian,项目名称:junlaravel,代码行数:30,代码来源:normal.otype.php

示例2: index

 /**
  *    后台首页
  *
  *    @author    Garbin
  *    @return    void
  */
 function index()
 {
     $back_nav = $menu = $this->_get_menu();
     unset($back_nav['dashboard']);
     $this->_hook('on_load_adminmenu', array('menu' => &$menu));
     $this->assign('menu', $menu);
     $this->assign('back_nav', $back_nav);
     $this->assign('menu_json', ecm_json_encode($menu));
     $this->display('index.html');
 }
开发者ID:184609680,项目名称:wcy_O2O_95180,代码行数:16,代码来源:default.app.php

示例3: check_captcha

 function check_captcha()
 {
     $captcha = empty($_GET['captcha']) ? '' : strtolower(trim($_GET['captcha']));
     if (!$captcha) {
         echo ecm_json_encode(false);
         return;
     }
     if (base64_decode($_SESSION['captcha']) != $captcha) {
         echo ecm_json_encode(false);
     } else {
         echo ecm_json_encode(true);
     }
     return;
 }
开发者ID:zhangxiaoling,项目名称:ecmall,代码行数:14,代码来源:captcha.app.php

示例4: check_growth

 function check_growth()
 {
     $growth_needed = empty($_GET['growth_needed']) ? '' : trim($_GET['growth_needed']);
     $grade = empty($_GET['grade']) ? 0 : intval($_GET['grade']);
     if (!$growth_needed) {
         echo ecm_json_encode(false);
         return;
     }
     if ($this->_grade_mod->compare($grade, $growth_needed)) {
         echo ecm_json_encode(true);
     } else {
         echo ecm_json_encode(false);
     }
     return;
 }
开发者ID:BGCX261,项目名称:zmall-svn-to-git,代码行数:15,代码来源:ugrade.app.php

示例5: check_grade

 function check_grade()
 {
     $grade_name = empty($_GET['grade_name']) ? '' : trim($_GET['grade_name']);
     $grade_id = empty($_GET['id']) ? 0 : intval($_GET['id']);
     if (!$grade_name) {
         echo ecm_json_encode(false);
         return;
     }
     if ($this->_grade_mod->unique($grade_name, $grade_id)) {
         echo ecm_json_encode(true);
     } else {
         echo ecm_json_encode(false);
     }
     return;
 }
开发者ID:BGCX261,项目名称:zmall-svn-to-git,代码行数:15,代码来源:sgrade.app.php

示例6: ajax_col

 function ajax_col()
 {
     $id = empty($_GET['id']) ? 0 : intval($_GET['id']);
     $column = empty($_GET['column']) ? '' : trim($_GET['column']);
     $value = isset($_GET['value']) ? trim($_GET['value']) : '';
     $data = array();
     if (in_array($column, array('recommended'))) {
         $data[$column] = $value;
         $this->_groupbuy_mod->edit("group_id = " . $id . " AND state = " . GROUP_ON, $data);
         if (!$this->_groupbuy_mod->has_error()) {
             echo ecm_json_encode(true);
         }
     } else {
         return;
     }
     return;
 }
开发者ID:zhangxiaoling,项目名称:ecmall,代码行数:17,代码来源:groupbuy.app.php

示例7: _get_goods_info

 /**
  * 取得商品信息
  */
 function _get_goods_info($id = 0)
 {
     $default_goods_image = Conf::get('default_goods_image');
     // 商城默认商品图片
     if ($id > 0) {
         $goods_info = $this->_goods_mod->get_info($id);
         if ($goods_info === false) {
             return false;
         }
         $goods_info['default_goods_image'] = $default_goods_image;
         if (empty($goods_info['default_image'])) {
             $goods_info['default_image'] = $default_goods_image;
         }
     } else {
         $goods_info = array('cate_id' => 0, 'if_show' => 1, 'recommended' => 1, 'price' => 1, 'stock' => 1, 'spec_qty' => 0, 'spec_name_1' => Lang::get('color'), 'spec_name_2' => Lang::get('size'), 'default_goods_image' => $default_goods_image, 'price2' => 1);
     }
     $goods_info['spec_json'] = ecm_json_encode(array('spec_qty' => $goods_info['spec_qty'], 'spec_name_1' => isset($goods_info['spec_name_1']) ? $goods_info['spec_name_1'] : '', 'spec_name_2' => isset($goods_info['spec_name_2']) ? $goods_info['spec_name_2'] : '', 'specs' => $goods_info['_specs']));
     return $goods_info;
 }
开发者ID:BGCX261,项目名称:zhou3liu-svn-to-git,代码行数:22,代码来源:my_goods.app.php

示例8: ajax_col

 function ajax_col()
 {
     $id = empty($_GET['id']) ? 0 : intval($_GET['id']);
     $column = empty($_GET['column']) ? '' : trim($_GET['column']);
     $value = isset($_GET['value']) ? trim($_GET['value']) : '';
     $data = array();
     if (in_array($column, array('ad_name', 'position', 'link'))) {
         $data[$column] = $value;
         $this->_ad_mod->edit($id, $data);
         if (!$this->_ad_mod->has_error()) {
             echo ecm_json_encode(true);
         }
     } else {
         return;
     }
     return;
 }
开发者ID:junnyboyqian,项目名称:junlaravel,代码行数:17,代码来源:ad.app.php

示例9: check_name

 function check_name()
 {
     $store_name = empty($_GET['store_name']) ? '' : trim($_GET['store_name']);
     $store_mod =& m('store');
     if (!$store_mod->unique($store_name)) {
         echo ecm_json_encode(false);
         return;
     }
     echo ecm_json_encode(true);
 }
开发者ID:BGCX261,项目名称:zhou3liu-svn-to-git,代码行数:10,代码来源:apply.app.php

示例10: ajax_col

 function ajax_col()
 {
     $id = empty($_GET['id']) ? 0 : intval($_GET['id']);
     $column = empty($_GET['column']) ? '' : trim($_GET['column']);
     $value = isset($_GET['value']) ? trim($_GET['value']) : '';
     $data = array();
     if (in_array($column, array('brand_name', 'recommended', 'sort_order'))) {
         $data[$column] = $value;
         if ($column == 'brand_name') {
             $brand = $this->_brand_mod->get_info($id);
             if (!$this->_brand_mod->unique($value, $id)) {
                 echo ecm_json_encode(false);
                 return;
             }
         }
         if ($this->_brand_mod->edit($id, $data)) {
             echo ecm_json_encode(true);
         }
     } else {
         return;
     }
     return;
 }
开发者ID:BGCX261,项目名称:zhou3liu-svn-to-git,代码行数:23,代码来源:brand.app.php

示例11: ajax_col

 function ajax_col()
 {
     $id = empty($_GET['id']) ? 0 : intval($_GET['id']);
     $column = empty($_GET['column']) ? '' : trim($_GET['column']);
     $value = isset($_GET['value']) ? trim($_GET['value']) : '';
     $data = array();
     if (in_array($column, array('title', 'sort_order'))) {
         $data[$column] = $value;
         $this->_navi_mod->edit($id, $data);
         if (!$this->_navi_mod->has_error()) {
             $this->_clear_cache();
             echo ecm_json_encode(true);
         }
     } else {
         return;
     }
     return;
 }
开发者ID:zhangxiaoling,项目名称:ecmall,代码行数:18,代码来源:navigation.app.php

示例12: check_category

 function check_category()
 {
     $cate_name = empty($_GET['cate_name']) ? '' : trim($_GET['cate_name']);
     $parent_id = empty($_GET['parent_id']) ? 0 : intval($_GET['parent_id']);
     $cate_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
     if (!$cate_name) {
         echo ecm_json_encode(true);
         return;
     }
     if ($this->_gcategory_mod->unique($cate_name, $parent_id, $cate_id)) {
         echo ecm_json_encode(true);
     } else {
         echo ecm_json_encode(false);
     }
     return;
 }
开发者ID:woolh,项目名称:Online,代码行数:16,代码来源:my_category.app.php

示例13: ajax_col

 function ajax_col()
 {
     $id = empty($_GET['id']) ? 0 : intval($_GET['id']);
     $column = empty($_GET['column']) ? '' : trim($_GET['column']);
     $value = isset($_GET['value']) ? trim($_GET['value']) : '';
     $data = array();
     if (in_array($column, array('cate_name', 'if_show', 'sort_order'))) {
         $data[$column] = $value;
         if ($column == 'cate_name') {
             $gcategory = $this->_gcategory_mod->get_info($id);
             if (!$this->_gcategory_mod->unique($value, $gcategory['parent_id'], $id)) {
                 echo ecm_json_encode(false);
                 return;
             }
         }
         if ($this->_gcategory_mod->edit($id, $data)) {
             echo ecm_json_encode(true);
         }
     } else {
         return;
     }
     return;
 }
开发者ID:BGCX261,项目名称:zhou3liu-svn-to-git,代码行数:23,代码来源:gcategory.app.php

示例14: check_name

 function check_name()
 {
     $id = empty($_GET['id']) ? 0 : intval($_GET['id']);
     $store_name = empty($_GET['store_name']) ? '' : trim($_GET['store_name']);
     if (!$this->_store_mod->unique($store_name, $id)) {
         echo ecm_json_encode(false);
         return;
     }
     echo ecm_json_encode(true);
 }
开发者ID:zhangxiaoling,项目名称:ecmall,代码行数:10,代码来源:store.app.php

示例15: get_editor_panel

 /**
  *    获取编辑器面板
  *
  *    @author    Garbin
  *    @return    void
  */
 function get_editor_panel()
 {
     /* 获取挂件列表 */
     $widgets = list_widget();
     header('Content-Type:text/html;charset=' . CHARSET);
     $this->assign('widgets', ecm_json_encode($widgets));
     $this->assign('site_url', SITE_URL);
     $this->display('template.panel.html');
 }
开发者ID:BGCX261,项目名称:zhou3liu-svn-to-git,代码行数:15,代码来源:template.app.php


注:本文中的ecm_json_encode函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。