<?php
session_start();

$title = "Prihlásenie";

include('funkcie.php');
include('funkcie_select.php');
include('funkcie_insert.php');
include('funkcie_update.php');
include('funkcie_delete.php');

if ($uzivatel = ov_uzivatela()) { 
  $_SESSION['id'] = $uzivatel['id'];           
  $_SESSION['nick'] = $uzivatel['nick']; 
  $_SESSION['meno'] = $uzivatel['meno'];
  $_SESSION['heslo'] = $uzivatel['heslo'];
  $_SESSION['sex'] = $uzivatel['sex'];
  $_SESSION['mail'] = $uzivatel['mail'];
  $_SESSION['skin'] = $uzivatel['skin'];
  $_SESSION['icq'] = $uzivatel['icq'];
  $_SESSION['mobil'] = $uzivatel['mobil'];
  $_SESSION['nar'] = $uzivatel['nar'];
  $_SESSION['foto'] = $uzivatel['foto'];
  header("Location: ./home.php?f=".$_SESSION['id']);
}
          
elseif (isset($_POST['odhlasit'])) {     
  session_unset();
  session_destroy(); 
}

hlavicka($title);

?>

<body>
  <div id="poz">
    <?php include('navigacia.php'); ?>
    <div id="main">
    <div id="prihl_main">
      <div id="prihl_left">
        hiiii iiiii iigyvgbi yh vvgvhbhsbfaee theth erheh errertrtrtr ert  ertert
        hiiii iiiii iigyvgbi yh vvgvhbhsbfaee theth erheh errertrtrtr ert  ertert
        hiiii iiiii iigyvgbi yh vvgvhbhsbfaee theth erheh errertrtrtr ert  ertert
        hiiii iiiii iigyvgbi yh vvgvhbhsbfaee theth erheh errertrtrtr ert  ertert
        hiiii iiiii iigyvgbi yh vvgvhbhsbfaee theth erheh errertrtrtr ert  ertert
        hiiii iiiii iigyvgbi yh vvgvhbhsbfaee theth erheh errertrtrtr ert  ertert
        hiiii iiiii iigyvgbi yh vvgvhbhsbfaee theth erheh errertrtrtr ert  ertert
      </div>
      <div id="prihl_right">
        <form action="index.php" method="post" name="form">
          <strong>Meno:  </strong>
          <input name="nick" type="text" value="<?php if (isset($_POST["nick"])) {echo $_POST["nick"];} ?>" class="" /><br/>
          <strong>Heslo:  </strong>
          <input name="heslo" type="password" class="" /><br/>
          <a href="registracia.php" class="odosli_reg"><input type="button" name="odosli" value="Registruj" class="odosli" /></a>
          <input type="submit" name="submit" value="Prihlás" class="" />
        </form>
      </div>
    </div>
    </div>
    <div id="paticka">©2008 - 2009 Forum for Everyone | Created by Ygnac</div>
  </div>
</body>
</html>