Ejemplo n.º 1
0
 $setarr["shop_brand"] = $_POST["shop_brand"] ? trim($_POST["shop_brand"]) : adminmsg("请输入品牌");
 $setarr["scategory"] = $_POST["scategory"] ? trim($_POST["scategory"]) : adminmsg("请选择所属分类");
 $scategory_arr = explode(",", $setarr["scategory"]);
 $setarr["category"] = $scategory_arr[0];
 $setarr["scategory"] = $scategory_arr[1];
 $setarr["category_cn"] = $scategory_arr[2];
 $setarr["shop_stock"] = $_POST["shop_stock"] ? intval($_POST["shop_stock"]) : adminmsg("请输入商品库存");
 $setarr["shop_customer"] = intval($_POST["shop_customer"]);
 $setarr["shop_points"] = $_POST["shop_points"] ? intval($_POST["shop_points"]) : adminmsg("请输入商品兑换所需积分");
 $setarr["content"] = $_POST["content"] ? trim($_POST["content"]) : adminmsg("请输入商品描述");
 $setarr["recommend"] = intval($_POST["recommend"]);
 if ($_FILES['shop_img']['name']) {
     require_once QISHI_ROOT_PATH . 'include/upload.php';
     $upfiles_dir = "../data/shop/" . date("Y/m/d/");
     make_dir($upfiles_dir);
     $shop_img = _asUpFiles($upfiles_dir, "shop_img", 1024 * 2, 'jpg/gif/png', true);
     $makefile = $upfiles_dir . $shop_img;
     $thumb_dir = "../data/shop/thumb/" . date("Y/m/d/");
     make_dir($thumb_dir);
     makethumb($makefile, $thumb_dir, 288, 288, 1);
     $setarr['shop_img'] = date("Y/m/d/") . $shop_img;
 }
 if ($id > 0) {
     write_log("后台修改商品信息", $_SESSION['admin_name'], 3);
     !$db->updatetable(table("shop_goods"), $setarr, array("id" => $id)) ? adminmsg("修改失败!") : adminmsg("修改成功!", 2);
 } else {
     $setarr['addtime'] = time();
     $setarr['shop_number'] = time() . rand(1000, 9999);
     write_log("后台添加商品信息", $_SESSION['admin_name'], 3);
     !$db->inserttable(table("shop_goods"), $setarr) ? adminmsg("添加失败!") : adminmsg("添加成功!", 2);
 }
Ejemplo n.º 2
0
            $setarr['img'] = _asUpFiles($eval_updir, "img", 1000, 'gif/jpg/bmp/png', true);
            if (empty($setarr['img'])) {
                adminmsg('上传文件失败!', 1);
            }
            $setarr['img'] = date("Y/m/d/") . $setarr['img'];
        }
        write_log("后台修改试卷信息", $_SESSION['admin_name'], 3);
        !$db->updatetable(table("evaluation_paper"), $setarr, array("id" => $id)) ? adminmsg("修改失败!") : adminmsg("修改成功!", 2);
    } else {
        //LOGO
        if (empty($_FILES['img']['name'])) {
            adminmsg('请上传图片!', 1);
        } else {
            $eval_updir = "../data/eval/img/" . date("Y/m/d/");
            make_dir($eval_updir);
            $setarr['img'] = _asUpFiles($eval_updir, "img", 1000, 'gif/jpg/bmp/png', true);
            if (empty($setarr['img'])) {
                adminmsg('上传文件失败!', 1);
            }
            $setarr['img'] = date("Y/m/d/") . $setarr['img'];
        }
        $link[0]['text'] = "返回列表";
        $link[0]['href'] = '?act=list';
        write_log("后台添加试卷信息", $_SESSION['admin_name'], 3);
        //更新试卷数  1=>加    2=>减
        set_paper_num('1', $setarr["type_id"], 1);
        !$db->inserttable(table("evaluation_paper"), $setarr) ? adminmsg("添加失败!") : adminmsg("添加成功!", 2, $link);
    }
} elseif ($act == "paper_del") {
    $id = !empty($_REQUEST['id']) ? $_REQUEST['id'] : adminmsg("你没有选择试卷!", 1);
    $num = del_paper($id);
Ejemplo n.º 3
0
    $smarty->assign('title', '个人头像 - 会员中心 - ' . $_CFG['site_name']);
    $smarty->assign('user', $user);
    $smarty->assign('rand', rand(1, 100));
    $smarty->display('member_personal/personal_avatars.htm');
} elseif ($act == 'avatars_ready') {
    require_once QISHI_ROOT_PATH . 'include/cut_upload.php';
    !$_FILES['avatars']['name'] ? showmsg('请上传图片!', 1) : "";
    $up_dir_original = "../../data/avatar/original/";
    $up_dir_100 = "../../data/avatar/100/";
    $up_dir_48 = "../../data/avatar/48/";
    $up_dir_thumb = "../../data/avatar/thumb/";
    make_dir($up_dir_original . date("Y/m/d/"));
    make_dir($up_dir_100 . date("Y/m/d/"));
    make_dir($up_dir_48 . date("Y/m/d/"));
    make_dir($up_dir_thumb . date("Y/m/d/"));
    $setsqlarr['avatars'] = _asUpFiles($up_dir_original . date("Y/m/d/"), "avatars", 500, 'gif/jpg/bmp/png', true);
    $setsqlarr['avatars'] = date("Y/m/d/") . $setsqlarr['avatars'];
    if ($setsqlarr['avatars']) {
        makethumb($up_dir_original . $setsqlarr['avatars'], $up_dir_thumb . date("Y/m/d/"), 445, 300);
        // makethumb($up_dir_original.$setsqlarr['avatars'],$up_dir_100.date("Y/m/d/"),100,100);
        // makethumb($up_dir_original.$setsqlarr['avatars'],$up_dir_48.date("Y/m/d/"),48,48);
        $wheresql = " uid='" . $_SESSION['uid'] . "'";
        write_memberslog($_SESSION['uid'], 2, 1006, $_SESSION['username'], "修改了个人头像");
        $db->updatetable(table('members'), $setsqlarr, $wheresql) ? exit($setsqlarr['avatars']) : showmsg('保存失败!', 1);
    } else {
        showmsg('保存失败!', 1);
    }
} elseif ($act == 'avatars_save') {
    $savePath = "../../data/avatar/100/";
    //图片存储路径
    $savePathThumb = "../../data/avatar/48/";
Ejemplo n.º 4
0
    $smarty->assign('title', '上传照片 - 会员中心 - ' . $_CFG['site_name']);
    $smarty->assign('user', get_student_info(intval($_SESSION['uid'])));
    $smarty->assign('rand', rand(1, 100));
    $smarty->display('member_personal/dasai_photo.htm');
} elseif ($act == 'photo_ready') {
    require_once QISHI_ROOT_PATH . 'include/cut_upload.php';
    !$_FILES['photo']['name'] ? showmsg('请上传图片!', 1) : "";
    $up_dir_original = "../../../dasai/photo/original/";
    $up_dir_166 = "../../../dasai/photo/166/";
    $up_dir_71 = "../../../dasai/photo/71/";
    $up_dir_thumb = "../../../dasai/photo/thumb/";
    make_dir($up_dir_original);
    make_dir($up_dir_166);
    make_dir($up_dir_71);
    make_dir($up_dir_thumb);
    $setsqlarr['photo'] = _asUpFiles($up_dir_original, "photo", 500, 'gif/jpg/bmp/png', true);
    $setsqlarr['photo'] = $setsqlarr['photo'];
    if ($setsqlarr['photo']) {
        makethumb($up_dir_original . $setsqlarr['photo'], $up_dir_thumb, 445, 300);
        $wheresql = " uid='" . $_SESSION['uid'] . "'";
        write_memberslog($_SESSION['uid'], 2, 1006, $_SESSION['username'], "修改了个人照片");
        updatetable(table('dasai_student'), $setsqlarr, $wheresql) ? exit($setsqlarr['photo']) : showmsg('保存失败!', 1);
    } else {
        showmsg('保存失败!', 1);
    }
} elseif ($act == 'photo_save') {
    require_once QISHI_ROOT_PATH . 'include/cut_upload.php';
    require_once QISHI_ROOT_PATH . 'include/imageresize.class.php';
    $imgresize = new ImageResize();
    $userinfomation = get_student_info($_SESSION['uid']);
    if ($userinfomation['photo']) {
Ejemplo n.º 5
0
    check_token();
    $has_weixin_scan_login_cache = $db->getone("select 1 from " . table('config') . " where name='weixin_scan_login'");
    if (!$has_weixin_scan_login_cache) {
        inserttable(table("config"), array("name" => "weixin_scan_login"));
    }
    require_once ADMIN_ROOT_PATH . 'include/upload.php';
    if ($_FILES['weixin_img']['name']) {
        $weixin_img = _asUpFiles($upfiles_dir, "weixin_img", 1024 * 2, 'jpg/gif/png', "weixin_img");
        !$db->query("UPDATE " . table('config') . " SET value='{$weixin_img}' WHERE name='weixin_img'") ? adminmsg('更新站点设置失败', 1) : "";
    }
    if ($_FILES['weixin_first_pic']['name']) {
        $weixin_first_pic = _asUpFiles($upfiles_dir, "weixin_first_pic", 1024 * 2, 'jpg/gif/png', "weixin_first_pic");
        !$db->query("UPDATE " . table('config') . " SET value='{$weixin_first_pic}' WHERE name='weixin_first_pic'") ? adminmsg('更新站点设置失败', 1) : "";
    }
    if ($_FILES['weixin_default_pic']['name']) {
        $weixin_default_pic = _asUpFiles($upfiles_dir, "weixin_default_pic", 1024 * 2, 'jpg/gif/png', "weixin_default_pic");
        !$db->query("UPDATE " . table('config') . " SET value='{$weixin_default_pic}' WHERE name='weixin_default_pic'") ? adminmsg('更新站点设置失败', 1) : "";
    }
    foreach ($_POST as $k => $v) {
        !$db->query("UPDATE " . table('config') . " SET value='{$v}' WHERE name='{$k}'") ? adminmsg('更新站点设置失败', 1) : "";
    }
    refresh_cache('config');
    adminmsg("保存成功!", 2);
} elseif ($act == 'set_menu') {
    get_token();
    $smarty->assign('navlabel', "set_menu");
    $smarty->assign('menu', get_weixin_menu());
    $smarty->display('weixin/admin_weixin_menu.htm');
} elseif ($act == 'menu_all_save') {
    check_token();
    if (is_array($_POST['save_id']) && count($_POST['save_id']) > 0) {
Ejemplo n.º 6
0
    $smarty->assign('navlabel', "add");
    $smarty->display('hrtools/admin_hrtools_add.htm');
} elseif ($act == 'addsave') {
    check_token();
    $setsqlarr['h_filename'] = !empty($_POST['h_filename']) ? trim($_POST['h_filename']) : adminmsg('文档名称不能为空!', 1);
    $setsqlarr['h_typeid'] = intval($_POST['h_typeid']) > 0 ? intval($_POST['h_typeid']) : adminmsg('请选择分类!', 1);
    $setsqlarr['h_color'] = trim($_POST['h_color']);
    $setsqlarr['h_strong'] = intval($_POST['h_strong']);
    $setsqlarr['h_order'] = intval($_POST['h_order']);
    if (empty($_FILES['upfile']['name']) && empty($_POST['url'])) {
        adminmsg('请上传文件或者填写文件路径!', 1);
    }
    if ($_FILES['upfile']['name']) {
        $hrtools_updir = $hrtools_updir . date("Y/m/");
        make_dir($hrtools_updir);
        $setsqlarr['h_fileurl'] = _asUpFiles($hrtools_updir, "upfile", 3000, 'doc/ppt/xls/rtf', true);
        if (empty($setsqlarr['h_fileurl'])) {
            adminmsg('上传文件失败!', 1);
        }
        $setsqlarr['h_fileurl'] = $hrtools_dir . date("Y/m/") . $setsqlarr['h_fileurl'];
    } else {
        $setsqlarr['h_fileurl'] = trim($_POST['url']);
    }
    $link[0]['text'] = "继续添加";
    $link[0]['href'] = "?act=add&h_typeid={$setsqlarr['h_typeid']}&h_typeid_cn={$_POST['h_typeid_cn']}";
    $link[1]['text'] = "返回列表";
    $link[1]['href'] = '?';
    !inserttable(table('hrtools'), $setsqlarr) ? adminmsg("添加失败!", 0) : adminmsg("添加成功!", 2, $link);
} elseif ($act == 'hrtools_del') {
    check_token();
    $id = $_REQUEST['id'];
Ejemplo n.º 7
0
require_once dirname(__FILE__) . '/include/admin_common.inc.php';
$act = !empty($_GET['act']) ? trim($_GET['act']) : 'set';
check_permissions($_SESSION['admin_purview'], "site_set");
$smarty->assign('pageheader', "网站配置");
if ($act == 'set') {
    get_token();
    $smarty->assign('rand', rand(1, 100));
    $smarty->assign('upfiles_dir', $upfiles_dir);
    $smarty->assign('config', get_cache('config'));
    $smarty->assign('navlabel', "set");
    $smarty->display('set/admin_set_config.htm');
} elseif ($act == 'site_setsave') {
    check_token();
    require_once ADMIN_ROOT_PATH . 'include/upload.php';
    if ($_FILES['web_logo']['name']) {
        $web_logo = _asUpFiles($upfiles_dir, "web_logo", 1024 * 2, 'jpg/gif/png', "logo");
        !$db->query("UPDATE " . table('config') . " SET value='{$web_logo}' WHERE name='web_logo'") ? adminmsg('更新站点设置失败', 1) : "";
    }
    foreach ($_POST as $k => $v) {
        !$db->query("UPDATE " . table('config') . " SET value='{$v}' WHERE name='{$k}'") ? adminmsg('更新站点设置失败', 1) : "";
    }
    refresh_cache('config');
    adminmsg("保存成功!", 2);
} elseif ($act == 'map') {
    get_token();
    $smarty->assign('config', $_CFG);
    $smarty->assign('navlabel', "map");
    $smarty->display('set/admin_set_map.htm');
} elseif ($act == 'agreement') {
    get_token();
    $smarty->assign('config', $_CFG);
Ejemplo n.º 8
0
} elseif ($act == 'photo') {
    if (empty($hunter_profile)) {
        showmsg('请先完善猎头基本资料!', 0);
    }
    $smarty->assign('title', '照片认证 - 猎头会员中心 - ' . $_CFG['site_name']);
    $smarty->assign('points', get_cache('points_rule'));
    $smarty->assign('hunter_profile', $hunter_profile);
    $smarty->display('member_hunter/hunter_photo.htm');
} elseif ($act == 'photo_save') {
    require_once QISHI_ROOT_PATH . 'include/upload.php';
    $setsqlarr['audit'] = 2;
    //添加默认审核中..
    !$_FILES['photo_img']['name'] ? showmsg('请上传照片!', 1) : "";
    $photo_dir = "../../data/hunter/" . date("Y/m/d/");
    make_dir($photo_dir);
    $setsqlarr['photo_img'] = _asUpFiles($photo_dir, "photo_img", $_CFG['resume_photo_max'], 'gif/jpg/bmp/png', true);
    if ($setsqlarr['photo_img']) {
        /*
        	3.5新增打水印start
        */
        if (extension_loaded('gd')) {
            include_once QISHI_ROOT_PATH . 'include/watermark.php';
            $font_dir = QISHI_ROOT_PATH . "data/contactimgfont/cn.ttc";
            if (file_exists($font_dir)) {
                $tpl = new watermark();
                $tpl->img($photo_dir . $setsqlarr['photo_img'], gbk_to_utf8($_CFG['site_name']), $font_dir, 15, 0);
            }
        }
        /*
        	3.5新增end
        */
Ejemplo n.º 9
0
    $perpage = 10;
    $total_sql = "SELECT COUNT(*) AS num FROM " . table('resume_upload') . "  {$wheresql} ";
    $total = $db->get_total($total_sql);
    $page = new page(array('total' => $total, 'perpage' => $perpage));
    $offset = ($page->nowindex - 1) * $perpage;
    $smarty->assign('act', $act);
    $smarty->assign('title', '批量上传简历 - 企业会员中心 - ' . $_CFG['site_name']);
    $smarty->display('member_company/company_upload.htm');
} elseif ($act == 'upload_save') {
    require_once QISHI_ROOT_PATH . 'include/upload.php';
    require_once QISHI_ROOT_PATH . 'genv/lib.php';
    require_once QISHI_ROOT_PATH . 'genv/func_resume_upload.php';
    !$_FILES['logo']['name'] ? showmsg('请上传文件!', 1) : "";
    $uplogo_dir = "../../data/xls/" . date("Y/m/d/");
    make_dir($uplogo_dir);
    $setsqlarr['path'] = _asUpFiles($uplogo_dir, "logo", 1024 * 5, 'xls', true);
    if ($setsqlarr['path']) {
        $setsqlarr['path'] = date("Y/m/d/") . $setsqlarr['path'];
        $setsqlarr['name'] =& $_FILES["logo"]["name"];
        $setsqlarr['uid'] = $_SESSION['uid'];
        $setsqlarr['addtime'] = time();
        if ($db->inserttable(table('resume_upload'), $setsqlarr, 1)) {
            $link[0]['text'] = "上传了简历";
            $link[0]['href'] = '?act=upload_list';
            write_memberslog($_SESSION['uid'], 1, 8003, $_SESSION['username'], "上传了简历");
            $path = QISHI_ROOT_PATH . "data/xls/" . $setsqlarr['path'];
            $excel = excel_upload($path);
            $data = $excel["data"];
            foreach ($data as $key => $value) {
                $data[$key]["color"] = "#ffffff";
                if (get_telephone($value["telephone"])) {
Ejemplo n.º 10
0
} elseif ($act == 'edit_save') {
    check_token();
    $s_id = intval($_POST['s_id']);
    $setsqlarr['s_sitename'] = !empty($_POST['s_sitename']) ? trim($_POST['s_sitename']) : adminmsg('请填写分站名称!', 1);
    $setsqlarr['s_effective'] = isset($_POST['s_effective']) ? intval($_POST['s_effective']) : 1;
    $setsqlarr['s_districtname'] = !empty($_POST['s_districtname']) ? trim($_POST['s_districtname']) : adminmsg('请填写地区名称!', 1);
    $setsqlarr['s_domain'] = !empty($_POST['s_domain']) ? trim($_POST['s_domain']) : adminmsg('请填写域名!', 1);
    $setsqlarr['s_m_domain'] = trim($_POST['s_m_domain']);
    $setsqlarr['s_tpl'] = !empty($_POST['s_tpl']) ? trim($_POST['s_tpl']) : '';
    $setsqlarr['s_order'] = intval($_POST['s_order']);
    $setsqlarr['s_index'] = getfirstchar($setsqlarr['s_sitename']);
    $setsqlarr['s_title'] = trim($_POST['s_title']);
    $setsqlarr['s_keywords'] = trim($_POST['s_keywords']);
    $setsqlarr['s_description'] = trim($_POST['s_description']);
    if ($_FILES['s_logo']['name']) {
        $setsqlarr['s_logo'] = _asUpFiles($upfiles_dir, "s_logo", 1024 * 2, 'jpg/gif/png', "logo" . md5($setsqlarr['s_domain']));
        if (empty($setsqlarr['s_logo'])) {
            adminmsg('上传图片出错!', 1);
        }
    }
    $link[0]['text'] = "查看修改结果";
    $link[0]['href'] = '?act=edit&id=' . $s_id;
    $link[1]['text'] = "返回分站管理";
    $link[1]['href'] = '?act=list';
    if (!$db->updatetable(table('subsite'), $setsqlarr, " s_id=" . $s_id . "")) {
        adminmsg("修改失败!", 0);
    } else {
        refresh_subsite_cache();
        adminmsg("修改成功!", 2, $link);
    }
} elseif ($act == 'subsite_del') {
Ejemplo n.º 11
0
Archivo: user.php Proyecto: winiceo/job
    $_POST = array_map("utf8_to_gbk", $_POST);
    $resume_id = intval($_POST["resume_id"]);
    $uid = intval($_SESSION["uid"]);
    $title = trim($_POST['title']) ? trim($_POST['title']) : exit("请输入简历名称");
    $sql = "update " . table("resume") . " set title='{$title}' where id={$resume_id} and uid={$uid} ";
    if ($db->query($sql)) {
        exit("ok");
    } else {
        exit("err");
    }
} elseif ($act == 'logo_save') {
    require_once QISHI_ROOT_PATH . 'include/upload.php';
    !$_FILES['logo_img']['name'] ? exit('请上传图片!') : "";
    $logo_dir = "../../data/photo/" . date("Y/m/d/");
    make_dir($logo_dir);
    $setsqlarr['photo_img'] = _asUpFiles($logo_dir, "logo_img", $_CFG['logo_max_size'], 'gif/jpg/bmp/png', true);
    if ($setsqlarr['photo_img']) {
        $setsqlarr['photo_img'] = date("Y/m/d/") . $setsqlarr['photo_img'];
        $setsqlarr['photo_audit'] = intval($_CFG['audit_resume_photo']);
        $setsqlarr['photo'] = 1;
        $pid = intval($_GET["pid"]);
        if ($pid <= 0) {
            exit("-8");
        }
        $wheresql = "uid='" . $_SESSION['uid'] . "' and id=" . $pid;
        if (!$db->updatetable(table('resume'), $setsqlarr, $wheresql)) {
            exit("-6");
        } else {
            $data['isok'] = 1;
            $json_encode = json_encode($data);
            exit($json_encode);
Ejemplo n.º 12
0
    if (intval($_REQUEST['pid']) == 0) {
        exit('参数错误!');
    }
    $resume_basic = get_resume_basic(intval($_SESSION['uid']), intval($_REQUEST['pid']));
    if (empty($resume_basic['photo_img'])) {
        $setsqlarr['photo_audit'] = $_CFG['audit_resume_photo'];
    } else {
        $_CFG['audit_edit_photo'] != "-1" ? $setsqlarr['photo_audit'] = intval($_CFG['audit_edit_photo']) : "";
    }
    $up_res_original = "../../data/photo/original/";
    $up_res_120 = "../../data/photo/120/";
    $up_res_thumb = "../../data/photo/thumb/";
    make_dir($up_res_original . date("Y/m/d/"));
    make_dir($up_res_120 . date("Y/m/d/"));
    make_dir($up_res_thumb . date("Y/m/d/"));
    $setsqlarr['photo_img'] = _asUpFiles($up_res_original . date("Y/m/d/"), "photo", $_CFG['resume_photo_max'], 'gif/jpg/bmp/png', true);
    $setsqlarr['photo_img'] = date("Y/m/d/") . $setsqlarr['photo_img'];
    if ($setsqlarr['photo_img']) {
        makethumb($up_res_original . $setsqlarr['photo_img'], $up_res_thumb . date("Y/m/d/"), 280, 350);
        !updatetable(table('resume'), $setsqlarr, " id='" . intval($_REQUEST['pid']) . "' AND uid='" . intval($_SESSION['uid']) . "'") ? exit("保存失败!") : '';
        exit($setsqlarr['photo_img']);
    } else {
        showmsg('保存失败!', 1);
    }
} elseif ($act == 'make2_photo_save') {
    $resume_basic = get_resume_basic(intval($_SESSION['uid']), intval($_REQUEST['pid']));
    if (empty($resume_basic)) {
        showmsg("请先填写简历基本信息!", 0);
    }
    require_once QISHI_ROOT_PATH . 'include/cut_upload.php';
    require_once QISHI_ROOT_PATH . 'include/imageresize.class.php';
Ejemplo n.º 13
0
    $favorites_num = $db->get_total($favorites);
    $favorites_num = intval($user_setmeal['talent_pool']) - intval($favorites_num);
    $smarty->assign('favorites_num', intval($favorites_num));
    $smarty->display("m/company/m-setmeal-margin.html");
} elseif ($act == "company_auth") {
    $company_profile = get_company($_SESSION['uid']);
    $smarty->assign('company_profile', $company_profile);
    $smarty->display("m/company/m-enterprise-authenticate.html");
} elseif ($act == "company_auth_save") {
    require_once QISHI_ROOT_PATH . 'include/upload.php';
    $setsqlarr['license'] = trim($_POST['license']);
    $setsqlarr['audit'] = 2;
    !$_FILES['certificate_img']['name'] ? exit('请上传图片!') : "";
    $certificate_dir = "../../data/" . $_CFG['updir_certificate'] . "/" . date("Y/m/d/");
    make_dir($certificate_dir);
    $setsqlarr['certificate_img'] = _asUpFiles($certificate_dir, "certificate_img", $_CFG['certificate_max_size'], 'gif/jpg/bmp/png', true);
    if ($setsqlarr['certificate_img']) {
        /*
        		3.5新增打水印start
        */
        if (extension_loaded('gd')) {
            include_once QISHI_ROOT_PATH . 'include/watermark.php';
            $font_dir = QISHI_ROOT_PATH . "data/contactimgfont/cn.ttc";
            if (file_exists($font_dir)) {
                $tpl = new watermark();
                $tpl->img($certificate_dir . $setsqlarr['certificate_img'], gbk_to_utf8($_CFG['site_name']), $font_dir, 15, 0);
            }
        }
        /*
        		3.5新增end
        */
Ejemplo n.º 14
0
    /**
     * 2014-01-26新增start
     */
    $setsqlarr['refresh_jobs_space'] = intval($_POST['refresh_jobs_space']);
    $setsqlarr['refresh_jobs_time'] = intval($_POST['refresh_jobs_time']);
    //2015-01-09薪资短信设置 set_sms
    $setsqlarr['set_sms'] = intval($_POST['set_sms']);
    /*
    新增上传套餐图标
    */
    if ($_FILES['setmeal_img']['name']) {
        require_once ADMIN_ROOT_PATH . 'include/upload.php';
        $dir = '../data/setmealimg/';
        $oldimg = $db->getone("select setmeal_img from " . table('setmeal') . " where id=" . intval($_POST['id']) . " ");
        @unlink($dir . $oldimg['setmeal_img']);
        $setsqlarr['setmeal_img'] = _asUpFiles($dir, "setmeal_img", 10, 'gif', $_POST['id']);
    }
    if ($db->updatetable(table('setmeal'), $setsqlarr, " id=" . intval($_POST['id']))) {
        //填写管理员日志
        write_log("后台成功修改套餐", $_SESSION['admin_name'], 3);
        $link[0]['text'] = "返回套餐设置";
        $link[0]['href'] = "?act=set_meal";
        adminmsg("设置成功!", 2, $link);
    } else {
        //填写管理员日志
        write_log("后台修改套餐失败", $_SESSION['admin_name'], 3);
        adminmsg("设置失败!", 0);
    }
} elseif ($act == 'set_meal_del') {
    check_token();
    if (del_setmeal_one(intval($_GET['id']))) {
Ejemplo n.º 15
0
        showmsg("请完善您的机构资料再上传机构图片!", 1, $link);
    }
    $smarty->assign('title', '机构图片 - 机构会员中心 - ' . $_CFG['site_name']);
    $smarty->assign('img', get_train_img(0, 60, $_SESSION['uid']));
    $smarty->display('member_train/train_img.htm');
} elseif ($act == 'train_img_save') {
    $n = $db->get_total("SELECT COUNT(*) AS num FROM " . table('train_img') . " WHERE uid='" . intval($_SESSION['uid']) . "'");
    if ($n >= 8) {
        showmsg('机构图片最多发布8张!', 1);
    }
    require_once QISHI_ROOT_PATH . 'include/upload.php';
    !$_FILES['img']['name'] ? showmsg('请上传图片!', 1) : "";
    $datedir = date("Y/m/d/");
    $up_dir = "../../data/train_img/original/" . $datedir;
    make_dir($up_dir);
    $setsqlarr['img'] = _asUpFiles($up_dir, "img", 800, 'gif/jpg/bmp/png', true);
    if ($setsqlarr['img']) {
        $img_src = $up_dir . $setsqlarr['img'];
        $thumb_dir = "../../data/train_img/thumb/" . $datedir;
        make_dir($thumb_dir);
        makethumb($img_src, $up_dir, 600, 600);
        makethumb($img_src, $thumb_dir, 295, 165);
        $setsqlarr['uid'] = intval($_SESSION['uid']);
        $setsqlarr['train_id'] = $train_profile['id'];
        $setsqlarr['addtime'] = time();
        $setsqlarr['title'] = trim($_POST['title']);
        $setsqlarr['img'] = $datedir . $setsqlarr['img'];
        if ($train_profile['audit'] == '1') {
            $setsqlarr['audit'] = intval($_CFG['audit_verifytrain_addimg']);
        } else {
            $setsqlarr['audit'] = intval($_CFG['audit_unexaminedtrain_addimg']);
Ejemplo n.º 16
0
    $smarty->assign('campus_img_dir', $campus_img_dir);
    $smarty->assign('campus_dir', $campus_dir);
    $smarty->assign('pageheader', "合作院校");
    $smarty->display('campus/admin_cooperate_campus_edit.htm');
} elseif ($act == 'edit_campus_save') {
    check_token();
    $id = intval($_POST['id']);
    $setsqlarr['campusname'] = trim($_POST['campusname']) ? trim($_POST['campusname']) : adminmsg('您没有填写院校名称!', 1);
    $setsqlarr['website'] = trim($_POST['website']) ? trim($_POST['website']) : adminmsg('您没有填写院校主页!', 1);
    $setsqlarr['address'] = trim($_POST['address']) ? trim($_POST['address']) : adminmsg('您没有填写院校地址!', 1);
    $setsqlarr['contents'] = trim($_POST['contents']) ? trim($_POST['contents']) : adminmsg('您没有填写院校简介!', 1);
    //LOGO
    if (!empty($_FILES['logo']['name'])) {
        $campus_updir = $campus_updir . date("Y/m/d/");
        make_dir($campus_updir);
        $setsqlarr['logo'] = _asUpFiles($campus_updir, "logo", 1000, 'gif/jpg/bmp/png', true);
        if (empty($setsqlarr['logo'])) {
            adminmsg('上传文件失败!', 1);
        }
        $setsqlarr['logo'] = date("Y/m/d/") . $setsqlarr['logo'];
    }
    //保存院校图片
    foreach ($_FILES['image']['name'] as $key => $value) {
        if (empty($value)) {
            continue;
        }
        $img_path = '';
        $name = explode('.', $value);
        //将文件名以'.'分割得到后缀名,得到一个数组
        $img_path = $campus_img_updir . date("Y/m/d/");
        make_dir($img_path);
Ejemplo n.º 17
0
    $setsqlarr['type_id'] = trim($_POST['type_id']) ? intval($_POST['type_id']) : 0;
    $setsqlarr['content'] = !empty($_POST['content']) ? tag_link($_POST['content']) : adminmsg('您没有内容!', 1);
    $setsqlarr['tit_color'] = trim($_POST['tit_color']);
    $setsqlarr['tit_b'] = intval($_POST['tit_b']);
    $setsqlarr['author'] = trim($_POST['author']);
    $setsqlarr['source'] = trim($_POST['source']);
    $setsqlarr['focos'] = intval($_POST['focos']);
    $setsqlarr['is_display'] = intval($_POST['is_display']);
    $setsqlarr['is_url'] = trim($_POST['is_url']);
    $setsqlarr['seo_keywords'] = $_POST['seo_keywords'];
    $setsqlarr['seo_description'] = $_POST['seo_description'];
    $setsqlarr['article_order'] = intval($_POST['article_order']);
    if ($_FILES['Small_img']['name']) {
        $upfiles_dir .= date("Y/m/d/");
        make_dir($upfiles_dir);
        $Small_img = _asUpFiles($upfiles_dir, "Small_img", 1024 * 2, 'jpg/gif/png', true);
        $makefile = $upfiles_dir . $Small_img;
        make_dir($thumb_dir . date("Y/m/d/"));
        makethumb($makefile, $thumb_dir . date("Y/m/d/"), $thumbwidth, $thumbheight);
        $setsqlarr['Small_img'] = date("Y/m/d/") . $Small_img;
    }
    $setsqlarr['parentid'] = get_article_parentid($setsqlarr['type_id']);
    $setsqlarr['subsite_id'] = intval($_POST['subsite_id']);
    $link[0]['text'] = "返回文章列表";
    $link[0]['href'] = '?act=newslist';
    $link[1]['text'] = "查看已修改文章";
    $link[1]['href'] = "?act=article_edit&id=" . $id;
    write_log("修改id为" . $id . "的文章信息", $_SESSION['admin_name'], 3);
    !$db->updatetable(table('article'), $setsqlarr, " id=" . $id . "") ? adminmsg("修改失败!", 0) : adminmsg("修改成功!", 2, $link);
} elseif ($act == 'del_img') {
    check_token();
Ejemplo n.º 18
0
    $smarty->assign('upfiles_dir', $upfiles_dir);
    $smarty->assign('link', get_links_one($id));
    $smarty->assign('cat', get_link_category());
    $smarty->assign('url', $_SERVER['HTTP_REFERER']);
    $smarty->display('link/admin_link_edit.htm');
} elseif ($act == 'editsave') {
    check_token();
    check_permissions($_SESSION['admin_purview'], "link_edit");
    $setsqlarr['link_name'] = $_POST['link_name'] ? trim($_POST['link_name']) : adminmsg('链接名称不能为空!', 1);
    $setsqlarr['link_url'] = $_POST['link_url'];
    $setsqlarr['alias'] = $_POST['alias'];
    $setsqlarr['show_order'] = intval($_POST['show_order']);
    $setsqlarr['display'] = intval($_POST['display']);
    $setsqlarr['Notes'] = trim($_POST['Notes']);
    if ($_FILES['logo']['name']) {
        $setsqlarr['link_logo'] = _asUpFiles($upfiles_dir, "logo", 1024 * 2, 'jpg/gif/png', true);
        if (empty($setsqlarr['link_logo'])) {
            adminmsg('上传图片出错!', 1);
        } else {
            $setsqlarr['link_logo'] = $files_dir . $setsqlarr['link_logo'];
        }
    } else {
        $setsqlarr['link_logo'] = trim($_POST['link_logo']);
    }
    $link[0]['text'] = "返回上一页";
    $link[0]['href'] = $_POST['url'];
    !updatetable(table('link'), $setsqlarr, " link_id =" . intval($_POST['id'])) ? adminmsg("修改失败!", 0) : adminmsg("修改成功!", 2, $link);
} elseif ($act == 'category') {
    get_token();
    check_permissions($_SESSION['admin_purview'], "link_category");
    $smarty->assign('link', get_link_category());
Ejemplo n.º 19
0
    $link[0]['href'] = '?act=company_profile';
    $link[1]['text'] = "会员中心首页";
    $link[1]['href'] = 'company_index.php';
    if (empty($company_profile['companyname'])) {
        showmsg("请完善您的企业资料再上传企业LOGO!", 1, $link);
    }
    $smarty->assign('title', '企业LOGO - 企业会员中心 - ' . $_CFG['site_name']);
    $smarty->assign('company_profile', $company_profile);
    $smarty->assign('rand', rand(1, 100));
    $smarty->display('member_company/company_logo.htm');
} elseif ($act == 'company_logo_save') {
    require_once QISHI_ROOT_PATH . 'include/upload.php';
    !$_FILES['logo']['name'] ? showmsg('请上传图片!', 1) : "";
    $uplogo_dir = "../../data/logo/" . date("Y/m/d/");
    make_dir($uplogo_dir);
    $setsqlarr['logo'] = _asUpFiles($uplogo_dir, "logo", $_CFG['logo_max_size'], 'gif/jpg/bmp/png', $_SESSION['uid']);
    if ($setsqlarr['logo']) {
        $setsqlarr['logo'] = date("Y/m/d/") . $setsqlarr['logo'];
        $logo_src = "../../data/logo/" . $setsqlarr['logo'];
        $thumb_dir = $uplogo_dir;
        makethumb($logo_src, $thumb_dir, 300, 110);
        //生成缩略图
        $wheresql = "uid='" . $_SESSION['uid'] . "'";
        if (updatetable(table('company_profile'), $setsqlarr, $wheresql)) {
            $link[0]['text'] = "查看LOGO";
            $link[0]['href'] = '?act=company_logo';
            write_memberslog($_SESSION['uid'], 1, 8003, $_SESSION['username'], "上传了企业LOGO");
            showmsg('上传成功!', 2, $link);
        } else {
            showmsg('保存失败!', 1);
        }
Ejemplo n.º 20
0
    $setarr['specialty'] = $specialty;
    perfect_resume($_SESSION['uid'], $_SESSION['username'], $pid, 1);
    $db->updatetable(table('resume'), $setarr, array("id" => $pid, "uid" => $uid)) ? exit("ok") : exit("保存失败");
} elseif ($act == "ajax_resume_img_save") {
    $uid = intval($_SESSION['uid']);
    $pid = $_GET['pid'] ? intval($_GET['pid']) : exit("简历ID丢失");
    $n = $db->get_total("SELECT COUNT(*) AS num FROM " . table('resume_img') . " WHERE uid={$uid} and resume_id={$pid} ");
    if ($n >= 4) {
        exit("-7");
    }
    require_once QISHI_ROOT_PATH . 'include/upload.php';
    !$_FILES['resume_img']['name'] ? exit('请上传图片!') : "";
    $datedir = date("Y/m/d/");
    $up_dir = "../../data/photo/" . $datedir;
    make_dir($up_dir);
    $setsqlarr['img'] = _asUpFiles($up_dir, "resume_img", 800, 'gif/jpg/bmp/png/jpeg', true);
    if ($setsqlarr['img']) {
        // 新增打水印
        if (extension_loaded('gd')) {
            include_once QISHI_ROOT_PATH . 'include/watermark.php';
            $font_dir = QISHI_ROOT_PATH . "data/contactimgfont/cn.ttc";
            if (file_exists($font_dir)) {
                $tpl = new watermark();
                $tpl->img($up_dir . $setsqlarr['img'], gbk_to_utf8($_CFG['site_name']), $font_dir, 13, 0);
            }
        }
        $img_src = $up_dir . $setsqlarr['resume_img'];
        makethumb($img_src, $up_dir, 600, 600);
        $setsqlarr['uid'] = $uid;
        $setsqlarr['resume_id'] = $pid;
        $setsqlarr['addtime'] = time();
Ejemplo n.º 21
0
                adminmsg('上传文件失败!', 1);
            }
            $setsqlarr['floating_path'] = $ads_dir . date("Y/m/d/") . $setsqlarr['floating_path'];
        } else {
            $setsqlarr['floating_path'] = trim($_POST['floating_path']);
        }
    } elseif ($setsqlarr['type_id'] == "6") {
        $setsqlarr['video_width'] = $_POST['video_width'] ? intval($_POST['video_width']) : adminmsg('您没有填写宽度!', 1);
        $setsqlarr['video_height'] = $_POST['video_height'] ? intval($_POST['video_height']) : adminmsg('您没有填写高度!', 1);
        if (empty($_FILES['video_file']['name']) && empty($_POST['video_path'])) {
            adminmsg('请上传文件或者填写路径!', 1);
        }
        if ($_FILES['video_file']['name']) {
            $ads_updir = $ads_updir . date("Y/m/d/");
            make_dir($ads_updir);
            $setsqlarr['video_path'] = _asUpFiles($ads_updir, "video_file", 5000, "swf/flv/f4v", true);
            if (empty($setsqlarr['video_path'])) {
                adminmsg('上传文件失败!', 1);
            }
            $setsqlarr['video_path'] = $ads_dir . date("Y/m/d/") . $setsqlarr['video_path'];
        } else {
            $setsqlarr['video_path'] = trim($_POST['video_path']);
        }
    }
    $setsqlarr['addtime'] = $timestamp;
    $link[0]['text'] = "返回列表";
    $link[0]['href'] = trim($_POST['url']);
    $wheresql = " id='" . intval($_POST['id']) . "' ";
    !updatetable(table('ad'), $setsqlarr, $wheresql) ? adminmsg("修改失败!", 0) : adminmsg("修改成功!", 2, $link);
} elseif ($act == 'del_ad') {
    $id = $_REQUEST['id'];
Ejemplo n.º 22
0
    $smarty->display('set/admin_set_config.htm');
} elseif ($act == 'site_setsave') {
    check_token();
    require_once ADMIN_ROOT_PATH . 'include/upload.php';
    if ($_FILES['web_logo']['name']) {
        $web_logo = _asUpFiles($upfiles_dir, "web_logo", 1024 * 2, 'jpg/gif/png', "logo");
        if (!$db->query("UPDATE " . table('config') . " SET value='{$web_logo}' WHERE name='web_logo'")) {
            //填写管理员日志
            write_log("后台设置网站LOGO失败", $_SESSION['admin_name'], 3);
            adminmsg('更新站点设置失败', 1);
        }
        //填写管理员日志
        write_log("后台成功设置网站LOGO", $_SESSION['admin_name'], 3);
    }
    if ($_FILES['body_bgimg']['name']) {
        $body_bgimg = _asUpFiles($upfiles_dir, "body_bgimg", 1024 * 2, 'jpg/gif/png', "body_bg_img");
        if (!$db->query("UPDATE " . table('config') . " SET value='{$body_bgimg}' WHERE name='body_bgimg'")) {
            //填写管理员日志
            write_log("后台设置网站背景失败", $_SESSION['admin_name'], 3);
            adminmsg('更新站点设置失败', 1);
        }
        //填写管理员日志
        write_log("后台成功设置网站背景", $_SESSION['admin_name'], 3);
    }
    if ($_POST['set_body_bgimg_defaule'] == 1) {
        @unlink($upfiles_dir . $_CFG["body_bgimg"]);
        if (!$db->query("UPDATE " . table('config') . " SET value='' WHERE name='body_bgimg'")) {
            //填写管理员日志
            write_log("后台设置网站默认背景失败", $_SESSION['admin_name'], 3);
            adminmsg('更新站点设置失败', 1);
        }
Ejemplo n.º 23
0
     $setsqlarr['starttime'] = intval(convert_datefm($_POST['starttime'], 2));
 }
 if ($_POST['deadline'] == "") {
     $setsqlarr['deadline'] = 0;
 } else {
     $setsqlarr['deadline'] = intval(convert_datefm($_POST['deadline'], 2));
 }
 //图片
 if ($setsqlarr['type_id'] == "2") {
     if (empty($_FILES['img_file']['name']) && empty($_POST['img_path'])) {
         adminmsg('请上传图片或者填写图片路径!', 1);
     }
     if ($_FILES['img_file']['name']) {
         $ads_updir = $ads_updir . date("Y/m/d/");
         make_dir($ads_updir);
         $setsqlarr['img_path'] = _asUpFiles($ads_updir, "img_file", 1000, 'gif/jpg/bmp/png', true);
         if (empty($setsqlarr['img_path'])) {
             adminmsg('上传文件失败!', 1);
         }
         $setsqlarr['img_path'] = $ads_dir . date("Y/m/d/") . $setsqlarr['img_path'];
     } else {
         $setsqlarr['img_path'] = trim($_POST['img_path']);
     }
     $setsqlarr['img_url'] = trim($_POST['img_url']);
     $setsqlarr['img_explain'] = trim($_POST['img_explain']);
     $setsqlarr['img_uid'] = intval($_POST['img_uid']);
 } else {
     adminmsg('广告类型错误!', 1);
 }
 $setsqlarr['addtime'] = $timestamp;
 $link[0]['text'] = "返回列表";
Ejemplo n.º 24
0
    $smarty->display('company/admin_consultant_edit.htm');
} elseif ($act == 'consultant_edit_save') {
    check_token();
    check_permissions($_SESSION['admin_purview'], "consultant_edit");
    $id = intval($_POST['id']);
    if (!$id) {
        adminmsg("请选择顾问!", 1);
    }
    $consultant = get_consultant_one($id);
    $setsqlarr['name'] = !empty($_POST['name']) ? trim($_POST['name']) : adminmsg('请填写姓名!', 1);
    $setsqlarr['qq'] = !empty($_POST['qq']) ? trim($_POST['qq']) : adminmsg('请填写QQ!', 1);
    if ($_FILES['pic']['name']) {
        $upload_image_dir = "../data/" . $_CFG['updir_images'] . "/" . date("Y/m/d/");
        make_dir($upload_image_dir);
        require_once dirname(__FILE__) . '/include/upload.php';
        $setsqlarr['pic'] = _asUpFiles($upload_image_dir, "pic", "2048", 'gif/jpg/bmp/png', true);
        $setsqlarr['pic'] = date("Y/m/d/") . $setsqlarr['pic'];
        @unlink("../data/" . $_CFG['updir_images'] . "/" . $consultant['pic']);
    }
    updatetable(table('consultant'), $setsqlarr, " id={$id} ");
    $link[0]['text'] = "返回列表";
    $link[0]['href'] = "?act=consultant";
    $link[1]['text'] = "查看修改结果";
    $link[1]['href'] = "?act=consultant_edit&id={$id}";
    adminmsg('修改成功!', 2, $link);
} elseif ($act == "consultant_del") {
    check_permissions($_SESSION['admin_purview'], "consultant_del");
    $id = intval($_GET['id']);
    if (!$id) {
        adminmsg("请选择顾问!", 1);
    }
Ejemplo n.º 25
0
    }
    $smarty->assign('act', $act);
    $smarty->assign('teachers', $teachers);
    $smarty->assign('pid', $pid);
    $smarty->assign('title', '讲师信息 - 培训会员中心 - ' . $_CFG['site_name']);
    $smarty->display('member_train/train_teacher_make2.htm');
} elseif ($act == 'make2_save') {
    !$_FILES['photo']['name'] ? showmsg('请上传图片!', 1) : "";
    require_once QISHI_ROOT_PATH . 'include/upload.php';
    if (intval($_REQUEST['pid']) == 0) {
        showmsg('参数错误!', 0);
    }
    $photo_dir = substr($_CFG['teacher_photo_dir'], strlen($_CFG['site_dir']));
    $photo_dir = "../../" . $photo_dir . date("Y/m/d/");
    make_dir($photo_dir);
    $setsqlarr['photo_img'] = _asUpFiles($photo_dir, "photo", '1000', 'gif/jpg/bmp/png', true);
    $setsqlarr['photo_img'] = date("Y/m/d/") . $setsqlarr['photo_img'];
    $setsqlarr['photo'] = 1;
    !$db->updatetable(table('train_teachers'), $setsqlarr, " id='" . intval($_REQUEST['pid']) . "' AND uid='" . intval($_SESSION['uid']) . "'") ? showmsg("保存失败!", 0) : '';
    header("Location: ?act=photo_cutting&pid=" . intval($_REQUEST['pid']));
} elseif ($act == 'photo_cutting') {
    $uid = intval($_SESSION['uid']);
    $pid = intval($_REQUEST['pid']);
    $link[0]['text'] = "填写讲师基本信息";
    $link[0]['href'] = '?act=add_teachers';
    $teachers = get_teachers_one($pid, $uid);
    if (empty($teachers)) {
        showmsg("请先填写讲师基本信息!", 1, $link);
    }
    if (empty($teachers['photo_img'])) {
        header('Location: ?act=make2&pid=' . $_REQUEST['pid']);