<!--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>Manage Calendar</h1>

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

				for ($i=0; $i < 8; $i++) { 
					echo '<div class="col-lg-3"><div class="well well-sm well-button-calendar"><h4 class="title-well-calendar">';
					echo $prossimi_giorni_nome[$i];
					echo '</h4><h5 class="title-well-calendar"><i class="fa fa-calendar-o"></i> '.$prossimi_giorni[$i].'</h5>';
					for ($j=0; $j < 3; $j++) { 
						switch ($j) {
						    case 0:
						        if($prossimi_menu[$i][$j] != 0){
						        	echo '<div class="button-calendar btn-block"><a type="button" href="'.base_url().'index.php/menu/modifySingleMenu/'.$prossimi_menu[$i][$j].'" style="width:70%;" class="btn btn-success btn-sm">Breakfast</a>';
						        	echo '<a type="button" href="'.base_url().'index.php/pdf/printSingleMenu/'.$prossimi_menu[$i][$j].'" class="btn btn-info btn-sm" style="float:right;width:20%;"><i class="fa fa-print"></i></a></div>';
								}else{
									echo '<div class="button-calendar"><a type="button" class="btn btn-warning btn-block btn-sm">Breakfast</a></div>';
								}
						        break;
						    case 1:
						        if($prossimi_menu[$i][$j] != 0){
						        	echo '<div class="button-calendar btn-block"><a type="button" href="'.base_url().'index.php/menu/modifySingleMenu/'.$prossimi_menu[$i][$j].'" style="width:70%;" class="btn btn-success btn-sm">Lunch</a>';
						        	echo '<a type="button" href="'.base_url().'index.php/pdf/printSingleMenu/'.$prossimi_menu[$i][$j].'" class="btn btn-info btn-sm" style="float:right;width:20%;"><i class="fa fa-print"></i></a></div>';
								}else{
									echo '<div class="button-calendar"><a type="button" class="btn btn-warning btn-block btn-sm">Lunch</a></div>';
								}
						        break;
						    case 2:
						        if($prossimi_menu[$i][$j] != 0){
						        	echo '<div class="button-calendar btn-block"><a type="button" href="'.base_url().'index.php/menu/modifySingleMenu/'.$prossimi_menu[$i][$j].'" style="width:70%;" class="btn btn-success btn-sm">Dinner</a>';
						        	echo '<a type="button" href="'.base_url().'index.php/pdf/printSingleMenu/'.$prossimi_menu[$i][$j].'" class="btn btn-info btn-sm" style="float:right;width:20%;"><i class="fa fa-print"></i></a></div>';
								}else{
									echo '<div class="button-calendar"><a type="button" class="btn btn-warning btn-block btn-sm">Dinner</a></div>';
								}
						        break;
						}
					}
					echo '<div class="button-calendar-print"><a href="'.base_url().'index.php/pdf/printDayMenu/'.$prossimi_giorni[$i].'" type="button" class="btn btn-info"><i class="fa fa-print"></i> Print daily menu</a></div>';
					echo '</div></div>';
				}

				?>

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

<div class="col-lg-12">
	<div class="panel panel-info">
		<div class="panel-heading">Order</div>
		<div class="panel-body">

			<?php   
                $attributes = array('role' => 'form', 'class' => 'form-horizontal');
                echo form_open('calendar/confirmShoppingList',$attributes);
				
				echo "<div class='row'><div class='col-lg-5'>";
                    echo "<div class='form-group'>";
	                    echo '<label for="start-date" class="col-lg-3 control-label">Start Date</label>';
	                    echo '<div class="col-lg-6">';
		                    $nome_array = array('type' => 'text',
		                        'name' => 'start-date',
		                        'class' => 'form-control',
		                        'id' => 'datepicker1'
		                    );
		                    echo form_input($nome_array);
	                    echo '</div>';
	                    echo '<div style="color:grey;margin-left:-1.5em;padding-top:.5em;" class="col-lg-1">(yyyy/mm/dd)</div>';
                    echo "</div>";
                echo "</div><div class='col-lg-5'>";
                    echo "<div class='form-group'>";
	                    echo '<label for="end-date" class="col-lg-3 control-label">End Date</label>';
	                    echo '<div class="col-lg-6">';
		                    $nome_array = array('type' => 'text',
		                        'name' => 'end-date',
		                        'class' => 'form-control',
		                        'id' => 'datepicker2'
		                    );
		                    echo form_input($nome_array);
	                    echo '</div>';
	                    echo '<div style="color:grey;margin-left:-1.5em;padding-top:.5em;" class="col-lg-1">(yyyy/mm/dd)</div>';
                    echo "</div>";
                echo "</div><div class='col-lg-2'>";
	                echo "<div class='form-group'>";
		                    $button_array = array('class' => 'btn btn-info',
		                        'type' => 'submit',
		                        'name' => 'submit',
		                        'value' => 'Create shopping list' 
		                    );
                    echo form_submit($button_array);
                    echo '</div>';
                echo "</div></div>";

             	echo form_close();
	        ?>

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