• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP make_json_error函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: array

        $sql = "INSERT INTO " . $ecs->table('brand') . "(brand_name)" . "VALUES ( '{$brand}')";
        $db->query($sql);
        $brand_id = $db->insert_id();
        $arr = array("id" => $brand_id, "brand" => $brand);
        make_json_result($arr);
    }
} elseif ($_REQUEST['act'] == 'edit_sort_order') {
    check_authz_json('brand_manage');
    $id = intval($_POST['id']);
    $order = intval($_POST['val']);
    $name = $exc->get_name($id);
    if ($exc->edit("sort_order = '{$order}'", $id)) {
        admin_log(addslashes($name), 'edit', 'brand');
        make_json_result($order);
    } else {
        make_json_error(sprintf($_LANG['brandedit_fail'], $name));
    }
} elseif ($_REQUEST['act'] == 'toggle_show') {
    check_authz_json('brand_manage');
    $id = intval($_POST['id']);
    $val = intval($_POST['val']);
    $exc->edit("is_show='{$val}'", $id);
    make_json_result($val);
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('brand_manage');
    $id = intval($_GET['id']);
    /* 删除该品牌的图标 */
    $sql = "SELECT brand_logo FROM " . $ecs->table('brand') . " WHERE brand_id = '{$id}'";
    $logo_name = $db->getOne($sql);
    if (!empty($logo_name)) {
        @unlink(ROOT_PATH . DATA_DIR . '/brandlogo/' . $logo_name);
开发者ID:dw250100785,项目名称:ECShop-1,代码行数:31,代码来源:brand.php


示例17: admin_log

            //记录日志
            admin_log('', 'update', 'goods');
        }
        //记录日志
        admin_log('', 'trash', 'products');
        $url = 'goods.php?act=product_query&' . str_replace('act=product_remove', '', $_SERVER['QUERY_STRING']);
        ecs_header("Location: {$url}\n");
        exit;
    }
} elseif ($_REQUEST['act'] == 'edit_product_sn') {
    check_authz_json('goods_manage');
    $product_id = intval($_POST['id']);
    $product_sn = json_str_iconv(trim($_POST['val']));
    $product_sn = $_LANG['n_a'] == $product_sn ? '' : $product_sn;
    if (check_product_sn_exist($product_sn, $product_id)) {
        make_json_error($_LANG['sys']['wrong'] . $_LANG['exist_same_product_sn']);
    }
    /* 修改 */
    $sql = "UPDATE " . $ecs->table('products') . " SET product_sn = '{$product_sn}' WHERE product_id = '{$product_id}'";
    $result = $db->query($sql);
    if ($result) {
        clear_cache_files();
        make_json_result($product_sn);
    }
} elseif ($_REQUEST['act'] == 'edit_product_number') {
    check_authz_json('goods_manage');
    $product_id = intval($_POST['id']);
    $product_number = intval($_POST['val']);
    /* 货品库存 */
    $product = get_product_info($product_id, 'product_number, goods_id');
    /* 修改货品库存 */
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:goods.php


示例18: clear_cache_files

        clear_cache_files();
        $link[] = array('text' => $_LANG['back_list'], 'href' => 'attribute.php?act=list');
        sys_msg(sprintf($_LANG['drop_ok'], $count), 0, $link);
    } else {
        $link[] = array('text' => $_LANG['back_list'], 'href' => 'attribute.php?act=list');
        sys_msg($_LANG['no_select_arrt'], 0, $link);
    }
} elseif ($_REQUEST['act'] == 'edit_attr_name') {
    check_authz_json('attr_manage');
    $id = intval($_POST['id']);
    $val = json_str_iconv(trim($_POST['val']));
    /* 取得该属性所属商品类型id */
    $cat_id = $exc->get_name($id, 'cat_id');
    /* 检查属性名称是否重复 */
    if (!$exc->is_only('attr_name', $val, $id, " cat_id = '{$cat_id}'")) {
        make_json_error($_LANG['name_exist']);
    }
    $exc->edit("attr_name='{$val}'", $id);
    admin_log($val, 'edit', 'attribute');
    make_json_result(stripslashes($val));
} elseif ($_REQUEST['act'] == 'edit_sort_order') {
    check_authz_json('attr_manage');
    $id = intval($_POST['id']);
    $val = intval($_POST['val']);
    $exc->edit("sort_order='{$val}'", $id);
    admin_log(addslashes($exc->get_name($id)), 'edit', 'attribute');
    make_json_result(stripslashes($val));
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('attr_manage');
    $id = intval($_GET['id']);
    $db->query("DELETE FROM " . $ecs->table('attribute') . " WHERE attr_id='{$id}'");
开发者ID:norain2050,项目名称:mhFault,代码行数:31,代码来源:attribute.php


示例19: elseif

    }
} elseif ($_REQUEST['act'] == 'edit_order') {
    $id = intval($_REQUEST['id']);
    $val = isset($_REQUEST['val']) ? json_str_iconv(trim($_REQUEST['val'])) : '';
    check_authz_json('reg_fields');
    if (is_numeric($val)) {
        if ($exc->edit("dis_order = '{$val}'", $id)) {
            /* 管理员日志 */
            admin_log($val, 'edit', 'reg_fields');
            clear_cache_files();
            make_json_result(stripcslashes($val));
        } else {
            make_json_error($db->error());
        }
    } else {
        make_json_error($_LANG['order_not_num']);
    }
} elseif ($_REQUEST['act'] == 'toggle_dis') {
    check_authz_json('reg_fields');
    $id = intval($_POST['id']);
    $is_dis = intval($_POST['val']);
    if ($exc->edit("display = '{$is_dis}'", $id)) {
        clear_cache_files();
        make_json_result($is_dis);
    }
} elseif ($_REQUEST['act'] == 'toggle_need') {
    check_authz_json('reg_fields');
    $id = intval($_POST['id']);
    $is_need = intval($_POST['val']);
    if ($exc->edit("is_need = '{$is_need}'", $id)) {
        clear_cache_files();
开发者ID:BGCX262,项目名称:zuyii-svn-to-git,代码行数:31,代码来源:reg_fields.php


示例20: check_authz_json

    check_authz_json('users_manage');
    $id = empty($_REQUEST['id']) ? 0 : intval($_REQUEST['id']);
    $email = empty($_REQUEST['val']) ? '' : json_str_iconv(trim($_REQUEST['val']));
    $users =& init_users();
    $sql = "SELECT user_name FROM " . $ecs->table('users') . " WHERE user_id = '{$id}'";
    $username = $db->getOne($sql);
    if (is_email($email)) {
        if ($users->edit_user(array('username' => $username, 'email' => $email))) {
            admin_log(addslashes($username), 'edit', 'users');
            make_json_result(stripcslashes($email));
        } else {
            $msg = $users->error == ERR_EMAIL_EXISTS ? $GLOBALS['_LANG']['email_exists'] : $GLOBALS['_LANG']['edit_user_failed'];
            make_json_error($msg);
        }
    } else {
        make_json_error($GLOBALS['_LANG']['invalid_email']);
    }
} elseif ($_REQUEST['act'] == 'remove') {
    /* 检查权限 */
    admin_priv('users_drop');
    $sql = "SELECT user_name FROM " . $ecs->table('users') . " WHERE user_id = '" . $_GET['id'] . "'";
    $username = $db->getOne($sql);
    /* 通过插件来删除用户 */
    $users =& init_users();
    $users->remove_user($username);
    //已经删除用户所有数据
    /* 记录管理员操作 */
    admin_log(addslashes($username), 'remove', 'users');
    /* 提示信息 */
    $link[] = array('text' => $_LANG['go_back'], 'href' => 'users.php?act=list');
    sys_msg(sprintf($_LANG['remove_success'], $username), 0, $link);
开发者ID:moonlight-wang,项目名称:feilun,代码行数:31,代码来源:distributor.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP make_json_response函数代码示例发布时间:2022-05-15
下一篇:
PHP make_json函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap