Transfer upload page to new design

This commit is contained in:
Joshua Ramon Enslin 2019-08-30 23:14:18 +02:00 committed by Stefan Rohde-Enslin
parent e6272ddd17
commit adf447fe1a
2 changed files with 33 additions and 27 deletions

View File

@ -18,7 +18,7 @@
body { margin: 2em; background: #FFF; body { margin: 2em; background: #FFF;
font-family: sourceSansPro, Arial, Helvetica, Times; font-size: 1.2em; line-height: 1.5em; } font-family: sourceSansPro, Arial, Helvetica, Times; font-size: 1.2em; line-height: 1.5em; }
a { text-decoration: none; } a { text-decoration: none; color: inherit; }
h1 { display: block; max-width: 600px; margin: 0 auto 1.5em auto; } h1 { display: block; max-width: 600px; margin: 0 auto 1.5em auto; }
h1 > * { display: inline-block; vertical-align: middle; color: #212121; } h1 > * { display: inline-block; vertical-align: middle; color: #212121; }
@ -101,3 +101,7 @@ ul.fieldList > li.humanTLToggled { border-color: #CB9B8C; background: #CB9B8C; b
opacity: 1; opacity: 1;
transition: background .4s, opacity .4s; } transition: background .4s, opacity .4s; }
.options > a.buttonLike:hover { background: #D6D6D6; } .options > a.buttonLike:hover { background: #D6D6D6; }
.actionList { margin: 1em 0 1em 1em; padding: .5em 0; }
.actionList > li a { display: inline-block; padding: .3em; border-radius: .3em; transition: background .4s; }
.actionList > li a:hover { background: #CB9B8C; }

View File

@ -1,36 +1,38 @@
<?PHP <?PHP
echo '<link rel="stylesheet" type="text/css" href="css/main.css">'; declare(strict_types = 1);
echo '<div class="title">'; require_once __DIR__ . "/functions/functions.php";
echo 'museum-digital CSV to XML converter';
echo '</div>';
echo '<div class="maincontent">';
$target = "csv/"; $target = "csv/";
$target = $target . basename( $_FILES['uploaded']['name']); $target .= basename( $_FILES['uploaded']['name']);
$targetpart = basename( $_FILES['uploaded']['name']); $targetpart = basename( $_FILES['uploaded']['name']);
$ok = 1;
$semikoma = $_POST['deli'];
//This is our size condition //This is our size condition
if ($uploaded_size > 40000000) { if ($uploaded_size > 40000000) {
echo "Your file is too large.<br>"; echo "Your file is too large.<br>";
$ok = 0; return;
} }
//Here we check that $ok was not set to 0 by an error //Here we check that $ok was not set to 0 by an error
if ($ok == 0) { //If everything is ok we try to upload it
echo "Sorry your file was not uploaded"; if(!move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {
echo "Sorry, there was a problem uploading your file.";
return;
} }
else
{ echo printHTMLHead();
//If everything is ok we try to upload it
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "
echo "The file <b>" . basename( $_FILES['uploaded']['name']) . "</b> has been uploaded<hr>"; <div>
echo '<a href="index2.php?fnam=' . basename( $_FILES['uploaded']['name']) . '"><img src="img/go.gif"> Create XML (iso8859)</a><br>'; <p>The file has been uploaded: <b>" . basename( $_FILES['uploaded']['name']) . "</b>.</p>
echo '<a href="index4.php?fnam=' . basename( $_FILES['uploaded']['name']) . '"><img src="img/go.gif"> Create XML (utf-8)</a><br>'; <hr>
echo '<a href="index3.php?fnam=' . basename( $_FILES['uploaded']['name']) . '"><img src="img/go.gif"> Check validity for museum-digital import</a>'; <h3>How to proceed?</h3>
} <ul class='actionList'>
else <li><a href='index2.php?fnam=" . basename( $_FILES['uploaded']['name']) . "'>Create XML (iso8859)</a></li>
{ <li><a href='index4.php?fnam=" . basename( $_FILES['uploaded']['name']) . "'>Create XML (utf-8)</a></li>
echo "Sorry, there was a problem uploading your file."; <li><a href='index3.php?fnam=" . basename( $_FILES['uploaded']['name']) . "'>Check validity for museum-digital import</a></li>
} </ul>
} </div>
echo '</div>';
</body>
</html>
";