Generalized $want_price display
authorshort <>
Sun, 14 Apr 2002 00:07:06 +0000 (00:07 +0000)
committershort <>
Sun, 14 Apr 2002 00:07:06 +0000 (00:07 +0000)
index.php

index 1d21c76..8b044cc 100644 (file)
--- a/index.php
+++ b/index.php
@@ -67,16 +67,16 @@ function tab_price($product)
        print(""
                        ."<tr class=\"tab-bold\">".tab_left("phys_2002")
                                ."<td>pøedplatné na rok 2002 za cenu ".tab_price("phys_2002")."</td></tr>\n"
-                       ."<tr class=\"tab-bold\">".tab_left("phys_2001")
-                               ."<td>pøedplatné na rok 2001 za zvýhodnìnou cenu ".tab_price("phys_2001")."</td></tr>\n"
-                       ."<tr>"                   .tab_left("phys_2000")
-                               ."<td>roèník 2000 za cenu "                       .tab_price("phys_2000")."</td></tr>\n"
                        );
        foreach (price_a() as $product => $price) {
-               if (!(ereg("^cd_([0-9]+)$",$product,$matched)))
+               if ($product=="phys_2002")
                        continue;
-               $year=$matched[1];
-               print("<tr>".tab_left($product)."<td>roèník $year na CD za cenu ".tab_price($product)."</td></tr>\n");
+               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");
                }
        print('<tr><td colspan="3" align="right" class="smaller">(ceny jsou uvedeny vè. DPH a distribuèních nákladù)</td></tr>'."\n");