Rev 4 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | daniel-mar | 1 | <?php |
2 | |||
3 | daniel-mar | 3 | if (!defined('IBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
2 | daniel-mar | 4 | |
5 | if (($aktion == 'new') || ($aktion == 'edit')) |
||
6 | { |
||
7 | |||
8 | $zugangsdaten_status[1] = 'Funktioniert'; |
||
9 | $zugangsdaten_status[2] = 'Abgemeldet'; |
||
10 | $zugangsdaten_status[3] = 'Gesperrt'; |
||
11 | $zugangsdaten_status[4] = 'Unbekannt'; |
||
12 | |||
13 | echo str_replace('<body', '<body onload="self.focus();document.getElementById(\'name\').focus();"', $header); |
||
14 | |||
15 | if ($aktion == 'new') echo '<h1>Neue Zugangsinformation</h1>'; |
||
16 | if ($aktion == 'edit') echo '<h1>Zugangsinformation bearbeiten</h1>'; |
||
17 | |||
18 | if ($aktion == 'edit') |
||
19 | { |
||
20 | $res = db_query("SELECT name, folder, text, url, status FROM ".$mysql_zugangsdaten['praefix']."zugangsdaten WHERE id = '".db_escape($id)."' AND user = '".$benutzer['id']."'"); |
||
21 | if (db_num($res) == 0) |
||
22 | die($header.'Auf diesen Datensatz kann nicht zugegriffen werden. Entweder ist er nicht mehr verfügbar, oder die Zugriffsberechtigungen sind falsch.'.$footer); |
||
23 | $row = db_fetch($res); |
||
24 | |||
25 | $name = (isset($row['name'])) ? $row['name'] : ''; |
||
26 | $url = (isset($row['url'])) ? $row['url'] : ''; |
||
27 | $text = (isset($row['text'])) ? $row['text'] : ''; |
||
28 | $status = (isset($row['status'])) ? $row['status'] : ''; |
||
29 | $auszuwaehlen = (isset($row['folder'])) ? $row['folder'] : ''; |
||
30 | } |
||
31 | else |
||
32 | { |
||
33 | $name = ''; |
||
34 | $url = ''; |
||
35 | $text = ''; |
||
36 | $status = ''; |
||
37 | $auszuwaehlen = (isset($folder)) ? $folder : 0; |
||
38 | } |
||
39 | |||
40 | ?><script language="JavaScript" type="text/javascript"> |
||
41 | <!-- |
||
42 | |||
43 | function subm_form(act) |
||
44 | { |
||
45 | if (act == 0) |
||
46 | { |
||
47 | document.forms["mainform"].target = '_self'; |
||
48 | document.forms["mainform"].elements["seite"].value = 'kraftsetzung'; |
||
49 | } |
||
50 | if (act == 1) |
||
51 | { |
||
52 | document.forms["mainform"].target = '_blank'; |
||
53 | document.forms["mainform"].elements["seite"].value = 'test_url'; |
||
54 | } |
||
55 | document.forms.mainform.submit(); |
||
56 | } |
||
57 | |||
58 | // --> |
||
59 | </script><?php |
||
60 | |||
61 | echo '<form method="POST" name="mainform" action="'.$_SERVER['PHP_SELF'].'"> |
||
62 | <input type="hidden" name="seite" value=""> |
||
63 | <input type="hidden" name="aktion" value="'.$aktion.'"> |
||
64 | <input type="hidden" name="modul" value="'.$modul.'">'; |
||
65 | |||
66 | if ($aktion == 'edit') |
||
67 | echo '<input type="hidden" name="id" value="'.$id.'">'; |
||
68 | |||
69 | echo '<table cellspacing="0" cellpadding="0" border="0"> |
||
70 | <tr> |
||
71 | <td colspan="2"><b>Allgemeine Informationen</b><br><br></td> |
||
72 | </tr> |
||
73 | <tr> |
||
74 | <td valign="top">Name:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
75 | <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> |
||
76 | </tr> |
||
77 | <tr> |
||
78 | <td valign="top">In Ordner:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
79 | <td valign="top">'; |
||
80 | |||
81 | gfx_zeichneordnerbox($modul, 'ORDER BY `name`', 0, 0, $auszuwaehlen); |
||
82 | |||
83 | if (!isset($danach)) $danach = 'A'; |
||
84 | |||
85 | echo '</td> |
||
86 | </tr> |
||
87 | <tr> |
||
88 | <td colspan="2"><br><b>Detailierte Informationen</b><br><br></td> |
||
89 | </tr> |
||
90 | <tr> |
||
91 | <td valign="top">Status:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
92 | <td valign="top"><select name="status">'; |
||
93 | |||
94 | for ($i=1; $zugangsdaten_status[$i] != ''; $i++) |
||
95 | { |
||
96 | if ($status == $i) |
||
97 | $x = 'selected'; |
||
98 | else |
||
99 | $x = ''; |
||
100 | echo '<option value="'.$i.'"'.$x.'>'.$zugangsdaten_status[$i].'</option>'; |
||
101 | } |
||
102 | |||
103 | echo '</select></td> |
||
104 | </tr> |
||
105 | <tr> |
||
106 | <td valign="top">Webseite:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
107 | <td valign="top"><input type="text" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="url" value="'.$url.'" size="50"> [<a href="javascript:subm_form(1);">Besuchen</a>]</td> |
||
108 | </tr> |
||
109 | <tr> |
||
110 | <td colspan="2"><br><b>Inhalt der Zugangsinformation</b><br><br></td> |
||
111 | </tr> |
||
112 | <tr> |
||
113 | <td valign="top">Text:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
114 | <td valign="top"><textarea name="text" cols="40" rows="8">'.$text.'</textarea></td> |
||
115 | </tr> |
||
116 | <tr> |
||
117 | <td colspan="2"><br><b>Nach Speicherung</b><br><br></td> |
||
118 | </tr> |
||
119 | <tr> |
||
120 | <td valign="top">Aktion: </td> |
||
121 | <td><select name="danach"> |
||
122 | <option value="A"'; if ($danach == 'A') echo ' selected'; echo '>Zurück zum Hauptmenü</option> |
||
123 | <option value="B"'; if ($danach == 'B') echo ' selected'; echo '>Neuer Eintrag in Kategorie</option> |
||
124 | <option value="C"'; if ($danach == 'C') echo ' selected'; echo '>Neuer Eintrag im Ordner</option> |
||
125 | </select></td> |
||
126 | </tr> |
||
127 | </table><br> |
||
128 | <a href="javascript:subm_form(0);">'; |
||
129 | |||
130 | if ($aktion == 'new') echo 'Eintragung hinzufügen'; |
||
131 | if ($aktion == 'edit') echo 'Eintragung aktualisieren'; |
||
132 | |||
8 | daniel-mar | 133 | echo '</a> | <a href="'.$_SERVER['PHP_SELF'].'?seite=inhalt&modul='.urlencode($modul).'">Zurück</a> |
2 | daniel-mar | 134 | |
135 | </form>'; |
||
136 | |||
137 | echo $footer; |
||
138 | } |
||
139 | |||
3 | daniel-mar | 140 | ?> |