Move the page layout into CSS, hence no extra page title anymore
[infodrom.org/infocon.infodrom.org] / src / shop / show.wml
1 #include <infocon.style>
2 #include <shop.inc>
3
4 <page title="Online-Shop">
5
6 &nbsp;<table width=100% border=0 cellpadding=0 cellspacing=0>
7
8 <?
9   # So werden 1 Pixel dicke Rahmen erzeugt
10   $la = "<tr><td width=\"2\" bgcolor=\"#000000\"></td><td bgcolor=\"#000000\"><table cellpadding=\"0\" cellspacing=\"1\" width=\"100%\" border=\"0\" summary=\"\"><tr><td bgcolor=\"#ffffff\">";
11   $le = "</td></tr></table></td></tr>";
12   $ch = "#abdcfc";
13   $cd = "#eff0f1";
14
15   $dbh = dbconnect();
16
17   # FIXME: kill ' from $article
18   $sth = dbquery ($dbh, "SELECT * FROM article WHERE article = '$article'");
19
20   if (pg_NumRows ($sth) == 0) {
21     echo ($la);
22     echo ("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" summary=\"\">");
23     printf ("<tr><th align=\"left\" colspan=\"2\" bgcolor=\"%s\">"
24            ."<font face=\"Helvetica,Arial\">Kein Artikel gefunden.</font></th></tr>",
25            $ch);
26     echo ("</table>");
27     echo ($le);
28   } else {
29     $row = pg_fetch_array ($sth, 0);
30     echo ($la);
31   
32     echo ("<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" summary=\"\">");
33     printf ("<tr><th align=\"left\" colspan=\"2\" bgcolor=\"%s\">"
34            ."<font face=\"Helvetica,Arial\">%s</font></th></tr>",
35            $ch, $row['name']);
36   
37     if (strlen ($row['url_path']) > 0) {
38       $img = sprintf ("src=\"%s\" width=\"%d\" height=\"%d\" alt=\"[Artikel #%s]\"",
39                       $row['url_path'], $row['url_width'], $row['url_height'], $row['article']);
40     } else {
41       $img = "src=\"<root_prefix>Pics/nopix.png\" width=\"158\" height=\"183\" alt=\"[Kein Bild vorhanden]\"";
42     }
43
44     # Sub-Query
45     $sthi = dbquery ($dbh, sprintf ("SELECT subname,price,articleid FROM offer WHERE article = '%s'ORDER BY articleid",
46                                       $row['article']));
47     if (pg_NumRows ($sthi) > 0) {
48       <protect>
49       $table = "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"$cd\">";
50       </protect>
51       for ($ii=0; $ii < pg_NumRows ($sthi); $ii++) {
52         $rowi = pg_fetch_array ($sthi, $ii);
53         $table .= sprintf ("<tr><td align=\"left\" width=\"70%%\"><font face=\"Helvetica,Arial\">&nbsp;%s</font></td>",
54                            $rowi['subname']);
55         $table .= sprintf ("<td align=\"right\" width=\"20%%\"><font face=\"Helvetica,Arial\">%6.2f DM&nbsp;</font></td></tr>",
56                            $rowi['price']);
57       }
58       $table .= "</table>";
59     } else {
60       $table = "";
61     }
62     # /Sub-Query
63
64     <protect>
65     printf ("<tr><td width=\60%%\" align=\"left\" valign=\"top\">"
66            ."<font face=\"Helvetica,Arial\"><p>%s</font></td>"
67            ."<td width=\40%%\" rowspan=\"2\" align=\"center\" valign=\"top\"><img %s>&nbsp;</td></tr>",
68            $row['description'], $img);
69     </protect>
70     printf ("<tr><td width=\60%%\" align=\"left\" valign=\"bottom\">%s</td></tr>", $table);
71   
72     echo ("</table>");
73     echo ($le);
74   }
75 ?>
76
77 </table>
78
79 <p>Preise freibleibend.  Alle Preise verstehen sich inklusive gesetzlich vorgeschriebener Mehrwertsteuer.
80
81 </page>
82 # Local variables:
83 # mode: indented-text
84 # mode: auto-fill
85 # mode-: iso-accents
86 # end: