-
Notifications
You must be signed in to change notification settings - Fork 0
/
results.php
176 lines (162 loc) · 5.72 KB
/
results.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
<?php
/*!
* **************************************************************
**************** ProQuiz V2 ******************************
***************************************************************/
/* documentation at: http://proquiz.softon.org/documentation/
/* Designed & Maintained by
/* - Softon Technologies
/* Developer
/* - Manzovi
/* For Support Contact @
/* - proquiz@softon.org
/* Release Date : 02 Feb 2011
/* Licensed under GPL license:
/* http://www.gnu.org/licenses/gpl.html
*/
?><?php
if($_GET['type']=='all'){
$results_arr = getResults($db,'all');
?>
<div style="clear: both;"></div>
<div class="headDisp2">All Results :</div>
<table cellpadding="0" cellspacing="0" border="0" class="display" id="results">
<thead>
<tr>
<th>Rank</th>
<th>Quiz ID</th>
<th>Username</th>
<th>Type</th>
<th>Date</th>
<th>(%)</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<?php foreach($results_arr as $value){
$user = getUserData($db,$value['user']);
$type = getQuizType($value['created_by'],$value['locked_quiz']);
$class = getClass($value['percentage']);
?>
<tr class="<?php echo $class; ?>">
<td><?php echo $pq->getRank($db,$value['percentage'],$value['time_used']/$value['total_qstn']); ?></td>
<td>#<a href="summary.php?qid=<?php echo $value['instid']; ?>" target="_blank"><?php echo $value['instid']; ?></a></td>
<td><?php echo $user['username']; ?></td>
<td><?php echo $type; ?></td>
<td class="center"><?php echo date("d-m-Y",$value['quiz_inst_ts']); ?></td>
<td class="center"><?php echo $value['percentage']; ?></td>
<td class="center"><input type="button" class="spbutton" value="Go" onclick="window.location='summary.php?qid=<?php echo $value['instid']; ?>'" /></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th>Rank</th>
<th>Quiz ID</th>
<th>Username</th>
<th>Type</th>
<th>Date</th>
<th>%</th>
<th>Details</th>
</tr>
</tfoot>
</table>
<div style="clear: both;margin-top: 80px;"></div>
<?php }elseif($_GET['type']=='my_quiz'){
$results_arr = getResults($db,'my_quiz'); ?>
<div style="clear: both;"></div>
<div class="headDisp2">My Quiz Results :</div>
<table cellpadding="0" cellspacing="0" border="0" class="display" id="results">
<thead>
<tr>
<th>Rank</th>
<th>Quiz ID</th>
<th>Username</th>
<th>Type</th>
<th>Percentage (%)</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<?php foreach($results_arr as $value){
$user = getUserData($db,$value['user']);
$type = getQuizType($value['created_by'],$value['locked_quiz']);
$class = getClass($value['percentage']);
?>
<tr class="<?php echo $class; ?>">
<td><?php echo $pq->getRank($db,$value['percentage'],$value['time_used']/$value['total_qstn']); ?></td>
<td>#<a href="summary.php?qid=<?php echo $value['instid']; ?>" target="_blank"><?php echo $value['instid']; ?></a></td>
<td><?php echo $user['username']; ?></td>
<td><?php echo $type; ?></td>
<td class="center"><?php echo $value['percentage']; ?></td>
<td class="center"><input type="button" class="spbutton" value="Go" onclick="window.location='summary.php?qid=<?php echo $value['instid']; ?>'" /></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th>Rank</th>
<th>Quiz ID</th>
<th>Username</th>
<th>Type</th>
<th>Percentage</th>
<th>Details</th>
</tr>
</tfoot>
</table>
<div style="clear: both;margin-top: 80px;"></div>
<?php }elseif($_GET['type']=='stats'){
$results_arr = getResults($db,'stats'); ?>
<div style="clear: both;"></div>
<div class="headDisp2">Overall Statistics :</div>
<div style="width: 500px;height: 400px;" id="statsImg">
<?php if($sock = @fsockopen("chart.apis.google.com",80,$error_num,$error_str,5)){ ?>
<img width="500px" height="400px" src="<?php echo $results_arr; ?>" />
<?php } ?>
</div>
<div style="clear: both;margin-top: 80px;"></div>
<?php }else{
$results_arr = getResults($db,$_GET['type']);
?>
<div style="clear: both;"></div>
<div class="headDisp2">My Results :</div>
<table cellpadding="0" cellspacing="0" border="0" class="display" id="results">
<thead>
<tr>
<th>Rank</th>
<th>Quiz ID</th>
<th>Type</th>
<th>Date</th>
<th>Percentage (%)</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<?php foreach($results_arr as $value){
$user = getUserData($db,$value['user']);
$type = getQuizType($value['created_by'],$value['locked_quiz']);
$class = getClass($value['percentage']);
?>
<tr class="<?php echo $class; ?>">
<td><?php echo $pq->getRank($db,$value['percentage'],$value['time_used']/$value['total_qstn']); ?></td>
<td>#<a href="summary.php?qid=<?php echo $value['instid']; ?>" target="_blank"><?php echo $value['instid']; ?></a></td>
<td><?php echo $type; ?></td>
<td><?php echo date("d-m-Y",$value['quiz_inst_ts']); ?></td>
<td class="center"><?php echo $value['percentage']; ?></td>
<td class="center"><input type="button" class="spbutton" value="Go" onclick="window.location='summary.php?qid=<?php echo $value['instid']; ?>'" /></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th>Rank</th>
<th>Quiz ID</th>
<th>Username</th>
<th>Type</th>
<th>Percentage</th>
<th>Details</th>
</tr>
</tfoot>
</table>
<div style="clear: both;margin-top: 80px;"></div>
<?php } ?>