本文整理汇总了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);
}
示例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');
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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');
}