<?php
/********************************************************************
** Skripta, ki skrbi za glavne nastavitve modula						 **
** Author: Dave @ zabec.net		  											 **
** Date: 2008 																	    **
********************************************************************/

$tpl->assignInclude("nastavitve", "templates/".$settings['template']."/nastavitve.tpl");
$tpl->prepare();

$_SESSION['modul'] = "nastavitve";
$_SESSION['modul_id'] = "1";

switch($clean['page'])
{
	case "uporabniki":
		$act = "uporabniki";
	break;
	case "moduli":
		$act = "moduli";
	break;
	case "dostop":
		$act = "dostop";
	break;
	case "mojcms":
		$mojcms = true;
	break;
}
$_SESSION['act'] = $act;

if($act)
{
	include("mod/nastavitve/".$act."/settings.php");
}

//specifika mojcms
if($mojcms)
{
	$tpl->assignInclude("main_content", $ajax."templates/".$settings['template']."/moduli/moj_cms.tpl");
	$tpl->prepare();
	$result = $db->query("SELECT * FROM core_licence");
	$r = $result->fetch();
	$tpl->assign("verzija",$r['versionname']);
	$tpl->assign("id_licenca",$r['licence_id']);
	$tpl->assign("zadnja_verzija",$r['lastversion']);
	$tpl->assign("client_name",$r['client_name']);
	$tpl->assign("client_reseller",$r['client_reseller']);
	$tpl->assign("valid",formatDateFromDB($r['valid'], "date"));

	if($r['upgrade'] == 1)
	{
		$tpl->assign("update",$lang['nast_newversion']);
		$tpl->newBlock("nadgradi");
	}
	else
	{
		$tpl->assign("update",$lang['nast_lasversion']);
	}
}
?>