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

if($akcija == "get")
{
	$tpl = new TemplatePower($ajax."templates/".$settings['template']."/osebne_nastavitve.tpl");
	$tpl->prepare();
	$tpl->assignGlobal("template_dir", $ajax."/templates/".$settings['template']);

	/* Language */
	require('sys/lib_language.php');

	$result = $db->query("SELECT * FROM core_uporabniki WHERE id = '$_SESSION[id]'");
	$r = $result->fetch();
	$tpl->assign("uporabnik",$r['username']);
	$tpl->assign("ime_priimek",$r['ime_priimek']);
	$tpl->assign("num_results",$r['num_results']);

	$tpl->printToScreen();
}
elseif($akcija == "save")
{
	if($clean['geslo'])
	{
		$geslo = ", password = '$clean[geslo]'";
	}

	$db->query("UPDATE core_uporabniki SET ime_priimek = '$clean[ime_priimek]', num_results = '$clean[num_results]'".$geslo." WHERE id = '$_SESSION[id]'");
}
?>