Changeset 164 for www/otevreno.php
- Timestamp:
- Feb 21, 2009, 11:04:42 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
www/otevreno.php
r153 r164 7 7 var $ShortTitle = 'Otvírací doby'; 8 8 var $DaysOfWeek = array('Pondělí', 'Úterý', 'Středa', 'Čtvrtek', 'Pátek', 'Sobota', 'Neděle'); 9 var $DayShift = 3; 9 10 10 11 function Show() … … 15 16 { 16 17 $Output .= '<strong>'.$Subject['Name'].':</strong><br />'; 17 $DbResult2 = $this->Database->query('SELECT Subject, OpenTime, CloseTime, TIMEDIFF(CloseTime, DATE_FORMAT(NOW(), "0000-01-%w %T")) as RemainTime FROM `SubjectOpenTimeInterval` WHERE DATE_FORMAT(NOW(), "0000-01-%w %T") > OpenTime AND DATE_FORMAT(NOW(), "0000-01-%w %T") < CloseTime AND Subject='.$Subject['Subject']); 18 19 $DbResult2 = $this->Database->query('SELECT Subject, OpenTime, CloseTime, TIMEDIFF(DATE_FORMAT(CloseTime, "0000-01-%w %T"), DATE_FORMAT(NOW(), "0000-01-%w %T")) as RemainTime FROM `SubjectOpenTimeInterval` WHERE DATE_FORMAT(NOW(), "0000-01-%w %T") > OpenTime AND DATE_FORMAT(NOW(), "0000-01-%w %T") < CloseTime AND Subject='.$Subject['Subject']); 18 20 if($DbResult2->num_rows > 0) 19 21 { … … 26 28 $Output .= 'Otevírá za '.$DbRow['RemainTime']; 27 29 } 28 $Output .= '<table class="WideTable"> 30 31 $Output .= '<table class="WideTable"> 29 32 <tr><th>Den</th><th>Čas</th></tr>'; 30 33 foreach($this->DaysOfWeek as $DayIndex => $DayOfWeek) 31 34 { 32 $DbResult2 = $this->Database->query('SELECT *, DATE_FORMAT(OpenTime, "%k:%i") as OpenTime , DATE_FORMAT(CloseTime, "%k:%i") as CloseTime FROM SubjectOpenTimeInterval WHERE SubjectOpenTimeInterval.Subject = '.$Subject['Subject'].' AND ((DAYOFWEEK(OpenTime) + 0) MOD 7)='.$DayIndex);35 $DbResult2 = $this->Database->query('SELECT *, DATE_FORMAT(OpenTime, "%k:%i") as OpenTime2, DATE_FORMAT(CloseTime, "%k:%i") as CloseTime2, DAYOFWEEK(OpenTime) as Week FROM SubjectOpenTimeInterval WHERE SubjectOpenTimeInterval.Subject = '.$Subject['Subject'].' AND ((DAYOFWEEK(OpenTime) + 7) MOD 7)='.$DayIndex); 33 36 $Output .= '<tr><td>'.$DayOfWeek.'</td><td align="center">'; 34 37 if($DbResult2->num_rows) … … 36 39 while($TimeInterval = $DbResult2->fetch_assoc()) 37 40 { 38 $Output .= $TimeInterval['OpenTime '].' - '.$TimeInterval['CloseTime'].' ';41 $Output .= $TimeInterval['OpenTime2'].' - '.$TimeInterval['CloseTime2'].' '; 39 42 } 40 43 } else
Note:
See TracChangeset
for help on using the changeset viewer.