<?php 	session_start(); 
		ini_set('display_errors', 1);
		ini_set('display_startup_errors', 1);
		error_reporting(E_ALL); 
		require("classes.php");
		require("classes_admin.php");
        if(!isset($_SESSION['filters'])) $_SESSION['filters'] = 4;
		$db = new db();

        if(isset($_GET['blurb']) && $_SESSION['admin'] == "yes") {
            $page = new EditBlurb($_GET['blurb'], $db->conn);
        } elseif(isset($_POST['username'])) {
			$page = new ProcessLogin($_POST, $db->conn);
		} elseif(isset($_POST['subjectid'])) {
            $page = new ProcessEdit($_POST, $db->conn); 
        } else {
			$page = new LoginPage();
		}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Someone Thinks They're Special</title>
<link href="playground.css" rel="stylesheet" type="text/css">
<script>
    function stagingtext(callerid) {
        var feedbacktext = ["hidden", "deleted", "disapproved", "pending", "approved"];
        var newvalue = document.getElementById(callerid).value;
        document.getElementById(callerid+"fb").innerHTML = feedbacktext[newvalue];
    }
</script>
</head>

<body onload="">
	<div class='page_container'>

		<div class='header'>
			<?php $page->show_header_image(); ?>
			<?= Page::$alphaGrid; ?>
		</div>
		<div class='sidebar'>
			<?php $page->on_page(); ?>
			<?php if(!is_a($page, "IntroPage") && strpos($_SERVER['REQUEST_METHOD'], "ndex")) { $page->filters(); } ?>
		</div>
		<div class='content'>
			<?= $page->content; ?>
		</div>
		<div style='clear: both;'></div>
		<div class='footer'>
			<?= Page::$pageFooter; ?>
		</div>
	</div>
</body>
</html>
</html>