コード例 #1
0
ファイル: weathers.php プロジェクト: mpalermo73/scripts-git
    /*
    	print "now: $now\n";
    	print "nowPretty: $nowPretty\n";
    	print "apparent: ". $weatherCSV['apparent'] ."\n";
    	print "relative: ". $weatherCSV['relative'] ."\n";
    	print "barometer: ". $weatherCSV['barometer'] ."\n";
    	print "sustained: ". $weatherCSV['sustained'] ."\n";
    	print "gust: ". $weatherCSV['gust'] ."\n";
    	print "wind: ". $weatherCSV['wind'] ."\n";
    	print "weather-conditions: ". $weatherCSV['weather-conditions'] ."\n";
    */
    $stringCSV = "";
    $stringCSV .= "{$now}";
    $stringCSV .= "," . $nowPretty;
    $stringCSV .= "," . $weatherCSV['apparent'];
    $stringCSV .= "," . $weatherCSV['relative'];
    $stringCSV .= "," . $weatherCSV['barometer'];
    $stringCSV .= "," . $weatherCSV['sustained'];
    $stringCSV .= "," . $weatherCSV['gust'];
    $stringCSV .= "," . $weatherCSV['wind'];
    $stringCSV .= "," . $weatherCSV['weather-conditions'];
    print $stringCSV . "\n";
}
foreach ($places as $place => $location) {
    $lat = $location['lat'];
    $lon = $location['lon'];
    getWeather($place, $lat, $lon);
    buildArray($weatherXML);
    makeCSV($weatherCSV);
    print "===========================\n";
}
コード例 #2
0
ファイル: load.php プロジェクト: hbeyer/liddel-tool
            }
        } elseif ($_SESSION['extension'] == 'xml') {
            $valid = validateXML('upload/files/' . $_SESSION['fileNameInternal'] . '.xml', 'uploadXML.xsd', 'mods-3-4.xsd');
            if ($valid == 1) {
                $data = loadXML('upload/files/' . $_SESSION['fileNameInternal'] . '.' . $_SESSION['extension']);
                $serialize = serialize($data);
                file_put_contents('upload/files/dataPHP-' . $_SESSION['fileNameInternal'], $serialize);
                $_SESSION['store'] = 1;
                echo 'Import war erfolgreich.<br /><a href="annotate.php">Weiter zur Metadatenaufnahme</a>';
            } elseif ($valid == 'mods') {
                //Deleting older files from folder "download"
                array_map('unlink', glob('download/*'));
                transformMODS($_SESSION['fileNameInternal']);
                if (file_exists('download/' . $_SESSION['fileNameInternal'] . '.xml')) {
                    $data = loadXML('download/' . $_SESSION['fileNameInternal'] . '.xml');
                    makeCSV($data, 'download', $_SESSION['fileNameInternal']);
                    unlink('upload/files/' . $_SESSION['fileNameInternal'] . '.xml');
                    echo 'Es wurde eine valide MODS-Datei erkannt und konvertiert.<br />Sie k&ouml;nnen mit <a href="download/' . $_SESSION['fileNameInternal'] . '.xml" target="_blank">dieser XML-Datei</a> oder <a href="download/' . $_SESSION['fileNameInternal'] . '.csv" target="_blank">dieser CSV-Datei</a> weiterarbeiten.';
                } else {
                    die('Fehler beim Konvertieren der MODS-Datei.');
                }
            } else {
                unlink('upload/files/' . $_SESSION['fileNameInternal'] . '.xml');
                die('Fehler beim Import: ' . $valid);
            }
        }
    }
} else {
    echo '
				<p>
					Daten k&ouml;nnen in folgenden Formaten hochgeladen werden:
コード例 #3
0
ファイル: annotate.php プロジェクト: hbeyer/liddel-tool
    } else {
        array_map('unlink', glob($folderName . '/*.html'));
    }
    if ($_SESSION['copiedToFolder'] == 0) {
        copy('proprietary.css', $folderName . '/proprietary.css');
        copy('proprietary.js', $folderName . '/proprietary.js');
        copy('chart.js', $folderName . '/chart.js');
        copy('upload/files/dataPHP-' . $_SESSION['fileNameInternal'], $folderName . '/dataPHP');
        unlink('upload/files/dataPHP-' . $_SESSION['fileNameInternal']);
        unlink('upload/files/' . $_SESSION['fileNameInternal'] . '.' . $_SESSION['extension']);
        $_SESSION['copiedToFolder'] = 1;
    }
    if (file_exists($folderName . '/dataPHP')) {
        $_SESSION['folder'] = 1;
        $dataString = file_get_contents($folderName . '/dataPHP');
        $data = unserialize($dataString);
        unset($dataString);
        saveXML($data, $catalogue, $folderName);
        makeCSV($data, $folderName, $catalogue->fileName);
        echo '<p>Die Metadaten wurden gespeichert.<br />';
        echo 'Weiter zur <a href="geodata.php">Geodatenanreicherung</a>.</p>';
    } else {
        echo '<p>Es ist ein Fehler aufgetreten. Bitte fangen Sie <a href="load.php">von vorne</a> an.</p>';
    }
}
?>
				
			</div>
		</body>
</html>