- Timestamp:
- Jan 5, 2009, 7:35:58 AM (16 years ago)
- Location:
- www
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
www/backup/index.php
r4 r130 12 12 { 13 13 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'])); 15 15 echo('<p>Položka byla přidána.</p>'.$zpet); 16 16 break; … … 20 20 break; 21 21 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'])); 23 23 echo('<p>Položka byla upravena.</p>'.$zpet); 24 24 break; 25 25 case 'update': 26 while (list ($key, $val) = each ($_POST)) 26 print_r($_POST); 27 while(list($key, $val) = each($_POST)) 27 28 { 28 list($command, $id) = explode("_", $key);29 list($command, $id) = explode("_", $key); 29 30 switch($command) 30 31 { 31 32 case 'edit': 32 33 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 { 35 37 echo('<form action="index.php?action=edit" method="post"><input type="hidden" name="id" value="'.$id.'">'); 36 38 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>'); … … 65 67 echo('<tr><td>'.$Row['name'].'</td><td> '.$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>'); 66 68 $DbResult2 = $Database->query("SELECT * FROM items WHERE parent=".$Row['id']); 67 while($Except = $DbResult2->fetch_array()) 69 while($Except = $DbResult2->fetch_array()) 68 70 { 69 71 echo('<tr><td>- '.$Except['name'].'</td><td> '.$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 8 8 include('config.php'); 9 9 include('database.php'); 10 include('error.php');10 //include('error.php'); 11 11 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']); 12 12 $Database->Prefix = $Config['Database']['Prefix']; 13 13 $Database->charset($Config['Database']['Charset']); 14 14 include('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(); 18 18 19 19 $MonthNames = array('', 'Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec'); -
www/style.php
r114 r130 105 105 'jidelna' => array('', 106 106 'index.php' => 'Jídelníček', 107 'menuedit.php' => 'Editace jídelníčku', 107 'menuedit.php' => 'Editace jídelníčku', 108 108 ), 109 109 'backup' => array('', 110 'index.php' => 'Nastavení zálohování', 110 'index.php' => 'Nastavení zálohování', 111 111 ), 112 112 'mapa.php' => 'Mapa webu', … … 119 119 array_shift($ScriptNameParts); 120 120 foreach($ScriptNameParts as $ScriptNamePart) 121 { 122 //echo($ScriptNamePart.'<br>'); 123 if(is_array($PathTreeItem[$ScriptNamePart])) 121 { 122 if(is_array($PathTreeItem[$ScriptNamePart])) 124 123 { 125 124 $PathTreeItem = $PathTreeItem[$ScriptNamePart]; … … 127 126 if($PathTreeItem[0] != '') 128 127 $Navigation .= '<a href="'.$Config['Web']['RootFolder'].$PathTreePath.'">'.$PathTreeItem[0].'</a> > '; 129 } else 128 } else 130 129 { 131 130 if($PathTreeItem[$ScriptNamePart] != '') 132 131 $Navigation .= '<a href="'.$Config['Web']['RootFolder'].$PathTreePath.$ScriptNamePart.'">'.$PathTreeItem[$ScriptNamePart].'</a> > '; 133 132 } 134 } 133 } 135 134 $Navigation = substr($Navigation, 0, -6); 136 135 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.'> 144 143 <div id="Title">'.$Title.'</div> 145 144 <div id="Navigation"><span id="MenuItem"><strong>Navigace >></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 .= ' </div></div>'; 150 149 echo($Output); 151 150 } … … 154 153 { 155 154 global $Time_Start; 155 156 156 $Time = floor((GetMicrotime() - $Time_Start) * 100) / 100; 157 157 echo('<div id="Footer"> -
www/user.php
r77 r130 20 20 var $DefaultRole = 2; 21 21 var $AnonymousUserId = 1; 22 22 23 23 function Check() 24 24 { … … 39 39 $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"'); 40 40 $Row = $Query->fetch_array(); 41 if( $Row['User'] != $this->AnonymousUserId)41 if(($Row['User'] != $this->AnonymousUserId) and ($Query->num_rows > 0)) 42 42 { 43 43 $Query = $this->Database->select('User', '*', "Id=".$Row['User'].""); 44 44 $this->User = $Query->fetch_array(); 45 45 $Result = USER_LOGGED; 46 } else 46 } else 47 47 { 48 48 $Query = $this->Database->select('User', '*', "Id=".$this->AnonymousUserId); … … 54 54 // Role and permission 55 55 $this->LoadRoles(); 56 57 56 } 58 57
Note:
See TracChangeset
for help on using the changeset viewer.