Ejemplo n.º 1
0
     if ($pro_cat['cat_points'] > 0) {
         $points = $pro_cat['cat_points'] * $days;
         $user_points = get_user_points($_SESSION['uid']);
         if ($points > $user_points) {
             exit("-2");
         }
     }
 } elseif ($_CFG['operation_mode'] == '2') {
     $setmeal = get_setmeal_promotion($_SESSION['uid'], intval($_GET['promotionid']));
     //获取会员套餐
     $num = $setmeal['num'];
     if ($setmeal['endtime'] < time() && $setmeal['endtime'] != '0' || $num <= 0) {
         exit("-3");
     }
 }
 $info = get_promotion_one($jobsid, $_SESSION['uid'], $_GET['promotionid']);
 if (!empty($info)) {
     exit("-4");
     // showmsg("此职位正在推广中,请选择其他职位或其他方案",1);
 }
 $setsqlarr['cp_available'] = 1;
 $setsqlarr['cp_promotionid'] = intval($_GET['promotionid']);
 $setsqlarr['cp_uid'] = $_SESSION['uid'];
 $setsqlarr['cp_jobid'] = $jobsid;
 $setsqlarr['cp_days'] = $days;
 $setsqlarr['cp_starttime'] = time();
 $setsqlarr['cp_endtime'] = strtotime("{$days} day");
 $setsqlarr['cp_val'] = $_GET['val'];
 $setsqlarr['cp_hour_cn'] = trim($_GET['hour']);
 $setsqlarr['cp_hour'] = intval($_GET['hour']);
 if ($setsqlarr['cp_promotionid'] == "4" && empty($setsqlarr['cp_val'])) {
Ejemplo n.º 2
0
     exit("面试人数有误!");
 }
 if ($json["amount"] > $interview_money) {
     exit("面试金额有误!");
 }
 if ($json["success_num"] > $interview_success_num) {
     exit("招聘人数有误!");
 }
 if ($json["success_amount"] > $interview_success_money) {
     exit("招聘成功金额有误!");
 }
 $block_balance = $interview_num * $interview_money + $interview_success_num * $interview_success_money;
 if ($block_balance > $can_balance) {
     exit("余额不足!");
 }
 $info = get_promotion_one($jobid, $uid, $catid);
 if (!empty($info)) {
     exit("此职位正在推广中,请选择其他职位或其他方案");
 }
 $setsqlarr['cp_available'] = 1;
 $setsqlarr['cp_promotionid'] = $catid;
 $setsqlarr['cp_uid'] = $uid;
 $setsqlarr['cp_jobid'] = $jobid;
 $json = array();
 $json["num"] = $interview_num;
 $json["amount"] = $interview_money;
 $json["success_num"] = $interview_success_num;
 $json["success_amount"] = $interview_success_money;
 $json["block_balance"] = $block_balance;
 $setsqlarr['cp_json'] = json_encode($json);
 $db->inserttable(table('promotion'), $setsqlarr);
Ejemplo n.º 3
0
        $setsqlarr['cp_uid'] = $jobs['uid'];
        if ($db->inserttable(table('promotion'), $setsqlarr)) {
            $u = get_user($setsqlarr['cp_uid']);
            $promotion = get_promotion_cat_one($setsqlarr['cp_promotionid']);
            write_memberslog($u['uid'], 1, 3004, $u['username'], "管理员增加推广:{$promotion['cat_name']},职位ID:{$setsqlarr['cp_jobid']}");
            set_job_promotion($setsqlarr['cp_jobid'], $setsqlarr['cp_promotionid'], $setsqlarr['cp_val']);
            write_log("添加推广:{$promotion['cat_name']},职位ID:{$setsqlarr['cp_jobid']}", $_SESSION['admin_name'], 3);
            $link[0]['text'] = "返回列表";
            $link[0]['href'] = "?act=list";
            adminmsg("添加成功", 2, $link);
        }
    }
} elseif ($act == 'promotion_edit') {
    get_token();
    $id = intval($_GET['id']);
    $show = get_promotion_one($id);
    $jobs = get_jobs_one($show['cp_jobid']);
    $promotion = get_promotion_cat_one($show['cp_promotionid']);
    $smarty->assign('time', time());
    $smarty->assign('show', $show);
    $smarty->assign('jobs', $jobs);
    $smarty->assign('promotion', $promotion);
    $smarty->display('promotion/admin_promotion_edit.htm');
} elseif ($act == 'promotion_edit_save') {
    check_token();
    $setsqlarr['cp_id'] = intval($_POST['id']);
    $setsqlarr['cp_promotionid'] = intval($_POST['promotionid']);
    $setsqlarr['cp_hour_cn'] = trim($_POST['hour']);
    $setsqlarr['cp_hour'] = intval($_POST['hour']);
    $days = intval($_POST['days']);
    if ($setsqlarr['cp_promotionid'] == "4") {
Ejemplo n.º 4
0
                showmsg("推广成功!", 2, $link);
            } else {
                $link[0]['text'] = "返回企业推广";
                $link[0]['href'] = "?act=promotion&promotionid={$_POST['promotionid']}";
                $link[1]['text'] = "职位列表";
                $link[1]['href'] = "company_jobs.php?act=jobs";
                showmsg("保存成功!", 2, $link);
            }
        }
    } else {
        showmsg("参数错误", 0);
    }
} elseif ($act == 'promotion_edit') {
    $jobsid = intval($_GET['jobsid']);
    $promotionid = intval($_GET['promotionid']);
    $info = get_promotion_one($jobsid, $_SESSION['uid'], $promotionid);
    $promotion = get_promotion_category_one($info['cp_promotionid']);
    $smarty->assign('title', "{$promotion['cat_name']} - 企业推广 - 企业会员中心 - {$_CFG['site_name']}");
    $smarty->assign('promotion', $promotion);
    $smarty->assign('info', $info);
    $smarty->assign('jobs', get_jobs_one($jobsid, $_SESSION['uid']));
    $smarty->assign('user_points', get_user_points($_SESSION['uid']));
    $smarty->display('member_company/company_promotion_edit.htm');
} elseif ($act == 'promotion_edit_save') {
    $id = intval($_POST['id']);
    $promotionid = intval($_POST['promotionid']);
    $days = intval($_POST['days']);
    $jobid = intval($_POST['jobid']);
    $catinfo = get_promotion_category_one($promotionid);
    $points = $catinfo['cat_points'] * $days;
    $user_points = get_user_points($_SESSION['uid']);