1
1
<?php
2
2
function show_scores () {
3
3
# read array from file
4
- echo '<table><tr><th>Name</th><th>Speedup achieved </th></tr> ' ;
4
+ echo '<table><tr><th>Name</th><th>Runtime (CPU seconds) </th></tr> ' ;
5
5
include ("scores.php " );
6
6
7
7
# update array with post request
@@ -10,17 +10,17 @@ function show_scores() {
10
10
$ score = htmlspecialchars ($ _POST ["score " ]);
11
11
$ scores [$ name ] = $ score ;
12
12
}
13
- arsort ($ scores );
13
+ asort ($ scores );
14
14
15
15
# write array to file
16
16
$ handle = fopen ("scores.php " ,"w " );
17
- $ string = " <?php \n\ $scores = " . var_export ($ scores ,true ) . " ; \n ?> " ;
18
- fwrite ($ handle ,$ string );
17
+ $ string = ' <?php $scores = ' . var_export ($ scores ,true ) . ' ;?> ' ;
18
+ fwrite ($ handle , $ string );
19
19
fclose ($ handle );
20
20
21
21
# display table
22
22
foreach ($ scores as $ key =>$ value ) {
23
- echo '<tr><td> ' . $ key . '</td><td> ' . number_format ($ value ,2 ) . ' x </td></tr> ' ;
23
+ echo '<tr><td> ' . $ key . '</td><td> ' . number_format ($ value ,2 ) . '</td></tr> ' ;
24
24
}
25
25
echo '</table> ' ;
26
26
@@ -126,7 +126,8 @@ function show_scores() {
126
126
-->
127
127
128
128
<div class="content">
129
- <? include ('workshop2013/inc/header.php ' ); ?>
129
+ <h1>R script runtime table</h1>
130
+ <!--<h2 class="strapline">November 26th to 29th 2013</h2>-->
130
131
</div>
131
132
132
133
</div>
@@ -161,7 +162,16 @@ function show_scores() {
161
162
162
163
163
164
165
+ <div class="panel-pane pane-custom pane-1 intro clearfix" >
166
+ <p class="intro">
167
+ Below is a table of runtimes automatically submitted by the R script.
168
+ </p>
169
+ </div>
170
+
171
+ <div class="panel-pane pane-custom pane-2 clearfix" >
164
172
<?php show_scores (); ?>
173
+ </div>
174
+
165
175
166
176
167
177
</div>
0 commit comments