易班附件通知系统项目文件提交

This commit is contained in:
rainerosion 2020-07-28 00:13:46 +08:00
parent eae139fb38
commit 3769ef4bab
59 changed files with 224 additions and 0 deletions

6
config.php Normal file
View File

@ -0,0 +1,6 @@
<?php
/**
* 文件上传授权码
*/
$AuthorizationCode = "yiban10672";
?>

52
data.dat Normal file
View File

@ -0,0 +1,52 @@
11.9A1|:|upload/3ade4509baf8d5de233c00b2c1b5aaad.xls|:|2017-11-15 10:52:01|:|Excel
11.9A2|:|upload/a87d92a7024967aef6b9db3551b1e76b.xls|:|2017-11-15 10:52:24|:|Excel
11.9A3|:|upload/31b63fc987ddd6ec73b9123f82056c18.xls|:|2017-11-15 10:55:27|:|Excel
11.9A4|:|upload/753cea061f05b74d4042abea0e4d1e84.xls|:|2017-11-15 10:55:47|:|Excel
11.9A5|:|upload/2cbee2632500131ec4e8d40ab863065d.xls|:|2017-11-15 10:56:07|:|Excel
11.9b2|:|upload/4c4c344e38b60ca73667e87349116bcf.xls|:|2017-11-15 10:56:25|:|Excel
11.9B1|:|upload/4b3f9190f81f7c9a2d0de3fded703107.xls|:|2017-11-16 01:14:54|:|Excel
11月16日A5栋|:|upload/6edb13945be857a81c956a7e43956977.xls|:|2017-11-19 12:05:53|:|Excel
11月16日A1栋|:|upload/516523650a057005a523f2a3e3ac33a6.xls|:|2017-11-19 12:50:59|:|Excel
11月16日A2栋|:|upload/74868143b71e2213ac0eee1d1b5f8d5c.xls|:|2017-11-19 12:51:23|:|Excel
11月16日A3栋|:|upload/47371e6c11a326c979ed5270ef9c83cb.xls|:|2017-11-19 12:51:49|:|Excel
11月16日A4栋|:|upload/4273e1e5bb1df345c29ae734ec4bcb08.xls|:|2017-11-19 12:52:21|:|Excel
11月16日B1栋|:|upload/31af24b4165b567eb9917d03029604ee.xls|:|2017-11-19 12:52:40|:|Excel
11月16日B2栋|:|upload/2f70cb3ea8d490c89e332d4a7288479c.xls|:|2017-11-19 12:53:05|:|Excel
11月23日A1栋|:|upload/26045f969152ffadc09dfba28bccb916.xls|:|2017-11-26 17:06:46|:|Excel
11月23日A2栋|:|upload/6a5d147212827508e965e213451a2534.xls|:|2017-11-26 17:07:22|:|Excel
11月23日A3栋|:|upload/2db4799c4a5d07783ab75e45437e2b2f.xls|:|2017-11-26 17:07:42|:|Excel
11月23日A4栋|:|upload/a085b76a203f08f036110af69d53a091.xls|:|2017-11-26 17:08:00|:|Excel
11月23日A4栋|:|upload/b160766f6b1a5317f63b43a4fdfc6b16.xls|:|2017-11-26 17:08:36|:|Excel
11月23日A5栋|:|upload/ea329c2e336aec51ef2fdac3a2553cd3.xls|:|2017-11-26 17:08:55|:|Excel
11月23日A6栋|:|upload/8523634d374749426b98af5fa917ea3f.xls|:|2017-11-26 17:09:18|:|Excel
11月23日A7栋|:|upload/49e9dd7d3505c0d20509760f5a769454.xls|:|2017-11-26 17:09:49|:|Excel
11月23日A1栋|:|upload/a96a90d88c5ebbe70377fca2054159f5.xls|:|2017-11-26 17:29:27|:|Excel
3月22日A1栋|:|upload/8aa0044a5b87c34636be9921a8cb35a2.xls|:|2018-03-26 23:33:55|:|Excel
3月22日A2栋|:|upload/334bc6b847b54795745ea9a08f5c0281.xls|:|2018-03-26 23:34:38|:|Excel
3月22日A3栋|:|upload/ca6edf298f57aa3fe0f5cd816f3c9127.xls|:|2018-03-26 23:35:19|:|Excel
3月22日A4栋|:|upload/c5b2a9312b5dde2d0565e2ee1c251007.xls|:|2018-03-26 23:35:39|:|Excel
3月22日A5栋|:|upload/ed655c1947f8acc41a79130ef7689035.xls|:|2018-03-26 23:35:56|:|Excel
3月22日A6栋|:|upload/b4a06da787a6afd7fa6c0612c85ab108.xls|:|2018-03-26 23:36:19|:|Excel
3月22日A67|:|upload/1d0fcac60ba3165082b484f31b9dd3eb.xls|:|2018-03-26 23:36:50|:|Excel
3.22A3栋|:|upload/da1dfbf782ddd9f1084752367d70659e.xls|:|2018-03-26 23:40:52|:|Excel
3.29A1|:|upload/e02eec0db2cdc0480f737200b17dabc7.xls|:|2018-04-01 16:27:52|:|Excel
3.29A2|:|upload/db93ff9096f049696e78e4a49aaf1ea7.xlsx|:|2018-04-01 16:28:16|:|Excel
3.29A3|:|upload/f2981c73f255d36b9e329bcb3c965c6c.xls|:|2018-04-01 16:28:42|:|Excel
3.29A4|:|upload/62012ca25a1ec0ea2b9cbf1093d0e0a6.xls|:|2018-04-01 16:29:02|:|Excel
3.29A5|:|upload/c5ec6c7956d6c71d7a0ecdcc7f4aea1e.xls|:|2018-04-01 16:29:21|:|Excel
3.29A6|:|upload/3e6dbc4178ab0f20afc869ceca4d74db.xls|:|2018-04-01 16:29:39|:|Excel
3.29A7|:|upload/a4dbe815b07990419260d7deffee8f04.xlsx|:|2018-04-01 16:30:01|:|Excel
4.12A1|:|upload/7f2546922c9d3a37c65255bb7cc14663.xls|:|2018-04-18 15:27:03|:|Excel
4.12A2|:|upload/c72e54d7db4b4a155658eca02f51eb2c.xls|:|2018-04-18 15:28:09|:|Excel
4.12A3|:|upload/eadd599416ef0737ab93bb23fd5201a0.xls|:|2018-04-18 15:28:30|:|Excel
4.12A4|:|upload/9b1afafc1ba5fdb72a4bd200924e6292.xls|:|2018-04-18 15:28:53|:|Excel
4.12A5|:|upload/9207119f0afbb8d1822cd365622710a9.xls|:|2018-04-18 15:32:22|:|Excel
4.12A6|:|upload/e61efec4e9aca852a8346f1e166cff32.xls|:|2018-04-18 15:35:01|:|Excel
4.12A7|:|upload/daed99fd1ebe48311187c72dd3b734ce.xlsx|:|2018-04-18 15:35:19|:|Excel
5.10A1|:|upload/977427f35cd081f91d18f7ede8335370.xlsx|:|2018-05-17 12:51:41|:|Excel
5.10A2|:|upload/238d4e9911df215510686f2e21a71163.xlsx|:|2018-05-17 12:52:04|:|Excel
5.10A3|:|upload/c690d28c671c793f5bba1bc8f22c6c65.xls|:|2018-05-17 12:52:28|:|Excel
5.10A4|:|upload/b343cd9421271642a2c2527104eebb33.xls|:|2018-05-17 12:52:49|:|Excel
5.10A5|:|upload/3e45453e45e3fa29257696a8aca27047.xlsx|:|2018-05-17 12:53:12|:|Excel
5.10A6|:|upload/9daab57196ec03dd6d81d315f40a5e01.xls|:|2018-05-17 12:53:35|:|Excel
5.10A7|:|upload/080efe15234ec05ad53dd79597700ea2.xlsx|:|2018-05-17 12:53:57|:|Excel

BIN
img/Excel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

BIN
img/PowerPoint.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 633 B

BIN
img/Word.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

61
index.php Normal file
View File

@ -0,0 +1,61 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html" charset="utf-8">
<title>易班消息通知平台</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<style type="text/css">
*{
font-family: 微软雅黑;
}
</style>
</head>
<body>
<div class="container">
<h3 class="page-header">易班消息通知平台</h3>
<div class="panel panel-primary">
<div class="panel-heading">
<div class="panel-title">
<h4>通知平台</h4>
</div>
</div>
<div class="panel-body">
<p class="alert alert-warning">这里是通知文档发送平台所有的通知将以OFFICE文档格式上传到本平台</p>
</div>
</div>
<div class="panel panel-danger">
<div class="panel-heading">
<div class="panel-title">
<b>通知文件列表</b> <small style="color:green;margin-left:15px;">[<a href="upload.php">发通知</a>]</small>
</div>
</div>
<table class="table table-striped table-hover table-bordered">
<tr>
<th>文件名</th>
<th>上传日期</th>
</tr>
<?php
error_reporting(0);
$con = file('data.dat');
$num = count($con);
for($i = $num - 1; $i >= 0; $i--){
$text = explode("|:|",$con[$i]);
echo'<tr>
<td>
<a href="'.$text[1].'"><img src="img/'.trim($text[3]).'.png" style="height:20px;margin-right:3px;" alt="'.$text[0].'" />'.$text[0].'</a>
</td>
<td>'.$text[2].'</td>
</tr>';
}
?>
</table>
<div class="panel-footer">
<p>Copyright © 2017 by rainerosion. All rights reserved.</p>
</div>
</div>
</div>
</body>
</html>

105
upload.php Normal file
View File

@ -0,0 +1,105 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html" charset="utf-8">
<title>易班消息通知平台</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<style type="text/css">
*{
font-family: 微软雅黑;
}
.btn_form{
width:100%;
margin-top:4px;
}
</style>
</head>
<body>
<div class="container">
<h3 class="page-header">易班消息通知平台</h3>
<div class="panel panel-primary">
<div class="panel-heading">
<div class="panel-title">
<h4>通知平台</h4>
</div>
</div>
<div class="panel-body">
<p class="alert alert-warning">这里是通知文档发送平台所有的通知将以OFFICE文档格式上传到本平台由于服务器资源有限单个文档不得大于2MB</p>
</div>
</div>
<div class="panel panel-danger">
<div class="panel-heading">
<div class="panel-title">
<b>上传附件</b> <small style="color:green;margin-left:15px;">[<a href="index.php">回到首页</a>]</small>
</div>
</div>
<div class="panel-body">
<form action="?act=upload" method="POST" enctype="multipart/form-data">
<div class="form-group">
<label class="col-md-2 control-label">文件名:</label>
<div class="col-md-10">
<input class="form-control" name="name" type="text" value="" required="required">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">选择文件:</label>
<div class="col-md-10">
<input class="form-control" name="file" type="file" required="required" />
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">授权码:</label>
<div class="col-md-10">
<input class="form-control" name="code" type="text" value="" required="required">
</div>
</div>
<div class="col-md-offset-2 form-group">
<div class="col-md-6"><input type="submit" name="submit" class="btn btn_form btn-primary" value="上传发布"> </div>
<div class="col-md-6"><input type="reset" class="btn btn_form btn-danger" value="重置"> </div>
</div>
</form>
</div>
<div class="panel-footer">
<p>Copyright © 2017 by rains. All rights reserved.</p>
</div>
</div>
</div>
</body>
</html>
<?php
error_reporting(0);
date_default_timezone_set('Asia/Shanghai');
require_once("config.php");
if($_GET['act'] == 'upload'){
if(@$_POST['code'] != $AuthorizationCode){
die("<script>alert(\"授权失败无法上传!\");</script>");
}
if($_FILES['file']['error'] != 0){
die("<script>alert(\"文件上传出错!\");</script>");
}
$format = explode('.',$_FILES['file']['name']);
$format = $format[count($format)-1];
//var_dump($format);
if(($_FILES['file']['size']/1024) >= 2048 ){
echo "<script>alert(\"{$format}上传文件大小不得超过2M\");</script>";
}else{
$time = date('Y-m-d H:i:s');
$filename = md5($time).'.'.$format;
//echo $filename;
if($format == "doc" || $format == "docx"){
move_uploaded_file($_FILES['file']['tmp_name'], './upload/'.$filename);
file_put_contents('data.dat',"{$_POST['name']}|:|upload/{$filename}|:|{$time}|:|Word\r\n",FILE_APPEND | LOCK_EX);
echo '<script>alert("上传发布成功");</script>';
}elseif($format == "xls" || $format == "xlsx"){
move_uploaded_file($_FILES['file']['tmp_name'], './upload/'.$filename);
file_put_contents('data.dat',"{$_POST['name']}|:|upload/{$filename}|:|{$time}|:|Excel\r\n",FILE_APPEND | LOCK_EX);
echo '<script>alert("上传发布成功");</script>';
}else{
echo '<script>alert("不允许上传非Excel以及Word文件");</script>';
}
}
}
?>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.