-
Notifications
You must be signed in to change notification settings - Fork 1
/
books.php
executable file
·233 lines (227 loc) · 13.7 KB
/
books.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<!DOCTYPE html>
<html lang="en">
<?php
require_once 'function.php';
definePages();
$result=init(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME,"books","bookName");
?>
<head>
<meta charset="UTF-8">
<title>SCU资源共享站-书籍</title>
</head>
<!-- sytle sheet -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="mdl/material.teal-light_blue.min.css" />
<link rel="stylesheet" href="css/hidden.css" />
<body>
<!-- Always shows a header, even in smaller screens. -->
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<!-- Title -->
<span class="mdl-layout-title">欢迎来到SCU资源共享站</span>
<!-- Add spacer, to align navigation to the right -->
<div class="mdl-layout-spacer"></div>
<!-- Navigation. We hide it in small screens. -->
<nav class="mdl-navigation mdl-layout--large-screen-only">
<a class="mdl-navigation__link" href="<?php echo moviePage;?>">电影</a>
<a class="mdl-navigation__link" href="<?php echo serialPage;?>">电视剧</a>
<a class="mdl-navigation__link" href="<?php echo varietyShowPage;?>">综艺</a>
<a class="mdl-navigation__link" href="<?php echo booksPage;?>">书籍</a>
<a class="mdl-navigation__link" href="<?php echo gptPage;?>">GPT3.5</a>
</nav>
<!-- 没有用的search button等你完善-->
<div class="mdl-textfield mdl-js-textfield mdl-textfield--expandable
mdl-textfield--floating-label mdl-textfield--align-right">
<label class="mdl-button mdl-js-button mdl-button--icon" for="fixed-header-drawer-exp">
<i class="material-icons">search</i>
</label>
<div class="mdl-textfield__expandable-holder">
<input class="mdl-textfield__input" type="text" name="sample" id="fixed-header-drawer-exp">
</div>
</div>
</div>
</header>
<div class="mdl-layout__drawer">
<span class="mdl-layout-title">SCU资源共享站</span>
<nav class="mdl-navigation">
<a class="mdl-navigation__link" href="<?php echo indexPage;?>">
<span class="material-icons">home</span>首页
</a>
<a class="mdl-navigation__link" href="<?php echo moviePage;?>">
<span class="material-icons">movie</span>电影
</a>
<a class="mdl-navigation__link" href="<?php echo serialPage;?>">
<span class="material-icons">live_tv</span>电视剧
</a>
<a class="mdl-navigation__link" href="<?php echo varietyShowPage;?>">
<span class="material-icons">sports_martial_arts</span>综艺
</a>
<a class="mdl-navigation__link" href="<?php echo booksPage;?>">
<span class="material-icons">auto_stories</span>书籍
</a>
<a class="mdl-navigation__link" href="<?php echo gptPage;?>">
<span class="material-icons">chat</span>chat
</a>
<a class="mdl-navigation__link" href="https://github.com/dongguaguaguagua/getenjoyment">
<!-- 20-(24-17)=13 -->
<svg viewBox="0 0 24 24" width="17" height="17" style="font-size: small;padding-right: 19px;">
<path fill="#878787"
d="M12,0.4c-6.6,0-12,5.4-12,12c0,5.3,3.4,9.8,8.1,11.4c0.6,0.1,0.8-0.3,0.8-0.6c0-0.3,0-1,0-2c-3.3,0.7-4-1.6-4-1.6c-0.5-1.3-1.3-1.6-1.3-1.6c-1.1-0.7,0.1-0.7,0.1-0.7c1.2,0.1,1.9,1.2,1.9,1.2c1.1,1.9,2.8,1.3,3.5,1c0.1-0.8,0.4-1.3,0.8-1.6c-2.9-0.3-6-1.4-6-6c0-1.3,0.5-2.3,1.2-3.1c-0.1-0.3-0.5-1.5,0.1-3c0,0,1-0.3,3.2,1.2c0.9-0.3,1.9-0.5,2.9-0.5s2,0.2,2.9,0.5c2.1-1.5,3.2-1.2,3.2-1.2c0.6,1.5,0.2,2.7,0.1,3c0.8,0.8,1.2,1.8,1.2,3.1c0,4.6-3.1,5.7-6,6c0.5,0.4,0.9,1.1,0.9,2.3c0,1.7,0,3,0,3c0,0.3,0.2,0.7,0.8,0.6c4.7-1.6,8.1-6.1,8.1-11.4C24,5.8,18.6,0.4,12,0.4z" />
</svg>Github
</a>
</nav>
</div>
<main class="mdl-layout__content">
<div class="page-content">
<center>
<h3 style="color:rgb(65, 147, 136)">书籍</h3>
<!-- 绘制编辑对话框 -->
<div class="editForm">
<h3 style="color:rgb(65, 147, 136);">编辑资源</h3>
<form action="" method="post" name="editResources">
<span style="color: #429488;padding-right: 20px;"
class="material-icons">account_circle</span>
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" name="name" id="id_edit_name">
<label class="mdl-textfield__label" for="id_edit_name"></label>
</div>
<br>
<span style="color: #429488;padding-right: 20px;" class="material-icons">auto_stories</span>
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" name="bookName" id="id_edit_mediaName">
<label class="mdl-textfield__label" for="id_edit_mediaName"></label>
</div>
<br>
<span style="color: #429488;padding-right: 20px;" class="material-icons">add_link</span>
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" name="link"
pattern="^((https|http|ftp|rtsp|mms)?:\/\/)[^\s]+" id="id_edit_link"
onkeyup="autoLoadFilmNameAndExtractCode(this)">
<label class="mdl-textfield__label" for="id_edit_link"></label>
<span class="mdl-textfield__error">链接只能包含字母和数字及其他英文符号</span>
</div>
<br>
<span style="color: #429488;padding-right: 20px;" class="material-icons">code</span>
<div class="mdl-textfield mdl-js-textfield">
<input class="mdl-textfield__input" type="text" name="extractCode"
id="id_edit_extractCode" onkeyup="autoLoadFilmNameAndExtractCode2(this)">
<label class="mdl-textfield__label" for="id_edit_extractCode"></label>
</div>
<br>
<span style="color: #429488;padding-right: 20px;" class="material-icons">description</span>
<div class="mdl-textfield mdl-js-textfield">
<textarea class="mdl-textfield__input" type="text" name="notes"
id="id_edit_notes"></textarea>
<label class="mdl-textfield__label" for="id_edit_notes"></label>
</div>
<br>
<button
class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored"
type="submit">
提交
</button>
<br><br><br><br>
<div class="close" style="color:rgb(65, 147, 136);">关闭</div>
</form>
</div>
<!-- 表格内容 -->
<form action="books.php?act=insert" method="post">
<span style="color: #429488;padding-right: 20px;" class="material-icons">account_circle</span>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" name="name" id="id_name">
<label class="mdl-textfield__label" for="id_name">你的名字……</label>
</div>
<br>
<span style="color: #429488;padding-right: 20px;" class="material-icons">auto_stories</span>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" name="bookName" required="required"
id="id_mediaName">
<label class="mdl-textfield__label" for="id_mediaName">书籍名称(必填)</label>
</div>
<br>
<span style="color: #429488;padding-right: 20px;" class="material-icons">add_link</span>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" name="link"
pattern="^((https|http|ftp|rtsp|mms)?:\/\/)[^\s]+" id="id_link1"
onkeyup="autoLoadFilmNameAndExtractCode(this)">
<label class="mdl-textfield__label" for="id_link1">资源链接(必须是永久链接)</label>
<span class="mdl-textfield__error">链接只能包含字母和数字及其他英文符号</span>
</div>
<br>
<span style="color: #429488;padding-right: 20px;" class="material-icons">code</span>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" name="extractCode" id="id_extractCode1"
onkeyup="autoLoadFilmNameAndExtractCode2(this)">
<label class="mdl-textfield__label" for="id_extractCode1">提取码(如果有的话)</label>
</div>
<br>
<span style="color: #429488;padding-right: 20px;" class="material-icons">description</span>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<textarea class="mdl-textfield__input" type="text" name="notes" id="id_notes"></textarea>
<label class="mdl-textfield__label" for="id_notes">备注……</label>
</div>
<br>
<button
class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored"
type="submit">
分享资源
</button>
</form>
<br>
<!-- <div class="mdl-spinner mdl-js-spinner is-active"></div> -->
<!-- 加载中 -->
<!-- <div id="id_load"><span class="mdl-chip"><span class="mdl-chip__text">加载中……</span></span></div> -->
<!-- MDL Progress Bar with Indeterminate Progress -->
<div id="id_load" class="mdl-progress mdl-js-progress mdl-progress__indeterminate"></div>
<br>
<div class="wrap">
<!-- 搜索框 -->
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" value="" name="notes" id="id_searchKey"
style="width:400px;">
<label class="mdl-textfield__label" for="id_searchKey" style="width:400px;">搜索……</label>
</div>
<!-- 查询按钮 -->
<button style="margin-left: 100px;"
class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect" id='id_searchBtn'>
<span class="material-icons">search</span>
</button>
<!-- 绘制表格 -->
<table class="mdl-data-table mdl-js-data-table mdl-shadow--2dp" border=1px id='id_searchShow'>
</table>
</div>
<br><br><br><br><br>
</center>
</div>
</main>
</div>
</body>
<!-- Google mdl风格 -->
<script src="mdl/material.min.js"></script>
<!-- 编辑 -->
<script src="js/edit.js"></script>
<!-- 搜索及后面的表格显示 -->
<script src="js/search.js"></script>
<!-- 自动识别提取码 -->
<script src="js/autoLoadLink.js"></script>
<!-- mdl进度条 -->
<script src="js/timeOut.js"></script>
<!-- toast -->
<script src="js/toast.js"></script>
<script>
let l = [[], [], [], [], []];
<?php
$i = 0;
while ($row = mysqli_fetch_array($result)) {
echo "l[0][".$i."]=\"".$row['name']."\";";
echo "l[1][".$i."]=\"".$row['bookName']."\";";
echo "l[2][".$i."]=\"".$row['link']."\";";
echo "l[3][".$i."]=\"".$row['extractCode']."\";";
echo "l[4][".$i."]=\"".$row['notes']."\";\n";
$i++;
}
?>;
new Fuzzysearch(l, "books", "书籍");
</script>
</html>