Subversion Repositories personal-webbase

Rev

Rev 12 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. if (!defined('WBLEGAL')) die('Kann nicht ohne Personal WebBase ausgef&uuml;hrt werden.');
  4.  
  5.   // Initialisierung
  6.   $res = db_query("SELECT name, data FROM ".$mysql_zugangsdaten['praefix']."tabellen WHERE id = '".db_escape($id)."' AND user = '".$benutzer['id']."'");
  7.   $row = db_fetch($res);
  8.   $text = $row['data'];
  9.   echo '<b>'.$row['name'].'</b><br><br>';
  10.  
  11.   // Konstanten
  12.   $umbruch_zeile = ':';
  13.   $umbruch_item = '-';
  14.   $max_laenge = 50;
  15.  
  16.   // Inhaltsabfrage
  17.   $ary1 = explode($umbruch_zeile, $text);
  18.   echo '<center><table border="1" cellspacing="3" cellpadding="3" width="95%">';
  19.   for ($j=0; $ary1[$j]!=''; $j++)
  20.   {
  21.     $ary2 = explode($umbruch_item, $ary1[$j]);
  22.     if ($j == 0)
  23.     {
  24.       echo '<tr bgcolor="#DDDDDD">';
  25.       for ($i=0; $ary2[$i]!=''; $i++)
  26.       {
  27.         $tname = 'type'.$i;
  28.         $$tname = substr($ary2[$i], 0, 1);
  29.         $titel = substr($ary2[$i], 1, strlen($ary2[$i])-1);
  30.         $titel = base64_decode($titel);
  31.         if (strlen($titel) > $max_laenge)
  32.           $titel = substr($titel, 0, $max_laenge).'...';
  33.         $titel = my_htmlentities($titel);
  34.         echo '<td><b>'.$titel.'</b></td>';
  35.       }
  36.       echo '</tr>';
  37.     }
  38.     else
  39.     {
  40.           echo '<tr>';
  41.       for ($i=0; $ary2[$i]!=''; $i++)
  42.       {
  43.         $tname = 'type'.$i;
  44.             $inhalt = '<font color="#FF0000">Inhaltstyp fehlerhaft<font>';
  45.         if ($$tname == 'C')
  46.         {
  47.           $inhalt = base64_decode($ary2[$i]);
  48.           if ($inhalt == '1')
  49.                     $x = ' checked';
  50.               else
  51.                 $x = '';
  52.                   $inhalt = '<input type="checkbox"'.$x.' disabled>';
  53.         }
  54.         else if ($$tname == 'T')
  55.         {
  56.           $inhalt = base64_decode($ary2[$i]);
  57.           if (strlen($inhalt) > $max_laenge)
  58.             $inhalt = substr($inhalt, 0, $max_laenge).'...';
  59.           $inhalt = my_htmlentities($inhalt);
  60.         }
  61.         echo '<td>'.$inhalt.'</td>';
  62.       }
  63.           echo '</tr>';
  64.     }
  65.   }
  66.   echo '</table><br></center>';
  67.  
  68. ?>
  69.