Exemple #1
0
if (!is_null($command)) {
    if ($command == 'NEXT') {
        $fileName = '';
        switch ($_FILES["fileup"]["error"]) {
            case UPLOAD_ERR_OK:
                $fileName = $_FILES["fileup"]['tmp_name'];
                break;
            case UPLOAD_ERR_NO_FILE:
                $msg = get_text('FileNotUploaded', 'HTT');
                break;
            default:
                $msg = get_text('UnexpectedError');
        }
        if ($fileName != '') {
            $xml = file_get_contents($fileName);
            $arf = new ARFInput($xml);
            if ($arf->getError() != 999) {
                list($tourCode, $importedEntries, $badEntries, $postError) = $arf->import();
                $msg .= get_text('Report', 'Tournament') . '<br/>' . get_text('ImportedTour', 'Tournament') . ': ' . $tourCode . '<br/>' . get_text('ImportedEntries', 'Tournament') . ': ' . $importedEntries . '<br/>' . get_text('BadEntries', 'Tournament') . ': ' . join(',', $badEntries) . '<br/>' . get_text('PostProcError', 'Tournament') . ': ' . ($postError ? get_text('Yes') : get_text('No'));
            } else {
                $msg = get_text('BlockedPhase', 'Tournament');
            }
        }
    }
}
include 'Common/Templates/head.php';
?>
<div align="center">
	<div class="half">
		<form method="post" enctype="multipart/form-data" action="">
			<input type="hidden" name="Command" value="NEXT">
Exemple #2
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/ARF/ARFInput.class.php';
$streamError = 0;
$out = '<response>';
if (!isset($_REQUEST['xml'])) {
    $streamError = 1;
} else {
    $xml = stripslashes($_REQUEST['xml']);
    //print $xml;exit;
    $arf = new ARFInput($xml);
    list($tourCode, $importedEntries, $badEntries, $postError) = $arf->import();
    $out .= '<imported_tour>' . $tourCode . '</imported_tour>' . "\n" . '<imported_entries>' . $importedEntries . '</imported_entries>' . "\n" . '<bad_entries>' . join(',', $badEntries) . '</bad_entries>' . "\n" . '<post_proc_error>' . ($postError ? 1 : 0) . '</post_proc_error>' . "\n";
}
$out .= '<stream_error>' . $streamError . '</stream_error>' . "\n";
$out .= '</response>';
header('Content-Type: text/xml');
print $out;