Пример #1
0
            }
            break;
        case 'model':
            echo $x;
            break;
        case 'day':
            echo $x;
            break;
    }
    echo "</td><td align=right>" . format_credit_large($y->credit), "</td><td align=right>{$y->nresults}</td></tr>\n";
}
$mode = get_str('mode', true);
if (!$mode) {
    page_head("Show GPU info");
    echo "\n        <ul>\n        <li> <a href=show_coproc.php?mode=host>Hosts</a>\n        <li> <a href=show_coproc.php?mode=user>Users</a>\n        <li> <a href=show_coproc.php?mode=team>Teams</a>\n        <li> <a href=show_coproc.php?mode=model>GPU models</a>\n        <li> <a href=show_coproc.php?mode=day>Day</a>\n        </ul>\n    ";
    page_tail();
    exit;
}
$fname = "../ops/" . filename($mode);
$data = file_get_contents($fname);
$array = unserialize($data);
page_head(title($mode));
start_table();
header_row($mode);
$i = 0;
foreach ($array as $x => $y) {
    show_row($x, $y, $mode, $i);
    $i++;
}
end_table();
page_tail();
Пример #2
0
echo "<table border=\"0\" width=\"100%\">\n";
$show_notes = $format == "ultimate" || $format == "detailed";
$show_details = $format == "ultimate" || $format == "detailed" || "{$format}" == "activity" || "{$format}" == "quotes";
$show_quotes = $format == "ultimate" || "{$format}" == "activity" || "{$format}" == "quotes";
$show_work = ($format == "ultimate" || "{$format}" == "activity") && is_member_of('Admin', 'Support');
if (!$show_details) {
    header_row();
}
if ($result) {
    $grand_total = 0.0;
    $grand_qty_total = 0.0;
    // Build table of requests found
    for ($i = 0; $i < pg_NumRows($result); $i++) {
        $thisrequest = pg_Fetch_Object($result, $i);
        if ($show_details) {
            header_row();
        }
        data_row($thisrequest, $i);
        if ($show_details) {
            printf("<tr class=\"row%1d\">\n", $i % 2);
            echo "<td colspan=\"7\">" . html_format($thisrequest->detailed) . "</td>\n";
            echo "</tr>\n";
        }
        if ($show_quotes) {
            $subquery = "SELECT *, to_char( quoted_on, 'DD/MM/YYYY') AS nice_date ";
            $subquery .= "FROM request_quote, usr ";
            $subquery .= "WHERE request_id = {$thisrequest->request_id} ";
            $subquery .= "AND usr.user_no = request_quote.quote_by_id ";
            $subquery .= "ORDER BY request_id, quoted_on ";
            $total = 0.0;
            $qty_total = 0.0;