Changeset 4 for www/jidelna/menuedit.php
- Timestamp:
- Jan 14, 2008, 9:48:39 PM (17 years ago)
- Location:
- www
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
www
-
Property svn:ignore
set to
config.php
php_script_error.log
-
Property svn:ignore
set to
-
www/jidelna/menuedit.php
r1 r4 1 <? 1 <?php 2 2 include_once('../style.php'); 3 include_once('../is/db.php');4 3 include_once('../global.php'); 5 DB_Init('localhost','root','','is');6 DB_Query('SET CHARACTER SET latin2');4 Header('Cache-Control: no-cache'); 5 ShowHeader('Jídleníček jídelny Na kopečku','Editace jídelníčku'); 7 6 8 Header('Cache-Control: no-cache'); 9 10 ShowHeader('Jídleníèek jídelny Na kopeèku','Editace jídelníèku'); 11 12 $Dny = array('Nedìle', 'Pondìlí', 'Úterý', 'Støeda', 'Ètvrtek', 'Pátek', 'Sobota'); 13 $Status = array('Nezveøejnìno', 'Otevøeno', 'Zavøeno - svátek', 'Zavøeno - dovolená'); 14 $Count = 20; // poèet dopøedu zobrazených dnù 7 $Dny = array('Neděle', 'Pondělí', 'Úterý', 'Středa', 'Čtvrtek', 'Pátek', 'Sobota'); 8 $Status = array('Nezveřejněno', 'Otevřeno', 'Zavřeno - svátek', 'Zavřeno - dovolená'); 9 $Count = 20; // počet dopředu zobrazených dnů 15 10 16 11 function PrintTableRow($Row) … … 45 40 $Time = time()+$I*86400; 46 41 $Date = date('Y-m-d',$Time); 47 DB_Replace('meals',array('date' => $Date, 'meal' => $_POST['meal_'.$Date], 'soap' => $_POST['soap_'.$Date], 'status' => $_POST['status_'.$Date]));42 $Database->replace('meals',array('date' => $Date, 'meal' => $_POST['meal_'.$Date], 'soap' => $_POST['soap_'.$Date], 'status' => $_POST['status_'.$Date])); 48 43 } 49 echo('<div style="color: red; font-size: larger;">Menu ulo ¾eno!</div>');44 echo('<div style="color: red; font-size: larger;">Menu uloľeno!</div>'); 50 45 } 51 46 if($_GET['action'] == 'saveinfo') 52 47 { 53 DB_Delete('meals_info','1');54 DB_Insert('meals_info',array('info' => $_POST['info'], 'price' => $_POST['price']));55 echo('<div style="color: red; font-size: larger;">Informa èní údaje ulo¾eny!</div>');48 $Database->delete('meals_info','1'); 49 $Database->insert('meals_info',array('info' => $_POST['info'], 'price' => $_POST['price'])); 50 echo('<div style="color: red; font-size: larger;">Informační údaje uloľeny!</div>'); 56 51 } 57 52 } … … 64 59 { 65 60 $Time = time()+$I*86400; 66 DB_Select('meals','*','date = "'.date('Y-m-d',$Time).'"'); 67 if($Row = DB_Row()) PrintTableRow($Row); 61 $DbResult = $Database->select('meals','*','date = "'.date('Y-m-d',$Time).'"'); 62 if($Row = $DbResult->fetch_array()) 63 PrintTableRow($Row); 68 64 else { 69 65 $Row = array('status' => 0, 'meal' => '', 'soap' => '', 'date' => date('Y-m-d',$Time)); … … 72 68 } 73 69 echo('</table><br> 74 <div align="center"><input type="submit" value="Ulo ¾it menu"></div>70 <div align="center"><input type="submit" value="Uloľit menu"></div> 75 71 </fieldset></form>'); 76 72 echo('<form action="menuedit.php?action=saveinfo" method="post"> 77 <fieldset><legend>Informa èní údaje</legend>');73 <fieldset><legend>Informační údaje</legend>'); 78 74 79 DB_Select('meals_info','*');80 $Row = DB_Row();75 $DbResult = $Database->select('meals_info','*'); 76 $Row = $DbResult->fetch_array(); 81 77 echo('<textarea name="info" rows="20" cols="80" >'.$Row['info'].'</textarea><br>'. 82 'Cena: <input type="text" name="price" size="5" value="'.$Row['price'].'"> K è<br>'.83 '<div align="center"><input type="submit" value="Ulo ¾it údaje"></div>78 'Cena: <input type="text" name="price" size="5" value="'.$Row['price'].'"> Kč<br>'. 79 '<div align="center"><input type="submit" value="Uloľit údaje"></div> 84 80 </fieldset></form>'); 85 81
Note:
See TracChangeset
for help on using the changeset viewer.