<?php
require_once ("../Service_PHP/pg.php");
require_once ("../dbsettings.php");
define("db_cesta","../");
define("soubory_pubs","../zdroj/");                //cesta ke zdrojovemu souboru

global $db;


$admin=array(1=>"fiserp");

//**********************************************
//************** po kolika se maj zobrazovat projekty
define("pokolika",3);
//************************************************



$ident="fiserp";
//$ident=$REMOTE_USER;
$db->connect(dbhard,dbharduser,dbhardpass);
if (is_numeric($ident)) {
	    $res = $db->query (
		"select uid,username,fullname from usernames
		 where uid=$ident"
	    );
	} else {
	    $res = $db->query (
		"select uid,username,fullname from usernames
		 where username='$ident'"
	    );
	}


if (gettype($res) != 'resource' || !pg_numrows($res)) {
     echo ("Nastala chyba. Stránka nebude správně zobrazena");
    $db->close;exit;
    } else {$user = pg_fetch_assoc($res);}
$db->close();

$slashes=get_magic_quotes_gpc();

// funkce pro vypis rolovacich tlacitek .... $row-aktualni stranka
function rolovani($row,$pocetlistu,$ref)
{if ($pocetlistu>1){

   if ($row==2) {echo("<a href=\"$ref.php?row=1\"> &lt;&lt; </a> ");}
   if ($row>2) {echo(" <a href=\"$ref.php?row=1\"> &lt;&lt;
                      </a>");$pom=$row-1;
                echo(" <a href=\"$ref.php?row=$pom\"> &lt;
                      </a> ");}
   echo(" <span style=\"color:red;\">$row/$pocetlistu </span>");
   if ($row+1==$pocetlistu){echo("<a href=\"$ref.php?row=$pocetlistu\"> &gt;&gt; </a> ");}
   if ($row+1<$pocetlistu) {$pom=$row+1;echo(" <a href=\"$ref.php?row=$pom\"> &gt; </a> ");
   echo(" <a href=\"$ref.php?row=$pocetlistu\"> &gt;&gt;
                      </a>");
   }}}

function unseting($jm){
    unset($_SESSION[$jm]);
    if (strlen(SID)!=0){session_destroy();}
    }
?>
