-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfind_sel_course.php
137 lines (137 loc) · 7.01 KB
/
find_sel_course.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
<html>
<head>
<meta charset="utf-8">
<title>软件工程专业学生成绩管理系统ヽ(•ω•ゞ)</title>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/mystyle.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<style>
.table > tbody > tr > td{
vertical-align:middle;
}
</style>
</head>
<?php
/**
* Created by PhpStorm.
* User: iron man
* Date: 2017/11/15
* Time: 11:55
*/
include "header.php";
include "controller/find_course_controller.php";
?>
<body style="background: url(img/bg.png) repeat">
<div class="container box-style" style="margin: auto;min-height: 850px;overflow:auto;">
<div class="text-center">
<h1>查询选修课程信息</h1>
<div class="bs-example bs-example-tabs col-md-12" data-example-id="togglable-tabs" style="margin-top: 50px;margin-bottom: 50px;">
<?php
if (!$_SESSION['mode']) {
?>
<ul class="nav nav-pills" role="tablist"
style="border-radius: 10px;padding: 15px;background-color: #eeeeee">
<li role="presentation" class="active col-md-6 " style="padding: 0"><a href="#home" role="tab"
data-toggle="tab"
aria-controls="home"
aria-expanded="true">查询选修课表</a>
</li>
<li role="presentation" class="col-md-6" style="margin-right: -2px;padding: 0"><a href="#profile"
role="tab"
data-toggle="tab"
aria-controls="profile"
aria-expanded="false">查询课程选修情况</a>
</li>
</ul>
<?php
}
?>
<div id="myTabContent" class="tab-content">
<div role="tabpanel" class="tab-pane fade active in" id="home" aria-labelledby="home-tab">
<form action="find_sel_course.php?flag=1" method="post" style="margin-top: 50px">
<label for="">
<select name="level" id="" class="form-control">
<?php
$level_arr = getLevel();
foreach ($level_arr as &$value){
echo "
<option value=\"".$value."\">".$value."级</option>";
}
?>
</select>
</label>
<label for="">
<select name="class" id="" class="form-control">
<option value="1">1班</option>
<option value="2">2班</option>
</select>
</label>
<label for="">
<select name="term" id="" class="form-control">
<option value="1">第一学期</option>
<option value="2">第二学期</option>
</select>
</label>
<input class="btn btn-success" name="submit" type="submit" value="检索">
</form>
<form action="controller/in_course_controller.php" method="get">
<table class="table table-hover text-center" style="margin-top: 50px">
<thead>
<tr>
<th class="text-center">时间</th>
<th class="text-center">周一</th>
<th class="text-center">周二</th>
<th class="text-center">周三</th>
<th class="text-center">周四</th>
<th class="text-center">周五</th>
<th class="text-center">周六</th>
<th class="text-center">周日</th>
</tr>
</thead>
<tbody>
<?php
if (isset($_POST["level"])){
$_SESSION["del_course_category"] = array($_POST['level'],$_POST['class'],$_POST['term']);
$arr = getArr($_POST['level'],$_POST['class'],$_POST['term'],2);
$time_arr = array("8:00-9:50","10:10-12:00","14:30-16:20","16:30-18:20","19:30-21:20");
for ($i=0;$i<5;$i++){
?>
<tr>
<?php
echo "<td>".$time_arr[$i]."</td>";
for ($j=0;$j<7;$j++){
echo "<td>".$arr[$i][$j]."</td>";
}
?>
</tr>
<?php
}
}
?>
</tbody>
</table>
</form>
</div>
<?php
if (!$_SESSION['mode']) {
?>
<div role="tabpanel" class="tab-pane fade" id="profile" aria-labelledby="profile-tab">
<div class="list-group">
<?php
$course_arr = get_sel_info();
for ($i = 0; $i < count($course_arr); $i++) {
echo "<div class=\"col-md-3\" style='margin-top: 20px'><a href=\"#\" class=\"list-group-item\">" . $course_arr[$i]->cname . "<br>" . $course_arr[$i]->teacher . "<br>学分:" . $course_arr[$i]->score . "<br>" . $course_arr[$i]->date . "<br>" . $course_arr[$i]->place . "<br>选修人数:" . get_count($course_arr[$i]->cid) . "人</a></div>";
}
?>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
</body>
</html>