コード例 #1
0
ファイル: company_info.php プロジェクト: winiceo/fenzhan
    }
    if ($n = del_company_news($id, $_SESSION['uid'])) {
        showmsg("删除成功!共删除 {$n} 行", 2);
    } else {
        showmsg("删除失败!", 0);
    }
} elseif ($act == 'company_img') {
    $link[0]['text'] = "完善企业资料";
    $link[0]['href'] = '?act=company_profile';
    $link[1]['text'] = "会员中心首页";
    $link[1]['href'] = 'company_index.php';
    if (empty($company_profile['companyname'])) {
        showmsg("请完善您的企业资料再上传企业图片!", 1, $link);
    }
    $smarty->assign('title', '企业图片 - 企业会员中心 - ' . $_CFG['site_name']);
    $smarty->assign('img', get_company_img(0, 8, $_SESSION['uid']));
    $smarty->display('member_company/company_img.htm');
} elseif ($act == 'company_img_save') {
    $n = $db->get_total("SELECT COUNT(*) AS num FROM " . table('company_img') . " WHERE uid='" . intval($_SESSION['uid']) . "'");
    if ($n >= 8) {
        exit("-7");
    }
    require_once QISHI_ROOT_PATH . 'include/upload.php';
    !$_FILES['img']['name'] ? exit('请上传图片!') : "";
    $datedir = date("Y/m/d/");
    $up_dir = "../../data/companyimg/original/" . $datedir;
    make_dir($up_dir);
    $setsqlarr['img'] = _asUpFiles($up_dir, "img", 800, 'gif/jpg/bmp/png/jpeg', true);
    if ($setsqlarr['img']) {
        // 新增打水印
        if (extension_loaded('gd')) {
コード例 #2
0
ファイル: admin_company.php プロジェクト: winiceo/job
    }
    $_GET['audit'] != "" ? $wheresqlarr['i.audit'] = intval($_GET['audit']) : '';
    if (is_array($wheresqlarr)) {
        $wheresql = wheresql($wheresqlarr);
    }
    if (!empty($_GET['settr'])) {
        $settr = strtotime("-" . intval($_GET['settr']) . " day");
        $wheresql = empty($wheresql) ? " WHERE i.addtime> " . $settr : $wheresql . " AND i.addtime> " . $settr;
    }
    $joinsql = " LEFT JOIN " . table('company_profile') . " AS c ON i.company_id=c.id  ";
    $total_sql = "SELECT COUNT(*) AS num FROM " . table('company_img') . " AS i" . $joinsql . $wheresql;
    $total_val = $db->get_total($total_sql);
    $page = new page(array('total' => $total_val, 'perpage' => $perpage, 'getarray' => $_GET));
    $currenpage = $page->nowindex;
    $offset = ($currenpage - 1) * $perpage;
    $clist = get_company_img($offset, $perpage, $joinsql . $wheresql . $oederbysql);
    $smarty->assign('pageheader', "企业图片");
    $smarty->assign('clist', $clist);
    $smarty->assign('page', $page->show(3));
    $smarty->display('company/admin_company_img.htm');
} elseif ($act == 'del_company_img') {
    check_permissions($_SESSION['admin_purview'], "img_del");
    check_token();
    $id = !empty($_REQUEST['id']) ? $_REQUEST['id'] : adminmsg("你没有选择图片!", 1);
    $num = del_company_img($id);
    if ($num > 0) {
        adminmsg("删除成功!共删除" . $num . "行", 2);
    } else {
        adminmsg("删除失败!", 0);
    }
} elseif ($act == 'edit_img_audit') {