Changeset 130 for www


Ignore:
Timestamp:
Jan 5, 2009, 7:35:58 AM (16 years ago)
Author:
george
Message:
  • Upraveno: Zrušení kontroly přihlášení uživatelů.
  • Upraveno: Formátování kóud stránky zálohování.
Location:
www
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • www/backup/index.php

    r4 r130  
    1212{
    1313  case 'add':
    14     $Database->insert('items',array('name' => $_POST['name'], 'parent' => $_POST['parent'], 'description' => $_POST['description']));
     14    $Database->insert('items', array('name' => $_POST['name'], 'parent' => $_POST['parent'], 'description' => $_POST['description']));
    1515    echo('<p>Položka byla přidána.</p>'.$zpet);
    1616    break;
     
    2020    break;
    2121  case 'edit':
    22     $Database->update('items','id = '.$_POST['id'],array('name' => $_POST['name'], 'description' => $_POST['description']));
     22    $Database->update('items','id = '.$_POST['id'], array('name' => $_POST['name'], 'description' => $_POST['description']));
    2323    echo('<p>Položka byla upravena.</p>'.$zpet);
    2424    break;
    2525  case 'update':
    26     while (list ($key, $val) = each ($_POST))
     26    print_r($_POST);
     27    while(list($key, $val) = each($_POST))
    2728    {
    28       list($command, $id) = explode("_",$key);
     29      list($command, $id) = explode("_", $key);
    2930      switch($command)
    3031      {
    3132        case 'edit':
    3233          echo('<strong>Úprava položky:</strong><br/>');
    33           DB_Query("SELECT * FROM items WHERE id=$id");
    34           while ($Item = DB_Row()) {
     34          DB_Query('SELECT * FROM items WHERE id='.$id);
     35          while ($Item = DB_Row())
     36          {
    3537            echo('<form action="index.php?action=edit" method="post"><input type="hidden" name="id" value="'.$id.'">');
    3638            echo('Název/cesta<br/><input type="text" name="name" value="'.$Item['name'].'"><br/>Popis<br/><input type="text" name="description" value="'.$Item['description'].'"><br/><input type="submit" value="Odeslat"></form>');
     
    6567      echo('<tr><td>'.$Row['name'].'</td><td>&nbsp;'.$Row['description'].'</td><td><input type="submit" name="edit_'.$Row['id'].'" value="Upravit"/><input type="submit" name="remove_'.$Row['id'].'" value="Vymazat"/><input type="submit" name="except_'.$Row['id'].'" value="Přidat vyjímku"/></td></tr>');
    6668      $DbResult2 = $Database->query("SELECT * FROM items WHERE parent=".$Row['id']);
    67       while($Except = $DbResult2->fetch_array()) 
     69      while($Except = $DbResult2->fetch_array())
    6870      {
    6971        echo('<tr><td>-&nbsp;&nbsp;'.$Except['name'].'</td><td>&nbsp;'.$Except['description'].'</td><td><input type="submit" name="edit_'.$Except['id'].'" value="Upravit vyjímku"/><input type="submit" name="remove_'.$Except['id'].'" value="Vymazat vyjímku"/></td></tr>');
  • www/global.php

    r77 r130  
    88include('config.php');
    99include('database.php');
    10 include('error.php');
     10//include('error.php');
    1111$Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']);
    1212$Database->Prefix = $Config['Database']['Prefix'];
    1313$Database->charset($Config['Database']['Charset']);
    1414include('module.php');
    15 include('user.php');
    16 $User = new User($Database);
    17 $User->Check();
     15//include('user.php');
     16//$User = new User($Database);
     17//$User->Check();
    1818
    1919$MonthNames = array('', 'Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec');
  • www/style.php

    r114 r130  
    105105    'jidelna' => array('',
    106106      'index.php' => 'Jídelníček',
    107       'menuedit.php' => 'Editace jídelníčku',   
     107      'menuedit.php' => 'Editace jídelníčku',
    108108    ),
    109109    'backup' => array('',
    110       'index.php' => 'Nastavení zálohování',   
     110      'index.php' => 'Nastavení zálohování',
    111111    ),
    112112    'mapa.php' => 'Mapa webu',
     
    119119  array_shift($ScriptNameParts);
    120120  foreach($ScriptNameParts as $ScriptNamePart)
    121   {
    122     //echo($ScriptNamePart.'<br>');
    123     if(is_array($PathTreeItem[$ScriptNamePart]))
     121  {
     122    if(is_array($PathTreeItem[$ScriptNamePart]))
    124123    {
    125124      $PathTreeItem = $PathTreeItem[$ScriptNamePart];
     
    127126      if($PathTreeItem[0] != '')
    128127        $Navigation .= '<a href="'.$Config['Web']['RootFolder'].$PathTreePath.'">'.$PathTreeItem[0].'</a> &gt; ';
    129     } else 
     128    } else
    130129    {
    131130      if($PathTreeItem[$ScriptNamePart] != '')
    132131        $Navigation .= '<a href="'.$Config['Web']['RootFolder'].$PathTreePath.$ScriptNamePart.'">'.$PathTreeItem[$ScriptNamePart].'</a> &gt; ';
    133132    }
    134   } 
     133  }
    135134  $Navigation = substr($Navigation, 0, -6);
    136135
    137   $Output = '<?xml version="1.0" encoding="'.$Config['Web']['Charset'].'"?>'.
    138   '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'.
    139   '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'.
    140   '<head><link rel="stylesheet" href="'.$Config['Web']['RootFolder'].'/style.css" type="text/css" media="all" />'.
    141   '<script type="text/javascript" src="'.$Config['Web']['RootFolder'].'/global.js" />'.
    142   '<title>'.$Config['Web']['Title'].' - '.$Path.'</title>
    143   </head><body style="font-family: sans-serif;" '.$BodyParam.'>
     136  $Output = '<?xml version="1.0" encoding="'.$Config['Web']['Charset'].'"?>'."\n".
     137  '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n".
     138  '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'."\n".
     139  '<head><link rel="stylesheet" href="'.$Config['Web']['RootFolder'].'/style.css" type="text/css" media="all" />'."\n".
     140  '<script type="text/javascript" src="'.$Config['Web']['RootFolder'].'/global.js"></script>'."\n".
     141  '<title>'.$Config['Web']['Title'].' - '.$Path.'</title>'."\n".
     142  '</head><body style="font-family: sans-serif;" '.$BodyParam.'>
    144143<div id="Title">'.$Title.'</div>
    145144<div id="Navigation"><span id="MenuItem"><strong>Navigace &gt;&gt;</strong> '.$Navigation.'</span><div id="MenuItem2">';
    146   if($User->User['Id'] == $User->AnonymousUserId)
    147     $Output .= '<a href="'.$Config['Web']['RootFolder'].'?Action=LoginForm">Přihlášení</a> <a href="'.$Config['Web']['RootFolder'].'?Action=RegistrationForm">Registrace</a>';
    148       else $Output .= $User->User['Name'].' <a href="?Action=Logout">Odhlásit</a> <a href="?Action=UserOptions">Nastavení</a>';
    149   $Output .= '</div></div>';
     145//  if($User->User['Id'] == $User->AnonymousUserId)
     146    //$Output .= '<a href="'.$Config['Web']['RootFolder'].'?Action=LoginForm">Přihlášení</a> <a href="'.$Config['Web']['RootFolder'].'?Action=RegistrationForm">Registrace</a>';
     147//      else $Output .= $User->User['Name'].' <a href="?Action=Logout">Odhlásit</a> <a href="?Action=UserOptions">Nastavení</a>';
     148  $Output .= '&nbsp;</div></div>';
    150149  echo($Output);
    151150}
     
    154153{
    155154  global $Time_Start;
     155
    156156  $Time = floor((GetMicrotime() - $Time_Start) * 100) / 100;
    157157  echo('<div id="Footer">
  • www/user.php

    r77 r130  
    2020  var $DefaultRole = 2;
    2121  var $AnonymousUserId = 1;
    22  
     22
    2323  function Check()
    2424  {
     
    3939    $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"');
    4040    $Row = $Query->fetch_array();
    41     if($Row['User'] != $this->AnonymousUserId)
     41    if(($Row['User'] != $this->AnonymousUserId) and ($Query->num_rows > 0))
    4242    {
    4343      $Query = $this->Database->select('User', '*', "Id=".$Row['User']."");
    4444      $this->User = $Query->fetch_array();
    4545      $Result = USER_LOGGED;
    46     } else 
     46    } else
    4747    {
    4848      $Query = $this->Database->select('User', '*', "Id=".$this->AnonymousUserId);
     
    5454    // Role and permission
    5555    $this->LoadRoles();
    56    
    5756  }
    5857
Note: See TracChangeset for help on using the changeset viewer.