$html_header = new \html\Header(array('title' => "WorldCat Similar Titles", 'css' => array("style.min.css"), 'js' => array('jquery.min.js', 'bootstrap.min.js')));
?>
<!DOCTYPE html>
<html lang="en">
<?php 
echo $html_header->html();
?>
<body><?php 
if (isset($_POST['submit'])) {
    $params = array();
    $idlist = "";
    if (isset($_POST['idlist_textarea'])) {
        $idlist = \util\Misc::cleanCSV($_POST['idlist_textarea']);
        $parms['idlist_textarea'] = $_POST['idlist_textarea'];
    }
    $file = new \util\FileUpload('idlist_file');
    if (($txt = $file->read()) !== FALSE) {
        if ($idlist) {
            $idlist .= ", " . \util\Misc::cleanCSV($txt);
        } else {
            $idlist = \util\Misc::cleanCSV($txt);
        }
    }
    $idtype = $_POST['idtype'];
    $outputFormat = $_POST['outputFormat'];
    $params['idtype'] = $idtype;
    $params['outputFormat'] = $outputFormat;
    $params['hideunique'] = isset($_POST['hide_unique']) ? 1 : 0;
    if (trim($idlist) == "") {
        $params['errormsg'] = "Cannot submit without IDs!";
        echo \html\FormPanel::makeHiddenForm("CSVForm", "index.php", $params);
Esempio n. 2
0
<?php

require_once __DIR__ . "/bootstrap.php";
$header = new \html\Header();
$header->title(\util\Config::$app->name)->css('css/style.min.css')->js('js/jquery.min.js', 'js/bootstrap.min.js');
echo "<!DOCTYPE html>\n<html lang='en'>" . $header->html() . "<body>";
$fname = false;
if (isset($_POST['submit'])) {
    $file = new \util\FileUpload('spreadsheet');
    if (($fname = $file->moveToDir("tmp")) === false) {
        $_POST['errormsg'] = "Upload Failed!";
    }
}
if ($fname) {
    echo \html\FormPanel::makeHiddenForm("UploadForm", "upload_form_submit.php", array('spreadsheet' => $fname));
} else {
    echo "<header>" . \util\Html::genNavbar() . "</header>";
    $form = new \html\FormPanel("Import Spreadsheets", "form-panel", 'md-10', "form-horizontal", "");
    if (isset($_POST['errormsg'])) {
        $form->error($_POST['errormsg']);
    }
    $form->file('spreadsheet', '')->button('submit', 'Confirm/Upload', 'btn btn-primary');
    $container = new \html\GridDiv("container");
    $container->row()->column('md-1')->column('md-10', null, "\n                        <h1>Welcome!</h1>\n                        <p>\n                        Uploading Spreadsheet files will convert them into a database\n                        for use in generating reports.\n                        <br>Multiple files may be uploaded at one time.\n                        <br><b>Supported file extensions: [ .xls , .xml ]</b>\n                        </p>\n                    ")->row()->column('md-1')->column('md-10', null, $form->html())->column('md-1');
    echo $container->html();
}
echo "</body></html>";