<?php
include_once("includes/page_start.php");
include_once("includes/email_layout_components.php");
$email_script = "";
//$email_script .= "<script src='includes/lunch/lunch.js'></script>";

if(!allowed_email_access()) {
	print $page_header.print_navbar()."<div class='create_menu_heading'>You are not allowed to use this function, exit!</div>".$page_footer;
	exit();
}

$content = "";

$todo = "";
if(isset($_GET['todo'])) {
	$todo = $_GET['todo'];
}

if($todo) {
	switch($todo) {
		default:
			$call_function = $_GET['todo'];
			if(function_exists($call_function)) {
				$result = $call_function();
			}
	}
}


$page = "";
if(isset($_GET['page'])) {
	$page = $_GET['page'];
}

switch($page) {
	case "send_mail":
		$content .= send_mail_page(array());
	break;
	case "week_menu":
		$variables = email_week_menu();
		$content .= send_mail_page($variables);
	break;
	default:
		$content .= send_mail_page(array());
}

$content = "<div class='content'>".$content."</div>";

print $page_header.$email_script.print_standard_top().$content.$page_footer;
$_SESSION['previous_url_request'] = basename($_SERVER['REQUEST_URI']);

?>