@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $body = " |
29 | 29 | You are due for refresh on the following units from |
30 | 30 | "; |
31 | - foreach($user->refresh as $r) { |
|
31 | + foreach ($user->refresh as $r) { |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $rs = BoltRefresh::enum("due_time < $now"); |
38 | 38 | $users = array(); |
39 | 39 | |
40 | - foreach($rs as $r) { |
|
40 | + foreach ($rs as $r) { |
|
41 | 41 | $view = BoltView::lookup_id($r->view_id); |
42 | 42 | $user_id = $view->user_id; |
43 | 43 | if (!key_exists($user_id)) { |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | start_table(); |
36 | 36 | |
37 | 37 | switch($table){ |
38 | - case "platform": |
|
39 | - break; |
|
40 | - case "app": |
|
41 | - break; |
|
38 | + case "platform": |
|
39 | + break; |
|
40 | + case "app": |
|
41 | + break; |
|
42 | 42 | case "app_version": |
43 | 43 | print_detail_field(); |
44 | 44 | print_query_field(); |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | case "user": |
90 | 90 | print_query_field(); |
91 | 91 | break; |
92 | - default: |
|
93 | - echo "Unknown table name\n"; |
|
92 | + default: |
|
93 | + echo "Unknown table name\n"; |
|
94 | 94 | exit(); |
95 | 95 | } |
96 | 96 |
@@ -35,63 +35,63 @@ |
||
35 | 35 | start_table(); |
36 | 36 | |
37 | 37 | switch($table){ |
38 | - case "platform": |
|
39 | - break; |
|
40 | - case "app": |
|
41 | - break; |
|
42 | - case "app_version": |
|
43 | - print_detail_field(); |
|
44 | - print_query_field(); |
|
45 | - break; |
|
46 | - case "host": |
|
47 | - echo " |
|
38 | +case "platform": |
|
39 | + break; |
|
40 | +case "app": |
|
41 | + break; |
|
42 | +case "app_version": |
|
43 | + print_detail_field(); |
|
44 | + print_query_field(); |
|
45 | + break; |
|
46 | +case "host": |
|
47 | + echo " |
|
48 | 48 | <tr> |
49 | 49 | <td align=\"right\">Show Aggregate Information</td> |
50 | 50 | <td> |
51 | 51 | "; |
52 | - print_checkbox("", "show_aggregate", $show_aggregate); |
|
53 | - echo " |
|
52 | + print_checkbox("", "show_aggregate", $show_aggregate); |
|
53 | + echo " |
|
54 | 54 | </td> |
55 | 55 | </tr> |
56 | 56 | "; |
57 | - print_detail_field(); |
|
58 | - print_query_field(); |
|
59 | - break; |
|
60 | - case "workunit": |
|
61 | - print_detail_field(); |
|
62 | - print_query_field(); |
|
63 | - echo "<input type=\"hidden\" name=\"sort_by\" value=\"id\">\n"; |
|
64 | - break; |
|
65 | - case "result": |
|
66 | - echo "<tr><td align=\"right\">Server state</td><td> "; |
|
67 | - server_state_select(); |
|
68 | - echo "</td></tr>\n"; |
|
69 | - //print_text_field( "Batch number:", "batch", $batch ); |
|
70 | - echo "<tr><td align=\"right\">Outcome</td><td>"; |
|
71 | - outcome_select(); |
|
72 | - echo "</td></tr>\n"; |
|
73 | - echo "<tr><td align=\"right\">Client state</td><td>"; |
|
74 | - client_state_select(); |
|
75 | - echo "</td></tr>\n"; |
|
76 | - echo "<tr><td align=\"right\">Validate state</td><td>"; |
|
77 | - validate_state_select(); |
|
78 | - echo "</td></tr>\n"; |
|
79 | - echo "<tr><td align=\"right\">Sort by</td><td>"; |
|
80 | - result_sort_select(); |
|
81 | - sort_order_select(); |
|
82 | - echo "</td></tr>\n"; |
|
83 | - print_detail_field(); |
|
84 | - print_query_field(); |
|
85 | - break; |
|
86 | - case "team": |
|
87 | - print_query_field(); |
|
88 | - break; |
|
89 | - case "user": |
|
90 | - print_query_field(); |
|
91 | - break; |
|
92 | - default: |
|
93 | - echo "Unknown table name\n"; |
|
94 | - exit(); |
|
57 | + print_detail_field(); |
|
58 | + print_query_field(); |
|
59 | + break; |
|
60 | +case "workunit": |
|
61 | + print_detail_field(); |
|
62 | + print_query_field(); |
|
63 | + echo "<input type=\"hidden\" name=\"sort_by\" value=\"id\">\n"; |
|
64 | + break; |
|
65 | +case "result": |
|
66 | + echo "<tr><td align=\"right\">Server state</td><td> "; |
|
67 | + server_state_select(); |
|
68 | + echo "</td></tr>\n"; |
|
69 | + //print_text_field( "Batch number:", "batch", $batch ); |
|
70 | + echo "<tr><td align=\"right\">Outcome</td><td>"; |
|
71 | + outcome_select(); |
|
72 | + echo "</td></tr>\n"; |
|
73 | + echo "<tr><td align=\"right\">Client state</td><td>"; |
|
74 | + client_state_select(); |
|
75 | + echo "</td></tr>\n"; |
|
76 | + echo "<tr><td align=\"right\">Validate state</td><td>"; |
|
77 | + validate_state_select(); |
|
78 | + echo "</td></tr>\n"; |
|
79 | + echo "<tr><td align=\"right\">Sort by</td><td>"; |
|
80 | + result_sort_select(); |
|
81 | + sort_order_select(); |
|
82 | + echo "</td></tr>\n"; |
|
83 | + print_detail_field(); |
|
84 | + print_query_field(); |
|
85 | + break; |
|
86 | +case "team": |
|
87 | + print_query_field(); |
|
88 | + break; |
|
89 | +case "user": |
|
90 | + print_query_field(); |
|
91 | + break; |
|
92 | +default: |
|
93 | + echo "Unknown table name\n"; |
|
94 | + exit(); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | row2("Number of entries to show", "<input name=\"nresults\" value=\"20\">"); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | start_table(); |
36 | 36 | |
37 | -switch($table){ |
|
37 | +switch ($table) { |
|
38 | 38 | case "platform": |
39 | 39 | break; |
40 | 40 | case "app": |
@@ -102,5 +102,5 @@ discard block |
||
102 | 102 | print_describe_table($table, 4); |
103 | 103 | |
104 | 104 | admin_page_tail(); |
105 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
105 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
106 | 106 | ?> |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | start_table(); |
36 | 36 | |
37 | -switch($table){ |
|
37 | +switch($table) { |
|
38 | 38 | case "platform": |
39 | 39 | break; |
40 | 40 | case "app": |
@@ -55,5 +55,5 @@ |
||
55 | 55 | </form> |
56 | 56 | "; |
57 | 57 | admin_page_tail(); |
58 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
58 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
59 | 59 | ?> |
@@ -71,9 +71,9 @@ |
||
71 | 71 | "; |
72 | 72 | start_table(); |
73 | 73 | row1("User settings"); |
74 | - $x = ($flags&BOLT_FLAGS_SHOW_ALL)?"checked":""; |
|
74 | + $x = ($flags&BOLT_FLAGS_SHOW_ALL) ? "checked" : ""; |
|
75 | 75 | row2("Show hidden courses?", "<input type=checkbox name=show_all $x>"); |
76 | - $x = ($flags&BOLT_FLAGS_DEBUG)?"checked":""; |
|
76 | + $x = ($flags&BOLT_FLAGS_DEBUG) ? "checked" : ""; |
|
77 | 77 | row2("Show debugging output?", "<input type=checkbox name=debug $x>"); |
78 | 78 | row2("", "<input class=\"btn btn-primary\" type=submit name=submit value=\"Update settings\">"); |
79 | 79 | end_table(); |
@@ -21,11 +21,11 @@ |
||
21 | 21 | // TODO: document - when/why would you want to do this? |
22 | 22 | // TODO: use new DB interface |
23 | 23 | |
24 | -include_once( "../inc/db.inc" ); |
|
25 | -include_once( "../inc/util.inc" ); |
|
26 | -include_once( "../inc/db_ops.inc" ); |
|
27 | -include_once( "../inc/util_ops.inc" ); |
|
28 | -include_once( "../inc/prefs.inc" ); |
|
24 | +include_once("../inc/db.inc"); |
|
25 | +include_once("../inc/util.inc"); |
|
26 | +include_once("../inc/db_ops.inc"); |
|
27 | +include_once("../inc/util_ops.inc"); |
|
28 | +include_once("../inc/prefs.inc"); |
|
29 | 29 | |
30 | 30 | db_init(); |
31 | 31 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | echo "no app for batch $b->id\n"; |
34 | 34 | return; |
35 | 35 | } |
36 | - if ($b->fraction_done>0 && $b->credit_canonical>0) { |
|
36 | + if ($b->fraction_done > 0 && $b->credit_canonical > 0) { |
|
37 | 37 | $credit_total = $b->credit_canonical/$b->fraction_done; |
38 | 38 | $fpops_total = $credit_total*(86400e9/200); |
39 | 39 | } else { |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | start_table(); |
93 | 93 | table_header("Workunit", "Elapsed", "Proj FLOPS", "Raw credit", "granted"); |
94 | 94 | $n = 0; |
95 | - $total=0; |
|
96 | - foreach($rs as $r) { |
|
95 | + $total = 0; |
|
96 | + foreach ($rs as $r) { |
|
97 | 97 | $raw_credit = $r->elapsed_time*$r->flops_estimate*COBB_SCALE; |
98 | 98 | $n++; |
99 | 99 | $total += $raw_credit; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | function av_string($av_id) { |
119 | - if ($av_id> 0) { |
|
119 | + if ($av_id > 0) { |
|
120 | 120 | $av = BoincAppVersion::lookup($av_id); |
121 | 121 | $plat = BoincPlatform::lookup_id($av->platformid); |
122 | 122 | $x = "<a href=credit.php?av_id=$av_id>$plat->name $av->plan_class</a>"; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | function show_host_av($host_id, $av_id) { |
88 | 88 | $hav = BoincHostAppVersion::lookup("host_id=$host_id and app_version_id=$av_id"); |
89 | - page_head("Host $host_id / app_version $av_id credit"); |
|
89 | + page_head("host $host_id / app_version $av_id credit"); |
|
90 | 90 | echo "Results"; |
91 | 91 | $rs = BoincResult::enum("hostid=$host_id and app_version_id=$av_id and validate_state=1 order by id desc limit 100"); |
92 | 92 | start_table(); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | function show_appl($app_id) { |
182 | 182 | $app = BoincApp::lookup_id($app_id); |
183 | - page_head("App $app->user_friendly_name credit"); |
|
183 | + page_head("app $app->user_friendly_name credit"); |
|
184 | 184 | $avs = BoincAppVersion::enum("appid=$app_id and deprecated=0"); |
185 | 185 | start_table(); |
186 | 186 | table_header("platform/class/version", "PFC nsamples", "PFC avg", "PFC scale"); |
@@ -44,15 +44,15 @@ |
||
44 | 44 | $start_id = 0; //Set this to something else if you like |
45 | 45 | $posts = _mysql_query("select * from post where id>$start_id order by id"); |
46 | 46 | echo _mysql_error(); |
47 | - $i=0; |
|
48 | - while ($post = _mysql_fetch_object($posts)){ |
|
47 | + $i = 0; |
|
48 | + while ($post = _mysql_fetch_object($posts)) { |
|
49 | 49 | $i++; |
50 | 50 | if ($i%100 == 0) { //For every 100 posts |
51 | - echo $post->id.". "; flush(); // print out where we are |
|
51 | + echo $post->id.". "; flush(); // print out where we are |
|
52 | 52 | //usleep(200000); |
53 | 53 | } |
54 | 54 | |
55 | - if ($post->id > $start_id){ |
|
55 | + if ($post->id > $start_id) { |
|
56 | 56 | fix_post($post); |
57 | 57 | } |
58 | 58 | } |
@@ -45,14 +45,15 @@ |
||
45 | 45 | $posts = _mysql_query("select * from post where id>$start_id order by id"); |
46 | 46 | echo _mysql_error(); |
47 | 47 | $i=0; |
48 | - while ($post = _mysql_fetch_object($posts)){ |
|
48 | + while ($post = _mysql_fetch_object($posts)) { |
|
49 | 49 | $i++; |
50 | - if ($i%100 == 0) { //For every 100 posts |
|
50 | + if ($i%100 == 0) { |
|
51 | +//For every 100 posts |
|
51 | 52 | echo $post->id.". "; flush(); // print out where we are |
52 | 53 | //usleep(200000); |
53 | 54 | } |
54 | 55 | |
55 | - if ($post->id > $start_id){ |
|
56 | + if ($post->id > $start_id) { |
|
56 | 57 | fix_post($post); |
57 | 58 | } |
58 | 59 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | WHERE CONVERT(special_user, DECIMAL) > 0 and prefs.userid=user.id" |
39 | 39 | ); |
40 | 40 | for ($i=1; $i<=_mysql_num_rows($result); $i++){ |
41 | - $foo = _mysql_fetch_object($result); |
|
41 | + $foo = _mysql_fetch_object($result); |
|
42 | 42 | echo "<form action=\"manage_special_users_action.php\" method=\"POST\">\n"; |
43 | 43 | echo "<input type=\"hidden\" name=\"userid\" value=\"$foo->userid\" |
44 | 44 | <tr><td>$foo->name ($foo->id)</td> |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | row1("Current special users", '9'); |
28 | 28 | |
29 | 29 | echo "<tr><td>User</td>"; |
30 | -for ($i=0; $i<S_NFLAGS; $i++) { |
|
31 | - echo "<td width=\"15\">" . $special_user_bitfield[$i] . "</td>\n"; |
|
30 | +for ($i = 0; $i < S_NFLAGS; $i++) { |
|
31 | + echo "<td width=\"15\">".$special_user_bitfield[$i]."</td>\n"; |
|
32 | 32 | } |
33 | 33 | echo "</tr>"; |
34 | 34 | |
@@ -37,13 +37,13 @@ discard block |
||
37 | 37 | FROM forum_preferences as prefs, user |
38 | 38 | WHERE CONVERT(special_user, DECIMAL) > 0 and prefs.userid=user.id" |
39 | 39 | ); |
40 | -for ($i=1; $i<=_mysql_num_rows($result); $i++){ |
|
40 | +for ($i = 1; $i <= _mysql_num_rows($result); $i++) { |
|
41 | 41 | $foo = _mysql_fetch_object($result); |
42 | 42 | echo "<form action=\"manage_special_users_action.php\" method=\"POST\">\n"; |
43 | 43 | echo "<input type=\"hidden\" name=\"userid\" value=\"$foo->userid\" |
44 | 44 | <tr><td>$foo->name ($foo->id)</td> |
45 | 45 | "; |
46 | - for ($j=0; $j<S_NFLAGS; $j++) { |
|
46 | + for ($j = 0; $j < S_NFLAGS; $j++) { |
|
47 | 47 | $bit = substr($foo->special_user, $j, 1); |
48 | 48 | echo "<td><input type=\"checkbox\" name=\"role".$j."\" value=\"1\""; |
49 | 49 | if ($bit == 1) { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | echo "<tr><form action=\"manage_special_users_action.php\" method=\"POST\">\n"; |
59 | 59 | echo "<td>Add UserID:<input type=\"text\" name=\"userid\" size=\"6\"></td>"; |
60 | 60 | |
61 | -for ($j=0; $j<S_NFLAGS; $j++) { |
|
61 | +for ($j = 0; $j < S_NFLAGS; $j++) { |
|
62 | 62 | echo "<td><input type=\"checkbox\" name=\"role".$j."\" value=\"1\""; |
63 | 63 | echo "></td>\n"; |
64 | 64 | } |
@@ -69,5 +69,5 @@ discard block |
||
69 | 69 | |
70 | 70 | admin_page_tail(); |
71 | 71 | |
72 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
72 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
73 | 73 | ?> |
@@ -37,7 +37,7 @@ |
||
37 | 37 | FROM forum_preferences as prefs, user |
38 | 38 | WHERE CONVERT(special_user, DECIMAL) > 0 and prefs.userid=user.id" |
39 | 39 | ); |
40 | -for ($i=1; $i<=_mysql_num_rows($result); $i++){ |
|
40 | +for ($i=1; $i<=_mysql_num_rows($result); $i++) { |
|
41 | 41 | $foo = _mysql_fetch_object($result); |
42 | 42 | echo "<form action=\"manage_special_users_action.php\" method=\"POST\">\n"; |
43 | 43 | echo "<input type=\"hidden\" name=\"userid\" value=\"$foo->userid\" |