<?php

$str = "";

if (!$this->oSession->logged()) {

	$str .= '
<form method="post" action="'.$this->oUrl->href().'">
	<label for="loginname">Meno</label>
	<input type="text" name="loginname" id="loginname" class="login" ><br >
	<label for="password">Heslo</label>
	<input type="password" name="password" id="password" class="login" ><br >
	<label for="login">&nbsp;</label>
	<input type="submit" name="login" id="login" class="submit input_submit" value="Login" ><br >
		
</form>
<script type="text/javascript">
	document.getElementById("loginname").focus();
</script>'."\n";

	return '<div id="loginForm">'.$str.'</div>'."\n";

} else {

	/**
	 * 	<label for="login">Login:</label>
	'.$this->oSession->loginName.'<br /><br />
	<label for="logout">&nbsp;</label>
	 */
	include_once($this->path['plugins'] . "classes/hrac.class.php");
	$oHrac = new hracClass($this->oDb, $this->oDbS);
	$imgdata= $oHrac->dajFoto($this->oSession->idUser);
	$imgdata=str_replace("+", "%2B",$imgdata);
	
	$str .='<div id="leftLogout"> <img width=\'60px\' height=\'60px\' id="profilovka" src="http://www.cms.badmintonovaskola.sk/plugins/profil/zdrojFoto.tmpl.php?o='. urlencode($imgdata).'" alt="foto">';
	$str .= '<div id="loginName" >'.$this->oSession->loginName.'</div>';
	$str .= '
<form method="post" action="'.$this->oUrl->href().'">

	<input type="submit" name="logout" id="logout" class="submit input_submit" value="Logout" />
</form>'."\n";
	
	return '<div id="loginForm" class="logged">'.$str.'</div></div>'."\n";

}

?>
