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


PHP exchange::drop方法代码示例

本文整理汇总了PHP中exchange::drop方法的典型用法代码示例。如果您正苦于以下问题:PHP exchange::drop方法的具体用法?PHP exchange::drop怎么用?PHP exchange::drop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在exchange的用法示例。


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

示例1: new_region_id

    $region_type = $region['region_type'];
    $delete_region[] = $id;
    $new_region_id = $id;
    if ($region_type < 6) {
        for ($i = 1; $i < 6 - $region_type; $i++) {
            $new_region_id = new_region_id($new_region_id);
            if (count($new_region_id)) {
                $delete_region = array_merge($delete_region, $new_region_id);
            } 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;
开发者ID:jinjing1989,项目名称:wei,代码行数:31,代码来源:area_manage.php

示例2: elseif

} elseif ($_REQUEST['act'] == 'query') {
    $msg_list = msg_list();
    $smarty->assign('msg_list', $msg_list['msg_list']);
    $smarty->assign('filter', $msg_list['filter']);
    $smarty->assign('record_count', $msg_list['record_count']);
    $smarty->assign('page_count', $msg_list['page_count']);
    $sort_flag = sort_flag($msg_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('msg_list.htm'), '', array('filter' => $msg_list['filter'], 'page_count' => $msg_list['page_count']));
} elseif ($_REQUEST['act'] == 'remove') {
    $msg_id = intval($_REQUEST['id']);
    /* 检查权限 */
    check_authz_json('feedback_priv');
    $msg_title = $exc->get_name($msg_id);
    $img = $exc->get_name($msg_id, 'message_img');
    if ($exc->drop($msg_id)) {
        /* 删除图片 */
        if (!empty($img)) {
            @unlink(ROOT_PATH . DATA_DIR . '/feedbackimg/' . $img);
        }
        $sql = "DELETE FROM " . $ecs->table('feedback') . " WHERE parent_id = '{$msg_id}' LIMIT 1";
        $db->query($sql, 'SILENT');
        admin_log(addslashes($msg_title), 'remove', 'message');
        $url = 'user_msg.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
        ecs_header("Location: {$url}\n");
        exit;
    } else {
        make_json_error($GLOBALS['db']->error());
    }
}
/*------------------------------------------------------ */
开发者ID:YangZeSummer,项目名称:NanJingSecond-Hand,代码行数:31,代码来源:user_msg.php

示例3: elseif

            clear_cache_files();
            make_json_result(stripslashes($link_name));
        } else {
            make_json_error($db->error());
        }
    }
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('friendlink');
    $id = intval($_GET['id']);
    /* 获取链子LOGO,并删除 */
    $link_logo = $exc->get_name($id, "link_logo");
    if (strpos($link_logo, 'http://') === false && strpos($link_logo, 'https://') === false) {
        $img_name = basename($link_logo);
        @unlink(ROOT_PATH . DATA_DIR . '/afficheimg/' . $img_name);
    }
    $exc->drop($id);
    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();
开发者ID:muqidi,项目名称:PHP,代码行数:31,代码来源:friend_link.php

示例4: intval

        if (!$exc->is_only('max_points', intval($_POST['max_points']))) {
            sys_msg(sprintf($_LANG['integral_max_exists'], intval($_POST['max_points'])));
        }
    }
    $sql = "INSERT INTO " . $ecs->table('user_rank') . "( " . "rank_name, min_points, max_points, discount, special_rank, show_price" . ") VALUES (" . "'{$_POST['rank_name']}', '" . intval($_POST['min_points']) . "', '" . intval($_POST['max_points']) . "', " . "'{$_POST['discount']}', '{$special_rank}', '" . intval($_POST['show_price']) . "')";
    $db->query($sql);
    /* 管理员日志 */
    admin_log(trim($_POST['rank_name']), 'add', 'user_rank');
    clear_cache_files();
    $lnk[] = array('text' => $_LANG['back_list'], 'href' => 'user_rank.php?act=list');
    $lnk[] = array('text' => $_LANG['add_continue'], 'href' => 'user_rank.php?act=add');
    sys_msg($_LANG['add_rank_success'], 0, $lnk);
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('user_rank');
    $rank_id = intval($_GET['id']);
    if ($exc->drop($rank_id)) {
        /* 更新会员表的等级字段 */
        $exc_user->edit("user_rank = 0", $rank_id);
        $rank_name = $exc->get_name($rank_id);
        admin_log(addslashes($rank_name), 'remove', 'user_rank');
        clear_cache_files();
    }
    $url = 'user_rank.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
} elseif ($_REQUEST['act'] == 'edit_name') {
    $id = intval($_REQUEST['id']);
    $val = empty($_REQUEST['val']) ? '' : json_str_iconv(trim($_REQUEST['val']));
    check_authz_json('user_rank');
    if ($exc->is_only('rank_name', $val, $id)) {
        if ($exc->edit("rank_name = '{$val}'", $id)) {
开发者ID:dw250100785,项目名称:ECShop-1,代码行数:31,代码来源:user_rank.php

示例5: trim

    /* 检查是否存在重名的会员注册项 */
    if ($_POST['reg_field_name'] != $_POST['old_field_name'] && !$exc->is_only('reg_field_name', trim($_POST['reg_field_name']))) {
        sys_msg(sprintf($_LANG['field_name_exist'], trim($_POST['reg_field_name'])), 1);
    }
    $sql = "UPDATE " . $ecs->table('reg_fields') . " SET `reg_field_name` = '{$_POST['reg_field_name']}', `dis_order` = '{$_POST['reg_field_order']}', `display` = '{$_POST['reg_field_display']}', `is_need` = '{$_POST['reg_field_need']}' WHERE `id` = '{$_POST['id']}'";
    $db->query($sql);
    /* 管理员日志 */
    admin_log(trim($_POST['reg_field_name']), 'edit', 'reg_fields');
    clear_cache_files();
    $lnk[] = array('text' => $_LANG['back_list'], 'href' => 'reg_fields.php?act=list');
    sys_msg($_LANG['update_field_success'], 0, $lnk);
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('reg_fields');
    $field_id = intval($_GET['id']);
    $field_name = $exc->get_name($field_id);
    if ($exc->drop($field_id)) {
        /* 删除会员扩展信息表的相应信息 */
        $sql = "DELETE FROM " . $GLOBALS['ecs']->table('reg_extend_info') . " WHERE reg_field_id = '" . $field_id . "'";
        @$GLOBALS['db']->query($sql);
        admin_log(addslashes($field_name), 'remove', 'reg_fields');
        clear_cache_files();
    }
    $url = 'reg_fields.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
} elseif ($_REQUEST['act'] == 'edit_name') {
    $id = intval($_REQUEST['id']);
    $val = empty($_REQUEST['val']) ? '' : json_str_iconv(trim($_REQUEST['val']));
    check_authz_json('reg_fields');
    if ($exc->is_only('reg_field_name', $val, $id)) {
        if ($exc->edit("reg_field_name = '{$val}'", $id)) {
开发者ID:BGCX262,项目名称:zuyii-svn-to-git,代码行数:31,代码来源:reg_fields.php

示例6: sprintf

    if (!preg_match("/^[0-9]+\$/", $order)) {
        make_json_result('', sprintf($_LANG['enter_int'], $order));
    } else {
        if ($exc_cat->edit("sort_order = '{$order}'", $id)) {
            clear_cache_files();
            make_json_result(stripslashes($order));
        }
    }
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('shophelp_manage');
    $id = intval($_GET['id']);
    /* 非空的分类不允许删除 */
    if ($exc_article->num('cat_id', $id) != 0) {
        make_json_error(sprintf($_LANG['not_emptycat']));
    } else {
        $exc_cat->drop($id);
        clear_cache_files();
        admin_log('', 'remove', 'shophelpcat');
    }
    $url = 'shophelp.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
} elseif ($_REQUEST['act'] == 'remove_art') {
    check_authz_json('shophelp_manage');
    $id = intval($_GET['id']);
    $cat_id = $db->getOne('SELECT cat_id FROM ' . $ecs->table('article') . " WHERE article_id='{$id}'");
    if ($exc_article->drop($id)) {
        /* 清除缓存 */
        clear_cache_files();
        admin_log('', 'remove', 'shophelp');
    } else {
开发者ID:muqidi,项目名称:PHP,代码行数:31,代码来源:shophelp.php

示例7: while

 }
 /* 删除商品图片和轮播图片 */
 /*add by hg for date 2014-04-21 只有管理员添加的商品才能删除图片*/
 if ($goods['admin_agency_id'] == '0') {
     if (!empty($goods['goods_thumb'])) {
         @unlink('../' . $goods['goods_thumb']);
     }
     if (!empty($goods['goods_img'])) {
         @unlink('../' . $goods['goods_img']);
     }
     if (!empty($goods['original_img'])) {
         @unlink('../' . $goods['original_img']);
     }
 }
 /* 删除商品 */
 $exc->drop($goods_id);
 /* 删除商品的货品记录 */
 $sql = "DELETE FROM " . $ecs->table('products') . " WHERE goods_id = '{$goods_id}'";
 $db->query($sql);
 /* 记录日志 */
 admin_log(addslashes($goods['goods_name']), 'remove', 'goods');
 /* 删除商品相册 */
 $sql = "SELECT img_url, thumb_url, img_original " . "FROM " . $ecs->table('goods_gallery') . " WHERE goods_id = '{$goods_id}'";
 $res = $db->query($sql);
 /*add by hg for date 2014-04-21 只有管理员添加的商品才能删除图片*/
 if ($goods['admin_agency_id'] == '0') {
     while ($row = $db->fetchRow($res)) {
         if (!empty($row['img_url'])) {
             @unlink('../' . $row['img_url']);
         }
         if (!empty($row['thumb_url'])) {
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:goods.php

示例8: elseif

} elseif ($_REQUEST['act'] == 'query') {
    $cards_list = cards_list();
    $smarty->assign('card_list', $cards_list['card_list']);
    $smarty->assign('filter', $cards_list['filter']);
    $smarty->assign('record_count', $cards_list['record_count']);
    $smarty->assign('page_count', $cards_list['page_count']);
    $sort_flag = sort_flag($cards_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    make_json_result($smarty->fetch('card_list.htm'), '', array('filter' => $cards_list['filter'], 'page_count' => $cards_list['page_count']));
} elseif ($_REQUEST['act'] == 'remove') {
    /* 检查权限 */
    check_authz_json('card_manage');
    $card_id = empty($_REQUEST['id']) ? 0 : intval($_REQUEST['id']);
    $name = $exc->get_name($card_id);
    $img = $exc->get_name($card_id, 'card_img');
    if ($exc->drop($card_id)) {
        /* 删除图片 */
        if (!empty($img)) {
            @unlink('../' . DATA_DIR . '/cardimg/' . $img);
        }
        admin_log(addslashes($name), 'remove', 'card');
        $url = 'card.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
        ecs_header("Location: {$url}\n");
        exit;
    } else {
        make_json_error($db->error());
    }
} elseif ($_REQUEST['act'] == 'add') {
    /* 权限判断 */
    admin_priv('card_manage');
    /*初始化显示*/
开发者ID:duynhan07,项目名称:ecshop-vietnam,代码行数:31,代码来源:card.php

示例9: empty

     $data['office_phone'] = empty($_REQUEST['office_phone']) ? '' : trim($_REQUEST['office_phone']);
     $data['office_mobile'] = empty($_REQUEST['office_mobile']) ? '' : trim($_REQUEST['office_mobile']);
     $data['dept_id'] = empty($_REQUEST['dept']) ? '' : trim($_REQUEST['dept']);
     $data['level'] = empty($_REQUEST['posts']) ? '' : trim($_REQUEST['posts']);
     $data['remark'] = empty($_REQUEST['remark']) ? '' : trim($_REQUEST['remark']);
     $city_code = intval($_REQUEST['city']);
     $re = $db_write->autoExecute('hr_employees', $data, 'UPDATE', "id='" . $data['id'] . "'");
     $links[0]['text'] = '返回员工管理';
     $links[0]['href'] = 'employee.php?act=list';
     if ($re) {
         sys_msg('员工编辑成功!', 0, $links);
     }
     break;
 case 'remove':
     $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : '0';
     $excg->drop($id);
     $url = "employee.php?act=query&" . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
     los_header("Location: {$url}\n");
     exit;
     break;
 default:
     $sql = "SELECT station_id,station_name FROM ship_station  where station_id = '" . trim($_SESSION['station']) . "'";
     $stations = $db_read->getAll($sql);
     if ($stations) {
         $smarty->assign('Current', 'Current');
         $smarty->assign('stations', $stations);
         $_REQUEST['stations'] = $stations[0]['station_id'];
     } else {
         $stations = $db_read->getAll("SELECT station_id,station_name FROM ship_station where city_code {$city_code} ");
         $smarty->assign('stations', $stations);
     }
开发者ID:songtaiwu,项目名称:mordercms,代码行数:31,代码来源:employee.php

示例10: API_DeleteBrand

/**
 * 删除品牌
 *
 * @param array $post POST数据
 */
function API_DeleteBrand($post)
{
    require_once ROOT_PATH . ADMIN_PATH . '/includes/cls_exchange.php';
    admin_privilege('brand_manage');
    $brand_id = intval($_POST['Id']);
    $exc = new exchange($GLOBALS['ecs']->table("brand"), $GLOBALS['db'], 'brand_id', 'brand_name');
    $brand = $GLOBALS['db']->getRow("SELECT brand_logo FROM " . $GLOBALS['ecs']->table('brand') . " WHERE brand_id='{$brand_id}'");
    if (!empty($brand['brand_logo'])) {
        @unlink(ROOT_PATH . '/brandlogo/' . $brand['brand_logo']);
    }
    $exc->drop($brand_id);
    /* 更新商品的品牌编号 */
    $sql = "UPDATE " . $GLOBALS['ecs']->table('goods') . " SET brand_id=0 WHERE brand_id='{$brand_id}'";
    $GLOBALS['db']->query($sql);
    client_show_message(0, true);
}
开发者ID:Ryan007,项目名称:mybb,代码行数:21,代码来源:lib_api.php

示例11: get_votelist

    check_authz_json('vote_priv');
    $id = intval($_GET['id']);
    if ($exc->drop($id)) {
        /* 同时删除调查选项 */
        $db->query("DELETE FROM " . $ecs->table('vote_option') . " WHERE vote_id = '{$id}'");
        clear_cache_files();
        admin_log('', 'remove', 'ads_position');
    }
    $url = 'vote.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
} elseif ($_REQUEST['act'] == 'remove_option') {
    check_authz_json('vote_priv');
    $id = intval($_GET['id']);
    $vote_id = $db->getOne('SELECT vote_id FROM ' . $ecs->table('vote_option') . " WHERE option_id='{$id}'");
    if ($exc_opn->drop($id)) {
        clear_cache_files();
        admin_log('', 'remove', 'vote');
    }
    $url = 'vote.php?act=query_option&vid=' . $vote_id . '&' . str_replace('act=remove_option', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
}
/* 获取在线调查数据列表 */
function get_votelist()
{
    $filter = array();
    /* 记录总数以及页数 */
    $sql = 'SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('vote');
    $filter['record_count'] = $GLOBALS['db']->getOne($sql);
    $filter = page_and_size($filter);
开发者ID:nirvana-info,项目名称:old_bak,代码行数:31,代码来源:vote.php

示例12: elseif

        clear_cache_files();
    }
    $url = 'article.php?act=query_sjs&' . str_replace('act=remove_sjs', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
} elseif ($_REQUEST['act'] == 'remove_jg') {
    check_authz_json('article_manage');
    $id = intval($_GET['id']);
    /* 删除原来的文件 */
    $sql = "SELECT file_url FROM " . $ecs->table('article') . " WHERE article_id = '{$id}'";
    $old_url = $db->getOne($sql);
    if ($old_url != '' && strpos($old_url, 'http://') === false && strpos($old_url, 'https://') === false) {
        @unlink(ROOT_PATH . $old_url);
    }
    $name = $exc2->get_name($id);
    if ($exc2->drop($id)) {
        $db->query("DELETE FROM " . $ecs->table('comment') . " WHERE " . "comment_type = 1 AND id_value = {$id}");
        admin_log(addslashes($name), 'remove', 'article');
        clear_cache_files();
    }
    $url = 'article.php?act=query_jg&' . str_replace('act=remove_jg', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
} elseif ($_REQUEST['act'] == 'add_link_goods') {
    include_once ROOT_PATH . 'includes/cls_json.php';
    $json = new JSON();
    check_authz_json('article_manage');
    $add_ids = $json->decode($_GET['add_ids']);
    $args = $json->decode($_GET['JSON']);
    $article_id = $args[0];
    if ($article_id == 0) {
开发者ID:xiaoxiaowu007,项目名称:jicai,代码行数:31,代码来源:article.php

示例13: intval

         $db_write->autoExecute('sh_address', $data, 'UPDATE', 'id=' . intval($_REQUEST['id']));
         $links[0]['text'] = '返回地址点管理列表';
         $links[0]['href'] = 'area.php?act=list';
     } else {
         $data['area_name'] = empty($_POST['area_name']) ? '' : trim($_POST['area_name']);
         $data['region_id'] = empty($_POST['region_id']) ? '' : trim($_POST['region_id']);
         $data['route_id'] = empty($_POST['route_id']) ? '' : trim($_POST['route_id']);
         $db_write->autoExecute('ship_area', $data, 'UPDATE', 'area_id=' . intval($_REQUEST['id']));
         $links[0]['text'] = '返回地址点管理列表';
         $links[0]['href'] = 'area.php?act=list';
     }
     sys_msg('地址点编辑成功!', 0, $links);
     break;
 case 'remove':
     $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : '0';
     city_location() ? $excg1->drop($id) : $excg2->drop($id);
     $url = "area.php?act=query&" . str_replace('act=remove', '', $_SERVER['QUERT_STRING']);
     los_header("Location: {$url}\n");
     break;
 case 'batchAdd':
     //print_r($_REQUEST);
     //print_r($_FILES);
     batchInsertAdress('text/plain', '120000', $_SESSION['city_group']);
     break;
 default:
     $region_list = get_region_list();
     $station_list = get_station_list();
     $area_list = get_area_list();
     $smarty->assign('full_page', 1);
     $smarty->assign('ur_here', '地址点管理');
     $smarty->assign('action_link', array('href' => 'area.php?act=add', 'text' => '添加地址点'));
开发者ID:songtaiwu,项目名称:mordercms,代码行数:31,代码来源:area.php

示例14: trim

    admin_priv('supplier_tag');
    /* 检查是否存在重名的会员等级 */
    if (!$exc->is_only('tag_name', trim($_POST['tag_name']))) {
        sys_msg(sprintf($_LANG['tag_name_exists'], trim($_POST['tag_name'])), 1);
    }
    $sql = "INSERT INTO " . $ecs->table('supplier_tag') . "( " . "tag_name,  is_groom,  sort_order" . ") VALUES (" . "'{$_POST['tag_name']}', '" . intval($_POST['is_groom']) . "' ,'" . intval($_POST['sort_order']) . "')";
    $db->query($sql);
    /* 管理员日志 */
    clear_cache_files();
    $lnk[] = array('text' => $_LANG['back_list'], 'href' => 'supplier_tag.php?act=list');
    $lnk[] = array('text' => $_LANG['add_continue'], 'href' => 'supplier_tag.php?act=add');
    sys_msg($_LANG['add_tag_success'], 0, $lnk);
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('supplier_tag');
    $tag_id = intval($_GET['id']);
    if ($exc->drop($tag_id)) {
        /* 更新会员表的等级字段 */
        clear_cache_files();
    }
    $url = 'supplier_tag.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
} elseif ($_REQUEST['act'] == 'edit_name') {
    check_authz_json('supplier_tag');
    $id = intval($_REQUEST['id']);
    $val = empty($_REQUEST['val']) ? '' : json_str_iconv(trim($_REQUEST['val']));
    if ($exc->is_only('tag_name', $val, $id)) {
        if ($exc->edit("tag_name = '{$val}'", $id)) {
            /* 管理员日志 */
            clear_cache_files();
            make_json_result(stripcslashes($val));
开发者ID:seanguo166,项目名称:yinoos,代码行数:31,代码来源:supplier_tag.php


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