Subversion Repositories personal-webbase

Rev

Rev 4 | Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. if (!defined('IBLEGAL')) die('Kann nicht ohne Personal WebBase ausgef&uuml;hrt werden.');
  4.  
  5. echo str_replace('<body', '<body onload="self.focus();document.getElementById(\'kategorie\').focus();"', $header);
  6.  
  7. if (isset($sent) && ($sent == '1'))
  8. {
  9.   $ary = explode("\n", $eintraege);
  10.  
  11.   for ($i=0; $i <= count($ary); $i++)
  12.   {
  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);
  15.     $new = $row3['mx'];
  16.  
  17.     if (isset($ary[$i]) && ($ary[$i] != ''))
  18.     {
  19.       if (strpos($ary[$i], '*'))
  20.       {
  21.         $ary[$i] = str_replace('*', '', $ary[$i]);
  22.         $gebrannt = '1';
  23.       }
  24.       else
  25.       {
  26.         $gebrannt = '0';
  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']."')");
  29.     }
  30.   }
  31. }
  32.  
  33.   echo '<h1>Neue Eintr&auml;ge erstellen</h1>';
  34.  
  35.   echo '<form method="post" action="'.$_SERVER['PHP_SELF'].'" name="mainform">';
  36.   echo '<input type="hidden" name="modul" value="'.$modul.'">';
  37.   echo '<input type="hidden" name="seite" value="'.$seite.'">';
  38.   echo '<input type="hidden" name="sent" value="1">';
  39.  
  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");
  42.   while ($row2 = db_fetch($res2))
  43.     echo '<option value="'.$row2['spalte'].$row2['nummer'].'">'.$row2['spalte'].$row2['nummer'].' - '.$row2['name'].'</option>';
  44.   echo '</select><br><br>';
  45.  
  46.   echo '<textarea name="eintraege" cols="70" rows="10"></textarea><br>';
  47.  
  48.   echo '<br><input type="submit" class="button" onmouseover="this.className=\'button_act\';" onmouseout="this.className=\'button\';" value="Eintr&auml;ge Erstellen"> <input type="button" value="Abbrechen" onclick="document.location.href=\''.$_SERVER['PHP_SELF'].'?modul='.urlencode($modul).'&amp;seite=inhalt\'" class="button" onmouseover="this.className=\'button_act\';" onmouseout="this.className=\'button\';">';
  49.  
  50.   echo '</form>';
  51.  
  52.   echo $footer;
  53.  
  54. ?>
  55.