- if (($f=fopen("objednavka.js","r"))) {
- while (($s=fgets($f,0x1000))) {
- if (!($s=trim($s)))
- break;
- if (!(ereg("^want_price\\[ *'cd_([^']*)'\\]=([0-9]*);\$",$s,$o_matched)))
- continue;
- $o_year =$o_matched[1];
- $o_price=$o_matched[2];
- print("<tr>");
- tab_left("want_cd_$o_year");
- print("<td>roèník $o_year na CD za cenu $o_price Kè</td></tr>\n");
- }
- fclose($f);
+ unset($unset_month);
+ title(&$year,&$unset_month);
+
+?>
+<p> </p>
+
+<h2><a id="objednavka">Objednávka èasopisu</a></h2>
+<form action="objednavka.php<?php print($have_js); ?>" method="post" <?php print(form_charset()); ?>>
+<table border="0" width="100%">
+<tr><td align="center"><table border="1" width="90%" cellpadding="5">
+<tr><td align="center"><table border="0">
+<?php
+
+function tab_left($product)
+{
+ global $price_a;
+ return("<td>Objednávám(e)</td><td><input type=\"text\" name=\"want_$product\" size=\"2\""
+ ." onkeyup=\"sum_price(this)\" onchange=\"sum_price(this)\" /> (krát)</td>\n");
+}
+function tab_price($product)
+{
+ global $price_a;
+ return($price_a[$product]." Kè");
+}
+
+ $price_a=price_a();
+ print(""
+ ."<tr class=\"tab-bold\">".tab_left("phys_2002")
+ ."<td>pøedplatné na rok 2002 za cenu ".tab_price("phys_2002")."</td></tr>\n"
+ );
+ foreach (price_a() as $product => $price) {
+ if ($product=="phys_2002")
+ continue;
+ if (!(ereg("^(cd|phys)_([0-9]+)$",$product,$matched)))
+ continue;
+ $type=$matched[1];
+ $year=$matched[2];
+ print("<tr>".tab_left($product)."<td>roèník $year".($type!="cd" ? "" : " na CD")
+ ." za cenu ".tab_price($product)."</td></tr>\n");