Rev 12 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
12 | daniel-mar | 1 | <?php |
2 | |||
14 | daniel-mar | 3 | if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
12 | daniel-mar | 4 | |
5 | if (($aktion == 'new') || ($aktion == 'edit')) |
||
6 | { |
||
7 | echo str_replace('<body', '<body onload="self.focus();document.getElementById(\'name\').focus();"', $header); |
||
8 | |||
9 | if ($aktion == 'new') echo '<h1>Neuer Termin</h1>'; |
||
10 | if ($aktion == 'edit') echo '<h1>Termin bearbeiten</h1>'; |
||
11 | |||
12 | if ($aktion == 'edit') |
||
13 | { |
||
14 | $res = db_query("SELECT * FROM ".$mysql_zugangsdaten['praefix']."kalender WHERE id = '".db_escape($id)."' AND user = '".$benutzer['id']."'"); |
||
15 | if (db_num($res) == 0) |
||
16 | die($header.'Auf diesen Datensatz kann nicht zugegriffen werden. Entweder ist er nicht mehr verfügbar, oder die Zugriffsberechtigungen sind falsch.'.$footer); |
||
17 | $row = db_fetch($res); |
||
18 | |||
19 | $name = (isset($row['name'])) ? $row['name'] : ''; |
||
20 | $start_date = (isset($row['start_date'])) ? $row['start_date'] : '0000-00-00'; |
||
21 | $ary1 = explode('-', $start_date); |
||
22 | $datum1 = $ary1[2]; |
||
23 | $datum2 = $ary1[1]; |
||
24 | $datum3 = $ary1[0]; |
||
25 | $start_time = (isset($row['start_time'])) ? $row['start_time'] : '00:00:00'; |
||
26 | $ary2 = explode(':', $start_time); |
||
27 | $zeit1 = $ary2[0]; |
||
28 | $zeit2 = $ary2[1]; |
||
29 | $kommentare = (isset($row['kommentare'])) ? $row['kommentare'] : ''; |
||
30 | } |
||
31 | else |
||
32 | { |
||
33 | $name = ''; |
||
34 | $timestamp = ''; |
||
35 | $kommentare = ''; |
||
36 | $zeit1 = ''; |
||
37 | $zeit2 = ''; |
||
38 | $datum1 = ''; |
||
39 | $datum2 = date("m"); |
||
40 | $datum3 = date("Y"); |
||
41 | } |
||
42 | |||
43 | echo '<form method="POST" name="mainform" action="'.$_SERVER['PHP_SELF'].'"> |
||
44 | <input type="hidden" name="seite" value="kraftsetzung"> |
||
45 | <input type="hidden" name="herkunft" value="'.$herkunft.'"> |
||
46 | <input type="hidden" name="aktion" value="'.$aktion.'"> |
||
47 | <input type="hidden" name="modul" value="'.$modul.'">'; |
||
48 | |||
49 | if ($aktion == 'edit') |
||
50 | echo '<input type="hidden" name="id" value="'.$id.'">'; |
||
51 | |||
52 | if (!isset($danach)) $danach = 'A'; |
||
53 | |||
54 | echo '<table cellspacing="0" cellpadding="0" border="0"> |
||
55 | <tr> |
||
56 | <td colspan="2"><b>Allgemeine Informationen</b><br><br></td> |
||
57 | </tr> |
||
58 | <tr> |
||
59 | <td valign="top">Name:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
60 | <td valign="top"><input type="text" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="name" id="name" value="'.$name.'" size="50"></td> |
||
61 | </tr> |
||
62 | <tr> |
||
63 | <td colspan="2"><br><b>Detailierte Informationen</b><br><br></td> |
||
64 | </tr> |
||
65 | <tr> |
||
66 | <td valign="top">Datum:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
67 | <td valign="top"><input type="text" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="datum1" value="'.$datum1.'" size="3"> . <input type="text" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="datum2" value="'.$datum2.'" size="3"> . <input type="text" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="datum3" value="'.$datum3.'" size="6"></td> |
||
68 | </tr> |
||
69 | <tr> |
||
70 | <td valign="top"><br>Uhrzeit:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
71 | <td valign="top"><br><input type="text" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="zeit1" value="'.$zeit1.'" size="3"> : <input type="text" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="zeit2" value="'.$zeit2.'" size="3"></td> |
||
72 | </tr> |
||
73 | <tr> |
||
74 | <td colspan="2"><br></td> |
||
75 | </tr> |
||
76 | <tr> |
||
77 | <td valign="top">Kommentare:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
78 | <td valign="top"><textarea name="kommentare" cols="40" rows="8">'.$kommentare.'</textarea></td> |
||
79 | </tr> |
||
80 | <tr> |
||
81 | <td colspan="2"><br><b>Nach Speicherung</b><br><br></td> |
||
82 | </tr> |
||
83 | <tr> |
||
84 | <td valign="top">Aktion: </td> |
||
85 | <td><select name="danach"> |
||
86 | <option value="A"'; if ($danach == 'A') echo ' selected'; echo '>Zurück zur Wochenauflistung</option> |
||
87 | <option value="B"'; if ($danach == 'B') echo ' selected'; echo '>Zurück zur Terminauflistung</option> |
||
88 | <option value="C"'; if ($danach == 'C') echo ' selected'; echo '>Neuer Eintrag</option> |
||
89 | </select></td> |
||
90 | </tr> |
||
91 | </table><br> |
||
92 | <a href="javascript:document.mainform.submit();">'; |
||
93 | |||
94 | if ($aktion == 'new') echo 'Eintragung hinzufügen'; |
||
95 | if ($aktion == 'edit') echo 'Eintragung aktualisieren'; |
||
96 | |||
97 | echo '</a> | <a href="'.$_SERVER['PHP_SELF'].'?seite='.urlencode($herkunft).'&modul='.urlencode($modul).'">Zurück</a> |
||
98 | |||
99 | </form>'; |
||
100 | |||
101 | echo $footer; |
||
102 | } |
||
103 | |||
104 | ?> |