Esempio n. 1
0
$ctrl = isset($_GET['ctrl']) ? $_GET['ctrl'] : 'News';
$act = isset($_GET['act']) ? $_GET['act'] : 'All';
$classController = 'app\\controllers\\' . $ctrl . 'Controller';
//require __DIR__ . '/classes/DB.php';
$controller = new $classController();
$method = "action" . $act;
$controller->{$method}();
if (require_once 'core/init.php') {
    echo 1;
}
use app\models\Session;
use app\models\User;
use app\classes\DB;
$user = DB::connect();
if (Session::exists('home')) {
    echo "<p><b>" . Session::flash('home') . "</b></p>";
}
$user = new User();
if ($user->isLoggedIn()) {
    ?>
    <p>Hello, <a href="profile.php?user=<?php 
    echo escape($user->data()->username);
    ?>
"><?php 
    echo $user->data()->username;
    ?>
</a></p>
    <ul>
        <li>You can <a href="logout.php">log out</a> here!</li>
        <li>You can <a href="update.php">update</a> your profile here!</li>
        <li>You can <a href="changepassword.php">change password</a> here!</li>