<?php

ob_start();
session_start();
/*
 * 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
 */

class header {

    public static function headershow($smarty, $hosturl) {
        //can use db here
        //....
        if (!isset($_SESSION['new_lang'])) {
            $lang = "en";
        } else {
            $lang = $_SESSION['new_lang'];
        }

        define('default_lang_interface', $lang);

        $smarty->assign('lang', default_lang_interface);
        $smarty->assign('hosturl', $hosturl);


        #select table
        $setting = R::findOne('siteinfo', 'order by id desc');
        if (count($setting) > 0) {
            //send info to html
            $smarty->assign('setting', $setting);
        }

        //var_dump($setting);
        $smarty->display('templates/' . default_lang_interface . '/head.html');
        $smarty->display('templates/' . default_lang_interface . '/header.html');
    }

}
