<!--Copyright (C) 2014  Web3king - Alberto Bonacina

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->

<h1>Confirm Shopping List</h1>

<div class="col-lg-12">
	<div class="panel panel-info">
		<div class="panel-heading">Menu List</div>
		<div class="panel-body">
			
			<?php		


				echo "<h4>Dishes form ".$dataInizio." to ".$dataFine."</h4>";

				$attributes = array('role' => 'form', 'class' => 'form-horizontal');
		        echo form_open('pdf/createShoppingList',$attributes);
		        echo form_hidden('start-date',$dataInizio); 
		        echo form_hidden('end-date',$dataFine); 

		        foreach ($arrayTuttiMenu as $singleMenu) {
					echo "<br><br>";
					foreach ($singleMenu as $singleType) {
						foreach ($singleType as $singleDish) {
					        echo '<div class="row">';
								echo "<div class='form-group'>";
									echo form_hidden('id[]',$singleDish['id']);

									echo '<label for="date" class="col-lg-2 control-label">'.$singleDish['name'].'</label>';
				                    
				                    echo '<div class="col-lg-1">';
					                    $piatto_array = array('type' => 'text',
					                        'name' => 'people[]',
					                        'class' => 'form-control'
					                    );
					                echo form_input($piatto_array);
			                    	echo '</div>';
			                    echo "</div>";
			                echo "</div>";
			            }
					}
				}

		        echo "<div class='form-group'>";
                    echo '<div class="col-lg-2">';
	                    $button_array = array('class' => 'btn btn-primary',
	                        'type' => 'submit',
	                        'name' => 'submit',
	                        'value' => 'Create shopping list' 
	                    );
                    echo form_submit($button_array);
                    echo '</div>';
                echo "</div>";

               	echo form_close(); 

			?>

		</div>	
	</div>
</div>	