Changeset 130 for www/backup/index.php
- Timestamp:
- Jan 5, 2009, 7:35:58 AM (16 years ago)
- File:
-
- 1 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>');
Note:
See TracChangeset
for help on using the changeset viewer.