<?php

	if ($this->session->userdata('permisson')==1) {		
		$CI =& get_instance();
		$CI->load->library('libraryprofile');
		$CI->libraryprofile->showMenuBarManager($this->session->userdata('meno'),$this->session->userdata('priezvisko'));
		$this->load->helper('graph_helper');
	
	echo '<div id="default_container">';
		echo '<div class="button-group" style="margin-left:50px;margin-top:10px;">';
			switch($modeSta){
				case 1:
						echo '<a href="'.base_url('manager/redirectStatistics/1/1/'.$year).'" class="button active">Celkové štatistiky</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/2/1/'.$year).'" class="button">Štatistiky zamestnancov</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/3/2/'.$year).'" class="button">Štatistiky vozidiel</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/4/1/'.$year).'" class="button">Štatistiky zákazníkov</a>'; 
					echo '</div>';
					echo '<div class="button-group" style="margin-left:50px;margin-top:10px;">';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year-1)).'" class="button" style="margin-right:10px;">&laquo;</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year-1)).'" class="button">'.($year-1).'</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year)).'" class="button active">'.($year).'</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year+1)).'" class="button" style="margin-right:10px;">'.($year+1).'</a>';											
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year+1)).'" class="button" style="margin-right:10px;">&raquo;</a>';					
					echo '</div>';
				echo "<div class='vehicle_div' style='align:center; margin-top:5px;'></div>";		
					echo '<div class="button-group" style="margin-left:50px;margin-top:10px;">';
					switch($modeDet){
						case 1:
							echo '<a href="'.base_url('manager/redirectStatistics/1/1/'.$year).'" class="button active">Mzdy v hrubom</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/1/2/'.$year).'" class="button">Mzdy v čistom</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/1/3/'.$year).'" class="button">Počet inventúr</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/1/4/'.$year).'" class="button">Odpracovaných hodín</a>';
						break; 
						case 2:
							echo '<a href="'.base_url('manager/redirectStatistics/1/1/'.$year).'" class="button">Mzdy v hrubom</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/1/2/'.$year).'" class="button active">Mzdy v čistom</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/1/3/'.$year).'" class="button">Počet inventúr</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/1/4/'.$year).'" class="button">Odpracovaných hodín</a>';
						break;
						case 3:
							echo '<a href="'.base_url('manager/redirectStatistics/1/1/'.$year).'" class="button">Mzdy v hrubom</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/1/2/'.$year).'" class="button">Mzdy v čistom</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/1/3/'.$year).'" class="button active">Počet inventúr</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/1/4/'.$year).'" class="button">Odpracovaných hodín</a>';
						break; 
						case 4:
							echo '<a href="'.base_url('manager/redirectStatistics/1/1/'.$year).'" class="button">Mzdy v hrubom</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/1/2/'.$year).'" class="button">Mzdy v čistom</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/1/3/'.$year).'" class="button">Počet inventúr</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/1/4/'.$year).'" class="button active">Odpracovaných hodín</a>';
						break;  	
					}
					echo '</div>';
					echo "<div class='div_curve' style='height:370px;margin-top:5px'>";	
					echo '<div class="divForGraph">';
							drawGeneralGraphManager($modeDet, $year);
					echo '</div>';		
				break;
				case 2:
						echo '<a href="'.base_url('manager/redirectStatistics/1/1/'.$year).'" class="button">Celkové štatistiky</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/2/1/'.$year).'" class="button active">Štatistiky zamestnancov</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/3/2/'.$year).'" class="button">Štatistiky vozidiel</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/4/1/'.$year).'" class="button">Štatistiky zákazníkov</a>';  
					echo '</div>';
				echo '<div class="button-group" style="margin-left:50px;margin-top:10px;">';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year-1)).'" class="button" style="margin-right:10px;">&laquo;</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year-1)).'" class="button">'.($year-1).'</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year)).'" class="button active">'.($year).'</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year+1)).'" class="button" style="margin-right:10px;">'.($year+1).'</a>';											
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year+1)).'" class="button" style="margin-right:10px;">&raquo;</a>';					
					echo '</div>';
				echo "<div class='vehicle_div' style='align:center; margin-top:5px;'></div>";		
					echo '<div class="button-group" style="margin-left:50px;margin-top:10px;">';
					switch($modeDet){
						case 1:
							echo '<a href="'.base_url('manager/redirectStatistics/2/1/'.$year).'" class="button active">TOP Vedúci inventúr</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/2/2/'.$year).'" class="button">TOP Vodiči</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/2/3/'.$year).'" class="button">TOP zamestnanci</a>';
						break; 
						case 2:
							echo '<a href="'.base_url('manager/redirectStatistics/2/1/'.$year).'" class="button">TOP Vedúci inventúr</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/2/2/'.$year).'" class="button active">TOP Vodiči</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/2/3/'.$year).'" class="button">TOP zamestnanci</a>';
						break;
						case 3:
							echo '<a href="'.base_url('manager/redirectStatistics/2/1/'.$year).'" class="button">TOP Vedúci inventúr</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/2/2/'.$year).'" class="button">TOP Vodiči</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/2/3/'.$year).'" class="button active">TOP zamestnanci</a>';
						break; 						  	
					}
					echo '</div>';
					echo "<div class='div_curve' style='height:370px;margin-top:5px'>";	
					echo '<div class="divForGraph">';
						drawTopEmployeesManager($modeDet, $year);
					echo '</div>';
				break;
				case 3:
						echo '<a href="'.base_url('manager/redirectStatistics/1/1/'.$year).'" class="button">Celkové štatistiky</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/2/1/'.$year).'" class="button">Štatistiky zamestnancov</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/3/2/'.$year).'" class="button active">Štatistiky vozidiel</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/4/1/'.$year).'" class="button">Štatistiky zákazníkov</a>'; 
					echo '</div>';
				echo '<div class="button-group" style="margin-left:50px;margin-top:10px;">';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year-1)).'" class="button" style="margin-right:10px;">&laquo;</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year-1)).'" class="button">'.($year-1).'</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year)).'" class="button active">'.($year).'</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year+1)).'" class="button" style="margin-right:10px;">'.($year+1).'</a>';											
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year+1)).'" class="button" style="margin-right:10px;">&raquo;</a>';					
					echo '</div>';	
				echo "<div class='vehicle_div' style='align:center; margin-top:5px;'></div>";		
					echo '<div class="button-group" style="margin-left:50px;margin-top:10px;">';
					switch($modeDet){
						case 1:
							//echo '<a href="'.base_url('manager/redirectStatistics/3/1/'.$year).'" class="button active">Najviac hodín na cestách</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/3/2/'.$year).'" class="button">Najviac najazdených kilometrov</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/3/3/'.$year).'" class="button">Najviac absolvovaných inventúr</a>';
						break; 
						case 2:
							//echo '<a href="'.base_url('manager/redirectStatistics/3/1/'.$year).'" class="button">Najviac hodín na cestách</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/3/2/'.$year).'" class="button active">Najviac najazdených kilometrov</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/3/3/'.$year).'" class="button">Najviac absolvovaných inventúr</a>';
						break;
						case 3:
							//echo '<a href="'.base_url('manager/redirectStatistics/3/1/'.$year).'" class="button">Najviac hodín na cestách</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/3/2/'.$year).'" class="button">Najviac najazdených kilometrov</a>';
							echo '<a href="'.base_url('manager/redirectStatistics/3/3/'.$year).'" class="button active">Najviac absolvovaných inventúr</a>';
						break; 						  	
					}
					echo '</div>';

					echo "<div class='div_curve' style='height:370px;margin-top:5px'>";	
					echo '<div class="divForGraph">';						
						drawTopVehiclesManager($modeDet, $year);					
					echo '</div>';
				break;
				case 4:
						echo '<a href="'.base_url('manager/redirectStatistics/1/1/'.$year).'" class="button">Celkové štatistiky</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/2/1/'.$year).'" class="button">Štatistiky zamestnancov</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/3/2/'.$year).'" class="button">Štatistiky vozidiel</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/4/1/'.$year).'" class="button active">Štatistiky zákazníkov</a>'; 
					echo '</div>';
				echo '<div class="button-group" style="margin-left:50px;margin-top:10px;">';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year-1)).'" class="button" style="margin-right:10px;">&laquo;</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year-1)).'" class="button">'.($year-1).'</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year)).'" class="button active">'.($year).'</a>';
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year+1)).'" class="button" style="margin-right:10px;">'.($year+1).'</a>';											
						echo '<a href="'.base_url('manager/redirectStatistics/'.$modeSta.'/'.$modeDet.'/'.($year+1)).'" class="button" style="margin-right:10px;">&raquo;</a>';					
					echo '</div>'; 
				break;
			}
		
	echo '</div>';
			
		
	} else {
		redirect(base_url('main/restricted'));
	}	
?>
	


