Example #1
0
function analyze($appid, $app_version_id, $nresults)
{
    global $hist;
    $clause = $app_version_id ? " and app_version_id = {$app_version_id} " : "";
    $query = "select id, server_state, outcome, elapsed_time, flops_estimate from result where server_state=5 and appid={$appid} and outcome=1 and validate_state=1 {$clause} order by id desc limit {$nresults}";
    $r = mysql_query($query);
    $n = 0;
    while ($result = mysql_fetch_object($r)) {
        handle_result($result);
        $n++;
    }
    if (!$n) {
        echo "No done results for that app";
        exit;
    }
    ksort($hist);
    show_stats($hist);
    echo "<hr>\n";
    show_as_table();
    echo "<hr>\n";
    show_as_xml();
}
Example #2
0
                    // dans cette condition, la variable numero_page est incrémenté et est inférieure à $nombre
                    // constitution des liens
                    $suivante = $numero_page + 1;
                    $precedente = $numero_page - 1;
                    // affichage du lien précédent si nécéssaire
                    if ($precedente >= 0) {
                        $nav_bar .= "<img src='./images/left.gif' border='0' title='{$msg['48']}' alt='[{$msg['48']}]' hspace='3' align='bottom' onClick=\"document.navbar.dest.value='';document.navbar.numero_page.value='{$precedente}'; document.navbar.limite_page.value='{$limite_page}'; document.navbar.submit(); \"/>";
                    }
                    for ($i = 0; $i <= $nbpages_arrondi; $i++) {
                        if ($i == $numero_page) {
                            $nav_bar .= "<strong>" . ($i + 1) . "/" . ($nbpages_arrondi + 1) . "</strong>";
                        }
                    }
                    if ($suivante <= $nbpages_arrondi) {
                        $nav_bar .= "<img src='./images/right.gif' border='0' title='{$msg['49']}' alt='[{$msg['49']}]' hspace='3' align='bottom' onClick=\"document.navbar.dest.value='';document.navbar.numero_page.value='{$suivante}'; document.navbar.limite_page.value='{$limite_page}'; document.navbar.submit(); \" />";
                    }
                    echo $nav_bar;
                    echo "\n\t\t\t\t\t<input type='hidden' name='dest' value='' />\n\t\t\t\t\t{$msg['edit_cbgen_mep_afficher']} <input type='text' name='limite_page' value='{$limite_page}' class='saisie-5em' /> {$msg['1905']}\n\t\t\t\t\t<input type='submit' class='bouton' value='" . $msg['actualiser'] . "' onclick=\"this.form.dest.value='';document.navbar.numero_page.value=0;\" /><font size='4'>&nbsp;&nbsp;&nbsp;&nbsp;</font>\n\t\t\t\t\t<input type='image' src='./images/tableur.gif' border='0' onClick=\"this.form.dest.value='TABLEAU';\" alt='Export tableau EXCEL' title='Export tableau EXCEL' /><font size='4'>&nbsp;&nbsp;&nbsp;&nbsp;</font>\n\t\t\t\t\t<input type='image' src='./images/tableur_html.gif' border='0' onClick=\"this.form.dest.value='TABLEAUHTML';\" alt='Export tableau HTML' title='Export tableau HTML' />\n\t\t\t\t\t</form></p>";
                    break;
            }
        } else {
            echo $msg["etatperso_aucuneligne"];
        }
        mysql_free_result($res);
    }
}
if (!$id_proc) {
    print show_stats($dbh);
} else {
    print show_results_stats($id_proc);
}
if ($host && $port) {
    $fp = stream_socket_client("tcp://{$host}:{$port}", $errno, $errstr, DEFAULT_TCP_TIMEOUT);
} else {
    $fp = stream_socket_client("unix://{$socketpath}", $errno, $errstr, DEFAULT_UNIXSOCKET_TIMEOUT);
}
if (!$fp) {
    echo "{$errstr} ({$errno})" . PHP_EOL;
    exit - 1;
}
// Run logic
switch ($mode) {
    case 'settings':
        show_stats($fp, 'stats settings');
        break;
    case 'stats':
        show_stats($fp, 'stats');
        break;
    case 'sizes':
        sizes($fp);
        break;
    case 'dumpkeys':
        iterkeys($fp, DUMPMODE_ONLYKEYS);
        break;
    case 'removeexp':
        iterkeys($fp, REMOVEMODE_EXPIRED);
        break;
    case 'dump':
        iterkeys($fp, DUMPMODE_KEYVALUES);
        break;
    case 'display':
    default:
Example #4
0
     db_table_struct();
     break;
 case 'db_table_struct_select':
     db_table_struct_select();
     break;
 case 'add_query':
     add_query();
     break;
 case 'edit_query':
     edit_query();
     break;
 case 'db_tables':
     db_tables();
     break;
 case 'show_stats':
     show_stats();
     break;
 case 'generate_xml':
     generate_xml();
     break;
 case 'generate_csv':
     generate_csv();
     break;
 case 'paypal_info':
     paypal_info();
     break;
 case 'default':
     setdefault();
     break;
 case 'product_option':
     product_option();
Example #5
0
function analyze($appid, $platformid, $nresults)
{
    global $hist;
    $clause = "";
    switch ($platformid) {
        case 0:
            $clause = "";
            break;
        case 1:
            $clause = " and locate('Windows', os_name)";
            break;
        case 2:
            $clause = " and locate('Darwin', os_name)";
            break;
        case 3:
            $clause = " and locate('Linux', os_name)";
            break;
    }
    $query = "select server_state, outcome, cpu_time, p_fpops from result, host where server_state=5 and appid={$appid} and host.id = result.hostid {$clause} limit {$nresults}";
    $r = mysql_query($query);
    $n = 0;
    while ($result = mysql_fetch_object($r)) {
        switch ($result->outcome) {
            case 1:
                // success
                handle_result($result);
                $n++;
                break;
            case 2:
                // couldn't send
            // couldn't send
            case 3:
                // client error
            // client error
            case 4:
                // no reply
            // no reply
            case 5:
                // didn't need
            // didn't need
            case 6:
                // validate error
            // validate error
            case 7:
                // client detached
        }
    }
    if (!$n) {
        echo "No done results for that app";
        exit;
    }
    ksort($hist);
    show_stats($hist);
    echo "<hr>\n";
    show_as_table();
    echo "<hr>\n";
    show_as_xml();
}
Example #6
0
						//when a tag reaches the targetScore
						if (score >= targetScore) {
							$(this).children(":first").hide();
							this.previousElementSibling.firstElementChild.innerHTML = tagId;
							$(this).css("border-top-left-radius",0).css("border-top-right-radius",0);						
							score = targetScore
						};
						
						//set as % of targetScore
						score = score/targetScore;
						
						//setup relative height of column
						var columnHeight = Math.floor(score * progressHeight);
						var	columnMarginTop = progressHeight - columnHeight;
						
						$(this).css("height", columnHeight).css("margin-top",columnMarginTop);
					}); // end set progress heights
				}; //end Puzzles()
				

				window.onload = Puzzles;
				window.onresize = Puzzles;
			
			})()
		</script>
	</head>
	<body>
		<?php show_stats($conn); ?>		
	</body>
</html>
Example #7
0
        case 1:
            $x = "HTC Power to Give";
            break;
        default:
            error_page("invalid brand");
    }
    $hosts = BoincHost::enum("os_name='Android' and serialnum like '%{$x}%'");
    $n = 0;
    $t = 0;
    $a = 0;
    foreach ($hosts as $h) {
        $t += $h->total_credit;
        $a += $h->expavg_credit;
        if ($h->expavg_credit > 0.1) {
            $n++;
        }
    }
    page_head("Stats for {$x}");
    start_table();
    row2("Active devices", $n);
    row2("Average daily credit", $a);
    row2("Total credit", $t);
    end_table();
    page_tail();
}
$brand = get_int("brand", true);
if ($brand) {
    show_stats($brand);
} else {
    show_form();
}