<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
    class Libraryprofile
    {
 	 
	 	public function showProfile($employee) {
			echo '<div id="default_container">';			 			 		 							
			echo '<div class="button-group" style="margin-left:50px;margin-top:10px">';
				echo '<a href="'. base_url() . 'main/updateProfile/" class="button"  >Upraviť profil</a>';				
				echo '<a href="'. base_url() . 'main/changePassword/" class="button"  >Zmeniť heslo</a>';				
			echo '</div>';	
					echo "<div class='vehicle_div' style='align:center; margin-top:10px; margin-bottom:10px'></div>";		
			echo "<h3>Základné informácie: </h3>";	
			echo "<table class='profile_table'>";
				echo "<tr>";
					echo "<td>"; 
						echo "Identifikačné číslo: ";
					echo "</td>";
					echo "<td>";
						if (strlen($employee->ID_ZAM)==1) {
							echo "0000";
							echo $employee->ID_ZAM;
						} elseif (strlen($employee->ID_ZAM)==2) {
							echo "000";
							echo $employee->ID_ZAM;
						} elseif (strlen($employee->ID_ZAM)==3) {
							echo "00";
							echo $employee->ID_ZAM;
						} elseif (strlen($employee->ID_ZAM)==4) {
							echo "0";
							echo $employee->ID_ZAM;
						} else {
							echo $employee->ID_ZAM;
						}
					echo "</td>";
				echo "</tr>";
				
				echo "<tr>";
					echo "<td>";
						echo "Meno a priezvisko: ";
					echo "</td>";
					echo "<td>";
						echo $employee->Meno;
						echo " ";
						echo $employee->Priezvisko;
					echo "</td>";
				echo "</tr>";
				
				echo "<tr>";
					echo "<td>";
						echo "Rodné číslo: ";
					echo "</td>";
					echo "<td>";
						echo $employee->Rodne_cislo;
					echo "</td>";
					
				echo "</tr>";				
			echo "</table>";
			
			echo "<h3>Kontaktná adresa: </h3>";
			
			echo "<table class='profile_table'>";
				
				echo "<tr>";
					echo "<td>";
						echo "Ulica: ";
					echo "</td>";
					echo "<td>";
						if($employee->Ulica_zamestnanca==NULL){
							echo "-nevyplnené-";
						}else{
							echo $employee->Ulica_zamestnanca;
							echo " ";
							echo $employee->Cislo_domu_zamestnanca;	
						}					
					echo "</td>";
				echo "</tr>";
				
				echo "<tr>";
					echo "<td>";
						echo "PSČ: ";
					echo "</td>";
					echo "<td>";
						if($employee->PSC_zamestnanca==NULL){
							echo "-nevyplnené-";
						}else{
							echo $employee->PSC_zamestnanca;	
						}
					echo "</td>";
				echo "</tr>";
				
				echo "<tr>";
					echo "<td>";
						echo "Mesto: ";
					echo "</td>";
					echo "<td>";
						if($employee->Mesto_zamestnanca==NULL){
							echo "-nevyplnené-";
						}else{
							echo $employee->Mesto_zamestnanca;	
						}						
					echo "</td>";
				echo "</tr>";				
			echo "</table>";
		
		echo "<h3>Kontaktné údaje: </h3>";
		echo "<table class='profile_table'>";									
				echo "<tr>";
					echo "<td>";
						echo "Telefónne číslo: ";
					echo "</td>";
					echo "<td>";
						if($employee->Tel_cislo_zamestnanca==NULL){
							echo "-nevyplnené-";
						}else{
							echo "+421 ";
							echo $employee->Tel_cislo_zamestnanca;	
						}						
					echo "</td>";
				echo "</tr>";	
				
				echo "<tr>";
					echo "<td>";
						echo "Email: ";
					echo "</td>";
					echo "<td>";
						echo $employee->Email;
					echo "</td>";
				echo "</tr>";			
			echo "</table>";
			echo "<h3>Poisťovňa: </h3>";
		echo "<table class='profile_table'>";									
				echo "<tr>";
					echo "<td>";
						echo "Názov poisťovne: ";
					echo "</td>";
					echo "<td>";
						if($employee->ID_POIST==NULL){
							echo "-nevyplnené-";
						}else{
							echo $employee->Nazov_poistovne;	
						}	
					echo "</td>";
				echo "</tr>";	
				
				echo "<tr>";
					echo "<td>";
						echo "Kód poisťovne ";
					echo "</td>";
					echo "<td>";
						if($employee->ID_POIST==NULL){
							echo "-nevyplnené-";
						}else{
							echo $employee->Kod_poistovne;	
						}						
					echo "</td>";
				echo "</tr>";			
			echo "</table>";
			echo "<h3>Bankové spojenie: </h3>";
			echo "<table class='profile_table_bottom'>";									
				echo "<tr>";
					echo "<td>";
						echo "Číslo účtu: ";
					echo "</td>";
					echo "<td>";
						if($employee->Cislo_uctu==NULL){
							echo "-nevyplnené-";
						}else{
							echo $employee->Cislo_uctu;	
						}	
					echo "</td>";
				echo "</tr>";	
				
				echo "<tr>";
					echo "<td>";
						echo "Kód banky: ";
					echo "</td>";
					echo "<td>";
						if($employee->Kod_banky==NULL){
							echo "-nevyplnené-";
						}else{
							echo $employee->Kod_banky;	
						}
					echo "</td>";
										
				echo "</tr>";			
			echo "</table>";
		 echo '</div>';       
		 }       
         
      public function showMenuBarEmployee($meno, $priezvisko, $id_zam) {
		$CI =& get_instance();	
		$CI->load->model('model_employee');
		$status = $CI -> model_employee-> amIActiveEmployee($id_zam);
		echo "<nav>";
		echo"<ul>";			
				echo'<li class="profile_pic"><a href="'. base_url() .'main/getGeneralEmployeeInfo">'. $meno . ' ' . $priezvisko .'</a></li>';
				if($status==1){
					echo'<li class="profile_li"><a href="'. base_url() .'employee/getInventories/1">Inventúry</a></li>';					
				}
				echo'<li class="profile_li"><a href="'. base_url('employee/redirectPayChecks/'.date("Y")).'">Výplatné pásky</a></li>';
				echo'<li class="profile_li"><a href="'. base_url('statistics/redirectGraphEmployee/1/'.date("Y")).'">Štatistiky</a></li>';
				echo'<li class="profile_li"><a href="'. base_url() .'main/logout">Odhlásiť</a></li>';
		echo'<span style="margin-left:369px">';
			echo "<a href='".base_url('main/redirectNewPost/0/0')."'><img src='http://martinbendik.studenthosting.sk/pictures/noMess.png' height='28' width='28' style='margin-left:20px;margin-top:11px;opacity:0.9'></a>";						
		echo'</span>';
		echo'<span>';
			echo "<a href='".base_url('main/employee')."'><img src='http://martinbendik.studenthosting.sk/pictures/que2.png' height='21' width='21' style='margin-left: 10px;padding-bottom:4px;opacity:0.9'></a>";
		echo'</span>';
		echo'</ul>';
		echo'</nav>';
		 
	  }
	  public function showMenuBarLeadEmployee($meno, $priezvisko, $id_zam) {
		$CI =& get_instance();	
		$CI->load->model('model_employee');
		$status = $CI -> model_employee-> amIActiveEmployee($id_zam);
		echo "<nav>";
		echo"<ul>";			
				echo'<li class="profile_pic""><a href="'. base_url() . 'main/getGeneralEmployeeInfo">'. $meno . ' ' . $priezvisko .'</a></li>';
				if($status==1){
				echo'<li class="profile_li"><a href="'. base_url('lead_employee/getInventories/1').'">Inventúry</a></li>';
				echo'<li class="profile_li"><a href="'. base_url('lead_employee/getAllEmployees') .'">Zamestnanci</a></li>';					
				}
				echo'<li class="profile_li"><a href="'. base_url('employee/redirectPayChecks/'.date("Y")).'">Výplatné pásky</a></li>';
				echo'<li class="profile_li"><a href="'. base_url('statistics/redirectGraphLeadEmployee/1/2016') . '">Štatistiky</a></li>';
				echo'<li class="profile_li"><a href="'. base_url() . 'main/logout">Odhlásiť</a></li>';
				echo'<span style="margin-left:258px">';
					echo "<a href='".base_url('main/redirectNewPost/0/0')."'><img src='http://martinbendik.studenthosting.sk/pictures/noMess.png' height='28' width='28' style='margin-left:20px;margin-top:11px;opacity:0.9'></a>";						
				echo'</span>';
				echo'<span>';
					echo "<a href='".base_url('main/lead_employee')."'><img src='http://martinbendik.studenthosting.sk/pictures/que2.png' height='21' width='21' style='margin-left: 10px;padding-bottom:4px;opacity:0.9'></a>";
				echo'</span>';
		echo'</ul>';
		echo'</nav>';
		
	  }
	   public function showMenuBarDriver($meno, $priezvisko,$id_zam) {
		$CI =& get_instance();	
		$CI->load->model('model_employee');
		$status = $CI -> model_employee-> amIActiveEmployee($id_zam);
		echo "<nav>";
		echo"<ul>";			
				echo'<li class="profile_pic""><a href="'. base_url() . 'main/getGeneralEmployeeInfo">'. $meno . ' ' . $priezvisko .'</a></li>';
				if($status==1){
				echo'<li class="profile_li"><a href="'. base_url('driver/showAllInventories/1/1') .'">Inventúry</a></li>';
				echo'<li class="profile_li"><a href="'. base_url('driver/showVehicles/1') .'">Vozidlá</a></li>';				
				}
				echo'<li class="profile_li"><a href="'. base_url('employee/redirectPayChecks/'.date("Y")).'">Výplatné pásky</a></li>';
				echo'<li class="profile_li"><a href="'. base_url('statistics/redirectGraphDriver/1/1/2016') .'">Štatistiky</a></li>';
				echo'<li class="profile_li"><a href="'. base_url() . 'main/logout">Odhlásiť</a></li>';
		echo'<span style="margin-left:268px">';
			echo "<a href='".base_url('main/redirectNewPost/0/0')."'><img src='http://martinbendik.studenthosting.sk/pictures/noMess.png' height='28' width='28' style='margin-left:20px;margin-top:11px;opacity:0.9'></a>";						
		echo'</span>';
		echo'<span>';
			echo "<a href='".base_url('main/driver')."'><img src='http://martinbendik.studenthosting.sk/pictures/que2.png' height='21' width='21' style='margin-left: 10px;padding-bottom:4px;opacity:0.9'></a>";
		echo'</span>';
		echo'</ul>';
		echo'</nav>';
		
		
	  }

		   		   

	   public function showMenuBarManager($meno, $priezvisko) {
		$CI =& get_instance();	
		$CI->load->model('model_manager');
		$status = $CI -> model_manager-> isThereUnreadPost();
		echo "<nav>";
		echo"<ul>";	
				echo'<li class="profile_pic"><a href="'. base_url() . 'main/getGeneralEmployeeInfo">'. $meno . ' ' . $priezvisko .'</a></li>';
				echo'<li class="profile_li"><a href="'. base_url() . 'manager/showInventories/1">Inventúry</a>';
				echo'</li>';
				echo'<li class="profile_li"><a href="'. base_url() . 'manager/getAllEmployees">Zamestnanci</a></li>';
				echo'<li class="profile_li"><a href="'. base_url() . 'manager/getAllCustomers">Zakazníci</a></li>';
				echo'<li class="profile_li"><a href="'. base_url() . 'manager/getReservations/0">Rezervácie</a></li>';
				echo'<li class="profile_li"><a href="'. base_url() . 'manager/showVehicles/1">Vozidlá</a></li>';				
				echo'<li class="profile_li"><a href="'. base_url() . 'manager/redirectStatistics/1/1/2016">Štatistiky</a></li>';
				echo'<li class="profile_li"><a href="'. base_url() . 'main/logout">Odhlásiť</a></li>';
				echo'<span>';
					if($status==TRUE){
						echo "<a href='".base_url('manager/redirectPosts')."'><img src='http://martinbendik.studenthosting.sk/pictures/newMess.png' height='28' width='28' style='margin-left:20px;margin-top:11px;opacity:0.9'></a>";	
					}else{
						echo "<a href='".base_url('manager/redirectPosts')."'><img src='http://martinbendik.studenthosting.sk/pictures/noMess.png' height='28' width='28' style='margin-left:20px;margin-top:11px;opacity:0.9'></a>";						
					}

				echo'</span>';
				echo'<span>';
					echo "<a href='".base_url('manager/redirectSettings/1/'.date("Y",time())."/".date("n",time()))."'><img src='http://martinbendik.studenthosting.sk/pictures/sett.png' height='20' width='20' style='margin-left:15px;padding-bottom:4px;opacity:0.9'></a>";
				echo'</span>';
				echo'<span>';
					echo "<a href='".base_url('main/manager')."'><img src='http://martinbendik.studenthosting.sk/pictures/que2.png' height='21' width='21' style='margin-left: 10px;padding-bottom:4px;opacity:0.9'></a>";
				echo'</span>';
		echo'</ul>';
		
		echo'</nav>';
		
	  }
	  
	  
    }
	