コード例 #1
0
ファイル: importSheet.php プロジェクト: varfunc/commons
<?php

require_once 'CommonsPropagator.php';
if (!isset($_FILES['jUp']['error']) || is_array($_FILES['jUp']['error'])) {
    throw new RuntimeException('Invalid parameters.');
} else {
    $tmpName = $_FILES["jUp"]["tmp_name"];
    $name = $_FILES["jUp"]["name"];
    if (!move_uploaded_file($tmpName, $name)) {
        throw new Exception('Problem moving ' . $tmpName . ' to ' . $name . '.');
    }
    $propagator = new CommonsPropagator(",");
    echo $propagator->buildStructure($name);
}
コード例 #2
0
ファイル: agraphumer.php プロジェクト: varfunc/commons
?>
<html>
<head>
    <title>Metrics</title>
    <?php 
for ($i = 0; $i <= $cssFilesCount; $i++) {
    echo '<link rel="stylesheet" href="' . $cssFiles[$i] . '.css"></link>';
}
for ($i = 0; $i <= $javaScriptLeadersCount; $i++) {
    echo '<script src="' . $javaScriptLeaders[$i] . '.js" type="application/javascript"></script>';
}
?>
</head>
<body>
<?php 
// Single file printer signature: input file name[, number of write-in rows][, footer caption]
//
// e.g.:
$display = new CommonsPropagator(',', array('identifier', 'date', 'metric', 'metric', 'metric', 'metric', 'text'));
echo $display->printCsvFileAsTable('substanceAbuseMetrics.csv');
//
$display = new CommonsPropagator(',', array('identifier', 'date', 'text'));
echo $display->printCsvFileAsTable('positivityEntries.csv', 0, "A subjective daily log of one or more positive experiences.");
//
// Multiple sheets.
$display = new CommonsPropagator(',', array('identifier', 'text'));
echo $display->printCsvFilesAsTables('otherIdeas.csv', 'journal.csv');
?>
</body>
</html>
コード例 #3
0
ファイル: saveCommons.php プロジェクト: varfunc/commons
<?php

require_once 'CommonsPropagator.php';
var_dump($_POST['sheets']);
if (!isset($_POST['sheets'])) {
    throw new RuntimeException('Invalid parameters.');
} else {
    $information = $_POST['sheets'];
    $propagator = new CommonsPropagator(",");
    $propagator->saveCommons($information);
}