代码拉取完成,页面将自动刷新
<?php
include_once('config/config.php');
if($_POST){
$action = $_POST['action'] ?? '';
$adminid = $_POST['adminid'] ?? '';
}
if(!$adminid){
fail('请先登录!');
}
switch($action)
{
case 'dep':
$sql_dep = "select * from `pre_department` order by `id` desc";
$dep_data = all($sql_dep);
if($dep_data)
{
success('请求部门数据成功!',$dep_data);
}else{
fail('请求部门数据失败!');
}
break;
case 'job':
$depid = $_POST['depid'] ?? 0;
$sql_job = "select * from `pre_job` where `depid` = '$depid'";
$job_data = all($sql_job);
if($job_data)
{
success('请求职位数据成功!',$job_data);
}else{
fail('请求职位数据失败!');
}
break;
case 'get_job_by_id':
$id = $_POST['id'] ?? 0;
$sql_job1 = "select * from `pre_job` where `id` = '$id'";
$job_data1 = find($sql_job1);
if($job_data1)
{
success('请求职位数据成功!',$job_data1);
}else{
fail('请求职位数据失败!');
}
break;
case 'get_person_by_id':
$id = $_POST['id'] ?? 0;
$sql_person = "select `p`.*,`r`.province as r1,`r`.city as r2, `r`.district as r3 from `pre_person` as `p` left join `pre_region` as `r` on `p`.id = '$id' and `r`.parentpath rlike `p`.district";
$person_data = find($sql_person);
if($person_data)
{
success('请求职位数据成功!',$person_data);
}else{
fail('请求职位数据失败!');
}
break;
case 'file':
$filename = ltrim($_POST['filename'], '/') ?? '';
$res = is_file($filename);
if($res){
success('指定文件存在',$filename);
}else{
fail('指定文件不存在',$filename);
}
}
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。