<?php
session_start();
include_once('config.php');
include_once('db.php');

include_once('stat.php');
StatProcess();

function IconedLink($Link, $Text)
{
  $Extension = substr($Link, strrpos($Link, '.')+1);
  //echo($Extension); 
  $Icon = '<img src="images/icons/'.$Extension.'.gif" alt="'.$Extension.'"> ';
  return($Icon.'<a href="'.$Link.'">'.$Text.'</a>');
}

function ShowArray($Pole)
{
  echo('<pre style="font-size: 8pt;">');
  print_r($Pole);
  echo('</pre>');
}

function GetMicrotime()
{
    list($Usec, $Sec) = explode(" ",microtime());
    return ((float)$Usec + (float)$Sec);
}

function ShowHeader($Title,$Path)
{
  global $Time_Start, $refresh, $Charset, $Description, $Keywords;
  $Time_Start = GetMicrotime();		// Zjisti počáteční čas
  $Cesty = array(
    '/www/index.php' => '<a href="/index.php">Rozcestník</a>',
    '/www/vyzva.php' => '<a href="/index.php">Rozcestník</a> &gt; <a href="/www/vyzva.php">Výzva k připojení</a>',
    '/www/statistic.php' => '<a href="/index.php">Rozcestník</a> &gt; <a href="/www/statistic.php">Statistika</a>',
  );
  echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>  <head>  
  <link media="all" href="style.css" rel="stylesheet" type="text/css">
  <meta http-equiv="Content-Language" content="cs">
  <meta http-equiv="Content-Type" content="text/html; charset=');
  if(isset($Charset)) echo('windows-1250'); 
  else echo('iso-8859-2');
  echo('">'."\n");
  if (isset($Keywords)) echo('  <meta name="keywords" content="'.$Keywords.'">'."\n");
  if (isset($Description)) echo('  <meta name="description" content="'.$Description.'">'."\n"); 
  if (isset($refresh)) echo('  <meta http-equiv="Refresh" content="'.$refresh."\">\n");
  
  if(substr($_SERVER['SCRIPT_NAME'], 0, 21) == '/dev/zdechov.net/www/') $_SERVER['SCRIPT_NAME'] = '/www'.substr($_SERVER['SCRIPT_NAME'], 20);
  //echo($_SERVER['SCRIPT_NAME']);
  echo('  <title>ZdechovNET - '.$Path.'</title>
</head>'."\n".'<body style="font-family: Arial, sans-serif;">'."\n".
'<div style="background-color: #5050FF; color: white; padding: 0 5 0 5; font-size: 20pt;">'.$Title.'</div>'.
'<div style="margin-bottom: 5px; padding-bottom: 2px; border-width: 0 0 1 0; border-color: gray; border-style: dotted;"><strong>Navigace:</strong> '.$Cesty[$_SERVER['SCRIPT_NAME']].'</div>'.
'<div>');
//phpinfo();
}


function ShowFooter()
{
  global $Time_Start;
  $Time = floor((GetMicrotime() - $Time_Start)*100)/100;
  echo('</div><div style="border-width: 1 0 0 0; border-color: gray; border-style: solid;" align="center"><i style="font-size: x-small;">| Poslední aktualizace: '.date('j.n.Y',filemtime($_SERVER['SCRIPT_FILENAME'])).' | Doba generování stránky: '.$Time.' s | Webmistr: robie@centrum.cz |</i></div>');
  //ShowArray($GLOBALS);
  echo('</body></html>');
}

