예제 #1
0
파일: goods.php 프로젝트: dlpc/ecshop
    $sort_flag = sort_flag($goods_list['filter']);
    $smarty->assign($sort_flag['tag'], $sort_flag['img']);
    /* 获取商品类型存在规格的类型 */
    $specifications = get_goods_type_specifications();
    $smarty->assign('specifications', $specifications);
    make_json_result($smarty->fetch($tpl), '', array('filter' => $goods_list['filter'], 'page_count' => $goods_list['page_count']));
} elseif ($_REQUEST['act'] == 'remove') {
    $goods_id = intval($_REQUEST['id']);
    /*add by hg for date 2014-03-26 判断代理商是否非法操作商品*/
    static_goods($_REQUEST['goods_id']);
    /*end*/
    /* 检查权限 */
    check_authz_json('remove_back');
    if ($exc->edit("is_delete = 1", $goods_id)) {
        clear_cache_files();
        $goods_name = $exc->get_name($goods_id);
        admin_log(addslashes($goods_name), 'trash', 'goods');
        // 记录日志
        $url = 'goods.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
        ecs_header("Location: {$url}\n");
        exit;
    }
} elseif ($_REQUEST['act'] == 'restore_goods') {
    $goods_id = intval($_REQUEST['id']);
    check_authz_json('remove_back');
    // 检查权限
    $exc->edit("is_delete = 0, add_time = '" . gmtime() . "'", $goods_id);
    clear_cache_files();
    $goods_name = $exc->get_name($goods_id);
    admin_log(addslashes($goods_name), 'restore', 'goods');
    // 记录日志
예제 #2
0
    }
    $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)) {
            /* 管理员日志 */
            admin_log($val, 'edit', 'user_rank');
            clear_cache_files();
예제 #3
0
        $db->query($sql);
        /* 记录日志 */
        admin_log('', 'batch_remove', 'attribute');
        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') {
예제 #4
0
            $i++;
        }
        /* 记录管理员操作 */
        admin_log('', 'batch_remove', 'shipping_area');
    }
    /* 返回 */
    $links[0] = array('href' => 'shipping_area.php?act=list&shipping=' . intval($_REQUEST['shipping']), 'text' => $_LANG['go_back']);
    sys_msg($_LANG['remove_success'], 0, $links);
} elseif ($_REQUEST['act'] == 'edit_area') {
    /* 检查权限 */
    check_authz_json('shiparea_manage');
    /* 取得参数 */
    $id = intval($_POST['id']);
    $val = json_str_iconv(trim($_POST['val']));
    /* 取得该区域所属的配送id */
    $shipping_id = $exc->get_name($id, 'shipping_id');
    /* 检查是否有重复的配送区域名称 */
    if (!$exc->is_only('shipping_area_name', $val, $id, "shipping_id = '{$shipping_id}'")) {
        make_json_error($_LANG['repeat_area_name']);
    }
    /* 更新名称 */
    $exc->edit("shipping_area_name = '{$val}'", $id);
    /* 记录日志 */
    admin_log($val, 'edit', 'shipping_area');
    /* 返回 */
    make_json_result(stripcslashes($val));
} elseif ($_REQUEST['act'] == 'remove_area') {
    check_authz_json('shiparea_manage');
    $id = intval($_GET['id']);
    $name = $exc->get_name($id);
    $shipping_id = $exc->get_name($id, 'shipping_id');
예제 #5
0
    check_authz_json('article_manage');
    $id = intval($_POST['id']);
    $val = intval($_POST['val']);
    $exc->edit("article_type = '{$val}'", $id);
    clear_cache_files();
    make_json_result($val);
} elseif ($_REQUEST['act'] == 'remove') {
    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 = $exc->get_name($id);
    if ($exc->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&' . str_replace('act=remove', '', $_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];
예제 #6
0
파일: msg.php 프로젝트: norain2050/benhu
    assign_query_info();
    $msg_list = msg_list1();
    $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']);
    $smarty->assign('full_page', 1);
    $smarty->assign('sort_msg_id', '<img src="images/sort_desc.gif">');
    $smarty->assign('ur_here', $_LANG['msg']);
    $smarty->assign('full_page', 1);
    $smarty->display('msg.htm');
} elseif ($_REQUEST['act'] == 'remove') {
    $msg_id = intval($_REQUEST['id']);
    /* 检查权限 */
    // check_authz_json('fankui_priv');
    $msg_title = $exc->get_name($msg_id);
    if ($exc->drop($msg_id)) {
        $sql = "DELETE FROM " . $ecs->table('fankui') . " WHERE msg_id = '{$msg_id}' LIMIT 1";
        $db->query($sql, 'SILENT');
        admin_log(addslashes($msg_title), 'remove', 'message');
        $url = 'msg.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
        ecs_header("Location: {$url}\n");
        exit;
    } else {
        make_json_error($GLOBALS['db']->error());
    }
}
/**
 *
 *
 * @access  public
예제 #7
0
    $title = json_str_iconv(trim($_POST['val']));
    /* 检查文章标题是否有重名 */
    if ($exc->num('title', $title, $id) == 0) {
        if ($exc->edit("title = '{$title}'", $id)) {
            clear_cache_files();
            admin_log($title, 'edit', 'shopinfo');
            make_json_result(stripslashes($title));
        }
    } else {
        make_json_error(sprintf($_LANG['title_exist'], $title));
    }
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('shopinfo_manage');
    $id = intval($_GET['id']);
    /* 获得文章主题 */
    $title = $exc->get_name($id);
    if ($exc->drop($id)) {
        clear_cache_files();
        admin_log(addslashes($title), 'remove', 'shopinfo');
    }
    $url = 'shopinfo.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
}
/* 获取网店信息文章数据 */
function shopinfo_article_list()
{
    $list = array();
    $sql = 'SELECT article_id, title ,add_time' . ' FROM ' . $GLOBALS['ecs']->table('article') . ' WHERE cat_id = 0 ORDER BY article_id';
    $res = $GLOBALS['db']->query($sql);
    while ($rows = $GLOBALS['db']->fetchRow($res)) {
예제 #8
0
    $smarty->assign('full_page', 1);
    $smarty->display('msg_list.htm');
} 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());
    }
예제 #9
0
}
/*------------------------------------------------------ */
//-- 列出所有主仓库
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list') {
    admin_priv('store_manage');
    /* 取得参数 */
    $keyword = empty($_REQUEST['keyword']) ? 0 : trim($_REQUEST['keyword']);
    $parent_id = empty($_REQUEST['pid']) ? 0 : intval($_REQUEST['pid']);
    $smarty->assign('parent_id', $parent_id);
    /* 获取仓库列表 */
    $store_arr = store_list($keyword);
    $smarty->assign('store_arr', $store_arr);
    /* 当前的地区名称 */
    if ($region_id > 0) {
        $area_name = $exc->get_name($region_id);
        $area = '[ ' . $area_name . ' ] ';
        if ($region_arr) {
            $area .= $region_arr[0]['type'];
        }
    } else {
        $area = $_LANG['country'];
    }
    $smarty->assign('area_here', $area);
    /* 返回上一级的链接 */
    if ($region_id > 0) {
        $parent_id = $exc->get_name($region_id, 'parent_id');
        $action_link = array('text' => $_LANG['back_page'], 'href' => 'area_manage.php?act=list&&pid=' . $parent_id);
    } else {
        $action_link = '';
    }
예제 #10
0
파일: new_ads.php 프로젝트: dlpc/ecshop
    $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, 'img');
    $exc->drop($id);
    if (strpos($img, 'http://') === false) {
        if (!$db->getOne("SELECT id FROM " . $ecs->table('ad_new') . " WHERE img ='{$img}' AND id<>{$id}")) {
            @unlink('../' . $img);
        }
    }
    admin_log('', 'remove', 'ads');
    $url = 'new_ads.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
} elseif ($_REQUEST['act'] == 'query') {
    $ads_list = get_newadslist();
    $smarty->assign('ads_list', $ads_list['ads']);
    $smarty->assign('filter', $ads_list['filter']);
    $smarty->assign('record_count', $ads_list['record_count']);
예제 #11
0
    } else {
        make_json_error(sprintf($_LANG['tag_name_exists'], htmlspecialchars($val)));
    }
}
/*------------------------------------------------------ */
//-- 切换是否推荐
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'toggle_is_groom') {
    check_authz_json('supplier_tag');
    $id = intval($_REQUEST['id']);
    $val = intval($_REQUEST['val']);
    if ($exc->edit("is_groom = '{$val}'", $id)) {
        make_json_result($val);
    } else {
        make_json_error($db->error());
    }
} elseif ($_REQUEST['act'] == 'edit_sort') {
    check_authz_json('supplier_tag');
    $tag_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}'", $tag_id)) {
        $rank_name = $exc->get_name($tag_id);
        clear_cache_files();
        make_json_result($val);
    } else {
        make_json_error($val);
    }
}
예제 #12
0
    if ($exc->num('link_name', $link_name, $id) != 0) {
        make_json_error(sprintf($_LANG['link_name_exist'], $link_name));
    } else {
        if ($exc->edit("link_name = '{$link_name}'", $id)) {
            admin_log($link_name, 'edit', 'friendlink');
            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']));
    /* 检查输入的值是否合法 */
예제 #13
0
파일: information.php 프로젝트: dlpc/ecshop
            $info['img_file'] = $image->upload_image($img_file, '');
        }
        if (!$info['img_file']) {
            sys_msg('上传图片失败', 1);
        }
    }
    $db->autoExecute($ecs->table('information'), $info, 'update', "info_id = {$info_id}");
    /* 记录管理员操作 */
    admin_log($_POST['info_cat'], 'edit', 'information');
    clear_cache_files();
    // 清除模版缓存
    sys_msg($_LANG['edit'] . ' ' . $info['title_describe'] . ' ' . $_LANG['attradd_succed'], 0, $link, false);
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('information');
    $id = intval($_GET['id']);
    $img_file = $exc->get_name($id, 'img_file');
    $exc->drop($id);
    if (strpos($img_file, 'http://') === false) {
        @unlink('../' . $img_file);
    }
    admin_log('', 'remove', 'information_category');
    echo $url = "information.php?act=query&" . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
} elseif ($_REQUEST['act'] == 'query') {
    $info_list = get_info_list();
    $smarty->assign('info_lists', $info_list['info']);
    $smarty->assign('filter', $info_list['filter']);
    $smarty->assign('record_count', $info_list['record_count']);
    $smarty->assign('page_count', $info_list['page_count']);
    make_json_result($smarty->fetch('information_list.htm'), '', array('filter' => $info_list['filter'], 'page_count' => $info_list['page_count']));
예제 #14
0
    admin_priv('reg_fields');
    /* 检查是否存在重名的会员注册项 */
    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)) {
예제 #15
0
        admin_log(addslashes($name), 'remove', 'article');
        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];
예제 #16
0
파일: ads.php 프로젝트: Ryan007/mybb
    $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);
    }
    admin_log('', 'remove', 'ads');
    $url = 'ads.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
}
/* 获取广告数据列表 */
function get_adslist()
{
    /* 过滤查询 */
    $pid = !empty($_REQUEST['pid']) ? intval($_REQUEST['pid']) : 0;
예제 #17
0
        @unlink(ROOT_PATH . DATA_DIR . '/packimg/' . $img_name);
        $sql = "UPDATE " . $ecs->table('pack') . " SET pack_img = '' WHERE pack_id = '{$pack_id}'";
        $db->query($sql);
    }
    $link = array(array('text' => $_LANG['pack_edit_lnk'], 'href' => 'pack.php?act=edit&id=' . $pack_id), array('text' => $_LANG['pack_list_lnk'], 'href' => 'pack.php?act=list'));
    sys_msg($_LANG['drop_pack_img_success'], 0, $link);
}
/*------------------------------------------------------ */
//-- 编辑包装名称
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'edit_name') {
    check_authz_json('pack');
    $id = intval($_POST['id']);
    $val = json_str_iconv(trim($_POST['val']));
    /* 取得该属性所属商品类型id */
    $pack_name = $exc->get_name($id);
    if (!$exc->is_only('pack_name', $val, $id)) {
        make_json_error(sprintf($_LANG['packname_exist'], $pack_name));
    } else {
        $exc->edit("pack_name='{$val}'", $id);
        admin_log($val, 'edit', 'pack');
        make_json_result(stripslashes($val));
    }
}
/*------------------------------------------------------ */
//-- 编辑包装费用
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'edit_pack_fee') {
    check_authz_json('pack');
    $id = intval($_POST['id']);
    $val = floatval($_POST['val']);
예제 #18
0
파일: friend_link.php 프로젝트: muqidi/PHP
    if ($exc->num("link_name", $link_name, $id) != 0) {
        make_json_error(sprintf($_LANG['link_name_exist'], $link_name));
    } else {
        if ($exc->edit("link_name = '{$link_name}'", $id)) {
            admin_log($link_name, 'edit', 'friendlink');
            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']));
    /* 检查输入的值是否合法 */
예제 #19
0
    $smarty->assign('page_count', $cards_list['page_count']);
    $smarty->display('card_list.htm');
} 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') {
    /* 权限判断 */
예제 #20
0
} else {
    $_REQUEST['act'] = trim($_REQUEST['act']);
}
/*------------------------------------------------------ */
//-- 列出某地区下的所有地区列表
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'list') {
    admin_priv('area_manage');
    /* 取得参数:上级地区id */
    $region_id = empty($_REQUEST['pid']) ? 0 : intval($_REQUEST['pid']);
    $smarty->assign('parent_id', $region_id);
    /* 取得列表显示的地区的类型 */
    if ($region_id == 0) {
        $region_type = 0;
    } else {
        $region_type = $exc->get_name($region_id, 'region_type') + 1;
    }
    $smarty->assign('region_type', $region_type);
    /* 获取地区列表 */
    $region_arr = area_list($region_id);
    $smarty->assign('region_arr', $region_arr);
    /* 当前的地区名称 */
    if ($region_id > 0) {
        $area_name = $exc->get_name($region_id);
        $area = '[ ' . $area_name . ' ] ';
        if ($region_arr) {
            $area .= $region_arr[0]['type'];
        }
    } else {
        $area = $_LANG['country'];
    }
예제 #21
0
파일: app_version.php 프로젝트: dlpc/ecshop
    }
    if (isset($error)) {
        sys_msg($error, 0, $link);
    }
    $db->autoExecute($ecs->table('version'), $adArr, 'update', "id = {$id}");
    /* 记录管理员操作 */
    admin_log('', '', '', '编辑APP版本信息:' . $adArr['version']);
    clear_cache_files();
    // 清除模版缓存
    /* 提示信息 */
    $href[] = array('text' => '广告列表', 'href' => 'app_version.php?act=list');
    sys_msg($_LANG['edit'] . ' ' . $_POST['version'] . ' ' . $_LANG['attradd_succed'], 0, $href);
} elseif ($_REQUEST['act'] == 'remove') {
    check_authz_json('ad_manage');
    $id = intval($_GET['id']);
    $version = $exc->get_name($id, 'version');
    $exc->drop($id);
    admin_log('', '', '', '删除APP版本信息:' . $version);
    $url = 'app_version.php?act=query&' . str_replace('act=remove', '', $_SERVER['QUERY_STRING']);
    ecs_header("Location: {$url}\n");
    exit;
}
/* 获取版本数据列表 */
function version()
{
    $filter = array();
    /* 获得总记录数据 */
    $sql = 'SELECT COUNT(*) FROM ' . $GLOBALS['ecs']->table('version');
    $filter['record_count'] = $GLOBALS['db']->getOne($sql);
    $filter = page_and_size($filter);
    //dump($filter);