⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 post.inc.php

📁 UCH求职招聘插件。 1.个人简历发布(可设置简历状态隐私
💻 PHP
字号:
<?php
/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/

if ( !defined( "IN_UCHOME" ) )
{
		exit( "Access Denied" );
}
$id = empty( $_GET['id'] ) ? 0 : intval( $_GET['id'] );
$uid = $_SGLOBAL['supe_uid'];
if ( $_GET['op'] == "editwork" )
{
		$work = sqlforlist( "job_work", "id=".$id );
		$work = $work[0];
		$beginyears = $work['beginyear'];
		$beginmonth = $work['beginmonth'];
		$finishyear = $work['finishyear'];
		$finishmonth = $work['finishmonth'];
}
else if ( $_GET['op'] == "editstudy" )
{
		$study = sqlforlist( "job_study", "id=".$id );
		$study = $study[0];
		$beginyears = $study['beginyear'];
		$beginmonth = $study['beginmonth'];
		$finishyear = $study['finishyear'];
		$finishmonth = $study['finishmonth'];
}
else if ( $_GET['op'] == "workajax" )
{
		$list = sqlforlist( "job_work", "uid=".$_SGLOBAL['supe_uid']." ORDER BY beginyear DESC,beginmonth DESC" );
}
else if ( $_GET['op'] == "studyajax" )
{
		$study = sqlforlist( "job_study", "uid=".$_SGLOBAL['supe_uid']." ORDER BY beginyear DESC,beginmonth DESC" );
}
$beginyearhtml = "";
$nowy = sgmdate( "Y" );
$i = 0;
for ( ;	$i < 80;	++$i	)
{
		$they = $nowy - $i;
		$selectstr = $they == $beginyears ? " selected" : "";
		$beginyearhtml .= "<option value=\"".$they."\"{$selectstr}>{$they}</option>";
}
$beginmonthhtml = "";
$i = 1;
for ( ;	$i < 13;	++$i	)
{
		$selectstr = $i == $beginmonth ? " selected" : "";
		$beginmonthhtml .= "<option value=\"".$i."\"{$selectstr}>{$i}</option>";
}
$finishyearhtml = "";
$nowy = sgmdate( "Y" );
$i = 0;
for ( ;	$i < 80;	++$i	)
{
		$they = $nowy - $i;
		$selectstr = $they == $finishyear ? " selected" : "";
		$finishyearhtml .= "<option value=\"".$they."\"{$selectstr}>{$they}</option>";
}
$finishmonthhtml = "";
$i = 1;
for ( ;	$i < 13;	++$i	)
{
		$selectstr = $i == $finishmonth ? " selected" : "";
		$finishmonthhtml .= "<option value=\"".$i."\"{$selectstr}>{$i}</option>";
}
$companytypehtml = "";
foreach ( array( "无", "外资(欧美)", "外资(非欧美)", "合资(欧美)", "合资(非欧美)", "国企/上市公司", "民营/私营公司", "外企代表处", "其它性质" ) as $key => $value )
{
		$selectstr = $key == $work['companytype'] ? " selected" : "";
		$companytypehtml .= "<option value=\"".$key."\"{$selectstr}>{$value}</option>";
}
$edudegreehtml = "";
$edudegrees = array( "无", "小学", "初中", "高中", "中技", "中专", "大专", "本科", "硕士", "MBA", "博士", "其他" );
foreach ( $edudegrees as $key => $value )
{
		$selectstr = $key == $study['edudegree'] ? " selected" : "";
		$edudegreehtml .= "<option value=\"".$key."\"{$selectstr}>{$value}</option>";
}
if ( $_GET['op'] == "addcollect" )
{
		$collect = sqlforone( "collect", "job_collect", "jobid=".$id." AND cuid=".$uid );
		$collect = $collect[0];
}
else if ( $_GET['op'] == "addapply" )
{
		$apply = sqlforone( "apply", "job_collect", "jobid=".$id." AND cuid=".$uid );
		$apply = $apply[0];
		$ckjobs = !ckjobs( $id ) ? 0 : 1;
		$resumes = sqlforlist( "job_resumes", "uid=".$uid );
		$resumes = $resumes[0];
		$jobs = sqlforlist( "job_newjobs", "uid=".$uid." AND id=".$id );
		$jobs = $jobs[0];
}
if ( $_POST )
{
		foreach ( $GLOBALS['_POST'] as $key => $value )
		{
				$GLOBALS['_POST'][$key] = trim( $value );
		}
		if ( $_POST['do'] == "addwork" )
		{
				unset( $_POST['do'] );
				if ( $_POST['beginyear'] != "0" && $_POST['beginmonth'] != "0" && $_POST['companytype'] != "0" && !empty( $_POST['department'] ) || !empty( $_POST['company'] ) )
				{
						$GLOBALS['_POST']['industry'] = $_POST['workindustry'];
						$GLOBALS['_POST']['subindustry'] = $_POST['worksubindustry'];
						$GLOBALS['_POST']['position'] = $_POST['workposition'];
						$GLOBALS['_POST']['subposition'] = $_POST['worksubposition'];
						unset( $_POST['workindustry'] );
						unset( $_POST['worksubindustry'] );
						unset( $_POST['workposition'] );
						unset( $_POST['worksubposition'] );
						$id = inserttable( "job_work", $_POST, 1 );
				}
		}
		else if ( $_POST['do'] == "editwork" )
		{
				unset( $_POST['do'] );
				if ( $_POST['beginyear'] != "0" && $_POST['beginmonth'] != "0" && $_POST['companytype'] != "0" && !empty( $_POST['department'] ) || !empty( $_POST['company'] ) )
				{
						$GLOBALS['_POST']['industry'] = $_POST['workindustry'];
						$GLOBALS['_POST']['subindustry'] = $_POST['worksubindustry'];
						$GLOBALS['_POST']['position'] = $_POST['workposition'];
						$GLOBALS['_POST']['subposition'] = $_POST['worksubposition'];
						unset( $_POST['workindustry'] );
						unset( $_POST['worksubindustry'] );
						unset( $_POST['workposition'] );
						unset( $_POST['worksubposition'] );
						updatetable( "job_work", $_POST, array(
								"id" => $_POST['id']
						) );
				}
		}
		else if ( $_POST['do'] == "delwork" )
		{
				unset( $_POST['do'] );
				sqldel( "job_work", "id=".$_POST[id] );
		}
		else if ( $_POST['do'] == "addstudy" )
		{
				unset( $_POST['do'] );
				if ( $_POST['beginyear'] != "0" && $_POST['beginmonth'] != "0" && $_POST['edudegree'] != "0" && !empty( $_POST['school'] ) )
				{
						inserttable( "job_study", $_POST );
				}
		}
		else if ( $_POST['do'] == "editstudy" )
		{
				unset( $_POST['do'] );
				if ( $_POST['beginyear'] != "0" && $_POST['beginmonth'] != "0" && $_POST['edudegree'] != "0" && !empty( $_POST['school'] ) )
				{
						updatetable( "job_study", $_POST, array(
								"id" => $_POST['id']
						) );
				}
		}
		else if ( $_POST['do'] == "delstudy" )
		{
				unset( $_POST['do'] );
				sqldel( "job_study", "id=".$_POST['id'] );
		}
		else if ( $_POST['do'] == "addcollect" )
		{
				unset( $_POST['do'] );
				$GLOBALS['_POST']['dateline'] = $_SGLOBAL['timestamp'];
				$GLOBALS['_POST']['cuid'] = $uid;
				$GLOBALS['_POST']['collect'] = 1;
				$collect = sqlforlist( "job_collect", "jobid=".$_POST['jobid']." AND cuid=".$uid );
				$collect = $collect[0];
				$newjobs = sqlforlist( "job_newjobs", "id=".$_POST['jobid'] );
				$newjobs = $newjobs[0];
				$spaces = getspace( $collect['cuid'] );
				$GLOBALS['_POST']['corpid'] = $newjobs['corpid'];
				if ( empty( $collect ) )
				{
						inserttable( "job_collect", $_POST );
						$_SGLOBAL['db']->query( "UPDATE ".tname( "job_newjobs" )." SET num=num+1 WHERE id=".$_POST['jobid'] );
						include_once( S_ROOT."./source/function_cp.php" );
						$icon = "jobs";
						$title_template = "{actor} 收藏了一条招聘 <a href=\"job.php?ac=jobs&id=".$newjobs['id']."\"><b>".$newjobs['title']."</b></a> 的信息";
						feed_add( $icon, $title_template );
						$n_url = "job.php?ac=jobs&id=".$newjobs['id'];
						$note_type = "jobs";
						$note = "收藏了您发布的 <a href='".$n_url."' target='_blank'>{$newjobs['title']}</a> 的招聘";
						include_once( S_ROOT."./source/function_cp.php" );
						notification_add( $newjobs['uid'], $note_type, $note );
				}
				else if ( is_array( $collect ) && $collect['collect'] == "0" )
				{
						updatetable( "job_collect", array(
								"collect" => "1",
								"dateline" => $_POST['dateline']
						), array(
								"jobid" => $_POST['jobid'],
								"cuid" => $uid
						) );
						$_SGLOBAL['db']->query( "UPDATE ".tname( "job_newjobs" )." SET num=num+1 WHERE id=".$_POST['jobid'] );
						include_once( S_ROOT."./source/function_cp.php" );
						$icon = "jobs";
						$title_template = "{actor} 收藏了一条招聘 <a href=\"job.php?ac=jobs&id=".$newjobs['id']."\"><b>".$newjobs['title']."</b></a> 的信息";
						feed_add( $icon, $title_template );
						$n_url = "job.php?ac=jobs&id=".$newjobs['id'];
						$note_type = "jobs";
						$note = "收藏了您发布的 <a href='".$n_url."' target='_blank'>{$newjobs['title']}</a> 的招聘";
						include_once( S_ROOT."./source/function_cp.php" );
						notification_add( $newjobs['uid'], $note_type, $note );
				}
		}
		else if ( $_POST['do'] == "delcollect" )
		{
				unset( $_POST['do'] );
				$collect = sqlforlist( "job_collect", "cid=".$_POST['cid'] );
				$collect = $collect[0];
				if ( $collect['apply'] == "0" )
				{
						sqldel( "job_collect", "cid=".$_POST['cid'] );
						$_SGLOBAL['db']->query( "UPDATE ".tname( "job_newjobs" )." SET num=num-1 WHERE id=".$collect['jobid'] );
				}
				else if ( "0" < $collect['apply'] )
				{
						updatetable( "job_collect", array(
								"collect" => "0"
						), array(
								"cid" => $_POST['cid']
						) );
						$_SGLOBAL['db']->query( "UPDATE ".tname( "job_newjobs" )." SET num=num-1 WHERE id=".$collect['jobid'] );
				}
		}
		else if ( $_POST['do'] == "addapply" )
		{
				unset( $_POST['do'] );
				$GLOBALS['_POST']['dateline'] = $_SGLOBAL['timestamp'];
				$GLOBALS['_POST']['cuid'] = $uid;
				$GLOBALS['_POST']['apply'] = 1;
				$apply = sqlforlist( "job_collect", "jobid=".$_POST['jobid']." AND cuid=".$uid );
				$apply = $apply[0];
				$newjobs = sqlforlist( "job_newjobs", "id=".$_POST['jobid'] );
				$newjobs = $newjobs[0];
				$GLOBALS['_POST']['corpid'] = $newjobs['corpid'];
				if ( empty( $apply ) )
				{
						inserttable( "job_collect", $_POST );
						include_once( S_ROOT."./source/function_cp.php" );
						$icon = "jobs";
						$title_template = "{actor} 应聘了一份工作 <a href=\"job.php?ac=jobs&id=".$_POST['jobid']."\"><b>".$newjobs['title']."</b></a> ,正在等待面试通知";
						feed_add( $icon, $title_template );
						$n_url = "job.php?ac=jobresumes";
						$note_type = "jobs";
						$note = "应聘了您发布的 <a href='".$n_url."' target='_blank'>{$newjobs['title']}</a> 的工作";
						include_once( S_ROOT."./source/function_cp.php" );
						notification_add( $newjobs['uid'], $note_type, $note );
				}
				else if ( is_array( $apply ) && $apply['apply'] == "0" )
				{
						updatetable( "job_collect", array(
								"apply" => "1",
								"dateline" => $_POST['dateline']
						), array(
								"jobid" => $_POST['jobid'],
								"cuid" => $uid
						) );
						include_once( S_ROOT."./source/function_cp.php" );
						$icon = "jobs";
						$title_template = "{actor} 应聘了一份工作 <a href=\"job.php?ac=jobs&id=".$newjobs['id']."\"><b>".$newjobs['title']."</b></a> ,正在等待面试通知";
						feed_add( $icon, $title_template );
						$n_url = "job.php?ac=jobresumes";
						$note_type = "jobs";
						$note = "应聘了您发布的 <a href='".$n_url."' target='_blank'>{$newjobs['title']}</a> 的工作";
						include_once( S_ROOT."./source/function_cp.php" );
						notification_add( $newjobs['uid'], $note_type, $note );
				}
		}
		else if ( $_POST['do'] == "delapply" )
		{
				unset( $_POST['do'] );
				$apply = sqlforlist( "job_collect", "cid=".$_POST['cid'] );
				$apply = $apply[0];
				if ( $apply['collect'] == "0" )
				{
						sqldel( "job_collect", "cid=".$_POST['cid'] );
				}
				else if ( "0" < $apply['collect'] )
				{
						updatetable( "job_collect", array(
								"collect" => "0"
						), array(
								"cid" => $_POST['cid']
						) );
				}
		}
		else if ( $_POST['do'] == "applyok" )
		{
				unset( $_POST['do'] );
				$apply = sqlforlist( "job_collect", "cid=".$_POST['cid'] );
				$apply = $apply[0];
				$newjobs = sqlforlist( "job_newjobs", "id=".$apply['jobid'] );
				$newjobs = $newjobs[0];
				$GLOBALS['_POST']['dateline'] = $_SGLOBAL['timestamp'];
				updatetable( "job_collect", array(
						"apply" => "2",
						"dateline" => $_POST['dateline'],
						"applyinfo" => $_POST['applyinfo']
				), array(
						"cid" => $_POST['cid']
				) );
				$n_url = "job.php?ac=apply&classid=2";
				$note_type = "jobs";
				$note = "通知您请参加 <a href='".$n_url."' target='_blank'>{$newjobs['title']}</a> 的工作面试";
				include_once( S_ROOT."./source/function_cp.php" );
				notification_add( $apply['cuid'], $note_type, $note );
		}
		else if ( $_POST['do'] == "applyno" )
		{
				unset( $_POST['do'] );
				$apply = sqlforlist( "job_collect", "cid=".$_POST['cid'] );
				$apply = $apply[0];
				$newjobs = sqlforlist( "job_newjobs", "id=".$apply['jobid'] );
				$newjobs = $newjobs[0];
				$GLOBALS['_POST']['dateline'] = $_SGLOBAL['timestamp'];
				updatetable( "job_collect", array(
						"apply" => "3",
						"dateline" => $_POST['dateline'],
						"applyinfo" => $_POST['applyinfo']
				), array(
						"cid" => $_POST['cid']
				) );
				$n_url = "job.php?ac=apply&classid=3";
				$note_type = "jobs";
				$note = "拒绝了您应聘 <a href='".$n_url."' target='_blank'>{$newjobs['title']}</a> 工作的申请";
				include_once( S_ROOT."./source/function_cp.php" );
				notification_add( $apply['cuid'], $note_type, $note );
		}
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -