本文整理汇总了PHP中_asUpFiles函数的典型用法代码示例。如果您正苦于以下问题:PHP _asUpFiles函数的具体用法?PHP _asUpFiles怎么用?PHP _asUpFiles使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_asUpFiles函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: trim
$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);
}
示例2: _asUpFiles
$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);
示例3: rand
$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/";
示例4: get_student_info
$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']) {
示例5: check_token
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) {
示例6: elseif
$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'];
示例7: dirname
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);
示例8: elseif
} 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
*/
示例9: COUNT
$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"])) {
示例10: elseif
} 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') {
示例11: array_map
$_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);
示例12: exit
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';
示例13: intval
$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
*/
示例14: intval
/**
* 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']))) {
示例15: showmsg
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']);