<?php $cvs_id='$Id$';
+ $detect_js=true;
+ $head='
+<script type="text/javascript" src="objednavka.js"></script>
+';
+ include("common.php");
+
$head_css="
.tab-bold { font-weight: bold; }
.post-type { font-family: monospace; }
.nowrap { white-space: nowrap; }
.centered { text-align: center; }
";
- $head='
-<script type="text/javascript" src="objednavka.js"></script>
-';
- $detect_js=true;
+ heading();
+?>
+<h1 class="centered"><img src="img/eap-title.png" <?php print(img_size(522,60)); ?> alt="Teplo & Peníze" /></h1>
+<ul>
+ <li><a href="obsah.php">Obsahy v¹ech roèníkù</a></li>
+<?php
- include("common.php");
+$result=db_query("select distinct year from $tb_obsah order by year");
+while ($row=mysql_fetch_array($result))
+ print("\t<li><a href=\"#year_".$row["year"]."\">Roèník ".$row["year"]."</a></li>\n");
+mysql_free_result($result);
?>
-<h1 class="centered"><img src="img/eap-title.png" alt="Teplo & Peníze" /></h1>
+ <li><a href="#objednavka">Objednávka</a></li>
+</ul>
+
<p> </p>
+<h2>Titulní strany</h2>
<?php
-function title_table_month($year,$month)
+function title_table_month($year,$month,$month_last)
{
- $month_cz=array("leden","únor","bøezen","duben","kvìten","èerven","èervenec","srpen","záøí","øíjen","listoped","prosinec");
- $size_width_s= 98; $size_height_s=138;
- $size_width =486; $size_height =688;
-
- $base=sprintf("img/eap-%04d-%02d",$year,$month+1);
- print("<a href=\"${base}.jpg\">"
- ."<img src=\"${base}s.jpg\" width=\"$size_width_s\" height=\"$size_height_s\""
- ." style=\"border:0;width:${size_width_s}px;height:${size_height_s}px\" alt=\"$year-".$month_cz[$month]."\" /><br />\n"
- ."$year<br />".$month_cz[$month]
- ."</a>");
+ $month_a=month_a($year,$month,$month_last);
+ print("<a href=\"title.php?year=$year&month=$month\">"
+ ."<img src=\"".$month_a["icon"]."\" ".img_size($month_a["icon"])
+ ." alt=\"titulní stránka ".$month_a["name"]."\" /></a><br />\n"
+ ."<a href=\"obsah.php?year=$year&month=$month\">obsah ".$month_a["name"]."</a>"
+ );
}
-function title_table_year($year,$month_max=11)
-{
- $split=6;
+$result=db_query("select year,month,month_last from $tb_obsah order by year,month");
+$split=6;
+$year=0;
+$fin_split="";
+$fin_year="";
+while ($row=mysql_fetch_array($result)) {
+ $row["month" ]--;
+ $row["month_last"]--;
- print("<table border=\"0\" width=\"100%\"><tr><td align=\"center\"><table border=\"1\" cellpadding=\"5\">\n");
- for ($month=0;$month<=$month_max;$month++) {
- if (($month%$split)==0)
- print("<tr>");
- print("<td align=\"center\">");
- title_table_month($year,$month);
- print("</td>");
- if (($month%$split)==$split-1 || $month==$month_max)
- print("</tr>\n");
- }
- print("</table></td></tr></table>");
-}
+ if ($row["year"]!=$year) {
+ print($fin_split.$fin_year);
-title_table_year(2001,5);
+ $year=$row["year"];
+ print("<a name=\"year_$year\"></a>"
+ ."<table border=\"0\" width=\"100%\"><tr><td align=\"center\"><table border=\"1\" cellpadding=\"5\">\n"
+ ."<tr><th colspan=\"$split\">Roèník $year (<a href=\"obsah.php?year=$year\">obsahy èísel</a>)</th></tr>\n"
+ );
+ $fin_year="</table></td></tr></table><p> </p>\n";
+ $month=-1;
+ $floor=-1;
+ }
+ while ($floor<floor($row["month"]/$split)) {
+ print($fin_split."<tr>");
+ $fin_split="</tr>";
+ $floor++;
+ }
+ while ($month+1<$row["month"]) {
+ print("<td></td>");
+ $month++;
+ }
+ print("<td align=\"center\""
+ .($row["month_last"]!=$row["month"] ? " colspan=\"".($row["month_last"]+1-$row["month"])."\"" : "")
+ .">");
+ title_table_month($year,$row["month"]+1,$row["month_last"]+1);
+ print("</td>");
+ $month=$row["month_last"];
+ }
+mysql_free_result($result);
+print($fin_split.$fin_year);
?>
<p> </p>
-<h2>Objednávka</h2>
+<h2><a name="objednavka">Objednávka</a></h2>
<form action="objednavka.php<?php print($have_js); ?>" method="post">
<table border="0" width="100%">
<tr><td align="center"><table border="1" width="90%">