- 09/30草莓互联2024年国庆假期...
- 09/15草莓互联2024年中秋节放...
- 08/10宝塔控制面板手动安装Ope...
- 06/07草莓互联2024年端午节放...
- 04/30草莓互联2024年五一劳动...
- 04/03草莓互联2024年清明放假...
- 03/24宝塔控制面板Nginx后端...
- 02/27宝塔面板python2.7升级...
- 02/19宝塔面板站点PCI DSS不合...
- 02/19宝塔面板站点站长工具中点亮HT...
- 02/14宝塔面板https协议无法获取...
- 02/11宝塔Windows面板下SQL...
- 02/02宝塔控制面板利用nginx实现...
- 09/18宝塔控制面板FTP增加Flas...
phpweb已经是国内最强的的开源电子商务系统了,但并非完美,因为任何...
互联网3年一轮回,京东凡客等电商品牌在三年之前也不过是小打小闹,而如...
电商已经成为趋势,传统行业的竞争已经逐渐演变到网络上,也有不少用Weboss...
phpweb系统是固定的模式,适用于大部分行业与需求。但有一些行业还是有自己...
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;
}
?>