<?php

/**
* welcome.TU.code Anmeldesystem.
* by David Kaufmann <astra@ionic.at>
*/

function html_top($title = ""){
  if($GLOBALS['devmode'] == 1)$title .= ' [DEVMODE]';

	return <<<EOF
<!DOCTYPE html>
<html lang="de" dir="ltr">
<head>
<meta charset="utf-8">
<title>$title</title>
<link rel="stylesheet" href="/style.css">
EOF;
}

function html_bottom(){
	return <<<EOF
<hr>
<!-- Entwickelt 2015 von David "astra" Kaufmann (Layout + Website) und Jan "someone" Valeš (Datenbank + Website). -->
<p class="footnote"><a href="https://frost.fsinf.at/iris?channels=w2c">Support-WebChat</a> (Ist ein WebIRC zu <a href="irc://irc.fsinf.at/w2c">#w2c auf irc.fsinf.at</a>)
<br>Auch möglich: <a href="mailto:someone@fsinf.at">eMail an someone@fsinf.at</a></p>
</body>
</html>
EOF;
}

function html_linkbox($current = "") {
	$items = array(
		'/index' => "Home",
		'/list' => "Anmeldungen",
		'/intern/index' => "Dateiupload",
		'/stats' => "Stats"
	);
	$out = '</head><body id="welcometucode"><div id="menu" class="align-center"><h1>Anmeldesystem welcomeTUcode</h1><ul class="menulist">';
	foreach ($items as $file => $name) {
		$activeitem = ($current === $file) ? ' menuactive' : '';
		$out .= '<li class="menuitem'.$activeitem.'"><a href="'.$file.'.php">'.$name.'</a></li>';
	}
	$out .= '</ul></div><hr>';
    if($GLOBALS['devmode'] == 1)$out .= '<p class="footnote">DEVMODE aktiv.<br>Am System wird gerade gearbeitet!</p>';
	return $out;
}