\n";
$html .= "\n";
$html .= "\t
\n";
$html .= "\t\t\n";
$html .= "\t\t\n";
if (file_exists($Icon)) $html .= "\t\t\n";
if (file_exists($Stylesheet)) $html .= "\t\t\n";
if (file_exists($javaScript)) $html .= "\t\t\n";
$html .= "\t\t$instanceName\n";
$html .= "\t\t\n";
$html .= "\t\t\t
\n";
if (file_exists($Logo)) $html .= "\t\t\t\t\n";
$html .= "\t\t\t\t$instanceName\n";
$html .= "\t\t\t\tYour files\n";
foreach (glob('*.php') as $file) {
if (!file_exists("$file".".name")) {
continue;
}
$name = file_get_contents("$file".".name");
$name = rtrim($name, "\r\n");
$html .= "\t\t\t\t$name\n";
}
if (!isset($_COOKIE[$cookieName])) {
$html .= "\t\t\t\tLog in\n";
} else {
$html .= "\t\t\t\tLog out\n";
}
if (isset($_COOKIE[$cookieTypeName]) && $_COOKIE[$cookieTypeName] == 2) {
$html .= "\t\t\t\tAdministration\n";
}
$html .= "\t\t\t\n";
$html .= "\t\t
\n";
$html .= "\t\n";
$html .= "\t\n";
$html .= "\t\t\n";
return "$html";
}
function printFooter($html) {
include "config.php";
$html .= "\t\t
\n";
$html .= "\t\n";
$html .= "\t\n";
$html .= "\n";
return "$html";
}
function printFileUploadForm($html, $Error) {
include "config.php";
// print the form
if (isset($_COOKIE[$cookieTypeName]) || ($publicUploading || $publicUploading == "true")) {
$html .= "\t\t\t\n";
$html .= "\t\t\tMax file size: $maxFileSize MB
\n";
// error handling
if ($Error == "file") {
$html .= "\t\t\tNo file specified.
\n";
} else if ($Error == "size") {
$html .= "\t\t\tFile is too big.
\n";
} else if ($Error == "key") {
$html .= "\t\t\tInvalid key. WTF?
\n";
} else if ($Error == "wtf") {
$html .= "\t\t\tWTF? Try again.
\n";
}
}
return "$html";
}
function checkIfAdminExists() {
include "config.php";
include "create-table.php";
$adminExists = 0;
$Database = createTables($sqlDB);
$DatabaseQuery = $Database->query('SELECT * FROM admins');
$adminExists = 0;
while ($line = $DatabaseQuery->fetchArray()) {
$adminExists = 1;
break;
}
return $adminExists;
}
?>