当前日期时间
当前时间:
网站标志
Logo
全站搜索
广告位
phpweb图片广告
广告位
phpweb图片广告
自定内容

phpweb已经是国内最强的的开源电子商务系统了,但并非完美,因为任何...

互联网3年一轮回,京东凡客等电商品牌在三年之前也不过是小打小闹,而如...

电商已经成为趋势,传统行业的竞争已经逐渐演变到网络上,也有不少用Weboss...

phpweb系统是固定的模式,适用于大部分行业与需求。但有一些行业还是有自己...

当前位置
文章正文

phpweb招聘模块job招聘人数达到招聘限额后自动转为停止招聘

发表:管理员  发表时间:2013-07-30 11:31:15   阅读:(1473)次  
phpweb job招聘模块,每个职位都有个招聘人数的限定!

当达到招聘人数的时候,职位自动转为 停止招聘!比如 华东区销售经理 职位招聘10人,当第十个人报名后, 此职位就会自动从职位列表中消失,这样避免了相同职位招聘人数过多问题!

修改代码 job post.php

$tsql -> query (“select jobname,pnums from pwn_job where id=’$jobid’”);
if ($tsql -> next_record ()) {
$jobname=$tsql->f(‘jobname’);
$pnums=$tsql->f(‘pnums’);

}
$tsql->query(“select count(id) from pwn_job_telent where jobid=’$jobid’”);
if($tsql->next_record()){
$topcount=$tsql->f(‘count(id)’);

}

$zong=(int)$topcount;
$shu=(int)$pnums;
echo “zong: “.$zong.” shu:”.$shu.” “.$zong>$shu-1;


if($zong>=$shu-1){

$tsql->query( “update pwn_job set jobstat=’0′ where id=’{$jobid}’ ” );
}

完整的post 文件代码为

<?php
define(“ROOTPATH”, “../”);
include(ROOTPATH.”includes/common.inc.php”);
include(“language/”.$sLan.”.php”);

$act = $_POST['act'];

switch($act){


//反馈表单提交
case “formsend”:

$REMOTE_ADDR=$_SERVER["REMOTE_ADDR"];
$jobid=htmlspecialchars($_POST["jobid"]);
$email=htmlspecialchars($_POST["email"]);
$title=htmlspecialchars($_POST["title"]);
$name=htmlspecialchars($_POST["name"]);
$sex=htmlspecialchars($_POST["sex"]);
$tel=htmlspecialchars($_POST["tel"]);
$address=htmlspecialchars($_POST["address"]);
$email=htmlspecialchars($_POST["email"]);
$url=htmlspecialchars($_POST["url"]);
$qq=htmlspecialchars($_POST["qq"]);
$company=htmlspecialchars($_POST["company"]);
$company_address=htmlspecialchars($_POST["company_address"]);
$zip=htmlspecialchars($_POST["zip"]);
$fax=htmlspecialchars($_POST["fax"]);
$products_id=htmlspecialchars($_POST["products_id"]);
$products_name=htmlspecialchars($_POST["products_name"]);
$products_num=htmlspecialchars($_POST["products_num"]);
$content=htmlspecialchars($_POST["content"]);
$custom1=htmlspecialchars($_POST["custom1"]);
$custom2=htmlspecialchars($_POST["custom2"]);
$custom3=htmlspecialchars($_POST["custom3"]);
$custom4=htmlspecialchars($_POST["custom4"]);
$custom5=htmlspecialchars($_POST["custom5"]);
$custom6=htmlspecialchars($_POST["custom6"]);
$custom7=htmlspecialchars($_POST["custom7"]);
$checkimgcode=htmlspecialchars($_POST["checkimgcode"]);
$ip=$_SERVER["REMOTE_ADDR"];

$fsql -> query (“select field_caption,field_name,field_null,value_repeat from pwn_job_form where use_field = ’1′ order by xuhao”);
while ($fsql -> next_record ()) {
$field_caption = $fsql -> f (‘field_caption’);
$field_name = $fsql -> f (‘field_name’);
$field_null = $fsql -> f (‘field_null’);
$value_repeat = $fsql -> f (‘value_repeat’);
$nowvalue=$_POST[$field_name];

if ($field_null == “1″ && (!isset ($nowvalue) || $nowvalue == “”)) {
echo $FormSendNTC1.$field_caption;
exit;
}


if ($value_repeat == “0″ && $nowvalue != “”) {
$tsql -> query (“select id from pwn_job_telent where ” . $field_name . “=’” . $nowvalue . “‘”);
if ($tsql -> next_record ()) {
echo $field_caption.$FormSendNTC2;
exit;
}
}
}

//图形验证码
if($checkimgcode!=”no”){
$ImgCode=$_POST["ImgCode"];

$Ic=$_COOKIE["CODEIMG"];
$Ic=strrev($Ic)+5*2-9;
$Ic=substr ($Ic,0,4);

if($ImgCode==”" || $Ic!=$ImgCode){
echo $strIcErr;
exit;
}
}

$nowtime = time ();

$tsql -> query (“select jobname,pnums from pwn_job where id=’$jobid’”);
if ($tsql -> next_record ()) {
$jobname=$tsql->f(‘jobname’);
$pnums=$tsql->f(‘pnums’);

}
$tsql->query(“select count(id) from pwn_job_telent where jobid=’$jobid’”);
if($tsql->next_record()){
$topcount=$tsql->f(‘count(id)’);

}

$zong=(int)$topcount;
$shu=(int)$pnums;
echo “zong: “.$zong.” shu:”.$shu.” “.$zong>$shu-1;


if($zong>=$shu-1){

$tsql->query( “update pwn_job set jobstat=’0′ where id=’{$jobid}’ ” );
}

$tsql -> query (“insert into pwn_job_telent set
`jobid`=’$jobid’,
`jobname`=’$jobname’,
`title`=’$title’,
`content`=’$content’,
`name`=’$name’,
`sex`=’$sex’,
`tel`=’$tel’,
`address`=’$address’,
`email`=’$email’,
`url`=’$url’,
`qq`=’$qq’,
`company`=’$company’,
`company_address`=’$company_address’,
`zip`=’$zip’,
`fax`=’$fax’,
`products_id`=’$products_id’,
`products_name`=’$products_name’,
`products_num`=’$products_num’,
`custom1`=’$custom1′,
`custom2`=’$custom2′,
`custom3`=’$custom3′,
`custom4`=’$custom4′,
`custom5`=’$custom5′,
`custom6`=’$custom6′,
`custom7`=’$custom7′,
`ip`=’$ip’,
`time`=’$nowtime’,
`uptime`=’$nowtime’,
`stat`=’0′,
`fav`=’0′
“);
echo “OK”;
exit;

break;

}
?>



脚注信息
© 2005-2015 草莓互联(100cm.cn) 广州同福信息科技有限公司 版权所有,并保留所有权利。

广州市东莞庄一横路116号 粤ICP备11046216号-7

经营性网站备案信息 广州网络警察报警平台 不良信息举报中心  百度信誉档案 广州工商红盾网 可信网站认证