|
1 <?php |
|
2 |
|
3 /** |
|
4 * @author Bettina Schwarzer, Fritz-Haber-Institut |
|
5 * @copyright 07/2012 |
|
6 * |
|
7 * Form Bericht Info |
|
8 */ |
|
9 |
|
10 echo "<form action=\"". $_SERVER['PHP_SELF'] ."\" method=\"post\" enctype=\"application/x-www-form-urlencoded\" name=\"form_inf\">\n"; |
|
11 echo "<table width=\"35%\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n"; |
|
12 echo "<tr>"; |
|
13 echo "<td>Produktbereich</td>"; |
|
14 echo "<td><select name='inf[prodb]'>"; |
|
15 if (is_array($inf['prodb'])) $select = in_array( "-1", $inf['prodb'] ) ? ' selected' : null; |
|
16 echo "<option $select value=\"-1\"></option>\n"; |
|
17 $sql = "SELECT prod_ber_ID,prod_ber_name FROM Produkt_Bereich ORDER BY 1"; |
|
18 if ($result = $dbc->queryObjectArray($sql)) |
|
19 { |
|
20 foreach ($result as $row) |
|
21 { |
|
22 $prod=str_replace(" "," ",htmlentities($row->prod_ber_name)); |
|
23 if (is_array($inf['prodb'])) $select = in_array($row->prod_ber_ID, $inf['prodb']) ? ' selected' : null; |
|
24 echo "<option $select value=\"| $row->prod_ber_ID-\">$row->prod_ber_ID $prod</option>\n"; |
|
25 } |
|
26 } |
|
27 echo "</select></td></tr>\n"; |
|
28 echo "<tr><td>Produktgruppe</td>"; |
|
29 echo "<td><select name='inf[prodg]'>"; |
|
30 if ($inf["prodg"] == -1) $select = " selected "; else $select = ""; |
|
31 echo "<option $select value=\"-1\"></option>\n"; |
|
32 $sql = "SELECT prod_group_ID, prod_group_name, prod_group_hier FROM Produkt_Gruppe ORDER BY 3"; |
|
33 if ($result = $dbc->queryObjectArray($sql)) |
|
34 { |
|
35 $select = ""; |
|
36 foreach ($result as $row) |
|
37 { |
|
38 if (isset($inf["prodg"])) $select = ($row->prod_group_ID == $inf["prodg"] ) ? ' selected' : null; |
|
39 echo "<option $select value=\"-$row->prod_group_ID-\">$row->prod_group_hier $row->prod_group_name</option>\n"; |
|
40 } |
|
41 } |
|
42 echo "</select></td></tr>\n"; |
|
43 echo "<tr><td>Infotyp</td>"; |
|
44 echo "<td><select name='inf[ityp]'>"; |
|
45 if ($inf["ityp"] == -1) $select = " selected "; else $select = ""; |
|
46 echo "<option $select value=\"-1\"></option>\n"; |
|
47 $sql = "SELECT infotyp_ID, infotyp_bez FROM Info_Typ ORDER BY 1"; |
|
48 if ($result = $dbc->queryObjectArray($sql)) |
|
49 { |
|
50 $select = ""; |
|
51 foreach ($result as $row) |
|
52 { |
|
53 if (isset($inf["ityp"])) $select = ($row->infotyp_ID == $inf["ityp"] ) ? ' selected' : null; |
|
54 echo "<option $select value=\"$row->infotyp_ID\">$row->infotyp_ID - $row->infotyp_bez</option>\n"; |
|
55 } |
|
56 } |
|
57 echo "</select></td></tr>\n"; |
|
58 echo "<tr><td>Adressat</td>"; |
|
59 echo "<td><select name='inf[adr]'>"; |
|
60 if ($inf["adr"] == -1) $select = " selected "; else $select = ""; |
|
61 echo "<option $select value=\"-1\"></option>\n"; |
|
62 $sql = "SELECT CAST(info_adr_ID AS CHAR) AS ID, info_adr_name AS bez FROM Adressat |
|
63 UNION |
|
64 SELECT fkt_ID AS ID, fkt_bez AS bez FROM Funktion ORDER BY 1"; |
|
65 if ($result = $dbc->queryObjectArray($sql)) |
|
66 { |
|
67 $select = ""; |
|
68 foreach ($result as $row) |
|
69 { |
|
70 if (isset($inf["adr"])) $select = ($row->ID == $inf["adr"] ) ? ' selected' : null; |
|
71 echo "<option $select value=\"$row->ID\">$row->ID - $row->bez</option>\n"; |
|
72 } |
|
73 } |
|
74 echo "</select></td></tr>\n"; |
|
75 echo "<tr><td>Status Freigabe</td>"; |
|
76 echo "<td><select name='inf[stat]'>"; |
|
77 if ($inf["stat"] == -1) $select = " selected "; else $select = ""; |
|
78 echo "<option $select value=\"-1\"></option>\n"; |
|
79 $sql = "SELECT info_freigabe_ID, info_freigabe_bez FROM Info_Freigabe ORDER BY 2"; |
|
80 if ($result = $dbc->queryObjectArray($sql)) |
|
81 { |
|
82 $select = ""; |
|
83 foreach ($result as $row) |
|
84 { |
|
85 if (isset($inf["stat"])) $select = ($row->info_freigabe_ID == $inf["stat"] ) ? ' selected' : null; |
|
86 echo "<option $select value=\"$row->info_freigabe_ID\">$row->info_freigabe_ID - $row->info_freigabe_bez</option>\n"; |
|
87 } |
|
88 } |
|
89 echo "</select></td></tr>\n"; |
|
90 echo "<tr> |
|
91 <td>Verknüpfung</td>"; |
|
92 if (isset($inf["bind"]) && $inf["bind"]=="AND") $cka="checked"; |
|
93 elseif (isset($inf["bind"]) && $inf["bind"]=="OR") $cko="checked"; |
|
94 else $cka="checked"; |
|
95 echo "<td>UND |
|
96 <input type=\"radio\" name=\"inf[bind]\" value=\"AND\" $cka/> |
|
97 ODER |
|
98 <input type=\"radio\" name=\"inf[bind]\" value=\"OR\" $cko/></td> |
|
99 </tr>"; |
|
100 echo "<tr> |
|
101 <td>Sortierung nach<br />(in dieser Reihenfolge)</td><td>"; |
|
102 $sort = array("-1"=>"","2"=>"Info","4"=>"Typ","5"=>"Produkt","6"=>"Adressat", "7"=>"Kennzeichen"); |
|
103 for ($i=1; $i<4; $i++) |
|
104 { |
|
105 echo "$i. <select name='inf[sort$i]'>\n"; |
|
106 foreach ($sort as $key=>$val) |
|
107 { |
|
108 $rsort = "sort" . $i; |
|
109 if ($inf[$rsort] == $val) $select= " selected"; else $select = ""; |
|
110 echo "<option$select value='$key'>$val</option>\n"; |
|
111 } |
|
112 echo "</select> \n"; |
|
113 } |
|
114 echo "</td></tr>\n"; |
|
115 $azeil = array(1=>'1',10=>'10',20=>'20',25=>'25',50=>'50',100=>'100',9999=>'alle'); // Anzahl gezeigter rows |
|
116 echo "<tr><td>Zeilen/Seite?</td><td><select name='inf[z]'>\n"; |
|
117 if (!$inf['z']) $inf['z'] = 9999; |
|
118 foreach ($azeil as $key=>$val) |
|
119 { |
|
120 if ($key == $inf['z']) $select = "selected"; else $select = ""; |
|
121 echo "<option $select value='$key'>$val</option>\n"; |
|
122 } |
|
123 echo "</select></td></tr>\n"; |
|
124 echo "<tr> |
|
125 <td> </td> |
|
126 <td colspan='3'><input class=\"button\" type=\"submit\" name=\"search\" value=\"Bericht erstellen\"></td> |
|
127 </tr> |
|
128 </table>\n |
|
129 </form>\n"; |
|
130 |
|
131 ?> |