<!DOCTYPE html>
<html>
<head>
<title>Schema Validation</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" enctype="multipart/form-data">
<label for="type">Type: </label>
<select name="type">
<option value="xmlfs">XML Filesystem</option>
<option value="translation">Translation XML</option>
</select>
<label for="file">Your file: </label>
<input type="file" name="file" id="file" />
<input type="submit" name="submit" value="Upload" />
</form>
<?php
require_once('functions.php');
if(isset($_POST['type']))
{
switch($_POST['type'])
{
case 'xmlfs':
$upload = new FilesystemXMLUpload($_FILES["file"]);
break;
case 'translation':
$upload = new TranslationXMLUpload($_FILES["file"]);
break;
default:
die('You submitted a wrong XML file type.');
}
if($upload->save())
{
?>
<div class="box">
<h2>Clear Cache</h2>
<iframe src="/clearcache.php"></iframe>
</div>
<?php
}
$upload->printInfos();
}
?>
<div class="box">
<h2>More Options</h2>
<ul>
<li>
<a href="?restore=1">Restore last backup</a>
</li>
<li>
<a href="/">goto root</a>
</li>
<li>
<a href="/clearcache.php">Clear Cache</a>
</li>
</ul>
</div>
</body>
</html>