记录修改
This commit is contained in:
parent
3a4a7aa6f5
commit
6ebd299ef6
125
admin/lishi_out_school_member.php
Normal file
125
admin/lishi_out_school_member.php
Normal file
|
@ -0,0 +1,125 @@
|
||||||
|
<?php
|
||||||
|
// 页面ID
|
||||||
|
$menu_page = 5;
|
||||||
|
$header_num = 1;
|
||||||
|
// 载入组件
|
||||||
|
include($_SERVER['DOCUMENT_ROOT'].'/admin/module/head-check.php');
|
||||||
|
|
||||||
|
// 载入全部人用户个人信息
|
||||||
|
$member_all_url = $setting['API']['Domain'].'/out_school/quanbu_select.php?key='.$setting['Key'];
|
||||||
|
$member_all_ch = curl_init($member_all_url);
|
||||||
|
curl_setopt($member_all_ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
|
||||||
|
curl_setopt($member_all_ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
$member_all = curl_exec($member_all_ch);
|
||||||
|
$member_all = json_decode($member_all,true);
|
||||||
|
?>
|
||||||
|
<!doctype html>
|
||||||
|
<!--
|
||||||
|
哎呀,原来你看到了呀。
|
||||||
|
欢迎你~
|
||||||
|
如果你想看完整的代码你可以去我的GITHUB看代码,代码地址如下哦:
|
||||||
|
https://github.com/XiaoLFeng/wxxy_class
|
||||||
|
欢迎来201宿舍玩啊~
|
||||||
|
-->
|
||||||
|
<html lang="zh">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title><?PHP echo $normal['data']['web_title']['text']?> - <?PHP echo $normal['data']['web_subtitle']['text']?></title>
|
||||||
|
<link rel="shortcut icon" href="<?PHP echo $normal['data']['web_icon']['text']?>" type="image/x-icon">
|
||||||
|
<meta name="description" content="<?PHP echo $normal['data']['web_desc']['text']?>">
|
||||||
|
<!-- CSS -->
|
||||||
|
<link rel="stylesheet" href="<?PHP echo $mirror['data']['info']['bootstrap_css'] ?>">
|
||||||
|
<link rel="stylesheet" href="<?PHP echo $mirror['data']['info']['bootstrap_icon'] ?>">
|
||||||
|
<link rel="stylesheet" href="<?PHP echo $mirror['data']['info']['qweather'] ?>">
|
||||||
|
</head>
|
||||||
|
<body style="background-color:#e3f2fd;">
|
||||||
|
<!-- 菜单 -->
|
||||||
|
<header>
|
||||||
|
<?PHP include($_SERVER['DOCUMENT_ROOT'].'/admin/module/header.php') ?>
|
||||||
|
</header>
|
||||||
|
<!-- 内容 -->
|
||||||
|
<div id="loader" class="container placeholder-glow text-center py-4">
|
||||||
|
<div class="spinner-grow text-primary" role="status"><span class="visually-hidden">Loading...</span></div>
|
||||||
|
<div class="spinner-grow text-primary" role="status"><span class="visually-hidden">Loading...</span></div>
|
||||||
|
<div class="spinner-grow text-primary" role="status"><span class="visually-hidden">Loading...</span></div>
|
||||||
|
</div>
|
||||||
|
<div id="main" class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-bg-4 col-lg-3 mb-3">
|
||||||
|
<?PHP include('./module/menu.php'); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-bg-8 col-lg-9 mt-3 mb-3">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-lg-12 mb-4">
|
||||||
|
<div class="card shadow rounded-3 flex-grow-1 mb-3">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 fs-5 mb-3"><i class="bi bi-emoji-smile"></i> 目前(<?PHP echo date('Y-m-d')?>) 在校外学生</div>
|
||||||
|
<div class="col-12 px-4 mb-3">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">学生</th>
|
||||||
|
<th scope="col">出校时间</th>
|
||||||
|
<th scope="col">返校时间</th>
|
||||||
|
<th scope="col">类型</th>
|
||||||
|
<th scope="col">主要到达地方</th>
|
||||||
|
<th scope="col">出校原因</th>
|
||||||
|
<th scope="col">记录</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?PHP
|
||||||
|
$num = 1;
|
||||||
|
while ($member_all['data'][$num]['studentID'] != NULL) {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?PHP echo $member_all['data'][$num]['name'] ?></th>
|
||||||
|
<td><?PHP echo $member_all['data'][$num]['out_time'] ?></td>
|
||||||
|
<td><?PHP echo $member_all['data'][$num]['back_time'] ?></td>
|
||||||
|
<td><?PHP echo $member_all['data'][$num]['out_type'] ?></td>
|
||||||
|
<td><?PHP echo $member_all['data'][$num]['out_place'] ?></td>
|
||||||
|
<td><?PHP echo $member_all['data'][$num]['out_reason'] ?></td>
|
||||||
|
<td><?PHP
|
||||||
|
if ($member_all['data'][$num]['back_time'] != NULL) {
|
||||||
|
echo '<span class="badge bg-success">已返校</span>';
|
||||||
|
} elseif ($member_all['data'][$num]['back_time'] == NULL) {
|
||||||
|
echo '<span class="badge bg-danger">未返校</span>';
|
||||||
|
} else {
|
||||||
|
echo '<span class="badge bg-secondary">未知记录</span>';
|
||||||
|
}
|
||||||
|
?></td>
|
||||||
|
</tr>
|
||||||
|
<?PHP
|
||||||
|
$num ++;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 页尾 -->
|
||||||
|
<?PHP include($_SERVER['DOCUMENT_ROOT'].'/module/footer.php') ?>
|
||||||
|
</body>
|
||||||
|
<!-- JavaScript -->
|
||||||
|
<script src="<?PHP echo $mirror['data']['info']['qweather'] ?>"></script>
|
||||||
|
<script src="<?PHP echo $mirror['data']['info']['bootstrap_bundle_js'] ?>"></script>
|
||||||
|
<script src="<?PHP echo $mirror['data']['info']['jquery'] ?>"></script>
|
||||||
|
<script>
|
||||||
|
// 加载内容
|
||||||
|
$("#main").hide();
|
||||||
|
window.onload=function(){
|
||||||
|
$("#loader").fadeOut(200);
|
||||||
|
$("#main").show(500);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</html>
|
|
@ -18,6 +18,12 @@ function menu_color($menu_num) {
|
||||||
<div class="col-12 my-2 px-4">
|
<div class="col-12 my-2 px-4">
|
||||||
<a href="/admin/" class="text-decoration-none d-flex <?PHP menu_color(2) ?>"><i class="bi bi-person"></i> 用户管理</a>
|
<a href="/admin/" class="text-decoration-none d-flex <?PHP menu_color(2) ?>"><i class="bi bi-person"></i> 用户管理</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-12 my-2 px-4">
|
||||||
|
<a href="/admin/out_school_member.php" class="text-decoration-none d-flex <?PHP menu_color(4) ?>"><i class="bi bi-person"></i> 进出校管理</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 my-2 px-4">
|
||||||
|
<a href="/admin/lishi_out_school_member.php" class="text-decoration-none d-flex <?PHP menu_color(5) ?>"><i class="bi bi-person"></i> 历史出校记录</a>
|
||||||
|
</div>
|
||||||
<div class="col-12 my-2 px-4">
|
<div class="col-12 my-2 px-4">
|
||||||
<a href="/admin/class_book.php" class="text-decoration-none d-flex <?PHP menu_color(3) ?>"><i class="bi bi-book"></i> 作业管理</a>
|
<a href="/admin/class_book.php" class="text-decoration-none d-flex <?PHP menu_color(3) ?>"><i class="bi bi-book"></i> 作业管理</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
156
admin/out_school_member.php
Normal file
156
admin/out_school_member.php
Normal file
|
@ -0,0 +1,156 @@
|
||||||
|
<?php
|
||||||
|
// 页面ID
|
||||||
|
$menu_page = 4;
|
||||||
|
$header_num = 1;
|
||||||
|
// 载入组件
|
||||||
|
include($_SERVER['DOCUMENT_ROOT'].'/admin/module/head-check.php');
|
||||||
|
|
||||||
|
// 载入全部人用户个人信息
|
||||||
|
$member_all_url = $setting['API']['Domain'].'/out_school/all_select.php?key='.$setting['Key'];
|
||||||
|
$member_all_ch = curl_init($member_all_url);
|
||||||
|
curl_setopt($member_all_ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
|
||||||
|
curl_setopt($member_all_ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
$member_all = curl_exec($member_all_ch);
|
||||||
|
$member_all = json_decode($member_all,true);
|
||||||
|
?>
|
||||||
|
<!doctype html>
|
||||||
|
<!--
|
||||||
|
哎呀,原来你看到了呀。
|
||||||
|
欢迎你~
|
||||||
|
如果你想看完整的代码你可以去我的GITHUB看代码,代码地址如下哦:
|
||||||
|
https://github.com/XiaoLFeng/wxxy_class
|
||||||
|
欢迎来201宿舍玩啊~
|
||||||
|
-->
|
||||||
|
<html lang="zh">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title><?PHP echo $normal['data']['web_title']['text']?> - <?PHP echo $normal['data']['web_subtitle']['text']?></title>
|
||||||
|
<link rel="shortcut icon" href="<?PHP echo $normal['data']['web_icon']['text']?>" type="image/x-icon">
|
||||||
|
<meta name="description" content="<?PHP echo $normal['data']['web_desc']['text']?>">
|
||||||
|
<!-- CSS -->
|
||||||
|
<link rel="stylesheet" href="<?PHP echo $mirror['data']['info']['bootstrap_css'] ?>">
|
||||||
|
<link rel="stylesheet" href="<?PHP echo $mirror['data']['info']['bootstrap_icon'] ?>">
|
||||||
|
<link rel="stylesheet" href="<?PHP echo $mirror['data']['info']['qweather'] ?>">
|
||||||
|
</head>
|
||||||
|
<body style="background-color:#e3f2fd;">
|
||||||
|
<!-- 菜单 -->
|
||||||
|
<header>
|
||||||
|
<?PHP include($_SERVER['DOCUMENT_ROOT'].'/admin/module/header.php') ?>
|
||||||
|
</header>
|
||||||
|
<!-- 内容 -->
|
||||||
|
<div id="loader" class="container placeholder-glow text-center py-4">
|
||||||
|
<div class="spinner-grow text-primary" role="status"><span class="visually-hidden">Loading...</span></div>
|
||||||
|
<div class="spinner-grow text-primary" role="status"><span class="visually-hidden">Loading...</span></div>
|
||||||
|
<div class="spinner-grow text-primary" role="status"><span class="visually-hidden">Loading...</span></div>
|
||||||
|
</div>
|
||||||
|
<div id="main" class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-bg-4 col-lg-3 mb-3">
|
||||||
|
<?PHP include('./module/menu.php'); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-bg-8 col-lg-9 mt-3 mb-3">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-lg-12 mb-4">
|
||||||
|
<div class="card shadow rounded-3 flex-grow-1 mb-3">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 fs-5 mb-3"><i class="bi bi-emoji-smile"></i> 目前(<?PHP echo date('Y-m-d')?>) 在校外学生</div>
|
||||||
|
<div class="col-12 px-4 mb-3">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">学生</th>
|
||||||
|
<th scope="col">出校时间</th>
|
||||||
|
<th scope="col">类型</th>
|
||||||
|
<th scope="col">主要到达地方</th>
|
||||||
|
<th scope="col">出校原因</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?PHP
|
||||||
|
$num = 1;
|
||||||
|
while ($member_all['data'][$num]['studentID'] != NULL) {
|
||||||
|
if ($member_all['data'][$num]['back_time'] == NULL) {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?PHP echo $member_all['data'][$num]['name'] ?></th>
|
||||||
|
<td><?PHP echo $member_all['data'][$num]['out_time'] ?></td>
|
||||||
|
<td><?PHP echo $member_all['data'][$num]['out_type'] ?></td>
|
||||||
|
<td><?PHP echo $member_all['data'][$num]['out_place'] ?></td>
|
||||||
|
<td><?PHP echo $member_all['data'][$num]['out_reason'] ?></td>
|
||||||
|
</tr>
|
||||||
|
<?PHP
|
||||||
|
}
|
||||||
|
$num ++;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card shadow rounded-3 flex-grow-1">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 fs-5 mb-3"><i class="bi bi-emoji-smile"></i> 目前(<?PHP echo date('Y-m-d')?>) 已返校学生</div>
|
||||||
|
<div class="col-12 px-4 mb-3">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">学生</th>
|
||||||
|
<th scope="col">出校时间</th>
|
||||||
|
<th scope="col">返校时间</th>
|
||||||
|
<th scope="col">类型</th>
|
||||||
|
<th scope="col">主要到达地方</th>
|
||||||
|
<th scope="col">出校原因</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?PHP
|
||||||
|
$num = 1;
|
||||||
|
while ($member_all['data'][$num]['studentID'] != NULL) {
|
||||||
|
if ($member_all['data'][$num]['back_time'] != NULL) {
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row"><?PHP echo $member_all['data'][$num]['name'] ?></th>
|
||||||
|
<td><?PHP echo $member_all['data'][$num]['out_time'] ?></td>
|
||||||
|
<td><?PHP echo $member_all['data'][$num]['back_time'] ?></td>
|
||||||
|
<td><?PHP echo $member_all['data'][$num]['out_type'] ?></td>
|
||||||
|
<td><?PHP echo $member_all['data'][$num]['out_place'] ?></td>
|
||||||
|
<td><?PHP echo $member_all['data'][$num]['out_reason'] ?></td>
|
||||||
|
</tr>
|
||||||
|
<?PHP
|
||||||
|
}
|
||||||
|
$num ++;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 页尾 -->
|
||||||
|
<?PHP include($_SERVER['DOCUMENT_ROOT'].'/module/footer.php') ?>
|
||||||
|
</body>
|
||||||
|
<!-- JavaScript -->
|
||||||
|
<script src="<?PHP echo $mirror['data']['info']['qweather'] ?>"></script>
|
||||||
|
<script src="<?PHP echo $mirror['data']['info']['bootstrap_bundle_js'] ?>"></script>
|
||||||
|
<script src="<?PHP echo $mirror['data']['info']['jquery'] ?>"></script>
|
||||||
|
<script>
|
||||||
|
// 加载内容
|
||||||
|
$("#main").hide();
|
||||||
|
window.onload=function(){
|
||||||
|
$("#loader").fadeOut(200);
|
||||||
|
$("#main").show(500);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</html>
|
49
api/out_school/all_select.php
Normal file
49
api/out_school/all_select.php
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
<?PHP
|
||||||
|
/*
|
||||||
|
* wxxy_class 项目组
|
||||||
|
* 代码均开源
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 载入头
|
||||||
|
include($_SERVER['DOCUMENT_ROOT'].'/api/header-control.php');
|
||||||
|
|
||||||
|
// 载入组件
|
||||||
|
$key = htmlspecialchars($_GET['key']);
|
||||||
|
$studentID = htmlspecialchars($_GET['studentID']);
|
||||||
|
|
||||||
|
// 构建函数
|
||||||
|
if ($key == $setting['Key']) {
|
||||||
|
$result_outschool_select = mysqli_query($conn,"SELECT * FROM ".$setting['SQL_DATA']['out_school']." a LEFT JOIN ".$setting['SQL_DATA']['info']." b ON a.studentID=b.studentID WHERE out_time LIKE '%".date('Y-m-d')."%'");
|
||||||
|
$num = 1;
|
||||||
|
while ($result_outschool_select_object = mysqli_fetch_object($result_outschool_select)) {
|
||||||
|
$array[$num] = array(
|
||||||
|
'studentID'=>$result_outschool_select_object->studentID,
|
||||||
|
'name'=>$result_outschool_select_object->name,
|
||||||
|
'out_time'=>$result_outschool_select_object->out_time,
|
||||||
|
'back_time'=>$result_outschool_select_object->back_ttime,
|
||||||
|
'out_type'=>$result_outschool_select_object->out_type,
|
||||||
|
'out_place'=>$result_outschool_select_object->out_place,
|
||||||
|
'out_reason'=>$result_outschool_select_object->out_reason,
|
||||||
|
);
|
||||||
|
$num ++;
|
||||||
|
}
|
||||||
|
// 编译数据
|
||||||
|
$data = array(
|
||||||
|
'output'=>'SUCCESS',
|
||||||
|
'code'=>200,
|
||||||
|
'info'=>'数据输出成功',
|
||||||
|
'data'=>$array,
|
||||||
|
);
|
||||||
|
// 输出数据
|
||||||
|
echo json_encode($data,JSON_UNESCAPED_UNICODE);
|
||||||
|
} else {
|
||||||
|
// 编译数据
|
||||||
|
$data = array(
|
||||||
|
'output'=>'KEY_ERROR',
|
||||||
|
'code'=>403,
|
||||||
|
'info'=>'密钥错误'
|
||||||
|
);
|
||||||
|
// 输出数据
|
||||||
|
echo json_encode($data,JSON_UNESCAPED_UNICODE);
|
||||||
|
header("HTTP/1.1 403 Forbidden");
|
||||||
|
}
|
51
api/out_school/in.php
Normal file
51
api/out_school/in.php
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
<?PHP
|
||||||
|
/*
|
||||||
|
* wxxy_class 项目组
|
||||||
|
* 代码均开源
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 载入头
|
||||||
|
include($_SERVER['DOCUMENT_ROOT'].'/api/header-control.php');
|
||||||
|
|
||||||
|
// 载入组件
|
||||||
|
$key = htmlspecialchars($_GET['key']);
|
||||||
|
$studentID = htmlspecialchars($_GET['studentID']);
|
||||||
|
|
||||||
|
// 构建函数
|
||||||
|
if ($key == $setting['Key']) {
|
||||||
|
mysqli_query($conn,"LOCK TABLE ".$setting['SQL_DATA']['out_school']." WRITE");
|
||||||
|
$result_outschool_select = mysqli_query($conn,"SELECT * FROM ".$setting['SQL_DATA']['out_school']." WHERE studentID=$studentID ORDER BY out_time DESC");
|
||||||
|
$result_outschool_select_object = mysqli_fetch_object($result_outschool_select);
|
||||||
|
|
||||||
|
if (mysqli_query($conn,"UPDATE ".$setting['SQL_DATA']['out_school']." SET back_ttime='".date('Y-m-d H:i:s')."' WHERE id='".$result_outschool_select_object->id."'")) {
|
||||||
|
// 编译数据
|
||||||
|
$data = array(
|
||||||
|
'output'=>'SUCCESS',
|
||||||
|
'code'=>200,
|
||||||
|
'info'=>'已登记返校'
|
||||||
|
);
|
||||||
|
// 输出数据
|
||||||
|
echo json_encode($data,JSON_UNESCAPED_UNICODE);
|
||||||
|
} else {
|
||||||
|
// 编译数据
|
||||||
|
$data = array(
|
||||||
|
'output'=>'DATA_ERROR',
|
||||||
|
'code'=>403,
|
||||||
|
'info'=>'数据错误'
|
||||||
|
);
|
||||||
|
// 输出数据
|
||||||
|
echo json_encode($data,JSON_UNESCAPED_UNICODE);
|
||||||
|
header("HTTP/1.1 403 Forbidden");
|
||||||
|
}
|
||||||
|
mysqli_query($conn,"UNLOCK TABLE");
|
||||||
|
} else {
|
||||||
|
// 编译数据
|
||||||
|
$data = array(
|
||||||
|
'output'=>'KEY_ERROR',
|
||||||
|
'code'=>403,
|
||||||
|
'info'=>'密钥错误'
|
||||||
|
);
|
||||||
|
// 输出数据
|
||||||
|
echo json_encode($data,JSON_UNESCAPED_UNICODE);
|
||||||
|
header("HTTP/1.1 403 Forbidden");
|
||||||
|
}
|
58
api/out_school/out.php
Normal file
58
api/out_school/out.php
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
<?PHP
|
||||||
|
/*
|
||||||
|
* wxxy_class 项目组
|
||||||
|
* 代码均开源
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 载入头
|
||||||
|
include($_SERVER['DOCUMENT_ROOT'].'/api/header-control.php');
|
||||||
|
|
||||||
|
// 载入组件
|
||||||
|
$key = htmlspecialchars($_GET['key']);
|
||||||
|
|
||||||
|
// 获取参数
|
||||||
|
$post = file_get_contents('php://input');
|
||||||
|
$POST_INFO = json_decode($post,true);
|
||||||
|
|
||||||
|
// 构建函数
|
||||||
|
if ($key == $setting['Key']) {
|
||||||
|
// 对数据进行转义,避免数据库注入
|
||||||
|
$info['studentID'] = addslashes($POST_INFO['data']['studentID']);
|
||||||
|
$info['reason'] = addslashes($POST_INFO['data']['reason']);
|
||||||
|
$info['place'] = addslashes($POST_INFO['data']['place']);
|
||||||
|
$info['info'] = addslashes($POST_INFO['data']['info']);
|
||||||
|
|
||||||
|
// 进行数据库匹配(由于没有设置过于复杂的密码则没有)
|
||||||
|
mysqli_query($conn,"LOCK TABLE ".$setting['SQL_DATA']['out_school']." WRITE");
|
||||||
|
if (mysqli_query($conn,"INSERT INTO ".$setting['SQL_DATA']['out_school']." (studentID,out_time,out_type,out_place,out_reason) VALUES ('".$info['studentID']."','".date('Y-m-d H:i:s')."','".$info['reason']."', '".$info['place']."', '".$info['info']."')")) {
|
||||||
|
// 编译数据
|
||||||
|
$data = array(
|
||||||
|
'output'=>'SUCCESS',
|
||||||
|
'code'=>200,
|
||||||
|
'info'=>'数据写入完毕',
|
||||||
|
);
|
||||||
|
// 输出数据
|
||||||
|
echo json_encode($data,JSON_UNESCAPED_UNICODE);
|
||||||
|
} else {
|
||||||
|
// 编译数据
|
||||||
|
$data = array(
|
||||||
|
'output'=>'DATA_ERROR',
|
||||||
|
'code'=>403,
|
||||||
|
'info'=>'数据写入错误'
|
||||||
|
);
|
||||||
|
// 输出数据
|
||||||
|
echo json_encode($data,JSON_UNESCAPED_UNICODE);
|
||||||
|
header("HTTP/1.1 403 Forbidden");
|
||||||
|
}
|
||||||
|
mysqli_query($conn,"UNLOCK TABLE");
|
||||||
|
} else {
|
||||||
|
// 编译数据
|
||||||
|
$data = array(
|
||||||
|
'output'=>'KEY_ERROR',
|
||||||
|
'code'=>403,
|
||||||
|
'info'=>'密钥错误'
|
||||||
|
);
|
||||||
|
// 输出数据
|
||||||
|
echo json_encode($data,JSON_UNESCAPED_UNICODE);
|
||||||
|
header("HTTP/1.1 403 Forbidden");
|
||||||
|
}
|
49
api/out_school/quanbu_select.php
Normal file
49
api/out_school/quanbu_select.php
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
<?PHP
|
||||||
|
/*
|
||||||
|
* wxxy_class 项目组
|
||||||
|
* 代码均开源
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 载入头
|
||||||
|
include($_SERVER['DOCUMENT_ROOT'].'/api/header-control.php');
|
||||||
|
|
||||||
|
// 载入组件
|
||||||
|
$key = htmlspecialchars($_GET['key']);
|
||||||
|
$studentID = htmlspecialchars($_GET['studentID']);
|
||||||
|
|
||||||
|
// 构建函数
|
||||||
|
if ($key == $setting['Key']) {
|
||||||
|
$result_outschool_select = mysqli_query($conn,"SELECT * FROM ".$setting['SQL_DATA']['out_school']." a LEFT JOIN ".$setting['SQL_DATA']['info']." b ON a.studentID=b.studentID ORDER BY out_time DESC");
|
||||||
|
$num = 1;
|
||||||
|
while ($result_outschool_select_object = mysqli_fetch_object($result_outschool_select)) {
|
||||||
|
$array[$num] = array(
|
||||||
|
'studentID'=>$result_outschool_select_object->studentID,
|
||||||
|
'name'=>$result_outschool_select_object->name,
|
||||||
|
'out_time'=>$result_outschool_select_object->out_time,
|
||||||
|
'back_time'=>$result_outschool_select_object->back_ttime,
|
||||||
|
'out_type'=>$result_outschool_select_object->out_type,
|
||||||
|
'out_place'=>$result_outschool_select_object->out_place,
|
||||||
|
'out_reason'=>$result_outschool_select_object->out_reason,
|
||||||
|
);
|
||||||
|
$num ++;
|
||||||
|
}
|
||||||
|
// 编译数据
|
||||||
|
$data = array(
|
||||||
|
'output'=>'SUCCESS',
|
||||||
|
'code'=>200,
|
||||||
|
'info'=>'数据输出成功',
|
||||||
|
'data'=>$array,
|
||||||
|
);
|
||||||
|
// 输出数据
|
||||||
|
echo json_encode($data,JSON_UNESCAPED_UNICODE);
|
||||||
|
} else {
|
||||||
|
// 编译数据
|
||||||
|
$data = array(
|
||||||
|
'output'=>'KEY_ERROR',
|
||||||
|
'code'=>403,
|
||||||
|
'info'=>'密钥错误'
|
||||||
|
);
|
||||||
|
// 输出数据
|
||||||
|
echo json_encode($data,JSON_UNESCAPED_UNICODE);
|
||||||
|
header("HTTP/1.1 403 Forbidden");
|
||||||
|
}
|
60
api/out_school/select.php
Normal file
60
api/out_school/select.php
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
<?PHP
|
||||||
|
/*
|
||||||
|
* wxxy_class 项目组
|
||||||
|
* 代码均开源
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 载入头
|
||||||
|
include($_SERVER['DOCUMENT_ROOT'].'/api/header-control.php');
|
||||||
|
|
||||||
|
// 载入组件
|
||||||
|
$key = htmlspecialchars($_GET['key']);
|
||||||
|
$studentID = htmlspecialchars($_GET['studentID']);
|
||||||
|
|
||||||
|
// 构建函数
|
||||||
|
if ($key == $setting['Key']) {
|
||||||
|
$result_outschool_select = mysqli_query($conn,"SELECT * FROM ".$setting['SQL_DATA']['out_school']." WHERE studentID=$studentID ORDER BY out_time DESC");
|
||||||
|
$result_outschool_select_object = mysqli_fetch_object($result_outschool_select);
|
||||||
|
|
||||||
|
if (!empty($result_outschool_select_object->out_time)) {
|
||||||
|
// 信息查询
|
||||||
|
if (empty($result_outschool_select_object->back_ttime)) {
|
||||||
|
// 编译数据
|
||||||
|
$data = array(
|
||||||
|
'output'=>'NO_BACK_SCHOOL',
|
||||||
|
'code'=>200,
|
||||||
|
'info'=>'未返校'
|
||||||
|
);
|
||||||
|
// 输出数据
|
||||||
|
echo json_encode($data,JSON_UNESCAPED_UNICODE);
|
||||||
|
} else {
|
||||||
|
// 编译数据
|
||||||
|
$data = array(
|
||||||
|
'output'=>'BACK_SCHOOL',
|
||||||
|
'code'=>200,
|
||||||
|
'info'=>'已返校'
|
||||||
|
);
|
||||||
|
// 输出数据
|
||||||
|
echo json_encode($data,JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 编译数据
|
||||||
|
$data = array(
|
||||||
|
'output'=>'BACK_SCHOOL',
|
||||||
|
'code'=>200,
|
||||||
|
'info'=>'已返校'
|
||||||
|
);
|
||||||
|
// 输出数据
|
||||||
|
echo json_encode($data,JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 编译数据
|
||||||
|
$data = array(
|
||||||
|
'output'=>'KEY_ERROR',
|
||||||
|
'code'=>403,
|
||||||
|
'info'=>'密钥错误'
|
||||||
|
);
|
||||||
|
// 输出数据
|
||||||
|
echo json_encode($data,JSON_UNESCAPED_UNICODE);
|
||||||
|
header("HTTP/1.1 403 Forbidden");
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
<?PHP
|
<?PHP
|
||||||
// 检查是否正常登录
|
// 检查是否正常登录
|
||||||
|
/*
|
||||||
$callback = htmlspecialchars($_GET['callback']);
|
$callback = htmlspecialchars($_GET['callback']);
|
||||||
if ($menu_id == 2) {
|
if ($menu_id == 2) {
|
||||||
if (!empty($_COOKIE['studentID'])) {
|
if (!empty($_COOKIE['studentID'])) {
|
||||||
|
@ -15,6 +16,7 @@ if ($menu_id == 2) {
|
||||||
header('location: https://ourwxxy.x-lf.com/auth.php?callback='.$get_ip);
|
header('location: https://ourwxxy.x-lf.com/auth.php?callback='.$get_ip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// 获取数据(获取数据库信息)
|
// 获取数据(获取数据库信息)
|
||||||
include($_SERVER['DOCUMENT_ROOT'].'/setting.inc.php');
|
include($_SERVER['DOCUMENT_ROOT'].'/setting.inc.php');
|
||||||
|
@ -41,4 +43,12 @@ $member_ch = curl_init($member_url);
|
||||||
curl_setopt($member_ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
|
curl_setopt($member_ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
|
||||||
curl_setopt($member_ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($member_ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
$member = curl_exec($member_ch);
|
$member = curl_exec($member_ch);
|
||||||
$member = json_decode($member,true);
|
$member = json_decode($member,true);
|
||||||
|
|
||||||
|
// 载入用户个人信息
|
||||||
|
$back_school_sel_url = $setting['API']['Domain'].'/out_school/select.php?key='.$setting['Key'].'&studentID='.$_COOKIE['studentID'];
|
||||||
|
$back_school_sel_ch = curl_init($back_school_sel_url);
|
||||||
|
curl_setopt($back_school_sel_ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
|
||||||
|
curl_setopt($back_school_sel_ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
$back_school_sel = curl_exec($back_school_sel_ch);
|
||||||
|
$back_school_sel = json_decode($back_school_sel,true);
|
|
@ -17,13 +17,14 @@ function menu_color($menu_num) {
|
||||||
<div class="accordion-body">
|
<div class="accordion-body">
|
||||||
<div class="row px-4">
|
<div class="row px-4">
|
||||||
<div class="col-12 mb-1"><a href="/index.php" class="text-decoration-none <?PHP menu_color(1) ?>"><i class="bi bi-house-door"></i> 主页</a></div>
|
<div class="col-12 mb-1"><a href="/index.php" class="text-decoration-none <?PHP menu_color(1) ?>"><i class="bi bi-house-door"></i> 主页</a></div>
|
||||||
<div class="col-12 mb-1"><a href="/task.php" class="text-decoration-none <?PHP menu_color(9) ?>"><i class="bi bi-book"></i> 作业提交查询表</a></div>
|
<div class="col-12 mb-1"><a href="/out_school.php" class="text-decoration-none <?PHP menu_color(10) ?>"><i class="bi bi-box-arrow-right"></i> 进出校登记</a></div>
|
||||||
|
<!-- <div class="col-12 mb-1"><a href="/task.php" class="text-decoration-none <?PHP menu_color(9) ?>"><i class="bi bi-book"></i> 作业提交查询表</a></div> -->
|
||||||
<div class="col-12 mb-1"><a href="/nucleic_acid.php" class="text-decoration-none <?PHP menu_color(3) ?>"><i class="bi bi-bandaid"></i> 核酸信息提交</a></div>
|
<div class="col-12 mb-1"><a href="/nucleic_acid.php" class="text-decoration-none <?PHP menu_color(3) ?>"><i class="bi bi-bandaid"></i> 核酸信息提交</a></div>
|
||||||
<div class="col-12 mb-1"><a href="/pan.php" class="text-decoration-none <?PHP menu_color(4) ?>"><i class="bi bi-device-hdd"></i> 班级网盘</a></div>
|
<div class="col-12 mb-1"><a href="/pan.php" class="text-decoration-none <?PHP menu_color(4) ?>"><i class="bi bi-device-hdd"></i> 班级网盘</a></div>
|
||||||
<div class="col-12 mb-1"><a href="/non-member-fty.php" class="text-decoration-none <?PHP menu_color(5) ?>"><i class="bi bi-chat"></i> 青年大学习(全员)</a></div>
|
<div class="col-12 mb-1"><a href="/non-member-fty.php" class="text-decoration-none <?PHP menu_color(5) ?>"><i class="bi bi-chat"></i> 青年大学习(全员)</a></div>
|
||||||
<!-- <div class="col-12 mb-1"><a href="/member-ty.php" class="text-decoration-none <?PHP menu_color(6) ?>"><i class="bi bi-chat-dots"></i> 青年大学习(团员)</a></div> -->
|
<!-- <div class="col-12 mb-1"><a href="/member-ty.php" class="text-decoration-none <?PHP menu_color(6) ?>"><i class="bi bi-chat-dots"></i> 青年大学习(团员)</a></div> -->
|
||||||
<div class="col-12 mb-1"><a href="/get_book.php" class="text-decoration-none <?PHP menu_color(7) ?>"><i class="bi bi-journal-bookmark"></i> 书本领取登记</a></div>
|
<div class="col-12 mb-1"><a href="/get_book.php" class="text-decoration-none <?PHP menu_color(7) ?>"><i class="bi bi-journal-bookmark"></i> 书本领取登记</a></div>
|
||||||
<div class="col-12 mb-1"><a href="/signin/" class="text-decoration-none <?PHP menu_color(8) ?>"><i class="bi bi-box-arrow-in-right"></i> 事务签到表</a></div>
|
<!-- <div class="col-12 mb-1"><a href="/signin/" class="text-decoration-none <?PHP menu_color(8) ?>"><i class="bi bi-box-arrow-in-right"></i> 事务签到表</a></div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
146
out_school.php
Normal file
146
out_school.php
Normal file
|
@ -0,0 +1,146 @@
|
||||||
|
<?php
|
||||||
|
// 页面ID
|
||||||
|
$menu_page = 10;
|
||||||
|
// 载入组件
|
||||||
|
include($_SERVER['DOCUMENT_ROOT'].'/module/head-check.php');
|
||||||
|
include($_SERVER['DOCUMENT_ROOT'].'/plugins/function.php');
|
||||||
|
?>
|
||||||
|
<!doctype html>
|
||||||
|
<!--
|
||||||
|
哎呀,原来你看到了呀。
|
||||||
|
欢迎你~
|
||||||
|
如果你想看完整的代码你可以去我的GITHUB看代码,代码地址如下哦:
|
||||||
|
https://github.com/XiaoLFeng/wxxy_class
|
||||||
|
欢迎来201宿舍玩啊~
|
||||||
|
-->
|
||||||
|
<html lang="zh">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title><?PHP echo $normal['data']['web_title']['text']?> - <?PHP echo $normal['data']['web_subtitle']['text']?></title>
|
||||||
|
<link rel="shortcut icon" href="<?PHP echo $normal['data']['web_icon']['text']?>" type="image/x-icon">
|
||||||
|
<meta name="description" content="<?PHP echo $normal['data']['web_desc']['text']?>">
|
||||||
|
<!-- CSS -->
|
||||||
|
<link rel="stylesheet" href="<?PHP echo $mirror['data']['info']['bootstrap_css'] ?>">
|
||||||
|
<link rel="stylesheet" href="<?PHP echo $mirror['data']['info']['bootstrap_icon'] ?>">
|
||||||
|
<link rel="stylesheet" href="<?PHP echo $mirror['data']['info']['qweather'] ?>">
|
||||||
|
</head>
|
||||||
|
<body style="background-color:#e3f2fd;">
|
||||||
|
<!-- 菜单 -->
|
||||||
|
<header>
|
||||||
|
<?PHP include($_SERVER['DOCUMENT_ROOT'].'/module/header.php') ?>
|
||||||
|
</header>
|
||||||
|
<!-- 内容 -->
|
||||||
|
<div id="loader" class="container placeholder-glow text-center py-4">
|
||||||
|
<div class="spinner-grow text-primary" role="status"><span class="visually-hidden">Loading...</span></div>
|
||||||
|
<div class="spinner-grow text-primary" role="status"><span class="visually-hidden">Loading...</span></div>
|
||||||
|
<div class="spinner-grow text-primary" role="status"><span class="visually-hidden">Loading...</span></div>
|
||||||
|
</div>
|
||||||
|
<div id="main" class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-bg-4 col-lg-3 mb-3">
|
||||||
|
<?PHP include('./module/menu.php'); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-bg-8 col-lg-9 mt-3 mb-3">
|
||||||
|
<?PHP
|
||||||
|
if ($back_school_sel['output'] == "NO_BACK_SCHOOL") {
|
||||||
|
?>
|
||||||
|
<div class="row">
|
||||||
|
<div class="card shadow rounded-3">
|
||||||
|
<div class="card-body">
|
||||||
|
<form action="/plugins/in_school.php" method="post">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 mb-3 fs-4 fw-bold text-center">软件工程2班 - 进出校统计</div>
|
||||||
|
<div class="col-12 mb-3 text-danger">您目前未销假,如已返校请销假!</div>
|
||||||
|
<div class="col-12 mb-3 text-success">一起努力,让我们健健康康参加考试,顺利度过疫情难关!</div>
|
||||||
|
<div class="col-12 col-xl-6 mb-3 px-5">
|
||||||
|
<label class="form-label"><i class="bi bi-credit-card-2-front"></i> 学号</label>
|
||||||
|
<input type="text" class="form-control" id="studentID" name="studentID" value="<?PHP echo stripslashes($member['data']['studentID']) ?>" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-xl-6 mb-3 px-5">
|
||||||
|
<label class="form-label"><i class="bi bi-person"></i> 姓名</label>
|
||||||
|
<input type="text" class="form-control" value="<?PHP echo stripslashes($member['data']['name']) ?>" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 mb-3 px-5">
|
||||||
|
<label class="form-label"><i class="bi bi-alarm"></i> 返校时间(以此刻时间为主)</label>
|
||||||
|
<input type="text" class="form-control" id="out" name="out" value="<?PHP echo date('Y-m-d H:i:s') ?>" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 mb-3 text-center"><button class="btn btn-primary" type="submit"><i class="bi bi-upload"></i> 提交信息</button></div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?PHP
|
||||||
|
} else {
|
||||||
|
?>
|
||||||
|
<div class="row">
|
||||||
|
<div class="card shadow rounded-3">
|
||||||
|
<div class="card-body">
|
||||||
|
<form action="/plugins/out_school.php" method="post">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 mb-3 fs-4 fw-bold text-center">软件工程2班 - 进出校统计</div>
|
||||||
|
<div class="col-12 mb-3">注意:这个进出校统计系统不属于学习通,不属于学校,只是我们班委处需要执行的操作,依据目前的防疫形势下,我们需要清楚你们的动向,请各位学生积极配合班委工作,出入校园信息请认真填写,谢谢配合!</div>
|
||||||
|
<div class="col-12 mb-3 text-danger">在你返校后请重新打开此页面进行销假!</div>
|
||||||
|
<div class="col-12 mb-3 text-success">一起努力,让我们健健康康参加考试,顺利度过疫情难关!</div>
|
||||||
|
<div class="col-12 col-xl-6 mb-3 px-5">
|
||||||
|
<label class="form-label"><i class="bi bi-credit-card-2-front"></i> 学号</label>
|
||||||
|
<input type="text" class="form-control" id="studentID" name="studentID" value="<?PHP echo stripslashes($member['data']['studentID']) ?>" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-xl-6 mb-3 px-5">
|
||||||
|
<label class="form-label"><i class="bi bi-person"></i> 姓名</label>
|
||||||
|
<input type="text" class="form-control" value="<?PHP echo stripslashes($member['data']['name']) ?>" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-xl-6 mb-3 px-5">
|
||||||
|
<label class="form-label"><i class="bi bi-house"></i> 所在宿舍</label>
|
||||||
|
<input type="text" class="form-control" value="<?PHP echo stripslashes($member['data']['dormitory']) ?>" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-xl-6 mb-3 px-5">
|
||||||
|
<label class="form-label"><i class="bi bi-alarm"></i> 离校时间(以申请时间为主)</label>
|
||||||
|
<input type="text" class="form-control" id="out" name="out" value="<?PHP echo date('Y-m-d H:i:s') ?>" readonly>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-xl-6 mb-3 px-5">
|
||||||
|
<label class="form-label"><i class="bi bi-shop"></i> 请假类型</label>
|
||||||
|
<select class="form-select" id="reason" name="reason" required>
|
||||||
|
<option value="普通" selected>普通</option>
|
||||||
|
<option value="病假">病假</option>
|
||||||
|
<option value="事假">事假</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-xl-6 mb-3 px-5">
|
||||||
|
<label class="form-label"><i class="bi bi-shop"></i> 主要去的地方</label>
|
||||||
|
<input type="text" class="form-control" id="place" name="place" placeholder="例如:锡山人民医院" required>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 mb-4 px-5">
|
||||||
|
<label class="form-label">备注信息(主要去的地方,去做什么,预计几点回来)</label>
|
||||||
|
<textarea class="form-control" id="info" name="info" rows="3" required></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 mb-3 text-center"><button class="btn btn-primary" type="submit"><i class="bi bi-upload"></i> 提交信息</button></div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?PHP
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 页尾 -->
|
||||||
|
<?PHP include($_SERVER['DOCUMENT_ROOT'].'/module/footer.php') ?>
|
||||||
|
</body>
|
||||||
|
<!-- JavaScript -->
|
||||||
|
<script src="<?PHP echo $mirror['data']['info']['qweather'] ?>"></script>
|
||||||
|
<script src="<?PHP echo $mirror['data']['info']['bootstrap_bundle_js'] ?>"></script>
|
||||||
|
<script src="<?PHP echo $mirror['data']['info']['jquery'] ?>"></script>
|
||||||
|
<script>
|
||||||
|
// 加载内容
|
||||||
|
$("#main").hide();
|
||||||
|
window.onload=function(){
|
||||||
|
$("#loader").fadeOut(200);
|
||||||
|
$("#main").show(500);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</html>
|
45
plugins/in_school.php
Normal file
45
plugins/in_school.php
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
<?PHP
|
||||||
|
/*
|
||||||
|
* 筱锋xiao_lfeng 分享系统(插件)
|
||||||
|
* 进出校组件
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 定义请求头
|
||||||
|
header("Content-type:text/html;charset=utf-8");
|
||||||
|
// 获取组件
|
||||||
|
include($_SERVER['DOCUMENT_ROOT'].'/setting.inc.php');
|
||||||
|
include($_SERVER['DOCUMENT_ROOT'].'/plugins/sql_conn.php');
|
||||||
|
// 获取参数
|
||||||
|
$studentID = $_POST['studentID'];
|
||||||
|
|
||||||
|
// 载入用户个人信息
|
||||||
|
$result_url = $setting['API']['Domain'].'/out_school/in.php?key='.$setting['Key'].'&studentID='.$studentID;
|
||||||
|
$result_ch = curl_init($result_url);
|
||||||
|
curl_setopt($result_ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
|
||||||
|
curl_setopt($result_ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
$result = curl_exec($result_ch);
|
||||||
|
$result = json_decode($result,true);
|
||||||
|
|
||||||
|
// 返回结果
|
||||||
|
if ($result['output'] == "SUCCESS") {
|
||||||
|
echo <<<EOF
|
||||||
|
<script language="javascript">
|
||||||
|
alert( "已销假,请通知班长或文体委员!" )
|
||||||
|
window.location.replace("/out_school.php");
|
||||||
|
</script>
|
||||||
|
EOF;
|
||||||
|
} elseif ($result['output'] == "DATA_ERROR") {
|
||||||
|
echo <<<EOF
|
||||||
|
<script language="javascript">
|
||||||
|
alert( "数据出错,请重试" )
|
||||||
|
window.history.go(-1);
|
||||||
|
</script>
|
||||||
|
EOF;
|
||||||
|
} else {
|
||||||
|
echo <<<EOF
|
||||||
|
<script language="javascript">
|
||||||
|
alert( "未知错误" )
|
||||||
|
window.history.go(-1);
|
||||||
|
</script>
|
||||||
|
EOF;
|
||||||
|
}
|
87
plugins/out_school.php
Normal file
87
plugins/out_school.php
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
<?PHP
|
||||||
|
/*
|
||||||
|
* 筱锋xiao_lfeng 分享系统(插件)
|
||||||
|
* 进出校组件
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 定义请求头
|
||||||
|
header("Content-type:text/html;charset=utf-8");
|
||||||
|
// 获取组件
|
||||||
|
include($_SERVER['DOCUMENT_ROOT'].'/setting.inc.php');
|
||||||
|
include($_SERVER['DOCUMENT_ROOT'].'/plugins/sql_conn.php');
|
||||||
|
// 获取参数
|
||||||
|
$studentID = $_POST['studentID'];
|
||||||
|
$out_time = $_POST['out'];
|
||||||
|
$reason = $_POST['reason'];
|
||||||
|
$place = $_POST['place'];
|
||||||
|
$info = $_POST['info'];
|
||||||
|
|
||||||
|
// 注册函数
|
||||||
|
// 发送POST
|
||||||
|
function http_post_json($url, $jsonStr) {
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_POST, 1);
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonStr);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
||||||
|
'Content-Type: application/json; charset=utf-8',
|
||||||
|
'Content-Length: ' . strlen($jsonStr)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$response = curl_exec($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 函数构建
|
||||||
|
// 检查数据是否为空
|
||||||
|
if (!empty($studentID)) {
|
||||||
|
// 发送用户信息
|
||||||
|
$url = $setting['API']['Domain']."/out_school/out.php?key=".$setting['Key']; //请求地址
|
||||||
|
$arr = array(
|
||||||
|
'output'=>"SUCCESS",
|
||||||
|
'code'=>200,
|
||||||
|
'info'=>"上传成功",
|
||||||
|
'data'=>array(
|
||||||
|
'studentID'=>$studentID,
|
||||||
|
'reason'=>$reason,
|
||||||
|
'place'=>$place,
|
||||||
|
'info'=>$info,
|
||||||
|
)
|
||||||
|
); //请求参数(数组)
|
||||||
|
$jsonStr = json_encode($arr); //转换为json格式
|
||||||
|
$result = http_post_json($url, $jsonStr);
|
||||||
|
$result = json_decode($result,true);
|
||||||
|
|
||||||
|
// 返回结果
|
||||||
|
if ($result['output'] == "SUCCESS") {
|
||||||
|
echo <<<EOF
|
||||||
|
<script language="javascript">
|
||||||
|
alert( "已提交出校申请,请通知班长或文体委员!" )
|
||||||
|
window.location.replace("/out_school.php");
|
||||||
|
</script>
|
||||||
|
EOF;
|
||||||
|
} elseif ($result['output'] == "DATA_ERROR") {
|
||||||
|
echo <<<EOF
|
||||||
|
<script language="javascript">
|
||||||
|
alert( "数据出错,请重试" )
|
||||||
|
window.history.go(-1);
|
||||||
|
</script>
|
||||||
|
EOF;
|
||||||
|
} else {
|
||||||
|
echo <<<EOF
|
||||||
|
<script language="javascript">
|
||||||
|
alert( "未知错误" )
|
||||||
|
window.history.go(-1);
|
||||||
|
</script>
|
||||||
|
EOF;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo <<<EOF
|
||||||
|
<script language="javascript">
|
||||||
|
alert( "不要空账户" )
|
||||||
|
window.history.go(-1);
|
||||||
|
</script>
|
||||||
|
EOF;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user