@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | credit_to_ops($credit, $ops, $unit); |
44 | 44 | |
45 | 45 | if ($bolden) { |
46 | - $lbold="[["; |
|
47 | - $rbold="]]"; |
|
46 | + $lbold = "[["; |
|
47 | + $rbold = "]]"; |
|
48 | 48 | } else { |
49 | - $lbold=""; $rbold=""; |
|
49 | + $lbold = ""; $rbold = ""; |
|
50 | 50 | } |
51 | 51 | return " $lbold$cobbs Cobblestones$rbold of computation ($ops $unit floating-point operations)"; |
52 | 52 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | // |
87 | 87 | function show_share_buttons() { |
88 | 88 | echo '<p>'; |
89 | - $current_url = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; |
|
89 | + $current_url = (empty($_SERVER['HTTPS']) ? 'http' : 'https')."://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; |
|
90 | 90 | $cert_url = urlencode($current_url); |
91 | 91 | |
92 | 92 | // Share on Facebook |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | if (DISABLE_TEAMS) error_page("Teams are disabled"); |
28 | 28 | |
29 | 29 | $border = get_str("border", true); |
30 | -if ($border=="no") { |
|
31 | - $border=0; |
|
30 | +if ($border == "no") { |
|
31 | + $border = 0; |
|
32 | 32 | } else { |
33 | - $border=8; |
|
33 | + $border = 8; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | // Make sure user_id is in the URL so that share functions work |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | if (!$user_id) { |
40 | 40 | $user = get_logged_in_user(); |
41 | 41 | Header(sprintf('Location: %s/cert_team.php?user_id=%d%s', |
42 | - url_base(), $user->id, $border==0?'&border=no':'' |
|
42 | + url_base(), $user->id, $border == 0 ? '&border=no' : '' |
|
43 | 43 | )); |
44 | 44 | exit; |
45 | 45 | } |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | require_once("../inc/cert.inc"); |
25 | 25 | |
26 | 26 | $border = get_str("border", true); |
27 | -if ($border=="no") { |
|
28 | - $border=0; |
|
27 | +if ($border == "no") { |
|
28 | + $border = 0; |
|
29 | 29 | } else { |
30 | - $border=8; |
|
30 | + $border = 8; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | // Make sure user_id is in the URL so that share functions work |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | if (!$user_id) { |
37 | 37 | $user = get_logged_in_user(); |
38 | 38 | Header(sprintf('Location: %s/cert1.php?user_id=%d%s', |
39 | - url_base(), $user->id, $border==0?'&border=no':'' |
|
39 | + url_base(), $user->id, $border == 0 ? '&border=no' : '' |
|
40 | 40 | )); |
41 | 41 | exit; |
42 | 42 | } |
@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | require_once("../inc/user.inc"); |
26 | 26 | |
27 | 27 | $border = get_str("border", true); |
28 | -if ($border=="no") { |
|
29 | - $border=0; |
|
28 | +if ($border == "no") { |
|
29 | + $border = 0; |
|
30 | 30 | } else { |
31 | - $border=8; |
|
31 | + $border = 8; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | // Make sure user_id is in the URL so that share functions work |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | if (!$user_id) { |
38 | 38 | $user = get_logged_in_user(); |
39 | 39 | Header(sprintf('Location: %s/cert_all.php?user_id=%d%s', |
40 | - url_base(), $user->id, $border==0?'&border=no':'' |
|
40 | + url_base(), $user->id, $border == 0 ? '&border=no' : '' |
|
41 | 41 | )); |
42 | 42 | exit; |
43 | 43 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | <tr><th align=left>Project</th><th align=left>Cobblestones</th><th align=left>Joined</th></tr> |
92 | 92 | "; |
93 | 93 | foreach ($user->projects as $p) { |
94 | - if ($p->total_credit<100) continue; |
|
94 | + if ($p->total_credit < 100) continue; |
|
95 | 95 | show_proj($p); |
96 | 96 | } |
97 | 97 | echo " |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if (!defined("DELETE_DELAY")) define("DELETE_DELAY", 2); |
43 | 43 | |
44 | 44 | function is_delete_account_token_valid($userid, $token) { |
45 | - if (!is_valid_token($userid, $token, TOKEN_TYPE_DELETE_ACCOUNT) ) { |
|
45 | + if (!is_valid_token($userid, $token, TOKEN_TYPE_DELETE_ACCOUNT)) { |
|
46 | 46 | sleep(LOGIN_FAIL_SLEEP_SEC); |
47 | 47 | return false; |
48 | 48 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | // |
127 | 127 | function is_over_but_not_validated($res) { |
128 | 128 | if ($res->server_state == RESULT_SERVER_STATE_OVER && $res->outcome == RESULT_OUTCOME_SUCCESS && |
129 | - ($res->validate_state == VALIDATE_STATE_INIT || $res->validate_state == VALIDATE_STATE_INCONCLUSIVE) ) { |
|
129 | + ($res->validate_state == VALIDATE_STATE_INIT || $res->validate_state == VALIDATE_STATE_INCONCLUSIVE)) { |
|
130 | 130 | return true; |
131 | 131 | } |
132 | 132 | return false; |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | // |
145 | 145 | function cancel_results_for_user($user) { |
146 | 146 | $ress = BoincResult::enum("userid = $user->id"); |
147 | - $cancel_clause="server_state=".RESULT_SERVER_STATE_OVER.", outcome=".RESULT_OUTCOME_CLIENT_DETACHED.", validate_state=".VALIDATE_STATE_INVALID; |
|
148 | - $set_id_clause="hostid=0, userid=0"; |
|
147 | + $cancel_clause = "server_state=".RESULT_SERVER_STATE_OVER.", outcome=".RESULT_OUTCOME_CLIENT_DETACHED.", validate_state=".VALIDATE_STATE_INVALID; |
|
148 | + $set_id_clause = "hostid=0, userid=0"; |
|
149 | 149 | foreach ($ress as $res) { |
150 | 150 | if (is_in_progress($res) || is_over_but_not_validated($res)) { |
151 | 151 | $res->update($cancel_clause.", ".$set_id_clause); |
@@ -168,12 +168,12 @@ discard block |
||
168 | 168 | |
169 | 169 | // delete remote submit user |
170 | 170 | // |
171 | - delete_remote_submit_user($user); // from submit_util.inc |
|
171 | + delete_remote_submit_user($user); // from submit_util.inc |
|
172 | 172 | |
173 | 173 | // remove user's team records |
174 | 174 | // |
175 | - user_erase_team_owner($user); // from team.inc |
|
176 | - user_quit_team($user); // from team.inc |
|
175 | + user_erase_team_owner($user); // from team.inc |
|
176 | + user_quit_team($user); // from team.inc |
|
177 | 177 | user_erase_team_delta($user); // from team.inc |
178 | 178 | |
179 | 179 | // Items that do not have logic elsewhere |
@@ -200,6 +200,6 @@ discard block |
||
200 | 200 | BoincTeamAdmin::delete("userid=$user->id"); |
201 | 201 | |
202 | 202 | // final action |
203 | - delete_user($user); //from user_util.inc |
|
203 | + delete_user($user); //from user_util.inc |
|
204 | 204 | return 0; |
205 | 205 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | echo "<p>"; |
29 | 29 | |
30 | 30 | form_start(secure_url_base()."edit_passwd_action.php", "post"); |
31 | -form_input_text(tra("New password"), "passwd", "", "password",'id="passwd"',passwd_visible_checkbox("passwd")); |
|
31 | +form_input_text(tra("New password"), "passwd", "", "password", 'id="passwd"', passwd_visible_checkbox("passwd")); |
|
32 | 32 | form_submit(tra("Change password")); |
33 | 33 | form_end(); |
34 | 34 | page_tail(); |
@@ -29,14 +29,14 @@ discard block |
||
29 | 29 | // |
30 | 30 | $idx = strpos($master_url, '://'); |
31 | 31 | if ($idx) { |
32 | - $url = substr($master_url, $idx+strlen('://')); |
|
32 | + $url = substr($master_url, $idx + strlen('://')); |
|
33 | 33 | } else { |
34 | 34 | $url = $master_url; |
35 | 35 | } |
36 | 36 | |
37 | 37 | // convert invalid characters into underscores |
38 | 38 | // |
39 | -for ($i=0; $i<strlen($url); $i++) { |
|
39 | +for ($i = 0; $i < strlen($url); $i++) { |
|
40 | 40 | $c = $url[$i]; |
41 | 41 | if (!ctype_alnum($c) && $c != '.' && $c != '-' && $c != '_') { |
42 | 42 | $url[$i] = '_'; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | //remove trailing underscore(s) |
47 | 47 | // |
48 | -$account_file = "account_" . rtrim($url, '_') . ".xml"; |
|
48 | +$account_file = "account_".rtrim($url, '_').".xml"; |
|
49 | 49 | |
50 | 50 | page_head(tra("Account keys")); |
51 | 51 | text_start(); |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | <p>", |
58 | 58 | tra("This key can be used to:"), |
59 | 59 | "<ul> |
60 | - <li><a href=get_passwd.php>",tra("log in to your account on the web"),"</a>; |
|
60 | + <li><a href=get_passwd.php>",tra("log in to your account on the web"), "</a>; |
|
61 | 61 | <li>", |
62 | 62 | tra("attach a computer to your account without using the BOINC Manager. |
63 | 63 | To do so, install BOINC, |
64 | 64 | create a file named %1 in the BOINC |
65 | - data directory, and set its contents to:","<b>$account_file</b>")," |
|
65 | + data directory, and set its contents to:","<b>$account_file</b>"), " |
|
66 | 66 | <p><pre>", |
67 | 67 | htmlspecialchars( |
68 | 68 | "<account> |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | as described above, but cannot be used to log in to your account or change it in any way. |
77 | 77 | If you want to attach untrusted or insecure computers to your account, |
78 | 78 | do so using your weak account key. |
79 | - Your weak account key is:")," |
|
79 | + Your weak account key is:"), " |
|
80 | 80 | <p><pre>$weak_auth</pre><p> |
81 | 81 | ", |
82 | - tra("The key depends on your account's email address and password. If you change either of these, the weak account key will change.")," |
|
82 | + tra("The key depends on your account's email address and password. If you change either of these, the weak account key will change."), " |
|
83 | 83 | </td></tr></table>" |
84 | 84 | ; |
85 | 85 | text_end(); |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | |
33 | 33 | function sched_log_name($x) { |
34 | 34 | if ($x == 0) return "NO_SUCH_LOG"; |
35 | - return gmdate('Y-m-d_H/Y-m-d_H:i', $x) . ".txt"; |
|
35 | + return gmdate('Y-m-d_H/Y-m-d_H:i', $x).".txt"; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | function sched_log_link($x) { |
39 | 39 | if (file_exists("sched_logs")) { |
40 | - return "<a href=\"../sched_logs/" . sched_log_name($x) . "\">" . time_str($x) . "</a>"; |
|
40 | + return "<a href=\"../sched_logs/".sched_log_name($x)."\">".time_str($x)."</a>"; |
|
41 | 41 | } else { |
42 | 42 | return time_str($x); |
43 | 43 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | function location_form($host) { |
47 | 47 | $none = "selected"; |
48 | - $h=$w=$s=$m=""; |
|
48 | + $h = $w = $s = $m = ""; |
|
49 | 49 | if ($host->venue == "home") $h = "selected"; |
50 | 50 | if ($host->venue == "work") $w = "selected"; |
51 | 51 | if ($host->venue == "school") $s = "selected"; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | row2(tra("Product name"), $host->product_name); |
100 | 100 | } |
101 | 101 | $x = $host->timezone/3600; |
102 | - if ($x >= 0) $x="+$x"; |
|
102 | + if ($x >= 0) $x = "+$x"; |
|
103 | 103 | row2(tra("Local Standard Time"), tra("UTC %1 hours", $x)); |
104 | 104 | } else { |
105 | 105 | $owner = BoincUser::lookup_id($host->userid); |
@@ -259,15 +259,15 @@ discard block |
||
259 | 259 | // "[vbox|5.0.0|1|1]", where now two additional flags give information about |
260 | 260 | // hardware virtualization support. Older clients may have the old-style |
261 | 261 | // serialnum in the DB despite the server being upgraded. |
262 | -function vbox_desc($x){ |
|
263 | - if (preg_match("/\[vbox\|(.*?)(\|([01])\|([01]))?\]/",$x,$matches)){ |
|
262 | +function vbox_desc($x) { |
|
263 | + if (preg_match("/\[vbox\|(.*?)(\|([01])\|([01]))?\]/", $x, $matches)) { |
|
264 | 264 | $desc = "Virtualbox (".$matches[1].") ".tra("installed"); |
265 | - if (sizeof($matches)>2){ |
|
266 | - if ($matches[3]=="1" and $matches[4]=="1") { |
|
265 | + if (sizeof($matches) > 2) { |
|
266 | + if ($matches[3] == "1" and $matches[4] == "1") { |
|
267 | 267 | return $desc.tra(", CPU has hardware virtualization support and it is enabled"); |
268 | - } elseif ($matches[3]=="1" and $matches[4]=="0") { |
|
268 | + } elseif ($matches[3] == "1" and $matches[4] == "0") { |
|
269 | 269 | return $desc.tra(", CPU has hardware virtualization support but it is disabled"); |
270 | - } elseif ($matches[3]=="0") { |
|
270 | + } elseif ($matches[3] == "0") { |
|
271 | 271 | return $desc.tra(", CPU does not have hardware virtualization support"); |
272 | 272 | } |
273 | 273 | } else { |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | // Given string of the form [BOINC|vers][type|model|count|RAM|driver-vers][vbox|vers], |
282 | 282 | // return a human-readable version of the GPU info |
283 | 283 | // |
284 | -function gpu_desc($x, $detail=true) { |
|
284 | +function gpu_desc($x, $detail = true) { |
|
285 | 285 | $descs = explode("]", $x); |
286 | 286 | array_pop($descs); |
287 | 287 | $str = ""; |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | if ($d[0] == "vbox") continue; |
294 | 294 | if (count($d) < 5) continue; |
295 | 295 | if ($str) $str .= "<p>"; |
296 | - if ($d[2]!="" && $d[2]!="1") $str .= "[".$d[2]."] "; |
|
296 | + if ($d[2] != "" && $d[2] != "1") $str .= "[".$d[2]."] "; |
|
297 | 297 | if ($d[0] == "CUDA") { |
298 | 298 | $str .= "NVIDIA"; |
299 | 299 | } else if ($d[0] == "CAL") { |
@@ -500,14 +500,14 @@ discard block |
||
500 | 500 | if ($pos1 === false) return $x; |
501 | 501 | $pos2 = strpos($model, ']'); |
502 | 502 | if ($pos2 === false) return $x; |
503 | - $a = substr($model, $pos1+1, $pos2-$pos1-1); |
|
503 | + $a = substr($model, $pos1 + 1, $pos2 - $pos1 - 1); |
|
504 | 504 | $y = explode(" ", $a); |
505 | 505 | if (count($y) == 0) return $x; |
506 | 506 | if ($y[0] == "Family") { |
507 | 507 | $x->info = $a; |
508 | 508 | } else { |
509 | 509 | $x->arch = $y[0]; |
510 | - $x->info = substr($a, strlen($y[0])+1); |
|
510 | + $x->info = substr($a, strlen($y[0]) + 1); |
|
511 | 511 | } |
512 | 512 | return $x; |
513 | 513 | } |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | $avg_time = 0; |
597 | 597 | |
598 | 598 | $results = BoincResult::enum("hostid=$hostid order by received_time"); |
599 | - foreach($results as $result) { |
|
599 | + foreach ($results as $result) { |
|
600 | 600 | if ($result->granted_credit <= 0) continue; |
601 | 601 | $total += $result->granted_credit; |
602 | 602 | |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | |
690 | 690 | function link_url($sort, $rev, $show_all) { |
691 | 691 | global $userid; |
692 | - $x = $userid ? "&userid=$userid":""; |
|
692 | + $x = $userid ? "&userid=$userid" : ""; |
|
693 | 693 | return "hosts_user.php?sort=$sort&rev=$rev&show_all=$show_all$x"; |
694 | 694 | } |
695 | 695 | |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | } |
764 | 764 | |
765 | 765 | function show_user_hosts($userid, $private, $show_all, $sort, $rev) { |
766 | - $desc = false; // whether the sort order's default is decreasing |
|
766 | + $desc = false; // whether the sort order's default is decreasing |
|
767 | 767 | switch ($sort) { |
768 | 768 | case "total_credit": $sort_clause = "total_credit"; $desc = true; break; |
769 | 769 | case "expavg_credit": $sort_clause = "expavg_credit"; $desc = true; break; |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | more_or_less($sort, $rev, $show_all); |
787 | 787 | |
788 | 788 | $now = time(); |
789 | - $old_hosts=0; |
|
789 | + $old_hosts = 0; |
|
790 | 790 | $i = 1; |
791 | 791 | $hosts = BoincHost::enum("userid=$userid order by $sort_clause"); |
792 | 792 | $any_product_name = false; |
@@ -798,9 +798,9 @@ discard block |
||
798 | 798 | } |
799 | 799 | user_host_table_start($private, $sort, $rev, $show_all, $any_product_name); |
800 | 800 | foreach ($hosts as $host) { |
801 | - $is_old=false; |
|
801 | + $is_old = false; |
|
802 | 802 | if (($now - $host->rpc_time) > 30*86400) { |
803 | - $is_old=true; |
|
803 | + $is_old = true; |
|
804 | 804 | $old_hosts++; |
805 | 805 | } |
806 | 806 | if (!$show_all && $is_old) continue; |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | } |
810 | 810 | end_table(); |
811 | 811 | |
812 | - if ($old_hosts>0) { |
|
812 | + if ($old_hosts > 0) { |
|
813 | 813 | more_or_less($sort, $rev, $show_all); |
814 | 814 | } |
815 | 815 | |
@@ -829,6 +829,6 @@ discard block |
||
829 | 829 | } |
830 | 830 | } |
831 | 831 | |
832 | -$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit |
|
832 | +$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit |
|
833 | 833 | |
834 | 834 | ?> |
@@ -42,27 +42,27 @@ discard block |
||
42 | 42 | // @return String A user readable DateTime-String in UTC |
43 | 43 | // @param Integer $x The mysql-Timestamp to convert |
44 | 44 | function mysqltime_str($x) { |
45 | - if(strpos($x,"-")==4) { |
|
45 | + if (strpos($x, "-") == 4) { |
|
46 | 46 | // Syntax of supplied mysql-timestamp is YYYY-MM-DD HH:MM:SS |
47 | - $year = substr($x,0,4); |
|
48 | - $month = substr($x,5,2); |
|
49 | - $day = substr($x,8,2); |
|
50 | - $hour = substr($x,11,2); |
|
51 | - $minute = substr($x,14,2); |
|
52 | - $second = substr($x,17,2); |
|
47 | + $year = substr($x, 0, 4); |
|
48 | + $month = substr($x, 5, 2); |
|
49 | + $day = substr($x, 8, 2); |
|
50 | + $hour = substr($x, 11, 2); |
|
51 | + $minute = substr($x, 14, 2); |
|
52 | + $second = substr($x, 17, 2); |
|
53 | 53 | } else { |
54 | 54 | // Syntax of supplied mysql-timestamp is YYYYMMDDHHMMSS |
55 | - $year = substr($x,0,4); |
|
56 | - $month = substr($x,4,2); |
|
57 | - $day = substr($x,6,2); |
|
58 | - $hour = substr($x,8,2); |
|
59 | - $minute = substr($x,10,2); |
|
60 | - $second = substr($x,12,2); |
|
55 | + $year = substr($x, 0, 4); |
|
56 | + $month = substr($x, 4, 2); |
|
57 | + $day = substr($x, 6, 2); |
|
58 | + $hour = substr($x, 8, 2); |
|
59 | + $minute = substr($x, 10, 2); |
|
60 | + $second = substr($x, 12, 2); |
|
61 | 61 | |
62 | 62 | } |
63 | 63 | //make a Unix-Timestamp |
64 | 64 | // echo "Time string is " . "$x"; |
65 | - $time = mktime($hour,$minute,$second,$month,$day,$year); |
|
65 | + $time = mktime($hour, $minute, $second, $month, $day, $year); |
|
66 | 66 | return time_str($time); |
67 | 67 | } |
68 | 68 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $constants = get_defined_constants(true); |
101 | 101 | foreach ($constants['mysqli'] as $c => $n) if (preg_match('/^MYSQLI_TYPE_(.*)/', $c, $m)) $types[$n] = $m[1]; |
102 | 102 | } |
103 | - return array_key_exists($type_id, $types)? strtolower($types[$type_id]) : "unknown"; |
|
103 | + return array_key_exists($type_id, $types) ? strtolower($types[$type_id]) : "unknown"; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | // Function prints a description of $table |
@@ -110,38 +110,38 @@ discard block |
||
110 | 110 | $result = $db->do_query("SELECT * from $table LIMIT 1"); |
111 | 111 | $fields = $result->field_count; |
112 | 112 | |
113 | - $avgnum=(int)($fields/$columns); |
|
114 | - if ($avgnum*$columns<$fields) { |
|
113 | + $avgnum = (int)($fields/$columns); |
|
114 | + if ($avgnum*$columns < $fields) { |
|
115 | 115 | $avgnum++; |
116 | 116 | } |
117 | 117 | |
118 | - $actualcolumns=0; |
|
119 | - while ($avgnum*$actualcolumns<$fields) { |
|
118 | + $actualcolumns = 0; |
|
119 | + while ($avgnum*$actualcolumns < $fields) { |
|
120 | 120 | $actualcolumns++; |
121 | 121 | } |
122 | 122 | |
123 | - if ($which>$actualcolumns) { |
|
123 | + if ($which > $actualcolumns) { |
|
124 | 124 | return 0; |
125 | 125 | } |
126 | 126 | |
127 | - $bot=($which-1)*$avgnum; |
|
128 | - $top=$which*$avgnum; |
|
127 | + $bot = ($which - 1)*$avgnum; |
|
128 | + $top = $which*$avgnum; |
|
129 | 129 | |
130 | - $width=100.0/$actualcolumns; |
|
130 | + $width = 100.0/$actualcolumns; |
|
131 | 131 | |
132 | 132 | echo "<td>"; |
133 | 133 | start_table('table-striped'); |
134 | 134 | echo "<tr><th align=\"left\">NAME</th><th align=\"left\">Type</th><th align=\"left\">Bytes</th>\n"; |
135 | - for ($count=$bot; $count<$top; $count++) { |
|
136 | - if ($count<$fields) { |
|
135 | + for ($count = $bot; $count < $top; $count++) { |
|
136 | + if ($count < $fields) { |
|
137 | 137 | $x = $result->fetch_field_direct($count); |
138 | 138 | $name = $x->name; |
139 | 139 | $type = mysql_fieldtype_str($x->type); |
140 | 140 | $length = $x->length; |
141 | 141 | } else { |
142 | - $name="<br/> "; |
|
143 | - $type="<br/>"; |
|
144 | - $length="<br/>"; |
|
142 | + $name = "<br/> "; |
|
143 | + $type = "<br/>"; |
|
144 | + $length = "<br/>"; |
|
145 | 145 | } |
146 | 146 | echo "\t<tr><td><b>$name</b></td><td>$type</td><td>$length</td></tr>\n"; |
147 | 147 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | echo "<h2>Description of <b>$table</b> table fields:</h2>\n"; |
157 | 157 | start_table(); |
158 | 158 | echo "<tr>"; |
159 | - for ($i=1; $i<=$how_many_columns; $i++) { |
|
159 | + for ($i = 1; $i <= $how_many_columns; $i++) { |
|
160 | 160 | print_describe_table_onecol($table, $i, $how_many_columns); |
161 | 161 | } |
162 | 162 | echo "</tr>"; |
@@ -175,10 +175,10 @@ discard block |
||
175 | 175 | } |
176 | 176 | |
177 | 177 | function print_query_field() { |
178 | - $currenttime=time(); |
|
179 | - $hourago=$currenttime-3600; |
|
180 | - $dayago=$currenttime-24*3600; |
|
181 | - $weekago=$currenttime-7*24*3600; |
|
178 | + $currenttime = time(); |
|
179 | + $hourago = $currenttime - 3600; |
|
180 | + $dayago = $currenttime - 24*3600; |
|
181 | + $weekago = $currenttime - 7*24*3600; |
|
182 | 182 | echo " |
183 | 183 | <tr> |
184 | 184 | <td align=\"right\">Additional clauses</td> |
@@ -202,11 +202,11 @@ discard block |
||
202 | 202 | } |
203 | 203 | } |
204 | 204 | |
205 | -function append_sql_query($original,$addition,$first) { |
|
205 | +function append_sql_query($original, $addition, $first) { |
|
206 | 206 | if ($first == 1) { |
207 | - return $original . " where " . $addition; |
|
207 | + return $original." where ".$addition; |
|
208 | 208 | } else { |
209 | - return $original . " and " . $addition; |
|
209 | + return $original." and ".$addition; |
|
210 | 210 | } |
211 | 211 | } |
212 | 212 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | if (isset($_GET[$name])) { |
308 | 308 | $value = $_GET[$name]; |
309 | 309 | } else { |
310 | - $value=null; |
|
310 | + $value = null; |
|
311 | 311 | } |
312 | 312 | if (isset($_GET[$order])) { |
313 | 313 | $order = $_GET[$order]; |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | } |
349 | 349 | |
350 | 350 | function get_url($base = "db_action.php") { |
351 | - $s = $base . "?table=$this->table$this->urlquery"; |
|
351 | + $s = $base."?table=$this->table$this->urlquery"; |
|
352 | 352 | return $s; |
353 | 353 | } |
354 | 354 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | $this->addeq('app_version_id'); |
364 | 364 | $this->addeq('exit_status'); |
365 | 365 | if (isset($_GET['nsecs'])) { |
366 | - $_GET['mod_time'] = date("YmdHis",time() - $_GET['nsecs']); |
|
366 | + $_GET['mod_time'] = date("YmdHis", time() - $_GET['nsecs']); |
|
367 | 367 | } |
368 | 368 | $this->addgt('mod_time'); |
369 | 369 | $this->addeq_not_CHOOSE_ALL('server_state'); |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | if ($n == '0') { // intentional compare by string |
385 | 385 | return "0"; |
386 | 386 | } else { |
387 | - if(strlen($clauses)) { |
|
387 | + if (strlen($clauses)) { |
|
388 | 388 | return "<a href=\"db_action.php?table=result&query=$mq&$query&clauses=".urlencode($clauses)."&sort_by=mod_time&detail=low\">$n</a>"; |
389 | 389 | } |
390 | 390 | else { |
@@ -397,13 +397,13 @@ discard block |
||
397 | 397 | // Determines if in stderr_out is an error reported and prints as human readable String |
398 | 398 | // @return String A human readable string if error otherwise FALSE |
399 | 399 | // @param String $stderr_out the stderr_out value to parse |
400 | -function stderr_error_string($stderr_out){ |
|
400 | +function stderr_error_string($stderr_out) { |
|
401 | 401 | $y = parse_element($stderr_out, "<error_code>"); |
402 | 402 | $x = 0; |
403 | 403 | if ($y) { |
404 | 404 | $x = (int)$y; |
405 | 405 | } |
406 | - if (0<=$x && $x<=9) { |
|
406 | + if (0 <= $x && $x <= 9) { |
|
407 | 407 | return FALSE; |
408 | 408 | } else { |
409 | 409 | return "$x ".error_code_str($x); |
@@ -411,8 +411,8 @@ discard block |
||
411 | 411 | } |
412 | 412 | |
413 | 413 | function admin_show_result_summary() { |
414 | - $ntotal =0; // TODO: how to count $result? |
|
415 | - $nvalid = 0; // for SUCCESS results |
|
414 | + $ntotal = 0; // TODO: how to count $result? |
|
415 | + $nvalid = 0; // for SUCCESS results |
|
416 | 416 | $ninvalid = 0; |
417 | 417 | $nfile_deleted = 0; |
418 | 418 | |
@@ -420,20 +420,20 @@ discard block |
||
420 | 420 | $outcome = array(); |
421 | 421 | $client_state = array(); |
422 | 422 | |
423 | - for ($ss=1; $ss<6; $ss++) { |
|
423 | + for ($ss = 1; $ss < 6; $ss++) { |
|
424 | 424 | $server_state[$ss] = 0; |
425 | 425 | } |
426 | - for ($ro=0; $ro<8; $ro++) { |
|
426 | + for ($ro = 0; $ro < 8; $ro++) { |
|
427 | 427 | $outcome[$ro] = 0; |
428 | 428 | } |
429 | - for ($cs=1; $cs<7; $cs++) { |
|
429 | + for ($cs = 1; $cs < 7; $cs++) { |
|
430 | 430 | $client_state[$cs] = 0; |
431 | 431 | } |
432 | - for ($fds=0; $fds<4; $fds++) { |
|
432 | + for ($fds = 0; $fds < 4; $fds++) { |
|
433 | 433 | $delete_state[$fds] = 0; |
434 | 434 | } |
435 | - for ($vs=0; $vs<NVALIDATE_STATES; $vs++) { |
|
436 | - $validate_state[$vs]=0; |
|
435 | + for ($vs = 0; $vs < NVALIDATE_STATES; $vs++) { |
|
436 | + $validate_state[$vs] = 0; |
|
437 | 437 | } |
438 | 438 | |
439 | 439 | $_GET['table'] = 'result'; |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | // |
509 | 509 | $delay = parse_config(get_config(), "<delete_delay_hours>"); |
510 | 510 | if ($delay) { |
511 | - $start2 = $start - $delay*3600;; |
|
511 | + $start2 = $start - $delay*3600; ; |
|
512 | 512 | $main_query .= " and ((file_delete_state>1 and mod_time>FROM_UNIXTIME($start2)) or (mod_time>FROM_UNIXTIME($start)))"; |
513 | 513 | } else { |
514 | 514 | $main_query .= " and mod_time > FROM_UNIXTIME($start)"; |
@@ -567,20 +567,20 @@ discard block |
||
567 | 567 | |
568 | 568 | start_table(); |
569 | 569 | echo "<tr valign=\"top\">"; |
570 | - echo "<td><h2>" . link_results("$ntotal results", $urlquery, '', '') . "</h2></td>"; |
|
571 | - echo "<td><h2>" . link_results("'Over' results", $urlquery, "server_state=5", '') . "</h2></td>"; |
|
572 | - echo "<td><h2>" . link_results("'Success' results", $urlquery, "outcome=1", '') . "</h2></td>"; |
|
573 | - echo "<td><h2>" . link_results("'Client error' results", $urlquery, "outcome=3", '') . "</h2></td>"; |
|
570 | + echo "<td><h2>".link_results("$ntotal results", $urlquery, '', '')."</h2></td>"; |
|
571 | + echo "<td><h2>".link_results("'Over' results", $urlquery, "server_state=5", '')."</h2></td>"; |
|
572 | + echo "<td><h2>".link_results("'Success' results", $urlquery, "outcome=1", '')."</h2></td>"; |
|
573 | + echo "<td><h2>".link_results("'Client error' results", $urlquery, "outcome=3", '')."</h2></td>"; |
|
574 | 574 | echo "</tr>"; |
575 | 575 | echo "<tr valign=\"top\">"; |
576 | 576 | echo "<td>"; |
577 | 577 | start_table('table-striped'); |
578 | 578 | echo "<tr><th>Server state</th><th># results</th></tr>\n"; |
579 | - for ($ss=1; $ss<6; $ss++) { |
|
579 | + for ($ss = 1; $ss < 6; $ss++) { |
|
580 | 580 | $res = new StdClass; |
581 | 581 | $res->server_state = $ss; |
582 | 582 | row2(result_server_state_string($res), |
583 | - link_results("$server_state[$ss]", $urlquery,"server_state=$ss", '') |
|
583 | + link_results("$server_state[$ss]", $urlquery, "server_state=$ss", '') |
|
584 | 584 | ); |
585 | 585 | } |
586 | 586 | end_table(); |
@@ -590,11 +590,11 @@ discard block |
||
590 | 590 | start_table('table-striped'); |
591 | 591 | echo "<tr><th>Outcome</th><th># results</th></tr>\n"; |
592 | 592 | |
593 | - for ($ro=0; $ro<8; $ro++) { |
|
593 | + for ($ro = 0; $ro < 8; $ro++) { |
|
594 | 594 | $res = new StdClass; |
595 | 595 | $res->outcome = $ro; |
596 | 596 | $res->exit_status = 0; |
597 | - c_row2($outcome[$ro]?outcome_color($ro):'', result_outcome_string($res), |
|
597 | + c_row2($outcome[$ro] ?outcome_color($ro) : '', result_outcome_string($res), |
|
598 | 598 | link_results("$outcome[$ro]", $urlquery, "outcome=$ro", '') |
599 | 599 | ); |
600 | 600 | } |
@@ -604,18 +604,18 @@ discard block |
||
604 | 604 | echo "<td>"; |
605 | 605 | start_table('table-striped'); |
606 | 606 | echo "<tr><th>Validate state</th><th># results</th></tr>\n"; |
607 | - for ($vs=0; $vs<NVALIDATE_STATES; $vs++) { |
|
607 | + for ($vs = 0; $vs < NVALIDATE_STATES; $vs++) { |
|
608 | 608 | $res = new StdClass; |
609 | 609 | $res->validate_state = $vs; |
610 | 610 | $res->exit_status = 0; |
611 | - c_row2($validate_state[$vs]?validate_color($vs):'', validate_state_str($res), |
|
611 | + c_row2($validate_state[$vs] ?validate_color($vs) : '', validate_state_str($res), |
|
612 | 612 | link_results("$validate_state[$vs]", $urlquery, "validate_state=$vs", "outcome=1")); |
613 | 613 | } |
614 | 614 | end_table(); |
615 | 615 | start_table('table-striped'); |
616 | 616 | echo "<tr><th>File Delete state</th><th># results</th></tr>\n"; |
617 | 617 | |
618 | - for ($fds=0; $fds<4; $fds++) { |
|
618 | + for ($fds = 0; $fds < 4; $fds++) { |
|
619 | 619 | row2(file_delete_state_str($fds), |
620 | 620 | link_results("$file_delete[$fds]", $urlquery, "outcome=1", "file_delete_state=$fds")); |
621 | 621 | } |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | echo "<td>"; |
628 | 628 | start_table('table-striped'); |
629 | 629 | echo "<tr><th>Client state</th><th># results</th></tr>\n"; |
630 | - for ($cs=1; $cs<7; $cs++) { |
|
630 | + for ($cs = 1; $cs < 7; $cs++) { |
|
631 | 631 | $res = new StdClass; |
632 | 632 | $res->client_state = $cs; |
633 | 633 | $res->exit_status = 0; |
@@ -646,9 +646,9 @@ discard block |
||
646 | 646 | <select name=\"server_state\"> |
647 | 647 | <option value=\"CHOOSE_ALL\" selected=\"selected\"> Any </option> |
648 | 648 | "; |
649 | - for ($i=1; $i<6; $i++) { |
|
649 | + for ($i = 1; $i < 6; $i++) { |
|
650 | 650 | $res = new StdClass; |
651 | - $res->server_state=$i; |
|
651 | + $res->server_state = $i; |
|
652 | 652 | echo "<option value=\"$i\"> "."[$i] ".' '.result_server_state_string($res)."</option>\n"; |
653 | 653 | } |
654 | 654 | echo "</select>\n"; |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | <select name=\"outcome\"> |
660 | 660 | <option value=\"CHOOSE_ALL\" selected=\"selected\"> Any </option> |
661 | 661 | "; |
662 | - for ($i=0; $i<8; $i++) { |
|
662 | + for ($i = 0; $i < 8; $i++) { |
|
663 | 663 | $res = new StdClass; |
664 | 664 | $res->outcome = $i; |
665 | 665 | $res->exit_status = 0; |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | <select name=\"validate_state\"> |
674 | 674 | <option value=\"CHOOSE_ALL\" selected=\"selected\"> Any </option> |
675 | 675 | "; |
676 | - for ($vs=0; $vs<NVALIDATE_STATES; $vs++) { |
|
676 | + for ($vs = 0; $vs < NVALIDATE_STATES; $vs++) { |
|
677 | 677 | $res = new StdClass; |
678 | 678 | $res->validate_state = $vs; |
679 | 679 | $res->exit_status = 0; |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | <select name=\"client_state\"> |
688 | 688 | <option value=\"CHOOSE_ALL\" selected=\"selected\"> Any </option> |
689 | 689 | "; |
690 | - for ($i=0; $i<7; $i++) { |
|
690 | + for ($i = 0; $i < 7; $i++) { |
|
691 | 691 | $res = new StdClass; |
692 | 692 | $res->client_state = $i; |
693 | 693 | $res->exit_status = 0; |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | } |
725 | 725 | |
726 | 726 | function table_title($table) { |
727 | - switch($table) { |
|
727 | + switch ($table) { |
|
728 | 728 | case "platform": return "Platforms"; |
729 | 729 | case "app": return "Applications"; |
730 | 730 | case "app_version": return "Application Versions"; |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | row("Created", time_str($platform->create_time)); |
745 | 745 | row("Name", $platform->name); |
746 | 746 | row("User friendly name", $platform->user_friendly_name); |
747 | - row("","<a href=\"db_action.php?table=app_version&platformid=$platform->id\">App versions for this platform</a>"); |
|
747 | + row("", "<a href=\"db_action.php?table=app_version&platformid=$platform->id\">App versions for this platform</a>"); |
|
748 | 748 | end_table(); |
749 | 749 | } |
750 | 750 | |
@@ -756,8 +756,8 @@ discard block |
||
756 | 756 | row("User-friendly name", $app->user_friendly_name); |
757 | 757 | row("Deprecated", $app->deprecated); |
758 | 758 | row("Homogeneous redundancy", $app->homogeneous_redundancy); |
759 | - row("","<a href=\"db_action.php?table=app_version&appid=$app->id\">App Versions for this application</a>"); |
|
760 | - row("","<a href=\"db_action.php?table=workunit&appid=$app->id&detail=low\">Workunits for this application</a>"); |
|
759 | + row("", "<a href=\"db_action.php?table=app_version&appid=$app->id\">App Versions for this application</a>"); |
|
760 | + row("", "<a href=\"db_action.php?table=workunit&appid=$app->id&detail=low\">Workunits for this application</a>"); |
|
761 | 761 | end_table(); |
762 | 762 | } |
763 | 763 | |
@@ -765,9 +765,9 @@ discard block |
||
765 | 765 | start_table(); |
766 | 766 | row("ID", $app_version->id); |
767 | 767 | row("Created", time_str($app_version->create_time)); |
768 | - row("Application", "<a href=\"db_action.php?table=app&id=$app_version->appid\">" . app_name_by_id($app_version->appid) . "</a>"); |
|
768 | + row("Application", "<a href=\"db_action.php?table=app&id=$app_version->appid\">".app_name_by_id($app_version->appid)."</a>"); |
|
769 | 769 | row("Version num", $app_version->version_num); |
770 | - row("Platform", "<a href=\"db_action.php?table=platform&id=$app_version->platformid\">" . platform_name_by_id($app_version->platformid) . "</a>" ); |
|
770 | + row("Platform", "<a href=\"db_action.php?table=platform&id=$app_version->platformid\">".platform_name_by_id($app_version->platformid)."</a>"); |
|
771 | 771 | row("Plan Class", $app_version->plan_class); |
772 | 772 | row("XML doc", "<pre>".htmlspecialchars($app_version->xml_doc)."</pre>"); |
773 | 773 | row("min_core_version", $app_version->min_core_version); |
@@ -901,7 +901,7 @@ discard block |
||
901 | 901 | row("External IP address", "$host->external_ip_addr<br>"); |
902 | 902 | row("Domain name", $host->domain_name); |
903 | 903 | $x = $host->timezone/3600; |
904 | - if ($x >= 0) $x="+$x"; |
|
904 | + if ($x >= 0) $x = "+$x"; |
|
905 | 905 | row("Local Standard Time", "UTC $x hours"); |
906 | 906 | row("Number of CPUs", $host->p_ncpus); |
907 | 907 | row("CPU", "$host->p_vendor $host->p_model"); |
@@ -953,10 +953,10 @@ discard block |
||
953 | 953 | start_table(); |
954 | 954 | row("Created", time_str($wu->create_time)); |
955 | 955 | row("Transition Time", time_str($wu->transition_time)); |
956 | - row("Last time modified",mysqltime_str($wu->mod_time)); |
|
956 | + row("Last time modified", mysqltime_str($wu->mod_time)); |
|
957 | 957 | row("Name", $wu->name); |
958 | 958 | row("XML doc", "<pre>".htmlspecialchars($wu->xml_doc)."</pre>"); |
959 | - row("Application", "<a href=\"db_action.php?table=app&id=$wu->appid\">" . app_name_by_id($wu->appid) . " [".$wu->appid."]</a>"); |
|
959 | + row("Application", "<a href=\"db_action.php?table=app&id=$wu->appid\">".app_name_by_id($wu->appid)." [".$wu->appid."]</a>"); |
|
960 | 960 | row("Application version number", $wu->app_version_num); |
961 | 961 | row("Batch", $wu->batch); |
962 | 962 | $x = number_format($wu->rsc_fpops_est/1e9, 2); |
@@ -969,12 +969,12 @@ discard block |
||
969 | 969 | $x = $wu->rsc_disk_bound/(1024*1024); |
970 | 970 | $y = number_format($x, 2); |
971 | 971 | row("Max Disk Usage", "$y MB"); |
972 | - row("Need validate?", ($wu->need_validate?"yes [":"no [").$wu->need_validate."]"); |
|
972 | + row("Need validate?", ($wu->need_validate ? "yes [" : "no [").$wu->need_validate."]"); |
|
973 | 973 | row("Canonical resultid", |
974 | 974 | "<a href=\"db_action.php?table=result&id=$wu->canonical_resultid\">".$wu->canonical_resultid."</a>"); |
975 | 975 | row("Canonical credit", $wu->canonical_credit); |
976 | 976 | //row("Timeout check time", time_str($wu->timeout_check_time)); |
977 | - row("Delay bound", "$wu->delay_bound" . " = " . time_diff($wu->delay_bound) ); |
|
977 | + row("Delay bound", "$wu->delay_bound"." = ".time_diff($wu->delay_bound)); |
|
978 | 978 | row("Error mask", wu_error_mask_str($wu->error_mask, true)); |
979 | 979 | row("File delete state", file_delete_state_str($wu->file_delete_state)." [".$wu->file_delete_state."]"); |
980 | 980 | row("Assimilation state", assimilate_state_str($wu->assimilate_state)." [".$wu->assimilate_state."]"); |
@@ -984,7 +984,7 @@ discard block |
||
984 | 984 | row("max error results", $wu->max_error_results); |
985 | 985 | row("max total results", $wu->max_total_results); |
986 | 986 | row("max success results", $wu->max_success_results); |
987 | - row("result template file",$wu->result_template_file); |
|
987 | + row("result template file", $wu->result_template_file); |
|
988 | 988 | row("hr_class", $wu->hr_class); |
989 | 989 | row("opaque", $wu->opaque); |
990 | 990 | row("Priority", $wu->priority); |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | } |
1063 | 1063 | |
1064 | 1064 | function outcome_color($outcome) { |
1065 | - switch($outcome) { |
|
1065 | + switch ($outcome) { |
|
1066 | 1066 | case 0: return '9900cc'; // "Init", purple |
1067 | 1067 | case 1: return '33cc33'; // "Success", green |
1068 | 1068 | case 3: return 'ff3333'; // "Client error", red |
@@ -1089,18 +1089,18 @@ discard block |
||
1089 | 1089 | row("Sent", time_str($result->sent_time)); |
1090 | 1090 | row("Report deadline", time_str($result->report_deadline)); |
1091 | 1091 | row("Received", time_str($result->received_time)); |
1092 | - row("Last time modified",mysqltime_str($result->mod_time)); |
|
1092 | + row("Last time modified", mysqltime_str($result->mod_time)); |
|
1093 | 1093 | row("Name", $result->name); |
1094 | - row("Workunit", "<a href=\"db_action.php?table=workunit&id=$result->workunitid\">" . wu_name_by_id($result->workunitid) . "</a> [$result->workunitid]" ); |
|
1094 | + row("Workunit", "<a href=\"db_action.php?table=workunit&id=$result->workunitid\">".wu_name_by_id($result->workunitid)."</a> [$result->workunitid]"); |
|
1095 | 1095 | row("Server state", result_server_state_string($result)." [$result->server_state]"); |
1096 | 1096 | row("Outcome", result_outcome_string($result)." [$result->outcome]"); |
1097 | 1097 | row("Client state", result_client_state_string($result)." [$result->client_state]"); |
1098 | 1098 | row("Exit status", exit_status_string($result->exit_status)); |
1099 | - row("Host ID", "<a href=\"db_action.php?table=host&id=$result->hostid\">" . host_name_by_id($result->hostid) . "</a> [$result->hostid]"); |
|
1100 | - row("User ID", "<a href=\"db_action.php?table=user&id=$result->userid\">" . user_name_by_id($result->userid) . "</a> [$result->userid]"); |
|
1099 | + row("Host ID", "<a href=\"db_action.php?table=host&id=$result->hostid\">".host_name_by_id($result->hostid)."</a> [$result->hostid]"); |
|
1100 | + row("User ID", "<a href=\"db_action.php?table=user&id=$result->userid\">".user_name_by_id($result->userid)."</a> [$result->userid]"); |
|
1101 | 1101 | row("CPU time", $result->cpu_time); |
1102 | 1102 | row("Elapsed time", $result->elapsed_time); |
1103 | - if($error=stderr_error_string($result->stderr_out)) { |
|
1103 | + if ($error = stderr_error_string($result->stderr_out)) { |
|
1104 | 1104 | row("error in stderr out", $error); |
1105 | 1105 | } |
1106 | 1106 | row("Batch", $result->batch); |
@@ -1117,16 +1117,16 @@ discard block |
||
1117 | 1117 | row("App version", $x1.app_version_string($result).$x2); |
1118 | 1118 | row("App version ID", $result->app_version_id); |
1119 | 1119 | row("Estimated GFLOPS", number_format($result->flops_estimate/1e9, 2)); |
1120 | - row("Random",$result->random); |
|
1121 | - row("Opaque",$result->opaque); |
|
1122 | - row("Teamid",$result->teamid); |
|
1123 | - row("Priority",$result->priority); |
|
1120 | + row("Random", $result->random); |
|
1121 | + row("Opaque", $result->opaque); |
|
1122 | + row("Teamid", $result->teamid); |
|
1123 | + row("Priority", $result->priority); |
|
1124 | 1124 | row("XML doc in", "<pre>".htmlspecialchars($result->xml_doc_in)."</pre>"); |
1125 | 1125 | row("XML doc out", "<pre>".htmlspecialchars($result->xml_doc_out)."</pre>"); |
1126 | 1126 | row("stderr out", "<pre>" |
1127 | 1127 | .htmlspecialchars( |
1128 | 1128 | $result->stderr_out, |
1129 | - ENT_QUOTES | (defined('ENT_SUBSTITUTE')?ENT_SUBSTITUTE:0), |
|
1129 | + ENT_QUOTES|(defined('ENT_SUBSTITUTE') ?ENT_SUBSTITUTE:0), |
|
1130 | 1130 | 'utf-8' |
1131 | 1131 | ) |
1132 | 1132 | ."</pre>" |
@@ -1174,23 +1174,23 @@ discard block |
||
1174 | 1174 | } else { |
1175 | 1175 | // result has not been received yet, so show report deadline either |
1176 | 1176 | // in green if in the future or in red if in the past. |
1177 | - $timenow=time(); |
|
1178 | - if ($result->report_deadline==0) { |
|
1177 | + $timenow = time(); |
|
1178 | + if ($result->report_deadline == 0) { |
|
1179 | 1179 | // not sent -- show create time in purple |
1180 | - $received = "<font color=\"9900cc\">". time_str($result->create_time) . "</font>"; |
|
1181 | - } else if ($result->report_deadline>=$timenow) { |
|
1180 | + $received = "<font color=\"9900cc\">".time_str($result->create_time)."</font>"; |
|
1181 | + } else if ($result->report_deadline >= $timenow) { |
|
1182 | 1182 | // overdue -- show deadline in red |
1183 | - $received = "<font color=\"#33cc33\">". time_str($result->report_deadline) . "</font>"; |
|
1183 | + $received = "<font color=\"#33cc33\">".time_str($result->report_deadline)."</font>"; |
|
1184 | 1184 | } else { |
1185 | 1185 | // in progress and not overdue -- show deadline in green |
1186 | - $received = "<font color=\"#ff3333\">". time_str($result->report_deadline) . "</font>"; |
|
1186 | + $received = "<font color=\"#ff3333\">".time_str($result->report_deadline)."</font>"; |
|
1187 | 1187 | } |
1188 | 1188 | } |
1189 | 1189 | $version = app_version_string($result)." (<a href=\"db_action.php?table=app_version&id=$result->app_version_id\">$result->app_version_id</a>)"; |
1190 | 1190 | $outcome_color = outcome_color($result->outcome); |
1191 | 1191 | $validate_color = validate_color($result->validate_state); |
1192 | 1192 | $host_user = host_user_link($result->hostid); |
1193 | - $cpu_hours = sprintf("%.1f",$result->cpu_time / 3600); |
|
1193 | + $cpu_hours = sprintf("%.1f", $result->cpu_time/3600); |
|
1194 | 1194 | $granted_credit = "<a href=credit.php?wu_id=$result->workunitid>".credit_str($result->granted_credit)."</a>"; |
1195 | 1195 | $delete_state = file_delete_state_str($result->file_delete_state); |
1196 | 1196 | |
@@ -1218,7 +1218,7 @@ discard block |
||
1218 | 1218 | row("ID", $user->id); |
1219 | 1219 | row("Created", time_str($user->create_time)); |
1220 | 1220 | row("Name", $user->name); |
1221 | - if(!in_rops()) { |
|
1221 | + if (!in_rops()) { |
|
1222 | 1222 | row("Authenticator", $user->authenticator); |
1223 | 1223 | } |
1224 | 1224 | row("Email address", $user->email_addr); |
@@ -1233,7 +1233,7 @@ discard block |
||
1233 | 1233 | row("Default venue", $user->venue); |
1234 | 1234 | row("Hosts", "<a href=\"db_action.php?table=host&userid=$user->id&detail=low\">click</a>"); |
1235 | 1235 | row("Cross project ID", $user->cross_project_id); |
1236 | - if(!in_rops()) { |
|
1236 | + if (!in_rops()) { |
|
1237 | 1237 | row("Password Hash", $user->passwd_hash); |
1238 | 1238 | } |
1239 | 1239 | row("Donated", $user->donated); |
@@ -1284,7 +1284,7 @@ discard block |
||
1284 | 1284 | echo "</table></td>"; |
1285 | 1285 | echo "<td><table border=\"2\">\n"; |
1286 | 1286 | echo "<tr><th>User</th><th># posts</th></tr>\n"; |
1287 | - for ($p=1; $p<=10; $p++) { |
|
1287 | + for ($p = 1; $p <= 10; $p++) { |
|
1288 | 1288 | row2_plain(user_links_ops($top10poster[$p]), $top10poster[$p]->posts); |
1289 | 1289 | } |
1290 | 1290 | echo "</table></td>"; |
@@ -1323,10 +1323,10 @@ discard block |
||
1323 | 1323 | function admin_show_team($team) { |
1324 | 1324 | start_table(); |
1325 | 1325 | row("ID", $team->id); |
1326 | - row("Team Founder", "<a href=\"db_action.php?table=user&id=$team->userid\">" . user_name_by_id($team->userid) . "</a>"); |
|
1326 | + row("Team Founder", "<a href=\"db_action.php?table=user&id=$team->userid\">".user_name_by_id($team->userid)."</a>"); |
|
1327 | 1327 | row("Name", $team->name); |
1328 | - row("Name (HTML Formatted)", "<pre>" . htmlspecialchars($team->name_html) . "</pre>" ); |
|
1329 | - row("Url", "<a href=\"http://$team->url\">" . $team->url . "</a>"); |
|
1328 | + row("Name (HTML Formatted)", "<pre>".htmlspecialchars($team->name_html)."</pre>"); |
|
1329 | + row("Url", "<a href=\"http://$team->url\">".$team->url."</a>"); |
|
1330 | 1330 | row("Type", team_type_string($team->type)); |
1331 | 1331 | row("Description", $team->description); |
1332 | 1332 | row("", "<a href=\"db_action.php?table=user&teamid=$team->id\">List All Members</a>"); |
@@ -1369,7 +1369,7 @@ discard block |
||
1369 | 1369 | if (!strlen($host->domain_name) && !strlen($host->last_ip_addr)) { |
1370 | 1370 | return "(blank)"; |
1371 | 1371 | } else { |
1372 | - return $host->domain_name . " (" . $host->last_ip_addr . ")"; |
|
1372 | + return $host->domain_name." (".$host->last_ip_addr.")"; |
|
1373 | 1373 | } |
1374 | 1374 | } |
1375 | 1375 |