<div id="mainMenu">
	<table border="0" cellpadding="0" cellspacing="0" class="mainMenu_table">
		<tr>
			<td><img height="17" width="236" alt="" src="/files/leftMenuTop.jpg"/></td>
		</tr>
		<tr>
			<td valign="top" style="background-image: url(/files/leftMenuMiddle.jpg); width: 236px; height: 141px;  background-repeat: no-repeat;padding:0px;">
			<div id="mainMenu_content">
				<?php
				
					function getClassName($item,$currentItem)
					{
						//$currentItem = $this->uri->segment('2');
						switch($item)
						{
							case "Główna":
									if($currentItem == "start")
										return "mainMenu_item_selected";
									else
										return "mainMenu_item";
										
							case "Moje domeny":
									if($currentItem == "domain" || $currentItem == "show_domain_stat" || $currentItem == "show_domain_chart" || $currentItem == "show_domain_statcounter" || $currentItem == "show_domain_keyword_activity")
										return "mainMenu_item_selected";
									else
										return "mainMenu_item";
							case "Dodaj afilianta":
									if($currentItem == "add_afiliant")
										return "mainMenu_item_selected";
									else
										return "mainMenu_item";
							case "Zarządzaj afiliantami":
									if($currentItem == "add_user_to_afiliant")
										return "mainMenu_item_selected";
									else
										return "mainMenu_item";			
							case "Mój profil":
									if($currentItem == "profile")
										return "mainMenu_item_selected";
									else
										return "mainMenu_item";			
							case "Zmień hasło":
									if($currentItem == "change_pass")
										return "mainMenu_item_selected";
									else
										return "mainMenu_item";
							case "Faktury":
									if($currentItem == "faktury")
										return "mainMenu_item_selected";
									else
										return "mainMenu_item";	
							case "Tickety":
									if($currentItem == "tickets")
										return "mainMenu_item_selected";
									else
										return "mainMenu_item";		
							case "Odebrane":
									if($currentItem == "/tickets/list_items/0" || $currentItem == "/tickets/list_items" )
										return "mainMenu_item_selected";
									else
										return "mainMenu_item";	
							case "Wyslane":		
									if($currentItem == "/tickets/list_items/1")
										return "mainMenu_item_selected";
									else
										return "mainMenu_item";											
							
						}
						return "mainMenu_item";
					}
					
					if(isset($this->session->userdata['master_id']))
					{
									echo '<div class="mainMenu_item"><a href="/master/start">Strona startowa</a></div>
										  <div class="mainMenu_item"><a href="/master/masters">Masterzy</a></div>
										  <div class="mainMenu_item"><a href="/master/employees">Pracownicy</a></div>
										  <div class="mainMenu_item"><a href="/master/change_master_pass">Zmień hasło</a></div>';												
					}
					//if($this->uri->segment('1')=='superadmin')
					elseif(isset($this->session->userdata['di_sa'])) 
					{
									echo '<div class="'.getClassName("Główna",$this->uri->segment('2')).'"><a href="/superadmin/start">Główna</a></div>
										  <div class="'.getClassName("Tickety",$this->uri->segment('1')).'"><a href="/tickets">Wiadomości</a></div>';
										  
									if( $this->uri->segment('1') == "tickets")
										{
											echo '<div class="'.getClassName("Odebrane",$this->uri->uri_string()).'"><a href="/tickets/list_items/0">&nbsp;&nbsp;&nbsp;Odebrane</a></div>
												  <div class="'.getClassName("Wyslane",$this->uri->uri_string()).'"><a href="/tickets/list_items/1">&nbsp;&nbsp;&nbsp;Wyslane</a></div>';											
										}
											  
									echo  '<div class="'.getClassName("Moje domeny",$this->uri->segment('2')).'"><a href="/superadmin/domain">Moje domeny</a></div>
										  <div class="'.getClassName("Dodaj afilianta",$this->uri->segment('2')).'"><a href="/superadmin/add_afiliant">Dodaj afilianta</a></div>
										  <div class="'.getClassName("Zarządzaj afiliantami",$this->uri->segment('2')).'"><a href="/superadmin/add_user_to_afiliant">Zarządzaj afiliantami</a></div>
										  <br />';
					}
					//elseif($this->uri->segment('1') == 'afiliant') 
					elseif(isset($this->session->userdata['id']))
					{
									echo '<div class="'.getClassName("Tickety",$this->uri->segment('1')).'"><a href="/tickets">Wiadomości</a></div>';
									if( $this->uri->segment('1') == "tickets")
										{
											echo '<div class="'.getClassName("Odebrane",$this->uri->uri_string()).'"><a href="/tickets/list_items/0">&nbsp;&nbsp;&nbsp;Odebrane</a></div>
												  <div class="'.getClassName("Wyslane",$this->uri->uri_string()).'"><a href="/tickets/list_items/1">&nbsp;&nbsp;&nbsp;Wyslane</a></div>';											
										}						
									echo '<div class="'.getClassName("Klienci",$this->uri->segment('2')).'"><a href="/afiliant/clients">Klienci</a></div>										  
										 <br />										 
										 ';
					}
					else
					{
									echo '<div class="'.getClassName("Główna",$this->uri->segment('2')).'"><a href="/admin/start">Główna</a></div>
										 <div class="'.getClassName("Tickety",$this->uri->segment('1')).'"><a href="/tickets">Wiadomości</a></div>';
										 
									if($this->uri->segment('1') == "tickets")
										{
											echo '<div class="'.getClassName("Odebrane",$this->uri->uri_string()).'"><a href="/tickets/list_items/0">&nbsp;&nbsp;&nbsp;Odebrane</a></div>
												 <div class="'.getClassName("Wyslane",$this->uri->uri_string()).'"><a href="/tickets/list_items/1">&nbsp;&nbsp;&nbsp;Wyslane</a></div>';											
										}
																				 
									echo '<div class="'.getClassName("Moje domeny",$this->uri->segment('2')).'"><a href="/admin/domain">Moje domeny</a></div>
										 <div class="'.getClassName("Mój profil",$this->uri->segment('2')).'"><a href="/admin/profile">Mój profil</a></div>
										 <div class="'.getClassName("Faktury",$this->uri->segment('2')).'"><a href="/admin/faktury">Faktury</a></div>
										 <div class="'.getClassName("Linki_sponsorowane",$this->uri->segment('2')).'"><a href="/admin/linki_sponsorowane">Linki sponsorowane</a></div>
										 <div class="'.getClassName("Zmień hasło",$this->uri->segment('2')).'"><a href="/admin/change_pass">Zmień hasło</a></div>
										 ';
					}
					
				?>
			</div>	
			</td>
		</tr>
		<tr>	
			<td>
				<img height="17" width="236" alt="" src="/files/leftMenuBottom.jpg"/>
			</td>
		</tr>
	</table>
</div>