<?php 
//headers for browser caching system
header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1.
header('Pragma: no-cache'); // HTTP 1.0.
header('Expires: 0'); // Proxies.

$is_debug = true;		//set to false on production server!!!!
$time_start = microtime();

require_once("./system/includes.php");
$db = new Db();

$REQUEST_URI = resolve_request($_SERVER['REQUEST_URI']);
if (isset($REQUEST_URI[0]) && $REQUEST_URI[0] != '') {
	$include_keyword = $REQUEST_URI[0];
} else {
	$include_keyword = 'izracun'; //default script and tpl to include
}

$page_title = $_LANG['si']['project_title'];

if (!isset($_COOKIE['login']) && (!isset($REQUEST_URI[0]) || $REQUEST_URI[0] != 'login')) {
	header("Location:/login/");
}

/* GET SCRIPTS */
$include_template_keyword=$include_keyword;
if (is_file("./scripts/$include_keyword.php")) {
	require_once("./scripts/$include_keyword.php"); 		//desired script
} else {
	//do nothing
}
$arr_users = get_user(true,array(3,4));

/* PRINT */
require_once("./html/html_header.tpl.php");
if (is_file("./html/$include_template_keyword.tpl.php")) {
	require_once("./html/$include_template_keyword.tpl.php");	//desired template
} else {
	require_once("./html/404.tpl.php");		//if desired template doesn't exist
}
require_once("./html/html_footer.tpl.php");
?>