source: web/style.php

Last change on this file was 17, checked in by chronos, 8 years ago
  • Modified: Old database class replaced by newer from Common package to fix compatibility with PHP7.
  • Property svn:executable set to *
File size: 2.8 KB
Line 
1<?php
2session_start();
3include_once('config.php');
4include_once('db.php');
5
6include_once('stat.php');
7StatProcess();
8
9function IconedLink($Link, $Text)
10{
11 $Extension = substr($Link, strrpos($Link, '.')+1);
12 //echo($Extension);
13 $Icon = '<img src="images/icons/'.$Extension.'.gif" alt="'.$Extension.'"> ';
14 return($Icon.'<a href="'.$Link.'">'.$Text.'</a>');
15}
16
17function ShowArray($Pole)
18{
19 echo('<pre style="font-size: 8pt;">');
20 print_r($Pole);
21 echo('</pre>');
22}
23
24function GetMicrotime()
25{
26 list($Usec, $Sec) = explode(" ",microtime());
27 return ((float)$Usec + (float)$Sec);
28}
29
30function ShowHeader($Title,$Path)
31{
32 global $Time_Start, $refresh, $Charset, $Description, $Keywords;
33 $Time_Start = GetMicrotime(); // Zjisti počáteční čas
34 $Cesty = array(
35 '/www/index.php' => '<a href="/index.php">RozcestnĂ­k</a>',
36 '/www/vyzva.php' => '<a href="/index.php">Rozcestník</a> &gt; <a href="/www/vyzva.php">Výzva k připojení</a>',
37 '/www/statistic.php' => '<a href="/index.php">RozcestnĂ­k</a> &gt; <a href="/www/statistic.php">Statistika</a>',
38 );
39 echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
40<html> <head>
41 <link media="all" href="style.css" rel="stylesheet" type="text/css">
42 <meta http-equiv="Content-Language" content="cs">
43 <meta http-equiv="Content-Type" content="text/html; charset=');
44 if(isset($Charset)) echo('windows-1250');
45 else echo('iso-8859-2');
46 echo('">'."\n");
47 if (isset($Keywords)) echo(' <meta name="keywords" content="'.$Keywords.'">'."\n");
48 if (isset($Description)) echo(' <meta name="description" content="'.$Description.'">'."\n");
49 if (isset($refresh)) echo(' <meta http-equiv="Refresh" content="'.$refresh."\">\n");
50
51 if(substr($_SERVER['SCRIPT_NAME'], 0, 21) == '/dev/zdechov.net/www/') $_SERVER['SCRIPT_NAME'] = '/www'.substr($_SERVER['SCRIPT_NAME'], 20);
52 //echo($_SERVER['SCRIPT_NAME']);
53 echo(' <title>ZdechovNET - '.$Path.'</title>
54</head>'."\n".'<body style="font-family: Arial, sans-serif;">'."\n".
55'<div style="background-color: #5050FF; color: white; padding: 0 5 0 5; font-size: 20pt;">'.$Title.'</div>'.
56'<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>'.
57'<div>');
58//phpinfo();
59}
60
61
62function ShowFooter()
63{
64 global $Time_Start;
65 $Time = floor((GetMicrotime() - $Time_Start)*100)/100;
66 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>');
67 //ShowArray($GLOBALS);
68 echo('</body></html>');
69}
70
Note: See TracBrowser for help on using the repository browser.