本文整理汇总了PHP中exchange::edit方法的典型用法代码示例。如果您正苦于以下问题:PHP exchange::edit方法的具体用法?PHP exchange::edit怎么用?PHP exchange::edit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exchange
的用法示例。
在下文中一共展示了exchange::edit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: API_EditBrand
function API_EditBrand($post)
{
/* 加载后台主操作函数 */
require_once ROOT_PATH . ADMIN_PATH . '/includes/lib_main.php';
require_once ROOT_PATH . ADMIN_PATH . '/includes/cls_exchange.php';
require_once ROOT_PATH . 'includes/cls_image.php';
/* 检查权限 */
admin_privilege('brand_manage');
$is_show = isset($_POST['is_show']) ? 1 : 0;
$brand_id = !empty($_POST['brand_id']) ? intval($_POST['brand_id']) : 0;
/*检查品牌名是否重复*/
$exc = new exchange($GLOBALS['ecs']->table("brand"), $GLOBALS['db'], 'brand_id', 'brand_name');
$is_only = $exc->is_only('brand_name', $_POST['brand_name'], '', '');
if (!$is_only) {
client_show_message(301);
}
$param = "brand_name = '{$_POST['brand_name']}', site_url='{$_POST['site_url']}', brand_desc='{$_POST['brand_desc']}', is_show='{$is_show}', sort_order='{$_POST['sort_order']}' ";
/* 处理图片 */
$img_name = upload_image($_POST['brand_logo'], 'brandlogo');
if ($img_name !== false) {
$param .= " ,brand_logo = '" . basename($img_name) . "' ";
}
/* 更新数据 */
if ($exc->edit($param, $brand_id, '')) {
/* 清除缓存 */
clear_cache_files();
admin_log($_POST['brand_name'], 'edit', 'brand');
client_show_message(0, true);
} else {
client_show_message(302);
}
}
示例2: intval
if (empty($_POST['id'])) {
sys_msg('invalid param');
}
$id = intval($_POST['id']);
$auction = auction_info($id);
if (empty($auction)) {
sys_msg($_LANG['auction_not_exist']);
}
if ($auction['status_no'] != FINISHED) {
sys_msg($_LANG['invalid_status']);
}
if ($auction['deposit'] <= 0) {
sys_msg($_LANG['no_deposit']);
}
/* 处理保证金 */
$exc->edit("is_finished = 2", $id);
// 修改状态
if (isset($_POST['unfreeze'])) {
/* 解冻 */
log_account_change($auction['last_bid']['bid_user'], $auction['deposit'], -1 * $auction['deposit'], 0, 0, sprintf($_LANG['unfreeze_auction_deposit'], $auction['act_name']));
} else {
/* 扣除 */
log_account_change($auction['last_bid']['bid_user'], 0, -1 * $auction['deposit'], 0, 0, sprintf($_LANG['deduct_auction_deposit'], $auction['act_name']));
}
/* 记日志 */
admin_log($auction['act_name'], 'edit', 'auction');
/* 清除缓存 */
clear_cache_files();
/* 提示信息 */
sys_msg($_LANG['settle_deposit_ok']);
} elseif ($_REQUEST['act'] == 'search_goods') {
示例3: sprintf
if ($file_url == '') {
$file_url = $_POST['file_url'];
}
/* 计算文章打开方式 */
if ($file_url == '') {
$open_type = 0;
} else {
$open_type = $_POST['FCKeditor1'] == '' ? 1 : 2;
}
/* 如果 file_url 跟以前不一样,且原来的文件是本地文件,删除原来的文件 */
$sql = "SELECT file_url FROM " . $ecs->table('article') . " WHERE article_id = '{$_POST['id']}'";
$old_url = $db->getOne($sql);
if ($old_url != '' && $old_url != $file_url && strpos($old_url, 'http://') === false && strpos($old_url, 'https://') === false) {
@unlink(ROOT_PATH . $old_url);
}
if ($exc->edit("title='{$_POST['title']}', cat_id='{$_POST['article_cat']}', article_type='{$_POST['article_type']}', is_open='{$_POST['is_open']}', author='{$_POST['author']}', author_email='{$_POST['author_email']}', keywords ='{$_POST['keywords']}', file_url ='{$file_url}', open_type='{$open_type}', content='{$_POST['FCKeditor1']}', link='{$_POST['link_url']}', description = '{$_POST['description']}'", $_POST['id'])) {
$link[0]['text'] = $_LANG['back_list'];
$link[0]['href'] = 'article.php?act=list&' . list_link_postfix();
$note = sprintf($_LANG['articleedit_succeed'], stripslashes($_POST['title']));
admin_log($_POST['title'], 'edit', 'article');
clear_cache_files();
sys_msg($note, 0, $link);
} else {
die($db->error());
}
} elseif ($_REQUEST['act'] == 'edit_title') {
check_authz_json('article_manage');
$id = intval($_POST['id']);
$title = json_str_iconv(trim($_POST['val']));
/* 检查文章标题是否重复 */
if ($exc->num("title", $title, $id) != 0) {
示例4: array
/*判断代理商或管理员*/
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 = intval($_REQUEST['id']);
check_authz_json('stock_out_type');
// 检查权限
$exc->edit("if_delete = 0, add_time = '" . gmtime() . "'", $id);
clear_cache_files();
//$goods_name = $exc->get_name($goods_id);
//admin_log(addslashes($goods_name), 'restore', 'goods'); // 记录日志
示例5: array
$smarty->assign('ur_here', $_LANG['add_js_code']);
$smarty->assign('action_link', array('href' => 'ads.php?act=list', 'text' => $_LANG['ad_list']));
$smarty->assign('url', $site_url);
$smarty->assign('js_code', $js_code);
$smarty->assign('lang_list', $lang_list);
assign_query_info();
$smarty->display('ads_js.htm');
} elseif ($_REQUEST['act'] == 'edit_ad_name') {
check_authz_json('ad_manage');
$id = intval($_POST['id']);
$ad_name = json_str_iconv(trim($_POST['val']));
/* 检查广告名称是否重复 */
if ($exc->num('ad_name', $ad_name, $id) != 0) {
make_json_error(sprintf($_LANG['ad_name_exist'], $ad_name));
} else {
if ($exc->edit("ad_name = '{$ad_name}'", $id)) {
admin_log($ad_name, 'edit', 'ads');
make_json_result(stripslashes($ad_name));
} else {
make_json_error($db->error());
}
}
} elseif ($_REQUEST['act'] == 'remove') {
check_authz_json('ad_manage');
$id = intval($_GET['id']);
$img = $exc->get_name($id, 'ad_code');
$exc->drop($id);
if (strpos($img, 'http://') === false && strpos($img, 'https://') === false) {
$img_name = basename($img);
@unlink(ROOT_PATH . DATA_DIR . '/afficheimg/' . $img_name);
}
示例6: elseif
} elseif ($_REQUEST['act'] == 'query') {
$position_list = ad_position_list();
$smarty->assign('position_list', $position_list['position']);
$smarty->assign('filter', $position_list['filter']);
$smarty->assign('record_count', $position_list['record_count']);
$smarty->assign('page_count', $position_list['page_count']);
make_json_result($smarty->fetch('ad_position_list.htm'), '', array('filter' => $position_list['filter'], 'page_count' => $position_list['page_count']));
} elseif ($_REQUEST['act'] == 'edit_position_name') {
check_authz_json('ad_manage');
$id = intval($_POST['id']);
$position_name = json_str_iconv(trim($_POST['val']));
/* 检查名称是否重复 */
if ($exc->num("position_name", $position_name, $id) != 0) {
make_json_error(sprintf($_LANG['posit_name_exist'], $position_name));
} else {
if ($exc->edit("position_name = '{$position_name}'", $id)) {
admin_log($position_name, 'edit', 'ads_position');
make_json_result(stripslashes($position_name));
} else {
make_json_result(sprintf($_LANG['brandedit_fail'], $position_name));
}
}
} elseif ($_REQUEST['act'] == 'edit_ad_width') {
check_authz_json('ad_manage');
$id = intval($_POST['id']);
$ad_width = json_str_iconv(trim($_POST['val']));
/* 宽度值必须是数字 */
if (!preg_match("/^[\\.0-9]+\$/", $ad_width)) {
make_json_error($_LANG['width_number']);
}
/* 广告位宽度应在1-1024之间 */
示例7: elseif
}
}
$smarty->assign('img_url', $img_url);
$smarty->display('goods_show_image.htm');
} elseif ($_REQUEST['act'] == 'edit_goods_name') {
check_authz_json('goods_manage');
$goods_id = intval($_POST['id']);
$goods_name = json_str_iconv(trim($_POST['val']));
/*add by hg for date 2014-04-25 多个商品命名同步*/
if (!if_agency()) {
$goods_id = 0;
} else {
$host_arr = host($goods_id);
if ($host_arr) {
foreach ($host_arr as $v => $k) {
$exc->edit("goods_name = '{$goods_name}', last_update=" . gmtime(), $k['goods_id']);
}
}
}
/*end*/
if ($exc->edit("goods_name = '{$goods_name}', last_update=" . gmtime(), $goods_id)) {
clear_cache_files();
make_json_result(stripslashes($goods_name));
}
} elseif ($_REQUEST['act'] == 'edit_goods_sn') {
check_authz_json('goods_manage');
$goods_id = intval($_POST['id']);
$goods_sn = json_str_iconv(trim($_POST['val']));
/* 检查是否重复 */
if (!$exc->is_only('goods_sn', $goods_sn, $goods_id)) {
make_json_error($_LANG['goods_sn_exists']);
示例8: basename
}
$param = "pack_name = '{$_POST['pack_name']}', pack_fee = '{$_POST['pack_fee']}', free_money= '{$_POST['free_money']}', pack_desc = '{$_POST['pack_desc']}' ";
/* 处理图片 */
if (!empty($_FILES['pack_img']['name'])) {
$upload_img = $image->upload_image($_FILES['pack_img'], "packimg", $_POST['old_packimg']);
if ($upload_img == false) {
sys_msg($image->error_msg);
}
$img_name = basename($upload_img);
} else {
$img_name = '';
}
if (!empty($img_name)) {
$param .= " ,pack_img = '{$img_name}' ";
}
if ($exc->edit($param, $_POST['id'])) {
$link[0]['text'] = $_LANG['back_list'];
$link[0]['href'] = 'pack.php?act=list&' . list_link_postfix();
$note = sprintf($_LANG['packedit_succed'], $_POST['pack_name']);
sys_msg($note, 0, $link);
admin_log($_POST['pack_name'], 'edit', 'pack');
} else {
die($db->error());
}
}
/* 删除卡片图片 */
if ($_REQUEST['act'] == 'drop_pack_img') {
/* 权限判断 */
admin_priv('pack');
$pack_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
/* 取得logo名称 */
示例9: array
$sort_flag = sort_flag($list['filter']);
$smarty->assign($sort_flag['tag'], $sort_flag['img']);
make_json_result($smarty->fetch('bonus_type.htm'), '', array('filter' => $list['filter'], 'page_count' => $list['page_count']));
}
/*------------------------------------------------------ */
//-- 编辑红包类型名称
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'edit_type_name') {
check_authz_json('bonus_manage');
$id = intval($_POST['id']);
$val = json_str_iconv(trim($_POST['val']));
/* 检查红包类型名称是否重复 */
if (!$exc->is_only('type_name', $id, $val)) {
make_json_error($_LANG['type_name_exist']);
} else {
$exc->edit("type_name='{$val}'", $id);
make_json_result(stripslashes($val));
}
}
/*------------------------------------------------------ */
//-- 编辑红包金额
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'edit_type_money') {
check_authz_json('bonus_manage');
$id = intval($_POST['id']);
$val = floatval($_POST['val']);
/* 检查红包类型名称是否重复 */
if ($val <= 0) {
make_json_error($_LANG['type_money_error']);
} else {
$exc->edit("type_money='{$val}'", $id);
示例10: elseif
$smarty->display('goods_type.htm');
} elseif ($_REQUEST['act'] == 'query') {
$good_type_list = get_goodstype();
$smarty->assign('goods_type_arr', $good_type_list['type']);
$smarty->assign('filter', $good_type_list['filter']);
$smarty->assign('record_count', $good_type_list['record_count']);
$smarty->assign('page_count', $good_type_list['page_count']);
make_json_result($smarty->fetch('goods_type.htm'), '', array('filter' => $good_type_list['filter'], 'page_count' => $good_type_list['page_count']));
} elseif ($_REQUEST['act'] == 'edit_type_name') {
check_authz_json('goods_type');
$type_id = !empty($_POST['id']) ? intval($_POST['id']) : 0;
$type_name = !empty($_POST['val']) ? json_str_iconv(trim($_POST['val'])) : '';
/* 检查名称是否重复 */
$is_only = $exc->is_only('cat_name', $type_name, $type_id);
if ($is_only) {
$exc->edit("cat_name='{$type_name}'", $type_id);
admin_log($type_name, 'edit', 'goods_type');
make_json_result(stripslashes($type_name));
} else {
make_json_error($_LANG['repeat_type_name']);
}
} elseif ($_REQUEST['act'] == 'toggle_enabled') {
check_authz_json('goods_type');
$id = intval($_POST['id']);
$val = intval($_POST['val']);
$exc->edit("enabled='{$val}'", $id);
make_json_result($val);
} elseif ($_REQUEST['act'] == 'add') {
admin_priv('goods_type');
$smarty->assign('ur_here', $_LANG['new_goods_type']);
$smarty->assign('action_link', array('href' => 'goods_type.php?act=manage', 'text' => $_LANG['goods_type_list']));
示例11: array
$smarty->assign('filter', $agency_list['filter']);
$smarty->assign('record_count', $agency_list['record_count']);
$smarty->assign('page_count', $agency_list['page_count']);
/* 排序标记 */
$sort_flag = sort_flag($agency_list['filter']);
$smarty->assign($sort_flag['tag'], $sort_flag['img']);
make_json_result($smarty->fetch('agency_list.htm'), '', array('filter' => $agency_list['filter'], 'page_count' => $agency_list['page_count']));
} elseif ($_REQUEST['act'] == 'edit_agency_name') {
check_authz_json('agency_manage');
$id = intval($_POST['id']);
$name = json_str_iconv(trim($_POST['val']));
/* 检查名称是否重复 */
if ($exc->num("agency_name", $name, $id) != 0) {
make_json_error(sprintf($_LANG['agency_name_exist'], $name));
} else {
if ($exc->edit("agency_name = '{$name}'", $id)) {
admin_log($name, 'edit', 'agency');
clear_cache_files();
make_json_result(stripslashes($name));
} else {
make_json_result(sprintf($_LANG['agency_edit_fail'], $name));
}
}
} elseif ($_REQUEST['act'] == 'remove') {
check_authz_json('agency_manage');
$id = intval($_GET['id']);
$name = $exc->get_name($id);
$exc->drop($id);
/* 更新管理员、配送地区、发货单、退货单和订单关联的办事处 */
$table_array = array('admin_user', 'region', 'order_info', 'delivery_order', 'back_order');
foreach ($table_array as $value) {
示例12: elseif
} elseif ($_REQUEST['act'] == 'edit_name') {
/* 检查权限 */
check_authz_json('ship_manage');
/* 取得参数 */
$id = json_str_iconv(trim($_POST['id']));
$val = json_str_iconv(trim($_POST['val']));
/* 检查名称是否为空 */
if (empty($val)) {
make_json_error($_LANG['no_shipping_name']);
}
/* 检查名称是否重复 */
if (!$exc->is_only('shipping_name', $val, $id)) {
make_json_error($_LANG['repeat_shipping_name']);
}
/* 更新支付方式名称 */
$exc->edit("shipping_name = '{$val}'", $id);
make_json_result(stripcslashes($val));
} elseif ($_REQUEST['act'] == 'edit_desc') {
/* 检查权限 */
check_authz_json('ship_manage');
/* 取得参数 */
$id = json_str_iconv(trim($_POST['id']));
$val = json_str_iconv(trim($_POST['val']));
/* 更新描述 */
$exc->edit("shipping_desc = '{$val}'", $id);
make_json_result(stripcslashes($val));
} elseif ($_REQUEST['act'] == 'edit_insure') {
/* 检查权限 */
check_authz_json('ship_manage');
/* 取得参数 */
$id = json_str_iconv(trim($_POST['id']));
示例13: max
}
if ($cat_type == 1 || $cat_type == 5) {
if ($_POST['parent_id'] > 0) {
$sql = "SELECT cat_type FROM " . $ecs->table('article_cat') . " WHERE cat_id = '{$_POST['parent_id']}'";
$p_cat_type = $db->getOne($sql);
if ($p_cat_type == 4) {
$cat_type = 5;
} else {
$cat_type = 1;
}
} else {
$cat_type = 1;
}
}
$dat = $db->getOne("SELECT cat_name, show_in_nav FROM " . $ecs->table('article_cat') . " WHERE cat_id = '" . $_POST['id'] . "'");
if ($exc->edit("cat_name = '{$_POST['cat_name']}', cat_desc ='{$_POST['cat_desc']}', keywords='{$_POST['keywords']}',parent_id = '{$_POST['parent_id']}', cat_type='{$cat_type}', sort_order='{$_POST['sort_order']}', show_in_nav = '{$_POST['show_in_nav']}'", $_POST['id'])) {
if ($_POST['cat_name'] != $dat['cat_name']) {
//如果分类名称发生了改变
$sql = "UPDATE " . $ecs->table('nav') . " SET name = '" . $_POST['cat_name'] . "' WHERE ctype = 'a' AND cid = '" . $_POST['id'] . "' AND type = 'middle'";
$db->query($sql);
}
if ($_POST['show_in_nav'] != $dat['show_in_nav']) {
if ($_POST['show_in_nav'] == 1) {
//显示
$nid = $db->getOne("SELECT id FROM " . $ecs->table('nav') . " WHERE ctype = 'a' AND cid = '" . $_POST['id'] . "' AND type = 'middle'");
if (empty($nid)) {
$vieworder = $db->getOne("SELECT max(vieworder) FROM " . $ecs->table('nav') . " WHERE type = 'middle'");
$vieworder += 2;
$uri = build_uri('article_cat', array('acid' => $_POST['id']), $_POST['cat_name']);
//不存在
$sql = "INSERT INTO " . $ecs->table('nav') . " (name,ctype,cid,ifshow,vieworder,opennew,url,type) " . "VALUES('" . $_POST['cat_name'] . "', 'a', '" . $_POST['id'] . "','1','{$vieworder}','0', '" . $uri . "','middle')";
示例14: sprintf
}
if ($cat_type == 1 || $cat_type == 5) {
if ($_POST['parent_id'] > 0) {
$sql = "SELECT cat_type FROM " . $ecs->table('weixin_menu') . " WHERE cat_id = '{$_POST['parent_id']}'";
$p_cat_type = $db->getOne($sql);
if ($p_cat_type == 4) {
$cat_type = 5;
} else {
$cat_type = 1;
}
} else {
$cat_type = 1;
}
}
$dat = $db->getOne("SELECT cat_name, weixin_type FROM " . $ecs->table('weixin_menu') . " WHERE cat_id = '" . $_POST['id'] . "'");
if ($exc->edit("cat_name = '{$_POST['cat_name']}', weixin_key ='{$_POST['weixin_key']}', links ='{$_POST['links']}', parent_id = '{$_POST['parent_id']}', cat_type='{$cat_type}', sort_order='{$_POST['sort_order']}', weixin_type = '{$_POST['weixin_type']}'", $_POST['id'])) {
if ($_POST['cat_name'] != $dat['cat_name']) {
//如果菜单名称发生了改变
$sql = "UPDATE " . $ecs->table('nav') . " SET name = '" . $_POST['cat_name'] . "' WHERE ctype = 'a' AND cid = '" . $_POST['id'] . "' AND type = 'middle'";
$db->query($sql);
}
$link[0]['text'] = '返回菜单列表';
$link[0]['href'] = 'weixin_menu.php?act=list';
$note = sprintf('菜单 %s 编辑成功', $_POST['cat_name']);
admin_log($_POST['cat_name'], 'edit', 'articlecat');
clear_cache_files();
sys_msg($note, 0, $link);
} else {
die($db->error());
}
} elseif ($_REQUEST['act'] == 'edit_sort_order') {
示例15: array
$smarty->assign('ur_here', $_LANG['exchange_goods_add']);
$smarty->assign('action_link', array('text' => $_LANG['15_exchange_goods_list'], 'href' => 'exchange_goods.php?act=list&' . list_link_postfix()));
$smarty->assign('form_action', 'update');
assign_query_info();
$smarty->display('exchange_goods_info.htm');
}
/*------------------------------------------------------ */
//-- 编辑
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'update') {
/* 权限判断 */
admin_priv('exchange_goods');
if (empty($_POST['goods_id'])) {
$_POST['goods_id'] = 0;
}
if ($exc->edit("exchange_integral='{$_POST['exchange_integral']}', is_exchange='{$_POST['is_exchange']}', is_hot='{$_POST['is_hot']}' ", $_POST['goods_id'])) {
$link[0]['text'] = $_LANG['back_list'];
$link[0]['href'] = 'exchange_goods.php?act=list&' . list_link_postfix();
admin_log($_POST['goods_id'], 'edit', 'exchange_goods');
clear_cache_files();
sys_msg($_LANG['articleedit_succeed'], 0, $link);
} else {
die($db->error());
}
} elseif ($_REQUEST['act'] == 'edit_exchange_integral') {
check_authz_json('exchange_goods');
$id = intval($_POST['id']);
$exchange_integral = floatval($_POST['val']);
/* 检查文章标题是否重复 */
if ($exchange_integral < 0 || $exchange_integral == 0 && $_POST['val'] != "{$goods_price}") {
make_json_error($_LANG['exchange_integral_invalid']);