Exemplo n.º 1
0
require_once "classes/Registration.php";
require_once "classes/Budget.php";
// create a login & registration object. when this object is created, it will do all login/logout stuff automatically
$login = new Login();
$registration = new Registration();
$budget = new Budget();
require_once "views/globalCSS.php";
require_once "views/globalJS.php";
if ($login->isUserLoggedIn() == true) {
    switch (key($_GET)) {
        case "budgets":
            require "views/logged_in/user_header_menu.php";
            if ($login->userHasBugdet() == true) {
                require "views/logged_in/budgets.php";
            } else {
                $budget->createNewBudget($budgetName = "Current", $budgetIdToDuplicate = "new");
                require "views/logged_in/user_header_menu.php";
                require "views/logged_in/demographicsForm.php";
                require "views/logged_in/incomeForm.php";
            }
            break;
        case "editincomebudget":
            if ($_GET['editincomebudget'] == "new") {
                $budget->createNewBudget($budgetName = $_GET['budgetname'], $budgetIdToDuplicate = "new");
            } else {
                $_SESSION['user_budgetid'] = $_GET['editincomebudget'];
            }
            if ($budget->errors) {
                require "views/logged_in/user_header_menu.php";
                require "views/logged_in/budgets.php";
            } else {