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


PHP make_json_error函数代码示例

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


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

示例1: 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

示例2: array

        $_POST['level_point'] > $maxpoint && ($_POST['level_point'] = $maxpoint);
        $_POST['level_money'] > $maxmoney && ($_POST['level_money'] = $maxmoney);
        if (!empty($_POST['level_point']) && strpos($_POST['level_point'], '%') === false) {
            $_POST['level_point'] .= '%';
        }
        if (!empty($_POST['level_money']) && strpos($_POST['level_money'], '%') === false) {
            $_POST['level_money'] .= '%';
        }
        $items = array('level_point' => $_POST['level_point'], 'level_money' => $_POST['level_money']);
        $links[] = array('text' => $_LANG['affiliate'], 'href' => 'affiliate.php?act=list');
        $config['item'][] = $items;
        $config['on'] = 1;
        $config['config']['separate_by'] = 0;
        put_affiliate($config);
    } else {
        make_json_error($_LANG['level_error']);
    }
    ecs_header("Location: affiliate.php?act=query\n");
    exit;
} elseif ($_REQUEST['act'] == 'updata') {
    $separate_by = intval($_POST['separate_by']) == 1 ? 1 : 0;
    $_POST['expire'] = (double) $_POST['expire'];
    $_POST['level_point_all'] = (double) $_POST['level_point_all'];
    $_POST['level_money_all'] = (double) $_POST['level_money_all'];
    $_POST['level_money_all'] > 100 && ($_POST['level_money_all'] = 100);
    $_POST['level_point_all'] > 100 && ($_POST['level_point_all'] = 100);
    if (!empty($_POST['level_point_all']) && strpos($_POST['level_point_all'], '%') === false) {
        $_POST['level_point_all'] .= '%';
    }
    if (!empty($_POST['level_money_all']) && strpos($_POST['level_money_all'], '%') === false) {
        $_POST['level_money_all'] .= '%';
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:affiliate.php

示例3: db_create_in

            } else {
                continue;
            }
        }
    }
    $sql = "DELETE FROM " . $ecs->table("region") . "WHERE region_id" . db_create_in($delete_region);
    $db->query($sql);
    if ($exc->drop($id)) {
        admin_log(addslashes($region['region_name']), 'remove', 'area');
        /* 获取地区列表 */
        $region_arr = area_list($region['parent_id']);
        $smarty->assign('region_arr', $region_arr);
        $smarty->assign('region_type', $region['region_type']);
        make_json_result($smarty->fetch('area_list.htm'));
    } else {
        make_json_error($db->error());
    }
}
function new_region_id($region_id)
{
    $regions_id = array();
    if (empty($region_id)) {
        return $regions_id;
    }
    $sql = "SELECT region_id FROM " . $GLOBALS['ecs']->table("region") . "WHERE parent_id " . db_create_in($region_id);
    $result = $GLOBALS['db']->getAll($sql);
    foreach ($result as $val) {
        $regions_id[] = $val['region_id'];
    }
    return $regions_id;
}
开发者ID:jinjing1989,项目名称:wei,代码行数:31,代码来源:area_manage.php

示例4: foreach

    foreach ($arr as $key => $val) {
        $opt[] = array('value' => $val['goods_id'], 'text' => $val['goods_name'], 'data' => '');
    }
    make_json_result($opt);
} elseif ($_REQUEST['act'] == 'drop_link_goods') {
    include_once ROOT_PATH . 'includes/cls_json.php';
    $json = new JSON();
    check_authz_json('article_manage');
    $drop_goods = $json->decode($_GET['drop_ids']);
    $arguments = $json->decode($_GET['JSON']);
    $article_id = $arguments[0];
    if ($article_id == 0) {
        $article_id = $db->getOne('SELECT MAX(article_id)+1 AS article_id FROM ' . $ecs->table('article'));
    }
    $sql = "DELETE FROM " . $ecs->table('goods_article') . " WHERE article_id = '{$article_id}' AND goods_id " . db_create_in($drop_goods);
    $db->query($sql, 'SILENT') or make_json_error($db->error());
    /* 重新载入 */
    $arr = get_article_goods($article_id);
    $opt = array();
    foreach ($arr as $key => $val) {
        $opt[] = array('value' => $val['goods_id'], 'text' => $val['goods_name'], 'data' => '');
    }
    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']);
开发者ID:norain2050,项目名称:mhFault,代码行数:31,代码来源:article.php

示例5: intval

    /* 更新配置 */
    $_CFG['mail_service'] = intval($_POST['mail_service']);
    $_CFG['smtp_host']    = trim($_POST['smtp_host']);
    $_CFG['smtp_port']    = trim($_POST['smtp_port']);
    $_CFG['smtp_user']    = json_str_iconv(trim($_POST['smtp_user']));
    $_CFG['smtp_pass']    = trim($_POST['smtp_pass']);
    $_CFG['smtp_mail']    = trim($_POST['reply_email']);
    $_CFG['mail_charset'] = trim($_POST['mail_charset']);

    if (send_mail('', $email, $_LANG['test_mail_title'], $_LANG['cfg_name']['email_content'], 0))
    {
        make_json_result('', $_LANG['sendemail_success'] . $email);
    }
    else
    {
        make_json_error(join("\n", $err->_message));
    }
}

/*------------------------------------------------------ */
//-- 删除上传文件
/*------------------------------------------------------ */
elseif ($_REQUEST['act'] == 'del')
{
    /* 检查权限 */
    check_authz_json('shop_config');

    /* 取得参数 */
    $code          = trim($_GET['code']);

    $filename = $_CFG[$code];
开发者ID:apgmer,项目名称:WShop,代码行数:31,代码来源:shop_config.php

示例6: make_json_error

        }
    } else {
        if (!empty($_REQUEST['is_ajax'])) {
            make_json_error($_LANG['priv_error']);
        } else {
            ecs_header("Location: privilege.php?act=login\n");
        }
        exit;
    }
}
$smarty->assign('token', $_CFG['token']);
if ($_REQUEST['act'] != 'login' && $_REQUEST['act'] != 'signin' && $_REQUEST['act'] != 'forget_pwd' && $_REQUEST['act'] != 'reset_pwd' && $_REQUEST['act'] != 'check_order') {
    $admin_path = preg_replace('/:\\d+/', '', $ecs->url()) . ADMIN_PATH;
    if (!empty($_SERVER['HTTP_REFERER']) && strpos(preg_replace('/:\\d+/', '', $_SERVER['HTTP_REFERER']), $admin_path) === false) {
        if (!empty($_REQUEST['is_ajax'])) {
            make_json_error($_LANG['priv_error']);
        } else {
            ecs_header("Location: privilege.php?act=login\n");
        }
        exit;
    }
}
/* 管理员登录后可在任何页面使用 act=phpinfo 显示 phpinfo() 信息 */
if ($_REQUEST['act'] == 'phpinfo' && function_exists('phpinfo')) {
    phpinfo();
    exit;
}
//header('Cache-control: private');
header('content-type: text/html; charset=' . EC_CHARSET);
header('Expires: Fri, 14 Mar 1980 20:53:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
开发者ID:alphaouyang,项目名称:ecshop,代码行数:31,代码来源:init.php

示例7: empty

     $no = empty($_POST['val']) ? 'N/A' : json_str_iconv(trim($_POST['val']));
     $no = $no == 'N/A' ? '' : $no;
     $order_id = empty($_POST['id']) ? 0 : intval($_POST['id']);
     if ($order_id == 0) {
         make_json_error('NO ORDER ID');
         exit;
     }
     $sql = 'UPDATE ' . $GLOBALS['ecs']->table('order_info') . " SET pay_note='{$no}' WHERE order_id = '{$order_id}'";
     if ($GLOBALS['db']->query($sql)) {
         if (empty($no)) {
             make_json_result('N/A');
         } else {
             make_json_result(stripcslashes($no));
         }
     } else {
         make_json_error($GLOBALS['db']->errorMsg());
     }
 } elseif ($_REQUEST['act'] == 'get_goods_info') {
     /* 取得订单商品 */
     $order_id = isset($_REQUEST['order_id']) ? intval($_REQUEST['order_id']) : 0;
     if (empty($order_id)) {
         make_json_response('', 1, $_LANG['error_get_goods_info']);
     }
     $goods_list = array();
     $goods_attr = array();
     $sql = "SELECT o.*, g.goods_thumb, g.goods_number AS storage, o.goods_attr, IFNULL(b.brand_name, '') AS brand_name " . "FROM " . $ecs->table('order_goods') . " AS o " . "LEFT JOIN " . $ecs->table('goods') . " AS g ON o.goods_id = g.goods_id " . "LEFT JOIN " . $ecs->table('brand') . " AS b ON g.brand_id = b.brand_id " . "WHERE o.order_id = '{$order_id}' ";
     $res = $db->query($sql);
     while ($row = $db->fetchRow($res)) {
         /* 虚拟商品支持 */
         if ($row['is_real'] == 0) {
             /* 取得语言项 */
开发者ID:norain2050,项目名称:benhu,代码行数:31,代码来源:order.php

示例8: intval

    $val = intval($_POST['val']);
    $sql = "SELECT ext_info FROM " . $ecs->table('goods_activity') . " WHERE act_id = '{$id}' AND act_type = '" . GAT_GROUP_BUY . "'";
    $ext_info = unserialize($db->getOne($sql));
    $ext_info['restrict_amount'] = $val;
    $sql = "UPDATE " . $ecs->table('goods_activity') . " SET ext_info = '" . serialize($ext_info) . "'" . " WHERE act_id = '{$id}'";
    $db->query($sql);
    clear_cache_files();
    make_json_result($val);
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('group_by');
    $id = intval($_GET['id']);
    /* 取得团购活动信息 */
    $group_buy = group_buy_info($id);
    /* 如果团购活动已经有订单,不能删除 */
    if ($group_buy['valid_order'] > 0) {
        make_json_error($_LANG['error_exist_order']);
    }
    /* 删除团购活动 */
    $sql = "DELETE FROM " . $ecs->table('goods_activity') . " WHERE act_id = '{$id}' LIMIT 1";
    $db->query($sql);
    admin_log(addslashes($group_buy['goods_name']) . '[' . $id . ']', 'remove', 'group_buy');
    clear_cache_files();
    $url = 'group_buy.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
}
/*
 * 取得团购活动列表
 * @return   array
 */
function group_buy_list()
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:group_buy.php

示例9: check_authz_json

}
/*------------------------------------------------------ */
//-- 更新库项目内容
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'update_library') {
    check_authz_json('library_manage');
    $html = stripslashes(json_str_iconv($_POST['html']));
    $lib_file = '../themes/' . $_CFG['template'] . '/library/' . $_POST['lib'] . '.lbi';
    $lib_file = str_replace("0xa", '', $lib_file);
    // 过滤 0xa 非法字符
    $org_html = str_replace("", '', file_get_contents($lib_file));
    if (@file_exists($lib_file) === true && @file_put_contents($lib_file, $html)) {
        @file_put_contents('../temp/backup/library/' . $_CFG['template'] . '-' . $_POST['lib'] . '.lbi', $org_html);
        make_json_result('', $_LANG['update_lib_success']);
    } else {
        make_json_error(sprintf($_LANG['update_lib_failed'], 'themes/' . $_CFG['template'] . '/library'));
    }
}
/*------------------------------------------------------ */
//-- 还原库项目
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'restore_library') {
    admin_priv('backup_setting');
    $lib_name = trim($_GET['lib']);
    $lib_file = '../themes/' . $_CFG['template'] . '/library/' . $lib_name . '.lbi';
    $lib_file = str_replace("0xa", '', $lib_file);
    // 过滤 0xa 非法字符
    $lib_backup = '../temp/backup/library/' . $_CFG['template'] . '-' . $lib_name . '.lbi';
    $lib_backup = str_replace("0xa", '', $lib_backup);
    // 过滤 0xa 非法字符
    if (file_exists($lib_backup) && filemtime($lib_backup) >= filemtime($lib_file)) {
开发者ID:norain2050,项目名称:mhFault,代码行数:31,代码来源:template.php

示例10: get_packagelist

    $packages = get_packagelist();
    $smarty->assign('package_list', $packages['packages']);
    $smarty->assign('filter', $packages['filter']);
    $smarty->assign('record_count', $packages['record_count']);
    $smarty->assign('page_count', $packages['page_count']);
    $sort_flag = sort_flag($packages['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('package_list.htm'), '', array('filter' => $packages['filter'], 'page_count' => $packages['page_count']));
} elseif ($_REQUEST['act'] == 'edit_package_name') {
    check_authz_json('package_manage');
    $id = intval($_POST['id']);
    $val = json_str_iconv(trim($_POST['val']));
    /* 检查活动重名 */
    $sql = "SELECT COUNT(*) " . " FROM " . $hhs->table('goods_activity') . " WHERE act_type='" . GAT_PACKAGE . "' AND act_name='{$val}' AND act_id <> '{$id}'";
    if ($db->getOne($sql)) {
        make_json_error(sprintf($_LANG['package_exist'], $val));
    }
    $exc->edit("act_name='{$val}'", $id);
    make_json_result(stripslashes($val));
} elseif ($_REQUEST['act'] == 'search_goods') {
    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[$key] = array('value' => $val['goods_id'], 'text' => $val['goods_name'], 'data' => $val['shop_price']);
        $opt[$key]['products'] = get_good_products($val['goods_id']);
    }
    make_json_result($opt);
} elseif ($_REQUEST['act'] == 'add_package_goods') {
开发者ID:shiruolin,项目名称:hzzshop,代码行数:31,代码来源:package.php

示例11: get_snatchlist

    $snatchs = get_snatchlist();
    $smarty->assign('snatch_list', $snatchs['snatchs']);
    $smarty->assign('filter', $snatchs['filter']);
    $smarty->assign('record_count', $snatchs['record_count']);
    $smarty->assign('page_count', $snatchs['page_count']);
    $sort_flag = sort_flag($snatchs['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('snatch_list.htm'), '', array('filter' => $snatchs['filter'], 'page_count' => $snatchs['page_count']));
} elseif ($_REQUEST['act'] == 'edit_snatch_name') {
    check_authz_json('snatch_manage');
    $id = intval($_POST['id']);
    $val = json_str_iconv(trim($_POST['val']));
    /* 检查活动重名 */
    $sql = "SELECT COUNT(*) " . " FROM " . $ecs->table('goods_activity') . " WHERE act_type='" . GAT_SNATCH . "' AND act_name='{$val}' AND act_id <> '{$id}'";
    if ($db->getOne($sql)) {
        make_json_error(sprintf($_LANG['snatch_name_exist'], $val));
    }
    $exc->edit("act_name='{$val}'", $id);
    make_json_result(stripslashes($val));
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('attr_manage');
    $id = intval($_GET['id']);
    $exc->drop($id);
    $url = 'snatch.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
} elseif ($_REQUEST['act'] == 'edit') {
    /* 权限判断 */
    admin_priv('snatch_manage');
    $snatch = get_snatch_info($_REQUEST['id']);
    $snatch['option'] = '<option value="' . $snatch['goods_id'] . '">' . $snatch['goods_name'] . '</option>';
开发者ID:BGCX262,项目名称:zuyii-svn-to-git,代码行数:31,代码来源:snatch.php

示例12: ecs_header

    }
    ecs_header("Location: shophelp.php?act=list_cat\n");
    exit;
} elseif ($_REQUEST['act'] == 'edit_title') {
    check_authz_json('shophelp_manage');
    $id = intval($_POST['id']);
    $title = json_str_iconv(trim($_POST['val']));
    /* 检查文章标题是否有重名 */
    if ($exc_article->num('title', $title, $id) == 0) {
        if ($exc_article->edit("title = '{$title}'", $id)) {
            clear_cache_files();
            admin_log($title, 'edit', 'shophelp');
            make_json_result(stripslashes($title));
        }
    } else {
        make_json_error(sprintf($_LANG['articlename_exist'], $title));
    }
}
/* 获得网店帮助文章分类 */
function get_shophelp_list()
{
    $list = array();
    $sql = 'SELECT cat_id, cat_name, sort_order' . ' FROM ' . $GLOBALS['ecs']->table('article_cat') . ' WHERE cat_type = 0 ORDER BY sort_order';
    $res = $GLOBALS['db']->query($sql);
    while ($rows = $GLOBALS['db']->fetchRow($res)) {
        $sql = 'SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('article') . " WHERE cat_id = '{$rows['cat_id']}'";
        $rows['num'] = $GLOBALS['db']->getOne($sql);
        $list[] = $rows;
    }
    return $list;
}
开发者ID:muqidi,项目名称:PHP,代码行数:31,代码来源:shophelp.php

示例13: elseif

    exit;
} elseif ($_REQUEST['act'] == 'edit_name') {
    check_authz_json('supplier_rank');
    $id = intval($_REQUEST['id']);
    $val = empty($_REQUEST['val']) ? '' : json_str_iconv(trim($_REQUEST['val']));
    if ($exc->is_only('rank_name', $val, $id)) {
        if ($exc->edit("rank_name = '{$val}'", $id)) {
            /* 管理员日志 */
            clear_cache_files();
            make_json_result(stripcslashes($val));
        } else {
            make_json_error($db->error());
        }
    } else {
        make_json_error(sprintf($_LANG['rank_name_exists'], htmlspecialchars($val)));
    }
} elseif ($_REQUEST['act'] == 'edit_sort') {
    check_authz_json('supplier_rank');
    $rank_id = empty($_REQUEST['id']) ? 0 : intval($_REQUEST['id']);
    $val = empty($_REQUEST['val']) ? 0 : intval($_REQUEST['val']);
    if ($val < 0 || $val > 255) {
        make_json_error($_LANG['js_languages']['sort_order_invalid']);
    }
    if ($exc->edit("sort_order = '{$val}'", $rank_id)) {
        $rank_name = $exc->get_name($rank_id);
        clear_cache_files();
        make_json_result($val);
    } else {
        make_json_error($val);
    }
}
开发者ID:firsteam,项目名称:falcons,代码行数:31,代码来源:supplier_rank.php

示例14: elseif

} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('admin_drop');
    $id = intval($_GET['id']);
    /* 获得管理员用户名 */
    $admin_name = $db->getOne('SELECT user_name FROM ' . $ecs->table('admin_user') . " WHERE user_id='{$id}'");
    /* demo这个管理员不允许删除 */
    if ($admin_name == 'demo') {
        make_json_error($_LANG['edit_remove_cannot']);
    }
    /* ID为1的不允许删除 */
    if ($id == 1) {
        make_json_error($_LANG['remove_cannot']);
    }
    /* 管理员不能删除自己 */
    if ($id == $_SESSION['admin_id']) {
        make_json_error($_LANG['remove_self_cannot']);
    }
    if ($exc->drop($id)) {
        $sess->delete_spec_admin_session($id);
        // 删除session中该管理员的记录
        admin_log(addslashes($admin_name), 'remove', 'privilege');
        clear_cache_files();
    }
    $url = 'privilege.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
}
/* 获取管理员列表 */
function get_admin_userlist()
{
    $list = array();
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:privilege.php

示例15: elseif

    $smarty->display('wholesale_list.htm');
} elseif ($_REQUEST['act'] == 'query') {
    $list = wholesale_list();
    $smarty->assign('wholesale_list', $list['item']);
    $smarty->assign('filter', $list['filter']);
    $smarty->assign('record_count', $list['record_count']);
    $smarty->assign('page_count', $list['page_count']);
    $sort_flag = sort_flag($list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('wholesale_list.htm'), '', array('filter' => $list['filter'], 'page_count' => $list['page_count']));
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('whole_sale');
    $id = intval($_GET['id']);
    $wholesale = wholesale_info($id);
    if (empty($wholesale)) {
        make_json_error($_LANG['wholesale_not_exist']);
    }
    $name = $wholesale['goods_name'];
    /* 删除记录 */
    $sql = "DELETE FROM " . $ecs->table('wholesale') . " WHERE act_id = '{$id}' LIMIT 1";
    $db->query($sql);
    /* 记日志 */
    admin_log($name, 'remove', 'wholesale');
    /* 清除缓存 */
    clear_cache_files();
    $url = 'wholesale.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
} elseif ($_REQUEST['act'] == 'batch') {
    /* 取得要操作的记录编号 */
    if (empty($_POST['checkboxes'])) {
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:wholesale.php


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