Order form looks as finished:
[www.energie.vellum.cz.git] / common.php
1 <?php // $Id$
2
3         error_reporting(E_ALL);
4
5         if (isset($want_js)) {
6                 $have_js=isset($HTTP_GET_VARS["have_js"]) || isset($HTTP_POST_VARS["have_js"]);
7                 if (!$have_js)
8                         $head.='<script type="text/javascript" src="have_js.js"></script>'."\n";
9                 }
10
11         $viewcvs=ereg_replace("^/~short/","\\0cgi-bin/viewcvs/",$HTTP_SERVER_VARS["SCRIPT_NAME"]);
12         if ($viewcvs==$HTTP_SERVER_VARS["SCRIPT_NAME"])
13                 unset($viewcvs);
14         $cvs_id_split=split(" ",$cvs_id);
15         $cvs_id_split[1]="<a href=\"$viewcvs\">".$cvs_id_split[1]."</a>";
16         $cvs_id_split[5]="<a href=\"mailto:".$cvs_id_split[5]."@".$HTTP_SERVER_VARS["HTTP_HOST"]."\">".$cvs_id_split[5]."</a>";
17         $cvs_id_html=join(" ",$cvs_id_split);
18
19 function addpercents($url)
20 {
21         $r=$c="";
22         foreach(preg_split('//', $url, -1, PREG_SPLIT_NO_EMPTY) as $c)
23                 if (ereg("[a-zA-Z0-9]",$c))
24                         $r.=$c;
25                 else
26                         $r.=sprintf("%%%02X",ord($c));
27         return($r);
28 }
29
30 function footer()
31 {
32         global $cvs_id_html,$viewcvs,$viewcvs,$HTTP_SERVER_VARS;
33         ?>
34 <hr />
35 <table border="0" width="100%">
36 <tr><td align="left"><span class="cvs-id"><?php print($cvs_id_html); ?></span></td><td align="right"><a
37         href="http://validator.w3.org/check/referer"><img src="http://www.w3.org/Icons/valid-xhtml10"
38                 style="border:0;width:88px;height:31px" width="88" height="31" alt="Valid XHTML 1.0!" /></a><a
39         href="http://jigsaw.w3.org/css-validator/validator?warning=2&amp;profile=css2&amp;uri=<?php
40                 print(addpercents("http://".$HTTP_SERVER_VARS["HTTP_HOST"].$HTTP_SERVER_VARS["REQUEST_URI"]));
41                 ?>"><img src="http://jigsaw.w3.org/css-validator/images/vcss"
42                 style="border:0;width:88px;height:31px" width="88" height="31" alt="Valid CSS!" /></a></td></tr>
43 </table>
44 </body></html>
45         <?php
46 }
47
48         header("Content-type: text/html; charset=iso-8859-2");
49 ?>
50 <?xml version="1.0" encoding="iso-8859-2"?>
51 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
52 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
53 <head><title>Energie &amp; peníze<?php
54         if (isset($title_tail))
55                 print(": $title_tail");
56 ?></title>
57 <style type="text/css"><!--
58 .cvs-id { font-family: monospace; }<?php
59         if (isset($head_css))
60                 print($head_css);
61         print("--></style>\n");
62         if (isset($head))
63                 print($head);
64 ?>
65 </head><body>