Example #1
0
</head>
<body>
<?php 
session_start();
/*
 * Initialize Database
 */
require "include/config.php";
require "backend/products/Clothes.php";
require_once "backend/database/Database.php";
//Creates a new Database object
$db = new Database();
//Connects with the database
$db->connectDatabase();
//Gets all the products and saves them
$db->getAllProducts();
/*
 * Views
 */
//Default page, if there is no GET for page
if (!isset($_GET['page'])) {
    include "view/index.php";
    return;
}
//Switch the GET for page
switch (strtolower($_GET['page'])) {
    //If it is login
    case "login":
        //Go to login page
        include "view/login.php";
        break;