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


PHP make_json_result函数代码示例

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


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

示例1: _wap_display_page

function _wap_display_page($page_name = 'index.htm')
{
    global $smarty;
    $full_page = empty($_REQUEST['is_ajax']) ? 1 : ($_REQUEST['is_ajax'] == 1 ? 0 : 1);
    $smarty->assign('full_page', $full_page);
    if ($full_page == 1) {
        $smarty->display($page_name);
    } else {
        $content = $smarty->fetch($page_name);
        make_json_result($content);
    }
    exit;
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:13,代码来源:lib_supplier_common_wap.php

示例2: install

 /**
  * 模板安装
  */
 public function install()
 {
     $tpl_name = I('get.tpl_name');
     $tpl_fg = I('get.tpl_fg', 0);
     $data['value'] = $tpl_name;
     $condition['code'] = 'template';
     $this->model->table('touch_shop_config')->data($data)->where($condition)->update();
     $data['value'] = $tpl_fg;
     $condition['code'] = 'stylename';
     $this->model->table('touch_shop_config')->data($data)->where($condition)->update();
     clear_all_files();
     //清除模板编译文件
     make_json_result($this->read_style_and_tpl($tpl_name, $tpl_fg), L('install_template_success'));
 }
开发者ID:m7720647,项目名称:demo,代码行数:17,代码来源:TemplateController.class.php

示例3: delmember

 public function delmember()
 {
     $user_id = $this->_get['id'];
     if (ADMINUSERID != 1) {
         make_json_error('对不起,您无权删除其他管理员');
     }
     if ($user_id == ADMINUSERID) {
         make_json_error('您不能删除自己');
     }
     if ($user_id) {
         mod_member::member_delete($user_id);
         $list = mod_member::member_list($start, $level, 20);
         pm_tpl::assign('admin_list', $list['data']);
         make_json_result(pm_tpl::fetch('member_list'));
     } else {
         make_json_error('删除失败');
     }
 }
开发者ID:Zniel,项目名称:fl_crtlpanel_self_dev,代码行数:18,代码来源:pmc_ajaxdo.php

示例4: array

        exit;
    }
    $links[] = array('href' => 'topic.php', 'text' => $_LANG['back_list']);
    sys_msg($_LANG['succed'], 0, $links);
} elseif ($_REQUEST['act'] == 'query') {
    $topic_list = get_topic_list();
    $smarty->assign('topic_list', $topic_list['item']);
    $smarty->assign('filter', $topic_list['filter']);
    $smarty->assign('record_count', $topic_list['record_count']);
    $smarty->assign('page_count', $topic_list['page_count']);
    $smarty->assign('use_storage', empty($_CFG['use_storage']) ? 0 : 1);
    /* 排序标记 */
    $sort_flag = sort_flag($topic_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    $tpl = 'topic_list.htm';
    make_json_result($smarty->fetch($tpl), '', array('filter' => $topic_list['filter'], 'page_count' => $topic_list['page_count']));
}
/**
 * 获取专题列表.
 */
function get_topic_list()
{
    $result = get_filter();
    if ($result === false) {
        /* 查询条件 */
        $filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'topic_id' : trim($_REQUEST['sort_by']);
        $filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
        $sql = 'SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('topic');
        $filter['record_count'] = $GLOBALS['db']->getOne($sql);
        /* 分页大小 */
        $filter = page_and_size($filter);
开发者ID:netroby,项目名称:ecshop,代码行数:31,代码来源:topic.php

示例5: get_distrib_sort

}
if ($_REQUEST['act'] == 'list') {
    $smarty->assign('full_page', 1);
    $distrib_sort_list = get_distrib_sort();
    $smarty->assign('distrib_sort_list', $distrib_sort_list['arr']);
    $smarty->assign('filter', $distrib_sort_list['filter']);
    $smarty->assign('record_count', $distrib_sort_list['record_count']);
    $smarty->assign('page_count', $distrib_sort_list['page_count']);
    $smarty->display('distrib_sort_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $distrib_sort_list = get_distrib_sort();
    $smarty->assign('distrib_sort_list', $distrib_sort_list['arr']);
    $smarty->assign('filter', $distrib_sort_list['filter']);
    $smarty->assign('record_count', $distrib_sort_list['record_count']);
    $smarty->assign('page_count', $distrib_sort_list['page_count']);
    make_json_result($smarty->fetch('distrib_sort_list.htm'), '', array('filter' => $city_list['filter'], 'page_count' => $city_list['page_count']));
}
function get_distrib_sort()
{
    $filter = array();
    $sql = "SELECT COUNT(distinct user_id) FROM " . $GLOBALS['ecs']->table('distrib_sort');
    $filter['record_count'] = $GLOBALS['db']->getOne($sql);
    $filter = page_and_size($filter);
    $arr = array();
    $sql = "SELECT d.*,sum(money) as total_money,u.user_name FROM " . $GLOBALS['ecs']->table('distrib_sort') . " as d inner join " . $GLOBALS['ecs']->table('users') . " as u on d.user_id = u.user_id group by d.user_id order by total_money desc";
    $res = $GLOBALS['db']->selectLimit($sql, $filter['page_size'], $filter['start']);
    while ($rows = $GLOBALS['db']->fetchRow($res)) {
        $arr[] = $rows;
    }
    return array('arr' => $arr, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);
}
开发者ID:moonlight-wang,项目名称:feilun,代码行数:31,代码来源:distrib_sort.php

示例6: COUNT

            $sql = "DELETE FROM " . $ecs->table('email_sendlist') . " WHERE id = '{$row['id']}'";
            $db->query($sql);
            //剩余列表数
            $count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('email_sendlist'));
            if ($count > 0) {
                $msg = sprintf($_LANG['mailsend_ok'], $row['email'], $count);
            } else {
                $msg = sprintf($_LANG['mailsend_finished'], $row['email']);
            }
            make_json_result('', $msg, array('count' => $count));
        } else {
            //发送出错
            if ($row['error'] < 3) {
                $time = time();
                $sql = "UPDATE " . $ecs->table('email_sendlist') . " SET error = error + 1, pri = 0, last_send = '{$time}' WHERE id = '{$row['id']}'";
            } else {
                //将出错超次的纪录删除
                $sql = "DELETE FROM " . $ecs->table('email_sendlist') . " WHERE id = '{$row['id']}'";
            }
            $db->query($sql);
            $count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('email_sendlist'));
            make_json_result('', sprintf($_LANG['mailsend_fail'], $row['email']), array('count' => $count));
        }
    } else {
        //无效的邮件队列
        $sql = "DELETE FROM " . $ecs->table('email_sendlist') . " WHERE id = '{$row['id']}'";
        $db->query($sql);
        $count = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('email_sendlist'));
        make_json_result('', sprintf($_LANG['mailsend_fail'], $row['email']), array('count' => $count));
    }
}
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:index.php

示例7: array

    $smarty->assign('record_count', $order_list['record_count']);
    $smarty->assign('page_count', $order_list['page_count']);
    $smarty->assign('full_page', 1);
    $smarty->assign('action_link', array('text' => $_LANG['user_account_manage'], 'href' => 'user_account_manage.php?act=list&start_date=' . local_date('Y-m-d', $start_date) . '&end_date=' . local_date('Y-m-d', $end_date)));
    /* 显示页面 */
    assign_query_info();
    $smarty->display('order_surplus_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $order_list = order_list();
    $smarty->assign('order_list', $order_list['order_list']);
    $smarty->assign('filter', $order_list['filter']);
    $smarty->assign('record_count', $order_list['record_count']);
    $smarty->assign('page_count', $order_list['page_count']);
    $sort_flag = sort_flag($order_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('order_surplus_list.htm'), '', array('filter' => $order_list['filter'], 'page_count' => $order_list['page_count']));
}
/**
* 获得账户变动金额
* @param   string  $type   0,充值 1,提现
* @return  array
*/
function get_total_amount($start_date, $end_date, $type = 0)
{
    $sql = " SELECT IFNULL(SUM(amount), 0) AS total_amount FROM " . $GLOBALS['ecs']->table('user_account') . " AS a, " . $GLOBALS['ecs']->table('users') . " AS u " . " WHERE process_type = {$type} AND is_paid = 1 AND a.user_id = u.user_id AND paid_time >= '{$start_date}' AND paid_time < '" . ($end_date + 86400) . "'";
    $amount = $GLOBALS['db']->getone($sql);
    $amount = $type ? price_format(abs($amount)) : price_format($amount);
    return $amount;
}
/**
 *  返回用户订单列表数据
开发者ID:run100,项目名称:ecshop,代码行数:31,代码来源:user_account_manage.php

示例8: make_json_result

    }
    make_json_result($opt);
}
/*------------------------------------------------------ */
//-- 搜索商品
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'get_goods_list') {
    include_once ROOT_PATH . 'includes/cls_json.php';
    $json = new JSON();
    $filters = $json->decode($_GET['JSON']);
    $arr = get_goods_list($filters);
    $opt = array();
    foreach ($arr as $key => $val) {
        $opt[] = array('value' => $val['goods_id'], 'text' => $val['goods_name'], 'data' => $val['shop_price']);
    }
    make_json_result($opt);
} elseif ($_REQUEST['act'] == 'batch') {
    /* 批量删除 */
    if (isset($_POST['type'])) {
        if ($_POST['type'] == 'button_remove') {
            admin_priv('article_manage');
            if (!isset($_POST['checkboxes']) || !is_array($_POST['checkboxes'])) {
                sys_msg($_LANG['no_select_article'], 1);
            }
            /* 删除原来的文件 */
            $sql = "SELECT file_url FROM " . $ecs->table('article') . " WHERE article_id " . db_create_in(join(',', $_POST['checkboxes'])) . " AND file_url <> ''";
            $res = $db->query($sql);
            while ($row = $db->fetchRow($res)) {
                $old_url = $row['file_url'];
                if (strpos($old_url, 'http://') === false && strpos($old_url, 'https://') === false) {
                    @unlink(ROOT_PATH . $old_url);
开发者ID:norain2050,项目名称:mhFault,代码行数:31,代码来源:article.php

示例9: clear_cache_files

    clear_cache_files();
    admin_log('', 'remove', 'friendlink');
    $url = 'friend_link.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
} elseif ($_REQUEST['act'] == 'edit_show_order') {
    check_authz_json('friendlink');
    $id = intval($_POST['id']);
    $order = json_str_iconv(trim($_POST['val']));
    /* 检查输入的值是否合法 */
    if (!preg_match("/^[0-9]+\$/", $order)) {
        make_json_error(sprintf($_LANG['enter_int'], $order));
    } else {
        if ($exc->edit("show_order = '{$order}'", $id)) {
            clear_cache_files();
            make_json_result(stripslashes($order));
        }
    }
}
/* 获取友情链接数据列表 */
function get_links_list()
{
    $result = get_filter();
    if ($result === false) {
        $filter = array();
        $filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'link_id' : trim($_REQUEST['sort_by']);
        $filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
        /* 获得总记录数据 */
        $sql = 'SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('friend_link');
        $filter['record_count'] = $GLOBALS['db']->getOne($sql);
        $filter = page_and_size($filter);
开发者ID:muqidi,项目名称:PHP,代码行数:31,代码来源:friend_link.php

示例10: sys_msg

    // 清除相关的缓存文件
    $link[0]['text'] = "操作成功";
    $link[0]['href'] = 'stock_out_type.php?act=list';
    sys_msg("出库类型添加操作成功", 0, $link);
} elseif ($_REQUEST['act'] == 'query') {
    check_authz_json('stock_out_type');
    $type_list = get_typelist();
    /*判断代理商或管理员*/
    if (if_agency()) {
        $smarty->assign('if_agency', if_agency());
    }
    $smarty->assign('type_list', $type_list['arr']);
    $smarty->assign('filter', $type_list['filter']);
    $smarty->assign('record_count', $type_list['record_count']);
    $smarty->assign('page_count', $type_list['page_count']);
    make_json_result($smarty->fetch('stock_out_type_list.htm'), '', array('filter' => $type_list['filter'], 'page_count' => $type_list['page_count']));
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('stock_out_type');
    $id = intval($_REQUEST['id']);
    /*add by hg for date 2014-03-26 判断代理商是否非法操作商品*/
    //static_goods($_REQUEST['goods_id']);
    /*end*/
    if ($exc->edit("if_delete = 1", $id)) {
        clear_cache_files();
        //$goods_name = $exc->get_name($goods_id);
        //admin_log(addslashes($goods_name), 'trash', 'goods'); // 记录日志
        $url = 'stock_out_type.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
        ecs_header("Location: {$url}\n");
        exit;
    }
} elseif ($_REQUEST['act'] == 'restore_type') {
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:stock_out_type.php

示例11: assign_query_info

    $smarty->assign('page_count', $result['page_count']);
    $smarty->assign('sort_suppliers_id', '<img src="images/sort_desc.gif">');
    /* 显示模板 */
    assign_query_info();
    $smarty->display('supplier_rebate_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    check_authz_json('supplier_manage');
    $result = rebate_list();
    $smarty->assign('supplier_list', $result['result']);
    $smarty->assign('filter', $result['filter']);
    $smarty->assign('record_count', $result['record_count']);
    $smarty->assign('page_count', $result['page_count']);
    /* 排序标记 */
    $sort_flag = sort_flag($result['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('supplier_rebate_list.htm'), '', array('filter' => $result['filter'], 'page_count' => $result['page_count']));
} elseif ($_REQUEST['act'] == 'view') {
    /* 检查权限 */
    admin_priv('supplier_manage');
    /* 取得供货商返佣信息 */
    $id = $_REQUEST['id'];
    $is_pay_ok = $_REQUEST['is_pay_ok'] ? intval($_REQUEST['is_pay_ok']) : 0;
    $sql = "SELECT r.*, s.supplier_name, s.bank, s.supplier_rebate FROM " . $ecs->table('supplier_rebate') . " AS r left join " . $ecs->table('supplier') . "  AS s on r.supplier_id=s.supplier_id WHERE r.rebate_id = '{$id}'";
    $rebate = $db->getRow($sql);
    if (empty($rebate)) {
        sys_msg('该返佣记录不存在!');
    } else {
        $nowtime = time();
        $rebate['rebate_paytime_start'] = local_date('Y.m.d', $rebate['rebate_paytime_start']);
        $paytime_end = $rebate['rebate_paytime_end'];
        $rebate['rebate_paytime_end'] = local_date('Y.m.d', $paytime_end);
开发者ID:seanguo166,项目名称:yinoos,代码行数:31,代码来源:supplier_rebate_bk.php

示例12: admin_log

        $rank_name = $exc->get_name($rank_id);
        admin_log(addslashes($rank_name), 'edit', 'user_rank');
        clear_cache_files();
        make_json_result($val);
    } else {
        make_json_error($val);
    }
} elseif ($_REQUEST['act'] == 'toggle_special') {
    check_authz_json('user_rank');
    $rank_id = intval($_POST['id']);
    $is_special = intval($_POST['val']);
    if ($exc->edit("special_rank = '{$is_special}'", $rank_id)) {
        $rank_name = $exc->get_name($rank_id);
        admin_log(addslashes($rank_name), 'edit', 'user_rank');
        make_json_result($is_special);
    } else {
        make_json_error($db->error());
    }
} elseif ($_REQUEST['act'] == 'toggle_showprice') {
    check_authz_json('user_rank');
    $rank_id = intval($_POST['id']);
    $is_show = intval($_POST['val']);
    if ($exc->edit("show_price = '{$is_show}'", $rank_id)) {
        $rank_name = $exc->get_name($rank_id);
        admin_log(addslashes($rank_name), 'edit', 'user_rank');
        clear_cache_files();
        make_json_result($is_show);
    } else {
        make_json_error($db->error());
    }
}
开发者ID:dw250100785,项目名称:ECShop-1,代码行数:31,代码来源:user_rank.php

示例13: foreach

    $send_rank[SEND_USER . '_0'] = $_LANG['user_list'];
    foreach ($special_ranks as $rank_key => $rank_value) {
        $send_rank[SEND_RANK . '_' . $rank_key] = $rank_value;
    }
    $smarty->assign('send_rank', $send_rank);
    assign_query_info();
    $smarty->display('magazine_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $magazinedb = get_magazine();
    $smarty->assign('magazinedb', $magazinedb['magazinedb']);
    $smarty->assign('filter', $magazinedb['filter']);
    $smarty->assign('record_count', $magazinedb['record_count']);
    $smarty->assign('page_count', $magazinedb['page_count']);
    $sort_flag = sort_flag($magazinedb['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('magazine_list.htm'), '', array('filter' => $magazinedb['filter'], 'page_count' => $magazinedb['page_count']));
} elseif ($_REQUEST['act'] == 'add') {
    if (empty($_POST['step'])) {
        include_once ROOT_PATH . 'includes/fckeditor/fckeditor.php';
        // 包含 html editor 类文件
        $smarty->assign('action_link', array('text' => $_LANG['go_list'], 'href' => 'magazine_list.php?act=list'));
        $smarty->assign(array('ur_here' => $_LANG['magazine_list'], 'act' => 'add'));
        create_html_editor('magazine_content');
        assign_query_info();
        $smarty->display('magazine_list_add.htm');
    } elseif ($_POST['step'] == 2) {
        $magazine_name = trim($_POST['magazine_name']);
        $magazine_content = trim($_POST['magazine_content']);
        $magazine_content = str_replace('src=\\"', 'src=\\"http://' . $_SERVER['HTTP_HOST'], $magazine_content);
        $time = gmtime();
        $sql = "INSERT INTO " . $ecs->table('mail_templates') . " (template_code, is_html,template_subject, template_content, last_modify, type) VALUES('" . md5($magazine_name . $time) . "',1, '{$magazine_name}', '{$magazine_content}', '{$time}', 'magazine')";
开发者ID:muqidi,项目名称:PHP,代码行数:31,代码来源:magazine_list.php

示例14: assign_query_info

    $smarty->assign('code', $code);
    $smarty->assign('filter', $agency_goods_list['filter']);
    $smarty->assign('record_count', $agency_goods_list['record_count']);
    $smarty->assign('page_count', $agency_goods_list['page_count']);
    $smarty->assign('full_page', 1);
    assign_query_info();
    $smarty->assign('action_link', list_link($is_add, $code));
    $smarty->assign('goods_res', $agency_goods_list['goods_res']);
    $smarty->display('goods_agency_info.htm');
} elseif ($_REQUEST['act'] == 'agency_add_query') {
    $agency_goods_list = agency_goods_list();
    $smarty->assign('goods_res', $agency_goods_list['goods_res']);
    $smarty->assign('filter', $agency_goods_list['filter']);
    $smarty->assign('record_count', $agency_goods_list['record_count']);
    $smarty->assign('page_count', $agency_goods_list['page_count']);
    make_json_result($smarty->fetch('goods_agency_info.htm'), '', array('filter' => $agency_goods_list['filter'], 'page_count' => $agency_goods_list['page_count']));
} elseif ($_REQUEST['act'] == 'agency_add_goods') {
    set_time_limit(0);
    $goods_id_arr = $_POST['checkboxes'];
    $shop_price_arr = $_POST['agency_shop_price'];
    if (@(!array_filter($goods_id_arr)) || !array_filter($shop_price_arr)) {
        sys_msg('没有填写价格或者没有勾选产品', 1, $link);
    }
    foreach ($goods_id_arr as $key => $value) {
        if (floatval($shop_price_arr[$value])) {
            $obj = new class_copy_goods($value, admin_agency_id(), $shop_price_arr[$value]);
            $obj->copy_go();
            $yes = true;
        }
    }
    if ($yes) {
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:goods.php

示例15: check_authz_json

    check_authz_json('ad_manage');
    $id = intval($_POST['id']);
    $ad_height = json_str_iconv(trim($_POST['val']));
    /* 高度值必须是数字 */
    if (!preg_match("/^[\\.0-9]+\$/", $ad_height)) {
        make_json_error($_LANG['height_number']);
    }
    /* 广告位宽度应在1-1024之间 */
    if ($ad_height > 1024 || $ad_height < 1) {
        make_json_error($_LANG['height_value']);
    }
    if ($exc->edit("ad_height = '{$ad_height}'", $id)) {
        clear_cache_files();
        // 清除模版缓存
        admin_log($ad_height, 'edit', 'ads_position');
        make_json_result(stripslashes($ad_height));
    } else {
        make_json_error($db->error());
    }
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('ad_manage');
    $id = intval($_GET['id']);
    /* 查询广告位下是否有广告存在 */
    $sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('ad') . " WHERE position_id = '{$id}'";
    if ($db->getOne($sql) > 0) {
        make_json_error($_LANG['not_del_adposit']);
    } else {
        $exc->drop($id);
        admin_log('', 'remove', 'ads_position');
    }
    $url = 'ad_position.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
开发者ID:a494008974,项目名称:bzbshop,代码行数:31,代码来源:ad_position.php


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