common.php/img() implemented to fully get rid of absolute image sizes
[www.energie.vellum.cz.git] / index.php
1 <?php $cvs_id='$Id$';
2
3         $detect_js=true;
4         $head='
5 <script type="text/javascript" src="objednavka.js"></script>
6 ';
7         include("common.php");
8
9         $head_css="
10 .tab-bold  { font-weight: bold; }
11 .tab-head  { font-weight: bold; color: yellow; background-color: transparent; }
12 .post-type { font-family: monospace; }
13 .nowrap    { white-space: nowrap; }
14 .centered  { text-align: center; }
15 .img-align { vertical-align:middle; }
16 ";
17         heading();
18 ?>
19 <h1 class="centered"><?php
20         print(img("img/eap-title.".(image_supported("image/png") ? "png" : "gif"),"Energie & Peníze"));
21         ?></h1>
22 <ul>
23         <li><a href="obsah.php">Obsahy v¹ech roèníkù</a></li>
24         <li><a href="title.php">V¹echny roèníky</a></li>
25 <?php
26
27         $getdate=getdate();
28         $year=$getdate["year"];
29
30         $result=db_query("select distinct year from $tb_obsah order by year");
31         while (($row=mysql_fetch_array($result)))
32                 print("\t<li><a href=\"title.php?year=".$row["year"]."\">Roèník ".$row["year"]."</a></li>\n");
33         mysql_free_result($result);
34
35 ?>
36         <li><a href="#objednavka">Objednávka</a></li>
37 </ul>
38
39 <p>&nbsp;</p>
40 <?php
41
42         unset($unset_month);
43         title(&$year,&$unset_month);
44
45 ?>
46 <p>&nbsp;</p>
47
48 <h2><a name="objednavka">Objednávka</a></h2>
49 <form action="objednavka.php<?php print($have_js); ?>" method="post">
50 <table border="0" width="100%">
51 <tr><td align="center"><table border="1" width="90%" cellpadding="5">
52 <tr><td align="center"><table border="0">
53 <?php
54
55 function tab_left($product)
56 {
57         global $price_a;
58         return("<td>Objednávám(e)</td><td><input type=\"text\" name=\"want_$product\" size=\"2\""
59                         ." onkeyup=\"sum_price(this)\" onchange=\"sum_price(this)\" /> (krát)</td>\n");
60 }
61 function tab_price($product)
62 {
63         global $price_a;
64         return($price_a[$product]." Kè");
65 }
66
67         $price_a=price_a();
68         print(""
69                         ."<tr class=\"tab-bold\">".tab_left("phys_2001")
70                                 ."<td>pøedplatné na rok 2001 za zvýhodnìnou cenu ".tab_price("phys_2001")."</td></tr>\n"
71                         ."<tr>"                   .tab_left("phys_2000")
72                                 ."<td>roèník 2000 za cenu "                       .tab_price("phys_2000")."</td></tr>\n"
73                         );
74         foreach (price_a() as $product => $price) {
75                 if (!(ereg("^cd_([0-9]+)$",$product,$matched)))
76                         continue;
77                 $year=$matched[1];
78                 print("<tr>".tab_left($product)."<td>roèník $year na CD za cenu ".tab_price($product)."</td></tr>\n");
79                 }
80
81         if ($have_js) {
82                 ?>
83         <tr><td colspan="3"><hr /></td></tr>
84         <tr><td colspan="3">Celková cena: <input type="text" name="price" value="0" size="5" readonly="readonly" /> Kè</td></tr>
85                 <?php
86                 }
87 ?>
88 </table></td></tr>
89 <?php
90
91 function print_addr($title,$pfx,$ico)
92 {
93         ?>
94         <tr><td align="center"><table border="0">
95                 <colgroup width="0*" span="3" />
96                 <tr><td colspan="3" align="center" class="tab-head"><?php print($title); ?></td></tr>
97                 <tr><td class="nowrap">Název firmy / Jméno:</td><td colspan="2"><input type="text" name="<?php print("${pfx}name"); ?>"    size="60" /></td></tr>
98                 <tr><td valign="top">Adresa:</td><td colspan="2"><table border="0">
99                         <colgroup width="0*" span="3" />
100                         <tr><td>Ulice:</td><td colspan="2"><input type="text" name="<?php print("${pfx}ulice"); ?>" size="60" /></td></tr>
101                         <tr><td>Mìsto:</td><td            ><input type="text" name="<?php print("${pfx}mesto"); ?>" size="30" /></td>
102                                 <td>PSÈ:                         <input type="text" name="<?php print("${pfx}psc"); ?>" size="5" maxlength="5" /></td></tr>
103                         </table></td></tr>
104         <?php
105         if ($ico) {
106         ?>
107                 <tr><td>IÈO:</td><td              ><input type="text" name="<?php print("${pfx}ico"); ?>" size="20" /></td>
108                         <td>DIÈ:           <input type="text" name="<?php print("${pfx}dic"); ?>" size="20" /></td></tr>
109         <?php
110                 }
111         ?>
112                 <tr><td class="nowrap">Kontaktní osoba:</td    ><td colspan="2"><input type="text" name="<?php print("${pfx}contact"); ?>" size="60" /></td></tr>
113                 <tr><td>Telefon:</td><td><input type="text" name="<?php print("${pfx}tel"); ?>" size="25" /></td>
114                         <td>Fax: <input type="text" name="<?php print("${pfx}fax"); ?>" size="25" /></td></tr>
115                 <tr><td>e-mail:</td             ><td colspan="2"><input type="text" name="<?php print("${pfx}mail"); ?>"    size="40" /></td></tr>
116         </table></td></tr>
117         <?php
118 }
119
120 print_addr("Adresa pro vystavení a zaslání faktury"          ,"addr1_",true);
121 print_addr("Adresa pro zasílaní èasopisu (jen pokud se li¹í)","addr2_",false);
122
123 ?>
124 <tr><td align="center"><table border="0">
125         <tr><td align="center" class="tab-head">Výbìr zpùsobu platby</td></tr>
126         <tr><td align="left"><input type="radio" name="payment" value="bill" checked="checked" />
127                         Zaslání proforma faktury a následná platba slo¾enkou, bankovním pøevodem apod.</td></tr>
128         <tr><td align="left"><input type="radio" name="payment" value="direct" />
129                         Platba <?php print(gsm_banking()); ?> èi jiný pøímý bankovní pøevod, za¹leme pouze daòový doklad</td></tr>
130 </table></td></tr>
131 <tr><td align="center"><table border="0">
132         <tr><td align="center" class="tab-head">Jiné sdìlení redakci</td></tr>
133         <tr><td align="center"><textarea name="comments" rows="5" cols="100"></textarea></td></tr>
134 </table></td></tr>
135 <tr><td align="center"><input type="submit" value="Ode¹li závaznou objednávku" onclick="return(validate(this.form))" /></td></tr>
136 </table></td></tr>
137 </table></form>
138
139 <?php
140         footer();
141 ?>