Rev 4 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4 | Rev 8 | ||
---|---|---|---|
1 | <?php |
1 | <?php |
2 | 2 | ||
3 | if (!defined('IBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
3 | if (!defined('IBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
4 | 4 | ||
5 | echo str_replace('<body', '<body onload="self.focus();document.getElementById(\'kategorie\').focus();"', $header); |
5 | echo str_replace('<body', '<body onload="self.focus();document.getElementById(\'kategorie\').focus();"', $header); |
6 | 6 | ||
7 | if (isset($sent) && ($sent == '1')) |
7 | if (isset($sent) && ($sent == '1')) |
8 | { |
8 | { |
9 | $ary = explode("\n", $eintraege); |
9 | $ary = explode("\n", $eintraege); |
10 | 10 | ||
11 | for ($i=0; $i <= count($ary); $i++) |
11 | for ($i=0; $i <= count($ary); $i++) |
12 | { |
12 | { |
13 | $res3 = db_query("SELECT MAX(`nr`) AS `mx` FROM `".$mysql_zugangsdaten['praefix']."datentraeger_eintraege` WHERE `kategorie` = '".$kategorie."' AND `user` = '".$benutzer['id']."'"); |
13 | $res3 = db_query("SELECT MAX(`nr`) AS `mx` FROM `".$mysql_zugangsdaten['praefix']."datentraeger_eintraege` WHERE `kategorie` = '".$kategorie."' AND `user` = '".$benutzer['id']."'"); |
14 | $row3 = db_fetch($res3); |
14 | $row3 = db_fetch($res3); |
15 | $new = $row3['mx']; |
15 | $new = $row3['mx']; |
16 | 16 | ||
17 | if (isset($ary[$i]) && ($ary[$i] != '')) |
17 | if (isset($ary[$i]) && ($ary[$i] != '')) |
18 | { |
18 | { |
19 | if (strpos($ary[$i], '*')) |
19 | if (strpos($ary[$i], '*')) |
20 | { |
20 | { |
21 | $ary[$i] = str_replace('*', '', $ary[$i]); |
21 | $ary[$i] = str_replace('*', '', $ary[$i]); |
22 | $gebrannt = '1'; |
22 | $gebrannt = '1'; |
23 | } |
23 | } |
24 | else |
24 | else |
25 | { |
25 | { |
26 | $gebrannt = '0'; |
26 | $gebrannt = '0'; |
27 | } |
27 | } |
28 | db_query("INSERT INTO `".$mysql_zugangsdaten['praefix']."datentraeger_eintraege` (`nr`, `name`, `kategorie`, `einstellungsdatum`, `gebrannt`, `user`) VALUES ('".($new+1)."', '".db_escape($ary[$i])."', '".db_escape($kategorie)."', NOW(), '".db_escape($gebrannt)."', '".$benutzer['id']."')"); |
28 | db_query("INSERT INTO `".$mysql_zugangsdaten['praefix']."datentraeger_eintraege` (`nr`, `name`, `kategorie`, `einstellungsdatum`, `gebrannt`, `user`) VALUES ('".($new+1)."', '".db_escape($ary[$i])."', '".db_escape($kategorie)."', NOW(), '".db_escape($gebrannt)."', '".$benutzer['id']."')"); |
29 | } |
29 | } |
30 | } |
30 | } |
31 | } |
31 | } |
32 | 32 | ||
33 | echo '<h1>Neue Einträge erstellen</h1>'; |
33 | echo '<h1>Neue Einträge erstellen</h1>'; |
34 | 34 | ||
35 | echo '<form method="post" action="'.$_SERVER['PHP_SELF'].'" name="mainform">'; |
35 | echo '<form method="post" action="'.$_SERVER['PHP_SELF'].'" name="mainform">'; |
36 | echo '<input type="hidden" name="modul" value="'.$modul.'">'; |
36 | echo '<input type="hidden" name="modul" value="'.$modul.'">'; |
37 | echo '<input type="hidden" name="seite" value="'.$seite.'">'; |
37 | echo '<input type="hidden" name="seite" value="'.$seite.'">'; |
38 | echo '<input type="hidden" name="sent" value="1">'; |
38 | echo '<input type="hidden" name="sent" value="1">'; |
39 | 39 | ||
40 | echo 'Kategorie: <select name="kategorie" id="kategorie">'; |
40 | echo 'Kategorie: <select name="kategorie" id="kategorie">'; |
41 | $res2 = db_query("SELECT `nummer`, `spalte`, `name` FROM `".$mysql_zugangsdaten['praefix']."datentraeger_kategorien` WHERE `user` = '".$benutzer['id']."' ORDER BY `spalte`, `nummer` ASC"); |
41 | $res2 = db_query("SELECT `nummer`, `spalte`, `name` FROM `".$mysql_zugangsdaten['praefix']."datentraeger_kategorien` WHERE `user` = '".$benutzer['id']."' ORDER BY `spalte`, `nummer` ASC"); |
42 | while ($row2 = db_fetch($res2)) |
42 | while ($row2 = db_fetch($res2)) |
43 | echo '<option value="'.$row2['spalte'].$row2['nummer'].'">'.$row2['spalte'].$row2['nummer'].' - '.$row2['name'].'</option>'; |
43 | echo '<option value="'.$row2['spalte'].$row2['nummer'].'">'.$row2['spalte'].$row2['nummer'].' - '.$row2['name'].'</option>'; |
44 | echo '</select><br><br>'; |
44 | echo '</select><br><br>'; |
45 | 45 | ||
46 | echo '<textarea name="eintraege" cols="70" rows="10"></textarea><br>'; |
46 | echo '<textarea name="eintraege" cols="70" rows="10"></textarea><br>'; |
47 | 47 | ||
48 | echo '<br><input type="submit" class="button" onmouseover="this.className=\'button_act\';" onmouseout="this.className=\'button\';" value="Einträge Erstellen"> <input type="button" value="Abbrechen" onclick="document.location.href=\''.$_SERVER['PHP_SELF'].'?modul='.$modul.'&seite=inhalt\'" class="button" onmouseover="this.className=\'button_act\';" onmouseout="this.className=\'button\';">'; |
48 | echo '<br><input type="submit" class="button" onmouseover="this.className=\'button_act\';" onmouseout="this.className=\'button\';" value="Einträge Erstellen"> <input type="button" value="Abbrechen" onclick="document.location.href=\''.$_SERVER['PHP_SELF'].'?modul='.urlencode($modul).'&seite=inhalt\'" class="button" onmouseover="this.className=\'button_act\';" onmouseout="this.className=\'button\';">'; |
49 | 49 | ||
50 | echo '</form>'; |
50 | echo '</form>'; |
51 | 51 | ||
52 | echo $footer; |
52 | echo $footer; |
53 | 53 | ||
54 | ?> |
54 | ?> |
55 | 55 |