I have a jquery calendar in my cakephp application with

	<?php //foreach ($mealplans as $mealplan){ ?>
					title: '<?php echo $mealplan['Mealplan']['event_name'] . ", ". $mealplan['Mealplan']['total_calories']. " cals"; ?>',
					start: new Date(y, m, <?php
					$event = $mealplan['Mealplan']['event_date']; echo substr($event, 0, -8); ?>, 0),
					end: new Date(y, m, 16),
					allDay: true,
					url: 'http://localhost/mealplans/view/1'
				<?php //} ?>

When I uncomment foreach and its curly bracket at the end then it prints out the first of my meal plans on January 15 until January 16 but I want it to print out all of them. Most of the php is working in the jquery code it's just this one part that doesn't work. When I uncomment the foreach and its end bracket then the calendar disappears. You can see it at http://myownmealplanner.com/calendars/navigate The calendar code is from http://arshaw.com/fullcalendar/docs/usage/