-
Notifications
You must be signed in to change notification settings - Fork 22
/
index.php~
executable file
·339 lines (314 loc) · 10.5 KB
/
index.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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<?php
session_start();
include "include/conn.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" id="html">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<script src="include/js/Jquery.js">
</script>
<link href="include/css/global.css" type="text/css" rel="stylesheet"/>
<title>沈工大 - 排课系统</title>
</head>
<body class="body_pos">
<div id="contest">
<!-- div层[排一个课]-->
<div class="header">
<div class="header_text">
<ul>
<li><a href="index.php" class="header_first">首页</a></li>
<li><a href="query.php" class="header_first">机房课程表</a></li>
<li><a href="class_shedule.php" class="header_first">班级课程表</a></li>
<?php
if(isset($_SESSION['teacher_id']))
{
$select_flag=0;
echo "
<li><a href=teacher/teacher_index.php class=header_first>个人中心</a> </li>
<li><a href=admin/data_dump.php class=header_first>Excel课表</a></li>
<li><a class=header_first onclick=zhuxiao()>注销</a></li>";
}
else
{
$select_flag=1;
echo "
<li><a href = teacher/index.php class=header_first>教师登录</li></a>";
}
?>
<li><a style="margin-left:60px;font-size:14px; width:120px;" class="header_first">
<ul class="some_select"style= left:<?php echo $select_flag==0?"640px":"520px;"; ?>>
<li onclick="course_select()">按课程查询</li>
<li onclick="address_select()">按机房查询</li>
<li onclick="student_num_select()">按学号查询</li>
<li onclick="week_select()">按周次查询</li>
<li onclick="teacher_num_select()">按教师号查询</li>
</ul>
更多查询</a>
</li>
<li><a style=" font-size:14px; width:90px;"href="http://portal.sut.edu.cn/dcp/forward.action?path=/portal/portal&p=HomePage" class="header_first" target="_blank">数字工大</a></li>
</ul>
</div>
</div>
<div class="triangle1"></div>
<div class="triangle2"></div>
<!--<a href = "teacher/index.php" class="a" style="width:300px; display:inline">教师登录</a>
<a href = "query.php" class="a" style="width:300px; display:inline">机房课程表</a>
-->
<center>
<br/>
<form name="form">
<input type="text" name="year" id="year" style="display:none;" value="<?php echo $db_year;?>"/>
<!--隐藏表单,1:course;2:address;3:student_num;4:week;5:teacher_num;6:teaacher_name-->
<input type="text" style="display:none" name="select_id" />
学院:
<select name="school" id="school" onChange="change_school(document.form.school.options[document.form.school.selectedIndex].value)">
<option value="" selected="selected">==请选择学院==</option>
</select>
专业:
<select name="major" id="major" onChange="change_major(document.form.major.options[document.form.major.selectedIndex].value)">
<option value=""selected="selected">==请选择专业==</option>
</select>
年级:
<select name="grade" id="grade" onchange="change_grade(document.form.grade.options[document.form.grade.selectedIndex].value)">
<option value="" selected="selected">==请选择年级==</option>
</select>
班级:
<select name="w_class" id="w_class">
<option value="" selected="selected">==请选择班级==</option>
</select>
<input type="button" value="查询" onclick="Inquiry()" class="button"/>
<input type="button" value="按教师查询" onclick="up_Inquiry()" class="button"/>
<p>
<p>
<center>
<div id="mask">
</div>
<div id="up"; style="display:none; width:400px; height:250px;">
<br /><br />
<font id="select_any">请输入教师名: </font>
<input name="teacher_name" id="teacher_name" type="text" class="input_text" onkeydown="if(event.keyCode == 13) teacher_Inquiry()"/>
<br />
<br />
<input type="button" value="确定" onclick="teacher_Inquiry()" class="button"/>
<input type="button" value="返回" onclick="teacher_Cancel()" class="button"/>
<br />
<br />
</div>
</center>
</form>
<br />
<div id="result_query">
</div>
</center>
</div>
<div class="back-to" id="toolBackTo">
<a class="backtotop">
<img src="image/back-tip.png"/>
</a>
</div>
<div class="footer"></div>
</body>
<script src="include/js/school_major_class.js">
</script>
<script>
function zhuxiao()
{
x = "000";
$.ajax({
type: "POST",
url: "teacher/logout.ajax.php",
data:"x="+x,
success: function(msg)
{
window.top.location.href = "index.php";
}
});
}
var year = document.getElementById("year").value;
function teacher_Inquiry()
{
select_some = document.form.teacher_name.value;
select_id = document.form.select_id.value;
$.ajax({
type:"POST",
url:"take_data_teacher.ajax.php",
data:"select_any="+select_some+"&year="+year+"&select_id="+select_id,
success: function(msg)
{
document.getElementById("contest").style.height="auto";
document.getElementById("result_query").style.display="inline";
document.getElementById("result_query").innerHTML = msg;
}
});
teacher_Cancel();
}
function teacher_Cancel()
{
$('#mask').animate({'opacity':'0'},function(){$('#mask').css({'zIndex':'-5'});});
$('#up').fadeOut(200);
}
function Inquiry()
{
var grade_id = document.form.grade.options[document.form.grade.selectedIndex].value;
var school_id = document.form.school.options[document.form.school.selectedIndex].value;
var major_id = document.form.major.options[document.form.major.selectedIndex].value;
var class_id = document.form.w_class.options[document.form.w_class.selectedIndex].value;
var course_class = grade_id+''+school_id+''+major_id+''+class_id;
//alert(course_class);
$.ajax({
type: "POST",
url: "take_data.ajax.php",
data: "year="+year+"&course_class="+course_class,
success: function(msg)
{
document.getElementById("contest").style.height="auto";
document.getElementById("result_query").style.display="inline";
document.getElementById("result_query").innerHTML = msg;
/*table_temp = document.getElementById("t_table");
var table_rows = table_temp.rows.length;
for(x = table_rows-1;x >0;x--)
{
table_temp.deleteRow(x);
}
if(msg == "")
{
trr = table_temp.insertRow(1);
trr.innerHTML = "暂无课程信息";
}
else
{
cnt=0;
x=0;
var data = msg.split("@");
var len = data.length-1;
//alert(len);
cnt = len;
len = len-1;
//alert(msg);
for(var i = 1;i<=cnt/6;i++)
{
var trr = table_temp.insertRow(1);
for(var j=0;j<6;j++)
{
var tdd = trr.insertCell();
tdd.innerHTML="";
len--;
}
}
for(i = 1;i<=cnt/6;i++)
{
for(var j=0;j<6;j++)
{
table_temp.rows[i].cells[j].innerHTML=data[x];
x++;
}
}
}*/
}
});
}
function click_up()
{
$('#mask').css({'zIndex':'5'});
$('#mask').animate({'opacity':'0.8'},200);
$('#up').fadeIn(200);
}
function course_select()
{
click_up();
document.form.select_id.value=1;
document.getElementById("select_any").innerHTML="请输入课程名:<font class=up_tips>[如:数据结构] <br /> <br /></font>";
document.getElementById("teacher_name").focus();
}
function address_select()
{
click_up();
document.form.select_id.value=2;
document.getElementById("select_any").innerHTML="请输入机房号:<font class=up_tips>[如:205 ]<br /> <br /></font>";
document.getElementById("teacher_name").focus();
}
function student_num_select()
{
click_up();
document.form.select_id.value=3;
document.getElementById("select_any").innerHTML="请输入学号:<font class=up_tips>[如:100405201] <br /> <br /></font>";
document.getElementById("teacher_name").focus();
}
function week_select()
{
click_up();
document.form.select_id.value=4;
document.getElementById("select_any").innerHTML="请输入周次:<font class=up_tips>[如:03 ]<br /> <br /></font>";
document.getElementById("teacher_name").focus();
}
function teacher_num_select()
{
click_up();
document.form.select_id.value=5;
document.getElementById("select_any").innerHTML="请输入教师号:<font class=up_tips>[如:11111 ]<br /> <br /></font>";
document.getElementById("teacher_name").focus();
}
function up_Inquiry()
{
click_up();
document.form.select_id.value=6;
document.getElementById("select_any").innerHTML="请输入教师名:<font class=up_tips>[如:修国一 ]<br /> <br /></font>";
document.getElementById("teacher_name").focus();
}
//返回顶部
$("#toolBackTo").hide();
$(function () {
$(window).scroll(function(){
if ($(window).scrollTop()>1){
$("#toolBackTo").fadeIn(1);
}
else
{
$("#toolBackTo").fadeOut(1);
}
});
//当点击跳转链接后,回到页面顶部位置
});
$("#toolBackTo").click(function(){
$('body,html').animate({scrollTop:0},1000);
return false;
});
//表格排序
function sortrows(Table,n){
var rows = Table.getElementsByTagName("tr");
//rows = Array.prototype.slice.call(rows,1);
var k = rows.length;
try{
rows = Array.prototype.slice.call(rows)
}
catch(e){
var ret = [];
while(k){
ret[--k] = rows[k];//Clone数组
}
rows = ret;
}
rows = rows.splice(1,rows.length);
rows.sort(function (row1,row2){
var cell1 = row1.getElementsByTagName("td")[n];
var cell2 = row2.getElementsByTagName("td")[n];
var val1 = cell1.innerHTML;
var val2 = cell2.innerHTML;
return val1.localeCompare(val2);
});
Table = document.getElementsByTagName("tbody")[0];
for(var i=0;i<rows.length;i++)
{
Table.appendChild(rows[i]);
}
}
function ownSort(m)
{
var Table = document.getElementById("t_table");
sortrows(Table,m);
}
</script>
</html>