コード例 #1
0
ファイル: icpc.php プロジェクト: sbaldrich/boca
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////////////
//Last updated 10/jul/2012 by cassio@ime.usp.br
require 'header.php';
$score = DBScore($_SESSION["usertable"]["contestnumber"], false, -1, $st["siteglobalscore"]);
echo "<h2>ICPC Output</h2>";
echo "<pre>";
$n = 0;
$class = 1;
while (list($e, $c) = each($score)) {
    if (isset($score[$e]["site"]) && isset($score[$e]["user"])) {
        $r = DBUserInfo($_SESSION["usertable"]["contestnumber"], $score[$e]["site"], $score[$e]["user"]);
        echo $r["usericpcid"] . ",";
        echo $class++ . ",";
        echo $score[$e]["totalcount"] . ",";
        echo $score[$e]["totaltime"] . ",";
        if ($score[$e]["first"]) {
            echo $score[$e]["first"] . "\n";
        } else {
            echo "0\n";
コード例 #2
0
ファイル: scoretable.php プロジェクト: justomiguel/boca
 if (!isset($hor)) {
     $hor = -1;
 }
 if ($hor > $duration) {
     $hor = $duration;
 }
 $level = $s["sitescorelevel"];
 if ($level <= 0) {
     $level = -$level;
 } else {
     $des = true;
 }
 if (($s = DBSiteInfo($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"])) == null) {
     ForceLoad("index.php");
 }
 $score = DBScore($_SESSION["usertable"]["contestnumber"], $ver, $hor * 60, $s["siteglobalscore"]);
 if ($_SESSION["usertable"]["usertype"] != "score" && $_SESSION["usertable"]["usertype"] != "admin" && $level > 3) {
     $level = 3;
 }
 $minu = 3;
 $rn = DBRecentNews($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"], $ver, $minu);
 if (count($rn) > 0 && $level > 3) {
     $strtmp .= "<table border=0><tr>";
     $strtmp .= "<td>News (last {$minu}'): &nbsp;</td>\n";
     for ($i = 0; $i < count($rn); $i++) {
         $strtmp .= "<td width=200>";
         if ($rn[$i]["yes"] == 't') {
             $strtmp .= "<img alt=\"" . $rn[$i]["colorname"] . ":\" width=\"28\" " . "src=\"" . balloonurl($rn[$i]["color"]) . "\" />";
         } else {
             $strtmp .= "<img alt=\"\" width=\"22\" " . "src=\"{$loc}/images/bigballoontransp-blink.gif\" />\n";
         }
コード例 #3
0
ファイル: webcast.php プロジェクト: sbaldrich/boca
    $teamID = $a['username'];
    if (isset($a['usershortname'])) {
        $teamName = $a['usershortname'];
    } else {
        $teamName = $a['userfullname'];
    }
    if (isset($a['usershortinstitution'])) {
        $teamUni = $a['usershortinstitution'];
    } else {
        $teamUni = $teamName;
    }
    $contestfile = $contestfile . $teamID . '' . $teamUni . '' . $teamName . "\n";
}
$contestfile = $contestfile . '1' . '' . '1' . "\n";
$contestfile = $contestfile . $numProblems . '' . 'Y' . "\n";
$score = DBScore($_SESSION["usertable"]["contestnumber"], false, -1, $ct["contestlocalsite"]);
//$contestfile = $contestfile .
//	"<h2>ICPC Output</h2>";
//$contestfile = $contestfile .
//	"<pre>";
$n = 0;
$class = 1;
while (list($e, $c) = each($score)) {
    if (isset($score[$e]["site"]) && isset($score[$e]["user"])) {
        if (DBSiteInfo($_SESSION["usertable"]["contestnumber"], $score[$e]["site"]) != null) {
            $r = DBUserInfo($_SESSION["usertable"]["contestnumber"], $score[$e]["site"], $score[$e]["user"]);
            $contestfile = $contestfile . $r["usericpcid"] . "," . $class++ . "," . $score[$e]["totalcount"] . "," . $score[$e]["totaltime"] . ",";
            if ($score[$e]["first"]) {
                $contestfile = $contestfile . $score[$e]["first"] . "\n";
            } else {
                $contestfile = $contestfile . "0\n";