예제 #1
0
function wxch_upload_file($upload)
{
    $image = new cls_image();
    $res = $image->upload_image($upload);
    if ($res) {
        return $res;
    } else {
        return false;
    }
}
예제 #2
0
파일: ads.php 프로젝트: Ryan007/mybb
 } else {
     $ad_link = !empty($_POST['ad_link2']) ? trim($_POST['ad_link2']) : '';
 }
 /* 获得广告的开始时期与结束日期 */
 $start_time = local_strtotime($_POST['start_time']);
 $end_time = local_strtotime($_POST['end_time']);
 /* 查看广告名称是否有重复 */
 $sql = "SELECT COUNT(*) FROM " . $ecs->table('ad') . " WHERE ad_name = '{$ad_name}'";
 if ($db->getOne($sql) > 0) {
     $link[] = array('text' => $_LANG['go_back'], 'href' => 'javascript:history.back(-1)');
     sys_msg($_LANG['ad_name_exist'], 0, $link);
 }
 /* 添加图片类型的广告 */
 if ($_POST['media_type'] == '0') {
     if (isset($_FILES['ad_img']['error']) && $_FILES['ad_img']['error'] == 0 || !isset($_FILES['ad_img']['error']) && isset($_FILES['ad_img']['tmp_name']) && $_FILES['ad_img']['tmp_name'] != 'none') {
         $ad_code = basename($image->upload_image($_FILES['ad_img'], 'afficheimg'));
     }
     if (!empty($_POST['img_url'])) {
         $ad_code = $_POST['img_url'];
     }
     if ((isset($_FILES['ad_img']['error']) && $_FILES['ad_img']['error'] > 0 || !isset($_FILES['ad_img']['error']) && isset($_FILES['ad_img']['tmp_name']) && $_FILES['ad_img']['tmp_name'] == 'none') && empty($_POST['img_url'])) {
         $link[] = array('text' => $_LANG['go_back'], 'href' => 'javascript:history.back(-1)');
         sys_msg($_LANG['js_languages']['ad_photo_empty'], 0, $link);
     }
 } elseif ($_POST['media_type'] == '1') {
     if (isset($_FILES['upfile_flash']['error']) && $_FILES['upfile_flash']['error'] == 0 || !isset($_FILES['upfile_flash']['error']) && isset($_FILES['ad_img']['tmp_name']) && $_FILES['upfile_flash']['tmp_name'] != 'none') {
         /* 检查文件类型 */
         if ($_FILES['upfile_flash']['type'] != "application/x-shockwave-flash") {
             $link[] = array('text' => $_LANG['go_back'], 'href' => 'javascript:history.back(-1)');
             sys_msg($_LANG['upfile_flash_type'], 0, $link);
         }
예제 #3
0
         if (!$image->check_img_type($_FILES['goods_img']['type'])) {
             sys_msg($_LANG['invalid_goods_img'], 1, array(), false);
         }
     }
 }
 $goods_img = '';
 // 初始化商品图片
 $goods_thumb = '';
 // 初始化商品缩略图
 $original_img = '';
 // 初始化原始图片
 $old_original_img = '';
 // 初始化原始图片旧图
 // 如果上传了商品图片,相应处理
 if ($_FILES['goods_img']['tmp_name'] != '' && $_FILES['goods_img']['tmp_name'] != 'none') {
     $original_img = $image->upload_image($_FILES['goods_img']);
     // 原始图片
     if ($original_img === false) {
         sys_msg($image->error_msg(), 1, array(), false);
     }
     $goods_img = $original_img;
     // 商品图片
     /* 复制一份相册图片 */
     $img = $original_img;
     // 相册图片
     $pos = strpos(basename($img), '.');
     $newname = dirname($img) . '/' . $image->random_filename() . substr(basename($img), $pos);
     if (!copy('../' . $img, '../' . $newname)) {
         sys_msg('fail to copy file: ' . realpath('../' . $img), 1, array(), false);
     }
     $img = $newname;
예제 #4
0
    $smarty->assign('card', $card);
    $smarty->assign('ur_here', $_LANG['card_add']);
    $smarty->assign('action_link', array('text' => $_LANG['07_card_list'], 'href' => 'card.php?act=list'));
    $smarty->assign('form_action', 'insert');
    assign_query_info();
    $smarty->display('card_info.htm');
} elseif ($_REQUEST['act'] == 'insert') {
    /* 权限判断 */
    admin_priv('card_manage');
    /*检查包装名是否重复*/
    $is_only = $exc->is_only('card_name', $_POST['card_name']);
    if (!$is_only) {
        sys_msg(sprintf($_LANG['cardname_exist'], stripslashes($_POST['card_name'])), 1);
    }
    /*处理图片*/
    $img_name = basename($image->upload_image($_FILES['card_img'], "cardimg"));
    /*插入数据*/
    $sql = "INSERT INTO " . $ecs->table('card') . "(card_name, card_fee, free_money, card_desc, card_img)\r\n            VALUES ('{$_POST['card_name']}', '{$_POST['card_fee']}', '{$_POST['free_money']}', '{$_POST['card_desc']}', '{$img_name}')";
    $db->query($sql);
    admin_log($_POST['card_name'], 'add', 'card');
    /*添加链接*/
    $link[0]['text'] = $_LANG['continue_add'];
    $link[0]['href'] = 'card.php?act=add';
    $link[1]['text'] = $_LANG['back_list'];
    $link[1]['href'] = 'card.php?act=list';
    sys_msg($_POST['card_name'] . $_LANG['cardadd_succeed'], 0, $link);
} elseif ($_REQUEST['act'] == 'edit') {
    /* 权限判断 */
    admin_priv('card_manage');
    $sql = "SELECT card_id, card_name, card_fee, free_money, card_desc, card_img FROM " . $ecs->table('card') . " WHERE card_id='{$_REQUEST['id']}'";
    $card = $db->GetRow($sql);
예제 #5
0
 $status = $_POST['status'];
 $users =& init_users();
 if (!$users->edit_user(array('username' => $username, 'password' => $password, 'email' => $email, 'gender' => $sex, 'bday' => $birthday), 1)) {
     if ($users->error == ERR_EMAIL_EXISTS) {
         $msg = $_LANG['email_exists'];
     } else {
         $msg = $_LANG['edit_user_failed'];
     }
     sys_msg($msg, 1);
 }
 if (!empty($password)) {
     $sql = "UPDATE " . $ecs->table('users') . "SET `ec_salt`='0' WHERE user_name= '" . $username . "'";
     $db->query($sql);
 }
 if (isset($_FILES['face_card']) && $_FILES['face_card']['tmp_name'] != '') {
     $face_card = $image->upload_image($_FILES['face_card']);
     if ($face_card === false) {
         sys_msg($image->error_msg(), 1, array(), false);
     }
 }
 if (isset($_FILES['back_card']) && $_FILES['back_card']['tmp_name'] != '') {
     $back_card = $image->upload_image($_FILES['back_card']);
     if ($back_card === false) {
         sys_msg($image->error_msg(), 1, array(), false);
     }
 }
 $sql = "update " . $ecs->table('users') . " set `real_name`='{$real_name}',`card`='{$card}',`country`='{$country}',`province`='{$province}',`city`='{$city}',`district`='{$district}',`address`='{$address}',`status`='{$status}' where user_name = '" . $username . "'";
 $db->query($sql);
 if ($face_card != '') {
     $sql = "update " . $ecs->table('users') . " set `face_card` = '{$face_card}' where user_name = '" . $username . "'";
     $db->query($sql);
예제 #6
0
 $cat['cat_id'] = !empty($_POST['cat_id']) ? intval($_POST['cat_id']) : 0;
 $cat['parent_id'] = !empty($_POST['parent_id']) ? intval($_POST['parent_id']) : 0;
 $cat['sort_order'] = !empty($_POST['sort_order']) ? intval($_POST['sort_order']) : 0;
 $cat['keywords'] = !empty($_POST['keywords']) ? trim($_POST['keywords']) : '';
 $cat['cat_desc'] = !empty($_POST['cat_desc']) ? $_POST['cat_desc'] : '';
 $cat['measure_unit'] = !empty($_POST['measure_unit']) ? trim($_POST['measure_unit']) : '';
 $cat['cat_name'] = !empty($_POST['cat_name']) ? trim($_POST['cat_name']) : '';
 $cat['show_in_nav'] = !empty($_POST['show_in_nav']) ? intval($_POST['show_in_nav']) : 0;
 $cat['style'] = !empty($_POST['style']) ? trim($_POST['style']) : '';
 $cat['style_moban'] = !empty($_POST['style_moban']) ? trim($_POST['style_moban']) : '';
 $cat['is_show'] = !empty($_POST['is_show']) ? intval($_POST['is_show']) : 0;
 $cat['grade'] = !empty($_POST['grade']) ? intval($_POST['grade']) : 0;
 $cat['filter_attr'] = !empty($_POST['filter_attr']) ? implode(',', array_unique(array_diff($_POST['filter_attr'], array(0)))) : 0;
 $cat['cat_recommend'] = !empty($_POST['cat_recommend']) ? $_POST['cat_recommend'] : array();
 if (isset($_FILES['cat_img']) && $_FILES['cat_img']['tmp_name'] != '') {
     $cat['cat_img'] = $image->upload_image($_FILES['cat_img']);
 }
 if (cat_exists($cat['cat_name'], $cat['parent_id'])) {
     /* 同级别下不能有重复的分类名称 */
     $link[] = array('text' => $_LANG['go_back'], 'href' => 'javascript:history.back(-1)');
     sys_msg($_LANG['catname_exist'], 0, $link);
 }
 if ($cat['grade'] > 10 || $cat['grade'] < 0) {
     /* 价格区间数超过范围 */
     $link[] = array('text' => $_LANG['go_back'], 'href' => 'javascript:history.back(-1)');
     sys_msg($_LANG['grade_error'], 0, $link);
 }
 /* 入库的操作 */
 if ($db->autoExecute($hhs->table('category'), $cat) !== false) {
     $cat_id = $db->insert_id();
     insert_cat_recommend($cat['cat_recommend'], $cat_id);
예제 #7
0
     }
     if ($row['goods_img'] != '' && is_file('../' . $row['goods_img'])) {
         @unlink('../' . $row['goods_img']);
     }
     if ($row['original_img'] != '' && is_file('../' . $row['original_img'])) {
         /* 先不处理,以防止程序中途出错停止 */
         //$old_original_img = $row['original_img']; //记录旧图路径
     }
     /* 清除原来商品图片 */
     if ($proc_thumb === false) {
         get_image_path($_REQUEST[goods_id], $row['goods_img'], false, 'goods', true);
         get_image_path($_REQUEST[goods_id], $row['goods_thumb'], true, 'goods', true);
     }
 }
 if (empty($is_url_goods_img)) {
     $original_img = $image->upload_image($_FILES['goods_img']);
     // 原始图片
 } elseif (copy(trim($_POST['goods_img_url']), ROOT_PATH . 'temp/' . basename($_POST['goods_img_url']))) {
     $original_img = 'temp/' . basename($_POST['goods_img_url']);
 }
 if ($original_img === false) {
     sys_msg($image->error_msg(), 1, array(), false);
 }
 $goods_img = $original_img;
 // 商品图片
 /* 复制一份相册图片 */
 /* 添加判断是否自动生成相册图片 */
 if ($_CFG['auto_generate_gallery']) {
     $img = $original_img;
     // 相册图片
     $pos = strpos(basename($img), '.');
예제 #8
0
파일: menu.php 프로젝트: seanguo166/yinoos
    } else {
        sys_msg('删除菜单失败!', 0, $link);
    }
} elseif ($_REQUEST['act'] == 'add') {
    $smarty->assign('from_act', 'add_menu');
    $smarty->assign('action_link', array('text' => '菜单列表', 'href' => 'menu.php?act=list'));
    $smarty->display('menu_info.htm');
} elseif ($_REQUEST['act'] == 'add_menu') {
    include_once ROOT_PATH . '/includes/cls_image.php';
    $image = new cls_image($_CFG['bgcolor']);
    $menu_name = $_REQUEST['menu_name'];
    $menu_url = $_REQUEST['menu_url'];
    $sort = $_REQUEST['sort'];
    if (isset($_FILES['menu_img']) && $_FILES['menu_img']['tmp_name'] != '' && isset($_FILES['menu_img']['tmp_name']) && $_FILES['menu_img']['tmp_name'] != 'none') {
        // 上传了,直接使用,原始大小
        $menu_img = $image->upload_image($_FILES['menu_img']);
        if ($menu_img === false) {
            show_message($image->error_msg());
        }
    }
    if ($menu_img == '') {
        sys_msg('菜单图片不能为空!', 0, $link);
    }
    $sql = "insert into " . $GLOBALS['ecs']->table('ecsmart_menu') . "(`menu_name`,`menu_img`,`menu_url`,`sort`) values('{$menu_name}','{$menu_img}','{$menu_url}','{$sort}')";
    $num = $GLOBALS['db']->query($sql);
    if ($num > 0) {
        sys_msg('添加菜单成功!', 0, $link);
    } else {
        sys_msg('添加菜单失败!', 0, $link);
    }
}
예제 #9
0
파일: user.php 프로젝트: naliduo/ecshop
         if (!$image->check_img_type($_FILES['avatar']['type'])) {
             show_message("图片格式不正确!");
         }
     }
 }
 //会员头像 by neo
 if (!empty($_FILES['avatar']['name'])) {
     /* 更新会员头像之前先删除旧的头像 */
     $sql = "SELECT avatar " . " FROM " . $GLOBALS['ecs']->table('users') . " WHERE user_id = '{$user_id}'";
     $row = $GLOBALS['db']->getRow($sql);
     if ($row['avatar'] != '') {
         @unlink($row['avatar']);
     }
     $img_name = $user_id . '.' . end(explode('.', $_FILES['avatar']['name']));
     $target = ROOT_PATH . DATA_DIR . '/avatar/';
     $original_img = $image->upload_image($_FILES['avatar'], 'avatar', $img_name);
     // 原始图片
     $avatar = $image->make_thumb($original_img, 55, 55, $target);
     if ($avatar === false) {
         show_message("图片保存出错!");
     }
 }
 $profile = array('user_id' => $user_id, 'email' => isset($_POST['email']) ? trim($_POST['email']) : '', 'sex' => isset($_POST['sex']) ? intval($_POST['sex']) : 0, 'birthday' => $birthday, 'avatar' => $avatar, 'other' => isset($other) ? $other : array());
 if (edit_profile($profile)) {
     show_message($_LANG['edit_profile_success'], $_LANG['profile_lnk'], 'user.php?act=profile', 'info');
 } else {
     if ($user->error == ERR_EMAIL_EXISTS) {
         $msg = sprintf($_LANG['email_exist'], $profile['email']);
     } else {
         $msg = $_LANG['edit_profile_failed'];
     }
예제 #10
0
            if ($row['original_img'] != '' && is_file('../' . $row['original_img']))
            {
                /* 先不处理,以防止程序中途出错停止 */
                //$old_original_img = $row['original_img']; //记录旧图路径
            }
            /* 清除原来商品图片 */
            if ($proc_thumb === false)
            {
                get_image_path($_REQUEST[goods_id], $row['goods_img'], false, 'goods', true);
                get_image_path($_REQUEST[goods_id], $row['goods_thumb'], true, 'goods', true);
            }
        }

        if (empty($is_url_goods_img))
        {
            $original_img   = $image->upload_image($_FILES['goods_img']); // 原始图片
        }
        elseif ($_POST['goods_img_url'])
        {
            
            if(preg_match('/(.jpg|.png|.gif|.jpeg)$/',$_POST['goods_img_url']) && copy(trim($_POST['goods_img_url']), ROOT_PATH . 'temp/' . basename($_POST['goods_img_url'])))
            {
                  $original_img = 'temp/' . basename($_POST['goods_img_url']);
            }
            
        }

        if ($original_img === false)
        {
            sys_msg($image->error_msg(), 1, array(), false);
        }
예제 #11
0
         $img = $original_img;
         // 相册图片
         $pos = strpos(basename($img), '.');
         $newname = dirname($img) . '/' . $image->random_filename() . substr(basename($img), $pos);
         if (!copy('../' . $img, '../' . $newname)) {
             sys_msg('fail to copy file: ' . realpath('../' . $img), 1, array(), false);
         }
         $img = $newname;
         $gallery_img = $img;
         $gallery_thumb = $img;
     }
 }
 // 是否上传商品缩略图
 if (isset($_FILES['goods_thumb']) && $_FILES['goods_thumb']['tmp_name'] != '' && isset($_FILES['goods_thumb']['tmp_name']) && $_FILES['goods_thumb']['tmp_name'] != 'none') {
     // 上传了,直接使用,原始大小
     $goods_thumb = $image->upload_image($_FILES['goods_thumb']);
     if ($goods_thumb === false) {
         sys_msg($image->error_msg(), 1, array(), false);
     }
 } else {
     // 未上传,如果自动选择生成,且上传了商品图片,生成所略图
     if ($proc_thumb && isset($_POST['auto_thumb']) && !empty($original_img)) {
         // 如果设置缩略图大小不为0,生成缩略图
         if ($_CFG['thumb_width'] != 0 || $_CFG['thumb_height'] != 0) {
             $goods_thumb = $image->make_thumb('../' . $original_img, $GLOBALS['_CFG']['thumb_width'], $GLOBALS['_CFG']['thumb_height']);
             if ($goods_thumb === false) {
                 sys_msg($image->error_msg(), 1, array(), false);
             }
         } else {
             $goods_thumb = $original_img;
         }
예제 #12
0
    $smarty->assign('cat_info', array('is_show' => 1));
    /* 显示页面 */
    $smarty->display('category_flashimg_info.htm');
}
/*------------------------------------------------------ */
//-- 商品分类轮播图片添加时的处理
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'insert') {
    /* 权限检查 */
    admin_priv('cat_manage');
    /* 初始化变量 */
    $flashimg['cat_id'] = !empty($_POST['cat_id']) ? intval($_POST['cat_id']) : 0;
    $flashimg['sort_order'] = !empty($_POST['sort_order']) ? intval($_POST['sort_order']) : 0;
    $flashimg['href_url'] = !empty($_POST['href_url']) ? trim($_POST['href_url']) : '';
    /*处理图片*/
    $flashimg['img_url'] = basename($image->upload_image($_FILES['img_url'], 'catflashimg'));
    /*处理URL*/
    $flashimg['href_url'] = sanitize_url($flashimg['href_url']);
    $flashimg['img_title'] = !empty($_POST['img_title']) ? trim($_POST['img_title']) : '';
    $flashimg['img_desc'] = !empty($_POST['img_desc']) ? trim($_POST['img_desc']) : '';
    /* 入库的操作 */
    if ($db->autoExecute($ecs->table('cat_flashimg'), $flashimg) !== false) {
        clear_cache_files();
        // 清除缓存
        /*添加链接*/
        $link[0]['text'] = "继续添加";
        $link[0]['href'] = 'category_flashimg.php?act=add&cat_id=' . $cat_id;
        $link[1]['text'] = "返回轮播图片列表";
        $link[1]['href'] = 'category_flashimg.php?act=list&cat_id=' . $cat_id;
        sys_msg("添加成功", 0, $link);
    }
예제 #13
0
파일: pay.php 프로젝트: dlpc/ecshop
 $link = 'pay.php?act=edit_show_bank&id=' . $id;
 if (!$id) {
     sys_msg('参数错误', 1);
 }
 if (!empty($_POST)) {
     $image = new cls_image($_CFG['bgcolor']);
     //实例化图片处理函数
     $bank_name = isset($_POST['bank_name']) ? $_POST['bank_name'] : '';
     $bank_code = isset($_POST['bank_code']) ? $_POST['bank_code'] : '';
     $bank_image = isset($_FILES['bank_image']) ? $_FILES['bank_image'] : '';
     $payment = isset($_POST['payment']) ? $_POST['payment'] : '';
     $status = isset($_POST['status']) ? $_POST['status'] : '0';
     $bank_img_name = '';
     if (isset($bank_image['error']) && $bank_image['error'] == 0) {
         if ($image->check_img_type($bank_image['type'])) {
             $bank_img_name = $image->upload_image($bank_image, '');
         }
         if (!$bank_img_name) {
             sys_msg('上传图片失败', 1);
         }
     }
     if ($bank_img_name) {
         $bank_img = ',bank_img = "' . $bank_img_name . '"';
     }
     $res = $db->query("update " . $ecs->table('show_bank') . " set bank_name = '{$bank_name}', bank_code = '{$bank_code}',state='{$status}',payment='{$payment}' {$bank_img} where id = {$id}");
     if ($res) {
         sys_msg('修改成功', 0, array(array('href' => 'pay.php?act=show_bank', 'text' => '返回')));
     } else {
         sys_msg('修改失败', 1, array(array('href' => $link, 'text' => '返回')));
     }
 } else {
예제 #14
0
파일: brand.php 프로젝트: seanguo166/yinoos
    $smarty->assign('brand', array('sort_order' => 50, 'is_show' => 1));
    $smarty->display('brand_info.htm');
} elseif ($_REQUEST['act'] == 'insert') {
    /*检查品牌名是否重复*/
    admin_priv('brand_manage');
    $is_show = isset($_REQUEST['is_show']) ? intval($_REQUEST['is_show']) : 0;
    $is_only = $exc->is_only('brand_name', $_POST['brand_name']);
    if (!$is_only) {
        sys_msg(sprintf($_LANG['brandname_exist'], stripslashes($_POST['brand_name'])), 1);
    }
    /*对描述处理*/
    if (!empty($_POST['brand_desc'])) {
        $_POST['brand_desc'] = $_POST['brand_desc'];
    }
    /*处理图片*/
    $img_name = basename($image->upload_image($_FILES['brand_logo'], 'brandlogo'));
    /*处理图片*/
    $brand_img = basename($image->upload_image($_FILES['brand_img'], 'brandimg'));
    /*处理URL*/
    $site_url = sanitize_url($_POST['site_url']);
    /*插入数据*/
    $sql = "INSERT INTO " . $ecs->table('brand') . "(brand_name, site_url, wap_brand_desc, brand_logo, brand_img,is_show, sort_order) " . "VALUES ('{$_POST['brand_name']}', '{$site_url}', '{$_POST['brand_desc']}', '{$img_name}','{$brand_img}', '{$is_show}', '{$_POST['sort_order']}')";
    $db->query($sql);
    admin_log($_POST['brand_name'], 'add', 'brand');
    /* 清除缓存 */
    clear_cache_files();
    $link[0]['text'] = $_LANG['continue_add'];
    $link[0]['href'] = 'brand.php?act=add';
    $link[1]['text'] = $_LANG['back_list'];
    $link[1]['href'] = 'brand.php?act=list';
    sys_msg($_LANG['brandadd_succed'], 0, $link);
예제 #15
0
 $cat['is_show'] = !empty($_POST['is_show']) ? intval($_POST['is_show']) : 0;
 $cat['grade'] = !empty($_POST['grade']) ? intval($_POST['grade']) : 0;
 $cat['filter_attr'] = !empty($_POST['filter_attr']) ? implode(',', array_unique(array_diff($_POST['filter_attr'], array(0)))) : 0;
 $cat['cat_recommend'] = !empty($_POST['cat_recommend']) ? $_POST['cat_recommend'] : array();
 if (cat_exists($cat['cat_name'], $cat['parent_id'])) {
     /* 同级别下不能有重复的分类名称 */
     $link[] = array('text' => $_LANG['go_back'], 'href' => 'javascript:history.back(-1)');
     sys_msg($_LANG['catname_exist'], 0, $link);
 }
 if ($cat['grade'] > 10 || $cat['grade'] < 0) {
     /* 价格区间数超过范围 */
     $link[] = array('text' => $_LANG['go_back'], 'href' => 'javascript:history.back(-1)');
     sys_msg($_LANG['grade_error'], 0, $link);
 }
 /* 处理图片 */
 $img_name = basename($image->upload_image($_FILES['cat_ico'], 'cat_ico'));
 $cat['cat_ico'] = empty($img_name) ? '' : $img_name;
 /* 入库的操作 */
 if ($db->autoExecute($ecs->table('category'), $cat) !== false) {
     $cat_id = $db->insert_id();
     if ($cat['show_in_nav'] == 1) {
         $vieworder = $db->getOne("SELECT max(vieworder) FROM " . $ecs->table('touch_nav') . " WHERE type = 'middle'");
         $vieworder += 2;
         //显示在自定义导航栏中
         $sql = "INSERT INTO " . $ecs->table('touch_nav') . " (name,ctype,cid,ifshow,vieworder,opennew,url,type)" . " VALUES('" . $cat['cat_name'] . "', 'c', '" . $db->insert_id() . "','1','{$vieworder}','0', '" . build_uri('category', array('cid' => $cat_id), $cat['cat_name']) . "','middle')";
         $db->query($sql);
     }
     insert_cat_recommend($cat['cat_recommend'], $cat_id);
     admin_log($_POST['cat_name'], 'add', 'category');
     // 记录管理员操作
     clear_cache_files();
예제 #16
0
 $min_amount = floatval($_POST['min_amount']) >= 0 ? floatval($_POST['min_amount']) : 0;
 $max_amount = floatval($_POST['max_amount']) >= 0 ? floatval($_POST['max_amount']) : 0;
 if ($max_amount > 0 && $min_amount > $max_amount) {
     sys_msg($_LANG['amount_error']);
 }
 /* 取得赠品 */
 $gift = array();
 if (intval($_POST['act_type']) == FAT_GOODS && isset($_POST['gift_id'])) {
     foreach ($_POST['gift_id'] as $key => $id) {
         $gift[] = array('id' => $id, 'name' => $_POST['gift_name'][$key], 'price' => $_POST['gift_price'][$key]);
     }
 }
 /* 处理图片 */
 $img_t = !empty($_POST['act_img']) ? $_POST['act_img'] : 0;
 if (!empty($_FILES['act_imgfile']['name']) && $img_t != 0) {
     $upload_img = $image->upload_image($_FILES['act_imgfile'], "actimg");
     if ($upload_img == false) {
         sys_msg($image->error_msg);
     }
     $img_name = basename($upload_img);
 } else {
     $img_name = '';
 }
 /* 提交值 */
 $favourable = array('act_id' => intval($_POST['id']), 'act_name' => $act_name, 'act_img' => $img_t, 'start_time' => local_strtotime($_POST['start_time']), 'end_time' => local_strtotime($_POST['end_time']), 'user_rank' => isset($_POST['user_rank']) ? join(',', $_POST['user_rank']) : '0', 'act_range' => intval($_POST['act_range']), 'act_range_ext' => intval($_POST['act_range']) == 0 ? '' : join(',', $_POST['act_range_ext']), 'min_amount' => floatval($_POST['min_amount']), 'max_amount' => floatval($_POST['max_amount']), 'act_type' => intval($_POST['act_type']), 'act_type_ext' => floatval($_POST['act_type_ext']), 'gift' => serialize($gift));
 if ($favourable['act_type'] == FAT_GOODS) {
     $favourable['act_type_ext'] = round($favourable['act_type_ext']);
 }
 if ($img_name != "") {
     $favourable['act_imgfile'] = $img_name;
 }
예제 #17
0
 /* 保存数据 */
 if ($is_add) {
     $db->autoExecute($ecs->table('favourable_activity'), $favourable, 'INSERT');
     $favourable['act_id'] = $db->insert_id();
 } else {
     $db->autoExecute($ecs->table('favourable_activity'), $favourable, 'UPDATE', "act_id = '{$favourable['act_id']}'");
 }
 //代表图片上传
 if ($_FILES['logo']['size']) {
     $save['supplier_id'] = 0;
     //自营运营商
     include_once ROOT_PATH . 'includes/cls_image.php';
     $image = new cls_image($_CFG['bgcolor']);
     $logo_path .= $save['supplier_id'];
     $logo_name = "original" . $save['supplier_id'] . '_' . $favourable['act_id'] . substr($_FILES['logo']['name'], -4);
     $picinfo = $image->upload_image($_FILES['logo'], $logo_path, $logo_name);
     $parray = pathinfo($picinfo);
     if ($picinfo) {
         $create_pic_info = array('580x260' => array('width' => 580, 'height' => 260));
         foreach ($create_pic_info as $key => $val) {
             $path = ROOT_PATH . $parray['dirname'] . '/';
             $image->create_pic_name = "original" . $save['supplier_id'] . '_' . $favourable['act_id'] . "_" . $key;
             $pinfo = $image->make_thumb(ROOT_PATH . $picinfo, $val['width'], $val['height'], $path);
         }
         $save['logo'] = '/' . $pinfo;
     }
     $pic_sql = "update " . $ecs->table('favourable_activity') . " set logo='" . $save['logo'] . "' where act_id=" . $favourable['act_id'];
     $db->query($pic_sql);
 }
 /* 记日志 */
 if ($is_add) {
<?php

define('IN_ECTOUCH', true);
require dirname(__FILE__) . '/includes/init.php';
include_once ROOT_PATH . '/include/cls_image.php';
require 'wxch_lg.php';
$_REQUEST['act'] = trim($_REQUEST['act']);
if ($_REQUEST['act'] == 'list') {
    $smarty->display('wxch_keywords.html');
} elseif ($_REQUEST['act'] == 'add') {
    if ($_POST) {
        $image = new cls_image($_CFG['bgcolor']);
        $path = $image->upload_image($_FILES['path']);
        $name = $_POST['name'];
        $keyword = $_POST['keyword'];
        $type = $_POST['type'];
        $contents = $_POST['contents'];
        if ($type == 0) {
            $get_type = $_GET['type'];
            switch ($get_type) {
                case 'text':
                    $type = 1;
                    break;
                case 'image':
                    $type = 2;
                    break;
            }
        }
        if ($type == 1) {
            $contents = htmltowei($contents);
            $db->query("INSERT INTO `wxch_keywords` (`name`, `keyword`, `type`, `contents`, `count`, `status`) VALUES\n('{$name}', '{$keyword}', {$type}, '{$contents}', 0, 1);");
예제 #19
0
파일: brand.php 프로젝트: jinjing1989/wei
    admin_priv('brand_manage');
    $is_show = isset($_REQUEST['is_show']) ? intval($_REQUEST['is_show']) : 0;
    $is_only = $exc->is_only('brand_name', $_POST['brand_name']);
    if (!$is_only) {
        sys_msg(sprintf($_LANG['brandname_exist'], stripslashes($_POST['brand_name'])), 1);
    }
    /*对描述处理*/
    if (!empty($_POST['brand_desc'])) {
        $_POST['brand_desc'] = $_POST['brand_desc'];
    }
    /*处理图片*/
    //$img_name = basename($image->upload_image($_FILES['brand_logo'],'brandlogo'));
    /*处理URL*/
    $site_url = sanitize_url($_POST['site_url']);
    /*处理图片品牌banner  by ecmoban S*/
    $banner_name = basename($image->upload_image($_FILES['brand_banner'], 'brandlogo'));
    /*插入数据*/
    $sql = "INSERT INTO " . $ecs->table('brand') . "(brand_name, site_url, brand_desc, is_show, sort_order , brand_banner) " . "VALUES ('{$_POST['brand_name']}', '{$site_url}', '{$_POST['brand_desc']}', '{$is_show}', '{$_POST['sort_order']}' , '{$_POST['banner_name']}]')";
    $db->query($sql);
    /**by ecmoban E*/
    admin_log($_POST['brand_name'], 'add', 'brand');
    /* 清除缓存 */
    clear_cache_files();
    $link[0]['text'] = $_LANG['continue_add'];
    $link[0]['href'] = 'brand.php?act=add';
    $link[1]['text'] = $_LANG['back_list'];
    $link[1]['href'] = 'brand.php?act=list';
    sys_msg($_LANG['brandadd_succed'], 0, $link);
} elseif ($_REQUEST['act'] == 'edit') {
    /* 权限判断 */
    admin_priv('brand_manage');
예제 #20
0
$dir_name = '/images/';
$picSize = $_FILES['imgFile']['size'];
//图片尺寸
list($picWidth, $picHeight) = getimagesize($_FILES['imgFile']['tmp_name']);
//图片高宽
/* 通知详情的图片 */
if ($act == 'notice' || $act == 'intro' || $act == 'info' || $act == 'lifenav' || $act == 'redpacket') {
    $maxSize = 1 * 1024 * 1024;
    $dir_name .= $act;
    if ($picSize > $maxSize) {
        $msg['error'] = 1;
        $msg['message'] = '上传图片不能大于1M';
    } else {
        $cls_image = new cls_image('#ffffff', $dir_name);
        $upload = isset($_FILES['imgFile']) ? $_FILES['imgFile'] : '';
        $msg = $cls_image->upload_image($upload, $dir = '', $img_name = '');
        if ($msg['error'] == 0) {
            $msg['url'] = $msg['msg'];
            if ($picWidth > 640) {
                $msg['msg'] = substr($msg['msg'], 1);
                $msg['url'] = $cls_image->make_thumb($msg['msg'], $width = 640, $height = 0, $path = '', $pic = '');
                @unlink($msg['msg']);
                // 删除原图,只保留缩略图
            }
        } else {
            $msg['message'] = $msg['msg'];
        }
    }
}
$msg = $Json->encode($msg);
echo $msg;
예제 #21
0
    $smarty->assign('form_action', 'insert');
    $smarty->assign('action_link', array('text' => $_LANG['06_pack_list'], 'href' => 'pack.php?act=list'));
    assign_query_info();
    $smarty->display('pack_info.htm');
}
if ($_REQUEST['act'] == 'insert') {
    /* 权限判断 */
    admin_priv('pack');
    /*检查包装名是否重复*/
    $is_only = $exc->is_only('pack_name', $_POST['pack_name']);
    if (!$is_only) {
        sys_msg(sprintf($_LANG['packname_exist'], stripslashes($_POST['pack_name'])), 1);
    }
    /* 处理图片 */
    if (!empty($_FILES['pack_img'])) {
        $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 = '';
    }
    /*插入数据*/
    $sql = "INSERT INTO " . $ecs->table('pack') . "(pack_name, pack_fee, free_money, pack_desc, pack_img)\r\n            VALUES ('{$_POST['pack_name']}', '{$_POST['pack_fee']}', '{$_POST['free_money']}', '{$_POST['pack_desc']}', '{$img_name}')";
    $db->query($sql);
    /*添加链接*/
    $link[0]['text'] = $_LANG['back_list'];
    $link[0]['href'] = 'pack.php?act=list';
    $link[1]['text'] = $_LANG['continue_add'];
    $link[1]['href'] = 'pack.php?act=add';
예제 #22
0
파일: suppliers.php 프로젝트: qgz/ecshop
        $smarty->display('suppliers_info.htm');
    }
} elseif (in_array($_REQUEST['act'], array('insert', 'update'))) {
    /* 检查权限 */
    admin_priv('suppliers_manage');
    include_once ROOT_PATH . 'includes/cls_image.php';
    $image = new cls_image($_CFG['bgcolor']);
    if ($_REQUEST['act'] == 'insert') {
        /* 提交值 */
        $suppliers = array('suppliers_name' => trim($_POST['suppliers_name']), 'logo' => trim($_POST['logo']), 'country' => trim($_POST['country']), 'province' => trim($_POST['province']), 'city' => trim($_POST['city']), 'district' => trim($_POST['district']), 'tel' => trim($_POST['tel']), 'work_time' => trim($_POST['work_time']), 'service' => trim($_POST['service']), 'address' => trim($_POST['address']), 'position_img' => trim($_POST['position_img']), 'line' => trim($_POST['line']), 'suppliers_desc' => trim($_POST['suppliers_desc']), 'parent_id' => 0);
        /* 判断名称是否重复 */
        $sql = "SELECT suppliers_id\n                FROM " . $ecs->table('suppliers') . "\n                WHERE suppliers_name = '" . $suppliers['suppliers_name'] . "' ";
        if ($db->getOne($sql)) {
            sys_msg($_LANG['suppliers_name_exist']);
        }
        $src = basename($image->upload_image($_FILES['logo'], 'suppliers'));
        if ($src) {
            $suppliers['logo'] = '../data/suppliers/' . $src;
        }
        $src = basename($image->upload_image($_FILES['position_img'], 'suppliers'));
        if ($src) {
            $suppliers['position_img'] = '../data/suppliers/' . $src;
        }
        $db->autoExecute($ecs->table('suppliers'), $suppliers, 'INSERT');
        $suppliers['suppliers_id'] = $db->insert_id();
        if (isset($_POST['admins'])) {
            $sql = "UPDATE " . $ecs->table('admin_user') . " SET suppliers_id = '" . $suppliers['suppliers_id'] . "', action_list = '" . SUPPLIERS_ACTION_LIST . "' WHERE user_id " . db_create_in($_POST['admins']);
            $db->query($sql);
        }
        /* 记日志 */
        admin_log($suppliers['suppliers_name'], 'add', 'suppliers');
예제 #23
0
    $remark = isset($_POST['remark']) ? addslashes($_POST['remark']) : '';
    if (($rebates = rebateHave($rebate_id)) === false) {
        sys_msg('该返佣记录不存在!');
    }
    include_once ROOT_PATH . '/includes/cls_image.php';
    $image = new cls_image($_CFG['bgcolor']);
    if ($_FILES['rebate_img']['size'] <= 0) {
        sys_msg('汇票凭证必须上传!');
    }
    if ($_FILES['rebate_img']['error'] == 0) {
        if (!$image->check_img_type($_FILES['rebate_img']['type'])) {
            sys_msg($_LANG['invalid_goods_thumb'], 1, array(), false);
        }
    }
    $dir = 'rebate/' . local_date("Ymd", gmtime()) . '/' . $rebates['supplier_id'];
    $rebate_img = $image->upload_image($_FILES['rebate_img'], $dir);
    $rebate = array('is_pay_ok' => 1, 'pay_time' => gmtime(), 'rebate_img' => $rebate_img, 'status' => 4);
    /* 保存返佣信息 */
    $db->autoExecute($ecs->table('supplier_rebate'), $rebate, 'UPDATE', "rebate_id = '" . $rebate_id . "'");
    $loginfo = array('rebateid' => $rebate_id, 'addtime' => $addtime, 'reason' => '佣金' . createSign($rebates['rebate_id'], $rebates['supplier_id']) . '转帐:' . $rebates['payable_price'], 'supplier_money' => $rebates['payable_price'], 'doman' => '平台方:' . $_SESSION['user_name'], 'supplier_id' => $rebates['supplier_id']);
    $db->autoExecute($ecs->table('supplier_money_log'), $loginfo, 'INSERT');
    $db->query('update ' . $ecs->table('supplier') . " set supplier_money = supplier_money + " . $rebates['payable_price'] . " where supplier_id=" . $rebates['supplier_id']);
    //修改佣金信息状态记录
    $rebate_list = array('rebateid' => $rebate_id, 'username' => '平台方:' . $_SESSION['user_name'], 'type' => REBATE_LOG_LIST, 'typedec' => '平台方付款', 'contents' => '佣金状态由等待付款变结算完成', 'addtime' => gmtime());
    $db->autoExecute($ecs->table('supplier_rebate_log'), $rebate_list, 'INSERT');
    /* 清除缓存 */
    clear_cache_files();
    /* 提示信息 */
    $links[] = array('href' => 'supplier_rebate.php?act=list', 'text' => '返回本期佣金列表');
    sys_msg('恭喜,处理成功!', 0, $links);
} elseif ($_REQUEST['act'] == 'beizhu') {
예제 #24
0
 $cat['is_show'] = !empty($_POST['is_show']) ? intval($_POST['is_show']) : 0;
 $cat['grade'] = !empty($_POST['grade']) ? intval($_POST['grade']) : 0;
 $cat['filter_attr'] = !empty($_POST['filter_attr']) ? implode(',', array_unique($_POST['filter_attr'])) : 0;
 $cat['cat_recommend'] = !empty($_POST['cat_recommend']) ? $_POST['cat_recommend'] : array();
 if (cat_exists($cat['cat_name'], $cat['parent_id'])) {
     /* 同级别下不能有重复的分类名称 */
     $link[] = array('text' => $_LANG['go_back'], 'href' => 'javascript:history.back(-1)');
     sys_msg($_LANG['catname_exist'], 0, $link);
 }
 if ($cat['grade'] > 10 || $cat['grade'] < 0) {
     /* 价格区间数超过范围 */
     $link[] = array('text' => $_LANG['go_back'], 'href' => 'javascript:history.back(-1)');
     sys_msg($_LANG['grade_error'], 0, $link);
 }
 /*处理图片*/
 $img_name = basename($image->upload_image($_FILES['thumb'], 'catthumb'));
 if ($img_name) {
     $cat['thumb'] = $img_name;
 }
 /* 入库的操作 */
 if ($db->autoExecute($ecs->table('category'), $cat) !== false) {
     $cat_id = $db->insert_id();
     if ($cat['show_in_nav'] == 1) {
         $vieworder = $db->getOne("SELECT max(vieworder) FROM " . $ecs->table('nav') . " WHERE type = 'middle'");
         $vieworder += 2;
         //显示在自定义导航栏中
         $sql = "INSERT INTO " . $ecs->table('nav') . " (name,ctype,cid,ifshow,vieworder,opennew,url,type)" . " VALUES('" . $cat['cat_name'] . "', 'c', '" . $db->insert_id() . "','1','{$vieworder}','0', '" . build_uri('category', array('cid' => $cat_id), $cat['cat_name']) . "','middle')";
         $db->query($sql);
     }
     insert_cat_recommend($cat['cat_recommend'], $cat_id);
     admin_log($_POST['cat_name'], 'add', 'category');
예제 #25
0
    $smarty->assign('brand', array('sort_order' => 50, 'is_show' => 1));
    $smarty->display('brand_info.htm');
} elseif ($_REQUEST['act'] == 'insert') {
    /*检查品牌名是否重复*/
    admin_priv('brand_manage');
    $is_show = isset($_REQUEST['is_show']) ? intval($_REQUEST['is_show']) : 0;
    $is_only = $exc->is_only('brand_name', $_POST['brand_name']);
    if (!$is_only) {
        sys_msg(sprintf($_LANG['brandname_exist'], stripslashes($_POST['brand_name'])), 1);
    }
    /*对描述处理*/
    if (!empty($_POST['brand_desc'])) {
        $_POST['brand_desc'] = $_POST['brand_desc'];
    }
    /*处理图片*/
    $img_name = basename($image->upload_image($_FILES['brand_logo'], 'brandlogo'));
    /*处理URL*/
    $site_url = sanitize_url($_POST['site_url']);
    /*插入数据*/
    $sql = "INSERT INTO " . $ecs->table('brand') . "(brand_name, site_url, brand_desc, brand_logo, is_show, sort_order) " . "VALUES ('{$_POST['brand_name']}', '{$site_url}', '{$_POST['brand_desc']}', '{$img_name}', '{$is_show}', '{$_POST['sort_order']}')";
    $db->query($sql);
    admin_log($_POST['brand_name'], 'add', 'brand');
    /* 清除缓存 */
    clear_cache_files();
    $link[0]['text'] = $_LANG['continue_add'];
    $link[0]['href'] = 'brand.php?act=add';
    $link[1]['text'] = $_LANG['back_list'];
    $link[1]['href'] = 'brand.php?act=list';
    sys_msg($_LANG['brandadd_succed'], 0, $link);
} elseif ($_REQUEST['act'] == 'edit') {
    /* 权限判断 */
예제 #26
0
파일: new_ads.php 프로젝트: dlpc/ecshop
     $error = '图片不能为空';
 } elseif (empty($adArr['file'])) {
     $error = '使用页面不能为空';
 }
 if (isset($error)) {
     sys_msg($error, 0, $link);
 }
 $old_img = $db->getOne("SELECT img FROM " . $ecs->table('ad_new') . " WHERE ad_name = '{$adArr['ad_name']}'");
 if ($db->getOne("SELECT id FROM " . $ecs->table('ad_new') . " WHERE ad_name = '{$adArr['ad_name']}' AND id <> {$id} AND admin_agency_id = {$adArr['admin_agency_id']}")) {
     sys_msg('广告名称已存在', 0, $link);
 }
 if (isset($img['error']) && $img['error'] == 0) {
     $image = new cls_image($_CFG['bgcolor']);
     //实例化图片处理函数
     if ($image->check_img_type($img['type'])) {
         $img_name = $image->upload_image($img, '');
     }
     if (!$img_name) {
         sys_msg('上传图片失败', 1);
     }
     $adArr['img'] = $img_name;
     if (!$db->getOne("SELECT id FROM " . $ecs->table('ad_new') . " WHERE img ='{$old_img}' AND id<>{$id}")) {
         @unlink('../' . $old_img);
     }
 }
 if (!isset($adArr['img'])) {
     $adArr['img'] = $outer_img;
 }
 $db->autoExecute($ecs->table('ad_new'), $adArr, 'update', "id = {$id}");
 /* 记录管理员操作 */
 admin_log($_POST['ad_name'] . '(新广告)', 'edit', 'ads');
예제 #27
0
파일: friend_link.php 프로젝트: muqidi/PHP
    $smarty->assign('ur_here', $_LANG['add_link']);
    $smarty->assign('action_link', array('href' => 'friend_link.php?act=list', 'text' => $_LANG['list_link']));
    $smarty->assign('action', 'add');
    $smarty->assign('form_act', 'insert');
    assign_query_info();
    $smarty->display('link_info.htm');
} elseif ($_REQUEST['act'] == 'insert') {
    /* 变量初始化 */
    $link_logo = '';
    $show_order = !empty($_POST['show_order']) ? intval($_POST['show_order']) : 0;
    $link_name = !empty($_POST['link_name']) ? sub_str(trim($_POST['link_name']), 250, false) : '';
    /* 查看链接名称是否有重复 */
    if ($exc->num("link_name", $link_name) == 0) {
        /* 处理上传的LOGO图片 */
        if (isset($_FILES['link_img']['error']) && $_FILES['link_img']['error'] == 0 || !isset($_FILES['link_img']['error']) && isset($_FILES['link_img']['tmp_name']) && $_FILES['link_img']['tmp_name'] != 'none') {
            $img_up_info = @basename($image->upload_image($_FILES['link_img'], 'afficheimg'));
            $link_logo = DATA_DIR . '/afficheimg/' . $img_up_info;
        }
        /* 使用远程的LOGO图片 */
        if (!empty($_POST['url_logo'])) {
            if (strpos($_POST['url_logo'], 'http://') === false && strpos($_POST['url_logo'], 'https://') === false) {
                $link_logo = 'http://' . trim($_POST['url_logo']);
            } else {
                $link_logo = trim($_POST['url_logo']);
            }
        }
        /* 如果链接LOGO为空, LOGO为链接的名称 */
        if ((isset($_FILES['upfile_flash']['error']) && $_FILES['upfile_flash']['error'] > 0 || !isset($_FILES['upfile_flash']['error']) && isset($_FILES['upfile_flash']['tmp_name']) && $_FILES['upfile_flash']['tmp_name'] == 'none') && empty($_POST['url_logo'])) {
            $link_logo = '';
        }
        /* 如果友情链接的链接地址没有http://,补上 */
예제 #28
0
        if ($goods_id <= 0)
        {
            sys_msg($_LANG['error_goods_null']);
        }
        $info = goods_group_buy($goods_id);
        if ($info && $info['act_id'] != $group_buy_id)
        {
            sys_msg($_LANG['error_goods_exist']);
        }

        $goods_name = $db->getOne("SELECT goods_name FROM " . $ecs->table('goods') . " WHERE goods_id = '$goods_id'");

        $act_name = empty($_POST['act_name']) ? $goods_name : sub_str($_POST['act_name'], 0, 255, false);
		
		//新增团购图片
		$group_img ='data/group_img/'.basename($image->upload_image($_FILES['group_img'],'group_img'));
		$isg_new = intval($_POST['isg_new']);
		$isg_rs = intval($_POST['isg_rs']);
		$group_rs = intval($_POST['group_rs']);
		if ($group_rs=='')
		{
		   $group_rs = rand(123,500);
        }		
		//验证图片是否存在
		if ($group_buy_id > 0)
        {
			if($group_img=='data/group_img/')
			{
				$group_img=$db->getOne("SELECT group_img FROM " . $ecs->table('goods_activity') . " WHERE act_id = '$group_buy_id'");
				}
			else
예제 #29
0
파일: user.php 프로젝트: seanguo166/yinoos
function action_act_identity()
{
    // 获取全局变量
    $user = $GLOBALS['user'];
    $_CFG = $GLOBALS['_CFG'];
    $_LANG = $GLOBALS['_LANG'];
    $smarty = $GLOBALS['smarty'];
    $db = $GLOBALS['db'];
    $ecs = $GLOBALS['ecs'];
    $user_id = $_SESSION['user_id'];
    include_once ROOT_PATH . '/includes/cls_image.php';
    $image = new cls_image($_CFG['bgcolor']);
    $real_name = $_POST['real_name'];
    $card = $_POST['card'];
    $country = $_POST['country'];
    $province = $_POST['province'];
    $city = $_POST['city'];
    $district = $_POST['district'];
    $address = $_POST['address'];
    if (isset($_FILES['face_card']) && $_FILES['face_card']['tmp_name'] != '') {
        if ($_FILES['face_card']['width'] > 800) {
            show_message('图片宽度不能超过800像素!');
        }
        if ($_FILES['face_card']['height'] > 800) {
            show_message('图片高度不能超过800像素!');
        }
        $face_card = $image->upload_image($_FILES['face_card']);
        if ($face_card === false) {
            show_message($image->error_msg());
        }
    }
    if (isset($_FILES['back_card']) && $_FILES['back_card']['tmp_name'] != '') {
        if ($_FILES['back_card']['width'] > 800) {
            show_message('图片宽度不能超过800像素!');
        }
        if ($_FILES['back_card']['height'] > 800) {
            show_message('图片高度不能超过800像素!');
        }
        $back_card = $image->upload_image($_FILES['back_card']);
        if ($back_card === false) {
            show_message($image->error_msg());
        }
    }
    $sql = "select face_card,back_card from " . $GLOBALS['ecs']->table('users') . " where user_id = '" . $_SESSION['user_id'] . "'";
    $rows = $GLOBALS['db']->getRow($sql);
    if ($rows['face_card'] == '') {
        if ($face_card == '') {
            show_message('请上传身份证正面照!');
        }
    }
    if ($rows['back_card'] == '') {
        if ($back_card == '') {
            show_message('请上传身份证背面照!');
        }
    }
    $sql = 'update ' . $GLOBALS['ecs']->table('users') . " set real_name = '{$real_name}',card='{$card}',country='{$country}',province='{$province}',city='{$city}',district='{$district}',address='{$address}',status = '2'";
    if ($face_card != '') {
        $sql .= " ,face_card = '{$face_card}'";
    }
    if ($back_card != '') {
        $sql .= " ,back_card = '{$back_card}'";
    }
    $sql .= " where user_id = '" . $_SESSION['user_id'] . "'";
    $num = $GLOBALS['db']->query($sql);
    if ($num > 0) {
        show_message('您已申请实名认证,请等待管理员的审核!', '返回上一页', 'user.php?act=profile');
    } else {
        show_message('实名认证失败!', '返回上一页', 'user.php?act=profile');
    }
}
예제 #30
0
             sys_msg('无效的图片格式:' . $_FILES['tpic']['type'][$key], 1, $links);
         }
     }
 }
 foreach ($_FILES['tpic']['size'] as $key => $value) {
     if ($value) {
         if ($value / 1024 / 1024 > 4) {
             $links[] = array('text' => '返会套餐列表', 'href' => 'system_taocan.php?act=list');
             sys_msg('图片大于4M:' . $_FILES['tpic']['name'][$key], 1, $links);
         }
     }
 }
 foreach ($_FILES['tpic']['tmp_name'] as $key => $value) {
     if ($value) {
         $upload = array('name' => $_FILES['tpic']['name'][$key], 'type' => $_FILES['tpic']['type'][$key], 'tmp_name' => $_FILES['tpic']['tmp_name'][$key], 'size' => $_FILES['tpic']['size'][$key]);
         $newimgs = $image->upload_image($upload);
         // 原始图片
         $taocan['tpic'] = $newimgs;
     }
 }
 $db->autoExecute($ecs->table('system_taocan'), $taocan, 'UPDATE', 'id=' . $id);
 $ulist = $db->getAll("select  id from " . $ecs->table('system_tc_goods') . " where tcid=" . $id);
 $newulist = array();
 foreach ($ulist as $j => $u) {
     $newulist[$j] = $u['id'];
 }
 $db->query("update " . $ecs->table('user_taocan') . " set tprice=" . $taocan['tprice'] . "  where id in (select  tcid from " . $ecs->table('user_tc_goods') . " where sgid=" . $newulist[0] . ")");
 //$uglist  = $db->getAll("select  tcid from ".$ecs->table('user_tc_goods')." where tcid=".$id);
 // $db->query("delete from ".$ecs->table('system_tc_goods')." where tcid=".$id);
 //套餐商品
 for ($i = 0; $i < 7; $i++) {