示例#1
0
<?php

require_once "classes/MealPlan.class.php";
require_once "classes/DBUtils.class.php";
// Initalize the Vars
$date = isset($_GET['date']) ? $_GET['date'] : date('m-d-Y');
$view = isset($_GET['view']) ? $_GET['view'] : "daily";
$dbDate = DBUtils::dbDate($date);
// get the date in ISO format so that we have the key
if ($SMObj->getUserLoginID() == NULL) {
    die($LangUI->_('You must be logged in to use the Meal Planner!'));
}
// Create a new meal plan object
$MPObj = new MealPlan($date);
$MPObj->load($dbDate, $dbDate);
//just want this one day
$minshow = 4;
// Min number of empty fields to show
$defaultServings = 2;
// The default number of servings
// Read in a list of Meals and recipes
$rc = DBUtils::fetchColumn($db_table_meals, 'meal_name', 'meal_id', 'meal_id');
$mealList = DBUtils::createList($rc, 'meal_id', 'meal_name');
?>
<script type="text/javascript">
	$(document).ready(function() {
			$(".ui-widget").find("input[id^='recipeAuto_']").each(function()
			{
					$(this).autocomplete({
						source: "index.php?m=recipes&a=get&format=no",
						minLength: 1,
示例#2
0
<?php

require_once "classes/MealPlan.class.php";
$date = isset($_GET['date']) ? $_GET['date'] : date('m-d-Y');
$view = isset($_GET['view']) ? $_GET['view'] : 'weekly';
if ($SMObj->getUserLoginID() == NULL) {
    die($LangUI->_('You must be logged in to use the Meal Planner!'));
}
// Create a new meal plan object
$MPObj = new MealPlan($date);
// Depending on the view type, load the need amount of meals.
if ($view == "daily") {
    // Just need to load the current date
    $dbDate = DBUtils::dbDate($date);
    // get the date in ISO format so that we have the key
    $MPObj->load($dbDate, $dbDate);
} else {
    if ($view == "weekly") {
        // Most likely to happen
        $weekList = $MPObj->getWeekDaysList($MPObj->currentDay, $MPObj->currentMonth, $MPObj->currentYear);
        $startDate = DBUtils::dbDate($weekList[0][1] . '-' . $weekList[0][0] . '-' . $weekList[0][2]);
        $endDate = DBUtils::dbDate($weekList[6][1] . '-' . $weekList[6][0] . '-' . $weekList[6][2]);
        $MPObj->load($startDate, $endDate);
    }
}
// we are not going to create a list for an entire month, that is just crazy...
?>
<table cellspacing="0" cellpadding="1" border="0" width="100%">
<tr>
	<td align="left" class="title">
		<?php