<?php

/*
 * awframework from aw.inc present aw controller
 * it will help you develop easy and fast with secure tools
 * you can edit and add what you feel right
 * don't change in strucure of file
 */

require_once("imp/_imp.php");

class Controllers {

    //public vars
    public $smarty;
    public $hosturl;

    // it will run in everytime with
    // default requried
    public function __construct() {
        require_once("../public/aw_config.php");
        $this->smarty = $smarty;
        $this->hosturl = $hosturl;


        $controlname = 'statistics';
        $this->smarty->assign('statisticspage', 1);

        require_once("header.php");
        require_once("footer.php");
    }

    //here the frist page and
    //the frist action in this class
    public function index() {

        //statistics
        $statistics = R::findOne("statistics", "order by id desc");
        $this->smarty->assign("statistics", $statistics);

        header::headershow($this->smarty, $this->hosturl);
        $this->smarty->display('templates/' . default_lang_interface . '/facts-page.html');
        footer::footershow($this->smarty, $this->hosturl);
    }

// at the end of class call
    public function __destruct() {
//close connection
        R::close();
    }

}
