-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule.php
More file actions
211 lines (162 loc) · 5.74 KB
/
module.php
File metadata and controls
211 lines (162 loc) · 5.74 KB
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
<?php
@session_start();
require "config1.inc.php";
if($_SESSION['user']==""){
header( 'Location: /login1.php' ) ;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../favicon.ico">
<title>Module information</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body style="padding-top:50px; padding-bottom:60px;">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">Hao useful</a>
<?php
if($_SESSION['user']=="")
{
echo'
<div class="navbar-brand"><span class="name">Please Login<?echo $?></span></div>';
}
else
{
echo'<p class="navbar-text navbar-right">';echo 'Hi '; echo $_SESSION['name'];echo '! Your major is ';echo $_SESSION['major_name'] ;echo'!</p>';
}
?>
</div>
<div id="navbar" class="collapse navbar-collapse">
<div class="pull-right">
<form action="/logout.php" method="get">
<button class="btn btn-default navbar-btn">Log out</button>
</form>
</div>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container">
<h1>Module information</h1>
<div class="col-xs-12 col-md-8">
<?php
$module_row=$_SESSION['module_row'];
//echo count($module_row);
//echo $module_row[0][0];
foreach ($module_row as $module) {
$module=$module[0];
echo '<div>
<div class="panel panel-primary">';
echo '<div class="panel-heading">';
echo $module;
echo '</div>
<div class="panel-body" style="padding:0">
<table class = "table table-bordered" style="margin-bottom:0">
<thead>
<tr>
<th>Teacher</th>
<th>Classroom</th>
<th>Time</th>
</tr>
</thead>
<tbody>';
$sql="select * from module where module_name='$module'";
$result = mysql_query($sql);
$module_info=mysql_fetch_row($result);
if($module_info){
echo'<tr>';
echo '<td>';
echo $module_info['2'];
echo '</td>';
echo '<td>';
echo $module_info['3'];
echo '</td>';
echo '<td>';
echo $module_info['4'];
echo '</td>';
echo '</tr>';
echo '
</tbody>
</table>
</div>
</div>
</div>
';
}
else{
echo 'can not find ';
}
}
?>
</div>
<div class="col-xs-12 col-md-4">
<div class="panel panel-info">
<div class="panel-heading">Major notifications</div>
<div class="panel-body" style="padding:0">
<ul class = "list-group" style="margin-bottom:0">
<li class = "list-group-item">
<span class = "badge">2016/03/30</span>
Mathematics is cancelled tommorow
</li>
<li class = "list-group-item">
<span class = "badge">2016/03/27</span>
Sign up for basketball this wednesday
</li>
</ul>
</div>
</div>
<br>
<div class="panel panel-info">
<div class="panel-heading">help forum</div>
<div class="panel-body" style="padding:0">
<ul class = "list-group" style="margin-bottom:0">
<li class = "list-group-item">
<span class = "badge">2016/03/30</span>
I do not know how to ..
</li>
<li class = "list-group-item">
<span class = "badge">2016/03/27</span>
I have problem in ..
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="footer" class="container">
<nav class="navbar navbar-default navbar-fixed-bottom">
<div class="navbar-inner navbar-content-center">
<p class="text-muted credit" style="padding: 10px; margin-top:10px;">
Coventry University and Guangdong University
</p>
</div>
</nav>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>