<?php


namespace App\Controllers;

use \App\Maps\Controller;
use \App\Providers\Shared;
use \App\Providers\Auth;
use \App\Models\Admins;

/**
*
*/
class Dashboard extends Controller
{
    protected $code = 'home';
    protected $title = 'Acceuil';


    public function main()
    {
    	Auth::BlockVisitor();
    	
    	if ( isset($_POST['submit']) ) {

    		$password = htmlspecialchars(htmlentities($_POST['password']));
    
    		$action = Admins::updatePassword(1, $password);
    		
    		Shared::Redirect( $_ENV['BASE_URL'] . "/" );
    	}

        $this->view('dashboard');
    }
}
