Example #1
0
        }
    }
}
if ($login) {
    set_time_limit(300);
    $xml = new XML_data();
    $ftp = new FTP_data();
    //
    // set file names and generade result xml
    //
    $res = mysql_query("select xControl from meeting where xMeeting = " . $_COOKIE['meeting_id']);
    $row = mysql_fetch_Array($res);
    $eventnr = $row[0];
    $local = dirname($_SERVER['SCRIPT_FILENAME']) . "/tmp/results.xml.gz";
    $remote = date("Ymd") . "_" . $eventnr . ".gz";
    $nbr_effort = $xml->gen_result_xml($local);
    // upload result file
    if ($nbr_effort > 0) {
        //upload only if file contains at least one results
        $ftp->open_connection($cfgSLVhost, $cfgSLVuser, $cfgSLVpass);
        $success = $ftp->put_file($local, $remote);
        $ftp->close_connection();
    } else {
        $success = true;
    }
    if ($success) {
        // output message and set round status to results_sent
        foreach ($GLOBALS['rounds'] as $xRunde) {
            mysql_query("UPDATE runde SET StatusUpload = 1 WHERE xRunde = {$xRunde}");
            if (mysql_errno() > 0) {
                AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
Example #2
0
        }
    }
}
if ($login) {
    set_time_limit(300);
    $xml = new XML_data();
    $ftp = new FTP_data();
    //
    // set file names and generade result xml
    //
    $res = mysql_query("select xControl from meeting where xMeeting = " . $_COOKIE['meeting_id']);
    $row = mysql_fetch_Array($res);
    $eventnr = $row[0];
    $local = dirname($_SERVER['SCRIPT_FILENAME']) . "/tmp/results.xml.gz";
    $remote = date("Ymd") . "_" . $eventnr . ".gz";
    $xml->gen_result_xml($local);
    // upload result file
    $ftp->open_connection($cfgSLVhost, $cfgSLVuser, $cfgSLVpass);
    $success = $ftp->put_file($local, $remote);
    $ftp->close_connection();
    if ($success) {
        // output message and set round status to results_sent
        foreach ($GLOBALS['rounds'] as $xRunde) {
            mysql_query("UPDATE runde SET StatusUpload = 1 WHERE xRunde = {$xRunde}");
            if (mysql_errno() > 0) {
                AA_printErrorMsg(mysql_errno() . ": " . mysql_error());
            }
        }
        echo "<p>{$strResultsUploaded}</p>";
    } else {
        echo "<p>{$strErrResultUpload}</p>";