-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresult.php
123 lines (112 loc) · 3.9 KB
/
result.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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto">
<link rel="stylesheet" href="assets/css/Responsive-Form.css">
<link rel="stylesheet" href="assets/css/Responsive-Form1.css">
<link rel="stylesheet" href="assets/css/styles.css">
<title>Results</title>
</head>
<body>
<?php
session_start();
include('conn.php');
?>
<div class="container">
<div>
<div class="form-group">
<div id="formdiv">
<table class="table table-striped">
<thead>
<tr>
<th>Event</th>
<th>School</th>
<th>Position</th>
</tr>
</thead>
<tbody>
<tr>
<?php
$quer = mysql_query("SELECT * FROM tb_events");
while($data=mysql_fetch_assoc($quer))
{
extract($data);
$quer1 = mysql_result(mysql_query("SELECT school FROM ".str_replace(' ', '', $data['event'])."_1 WHERE standings = '1'"), 0);
$quer2 = mysql_result(mysql_query("SELECT school FROM ".str_replace(' ', '', $data['event'])."_1 WHERE standings = '2'"), 0);
$quer3 = mysql_result(mysql_query("SELECT school FROM ".str_replace(' ', '', $data['event'])."_1 WHERE standings = '3'"), 0);
echo '<tr>';
echo '<td><strong>'.$data['event'].'</strong></td>';
echo '<td>'.$quer1.'</td>';
echo '<td>1</td>';
echo '</tr>';
echo '<tr>';
echo '<td><strong>'.$data['event'].'</strong></td>';
echo '<td>'.$quer2.'</td>';
echo '<td>2</td>';
echo '</tr>';
echo '<tr>';
echo '<td><strong>'.$data['event'].'</strong></td>';
echo '<td>'.$quer3.'</td>';
echo '<td>3</td>';
echo '</tr>';
echo '<tr>';
echo '<td></td>';
echo '<td></td>';
echo '<td></td>';
echo '</tr>';
}
?>
</tr>
</tbody>
</table>
<label><center><strong></strong><h2>Top 5 Schools</h2><strong></strong></center></label>
<table class="table table-striped">
<tbody>
<tr>
<th>Event</th>
<th>School</th>
<th>Position</th>
</tr>
<?php
$top = mysql_query("SELECT * FROM tb_school_points ORDER BY points DESC LIMIT 5");
while($data1=mysql_fetch_assoc($top)){
extract($data1);
echo '<tr>';
echo '<td><strong>Top School</strong></td>';
echo '<td>'.$data1['school'].'</td>';
echo '<td>'.$data1['points'].'</td>';
echo '</tr>';
}
?>
</tbody>
</table>
<label><center><strong></strong><h2>School Listing</h2><strong></strong></center></label>
<table class="table table-striped">
<tbody>
<tr>
<th>Event</th>
<th>School</th>
<th>Position</th>
</tr>
<?php
$top = mysql_query("SELECT * FROM tb_school_points ORDER BY points DESC");
while($data1=mysql_fetch_assoc($top)){
extract($data1);
echo '<tr>';
echo '<td><strong>School Listing</strong></td>';
echo '<td>'.$data1['school'].'</td>';
echo '<td>'.$data1['points'].'</td>';
echo '</tr>';
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</body>
</html>