$backwardLink = NULL; $title = NULL; $subtitle = NULL; // title of what day/week/month we are in if ($view == "daily") { //------------------------------------------------------------------------------- // Daily View //------------------------------------------------------------------------------- $weekDay = date('w', mktime(0, 0, 0, $MPObj->currentMonth, $MPObj->currentDay, $MPObj->currentYear)); $dbDate = DBUtils::dbDate($date); // get the date in ISO format so that we have the key $MPObj->load($dbDate, $dbDate); //just want this one day echo '<b>' . $MPObj->daysFull[$weekDay] . '</b>'; echo '<ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b">'; echo $MPObj->getMeals($dbDate, 3); echo '</ul>'; } else { if ($view == "weekly") { // Weekly view as default list($day, $month, $year) = $MPObj->getNextWeek($MPObj->currentDay, $MPObj->currentMonth, $MPObj->currentYear); $forwardLink = "<a href=\"index.php?m=meals&view=weekly&date={$month}-{$day}-{$year}\">" . $LangUI->_('Next Week') . "</a>\n"; list($day, $month, $year) = $MPObj->getPreviousWeek($MPObj->currentDay, $MPObj->currentMonth, $MPObj->currentYear); $backwardLink = "<a href=\"index.php?m=meals&view=weekly&date={$month}-{$day}-{$year}\">" . $LangUI->_('Previous Week') . "</a>\n"; $title = $LangUI->_('Weekly Meal Planner'); $weekList = $MPObj->getWeekDaysList($MPObj->currentDay, $MPObj->currentMonth, $MPObj->currentYear); $subtitle = $LangUI->_('Week of') . " " . $MPObj->monthsFull[$MPObj->currentMonth - 1] . " " . $weekList[0][0] . " " . $MPObj->currentYear; ?> <ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b"> <li data-role="list-divider"><?php
</tr> <!--------------- End of headers -----------------------------> <?php if ($view == "daily") { //------------------------------------------------------------------------------- // Daily View //------------------------------------------------------------------------------- $weekDay = date('w', mktime(0, 0, 0, $MPObj->currentMonth, $MPObj->currentDay, $MPObj->currentYear)); $dbDate = DBUtils::dbDate($date); // get the date in ISO format so that we have the key $MPObj->load($dbDate, $dbDate); //just want this one day echo '<tr><td colspan="3" valign="top" height=150><b>' . $MPObj->daysFull[$weekDay] . '</b> '; echo createEditLink($date, "daily"); echo '<br /><center><table border=0 cellpadding=0 cellspacing=0><tr><td>'; echo $MPObj->getMeals($dbDate, 1); echo '</td></tr></table></center><br />'; echo '</td></tr>'; } else { if ($view == "monthly") { //------------------------------------------------------------------------------- // monthly view //------------------------------------------------------------------------------- printWeekDays(); // Print out the weeks $month = $MPObj->currentMonth; $day = 1; $year = $MPObj->currentYear; while ($month == $MPObj->currentMonth) { $weekdays = $MPObj->getWeekDaysList($day, $month, $year); // Load the meals into memory