<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 "Afilianci":
									if($currentItem == "afiliants")
										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";		
							//kient menu
                            case "Klient_linki_sponsorowane": if($currentItem == "linki_sponsorowane") return "mainMenu_item_selected"; else return "mainMenu_item";
                            //afiliant menu
                            case "Afiliant_start": if($currentItem == "start" || $currentItem == "") return "mainMenu_item_selected"; else return "mainMenu_item";
                            case "Afiliant_profile": if($currentItem == "profile") return "mainMenu_item_selected"; else return "mainMenu_item";
							case "Afiliant_clients": if($currentItem == "clients" || $currentItem == "newclient") return "mainMenu_item_selected"; else return "mainMenu_item";
							case "Afiliant_payments": if($currentItem == "payments") return "mainMenu_item_selected"; else return "mainMenu_item";
							case "Afiliant_rozliczenia": if($currentItem == "rozliczenia") return "mainMenu_item_selected"; else return "mainMenu_item";
                            case "Afiliant_regulamin": if($currentItem == "regulamin") return "mainMenu_item_selected"; else return "mainMenu_item";

                            //ksiegowowsc
                             case "K_start": if($currentItem == "start") return "mainMenu_item_selected"; else return "mainMenu_item";
                             case "K_clients": if($currentItem == "clients") return "mainMenu_item_selected"; else return "mainMenu_item";
                             case "K_afiliants": if($currentItem == "afiliants") return "mainMenu_item_selected"; else return "mainMenu_item";
                             case "K_all_payments_seo": if($currentItem == "all_payments_seo") return "mainMenu_item_selected"; else return "mainMenu_item";
                             case "K_all_payments_sem": if($currentItem == "all_payments_sem") return "mainMenu_item_selected"; else return "mainMenu_item";
                             case "K_all_payments_afiliant": if($currentItem == "all_payments_afiliant") return "mainMenu_item_selected"; else return "mainMenu_item";
                             case "K_all_seo": if($currentItem == "all_seo") return "mainMenu_item_selected"; else return "mainMenu_item";
                             case "K_all_sem": if($currentItem == "all_sem") return "mainMenu_item_selected"; else return "mainMenu_item";
                             case "K_all_afiliant": if($currentItem == "all_afiliant") return "mainMenu_item_selected"; else return "mainMenu_item";
                             case "K_change_pass": if($currentItem == "change_pass") 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="/tickets">Wiadomości</a></div>
										  <div class="mainMenu_item"><a href="/master/domains">Domeny</a></div>
										  <div class="mainMenu_item"><a href="/master/employees">Pracownicy</a></div>
										  <div class="mainMenu_item"><a href="/master/clients">Klienci</a></div>
										  <div class="mainMenu_item"><a href="/master/afiliants">Afilianci</a></div>
										  <div class="mainMenu_item"><a href="/master/email_aliases">Aliasy mailowe</a></div>
										  <div class="mainMenu_item"><a href="/master/networds">Networds</a></div>
										  <div class="mainMenu_item"><a href="/master/mailing">Mailing</a></div>
										  <div class="mainMenu_item"><a href="/master/change_master_pass">Zmiana hasła</a></div>';												
					}
					elseif(isset($this->session->userdata['ksiegowosc_id'])) 
					{
						echo '<div class="'.getClassName("K_start",$this->uri->segment('2')).'"><a href="/ksiegowosc/start">Strona startowa</a></div>
							  <div class="'.getClassName("Tickety",$this->uri->segment('1')).'"><a href="/tickets">Wiadomości</a></div>
							  <div class="'.getClassName("K_clients",$this->uri->segment('2')).'"><a href="/ksiegowosc/clients">Klienci</a></div>
							  <div class="'.getClassName("K_afiliants",$this->uri->segment('2')).'"><a href="/ksiegowosc/afiliants">Afilianci</a></div>
							  <div class="'.getClassName("K_all_payments_seo",$this->uri->segment('2')).'"><a href="/ksiegowosc/all_payments_seo">Niezapłacone SEO</a></div>
							  <div class="'.getClassName("K_all_payments_sem",$this->uri->segment('2')).'"><a href="/ksiegowosc/all_payments_sem">Niezapłacone SEM proforma</a></div>
                              <div class="'.getClassName("K_all_payments_afiliant",$this->uri->segment('2')).'"><a href="/ksiegowosc/all_payments_afiliant">Niewypłacone należności afiliantom</a></div>
                              <div class="'.getClassName("K_all_seo",$this->uri->segment('2')).'"><a href="/ksiegowosc/all_seo">Wszystkie faktury SEO</a></div>
                              <div class="'.getClassName("K_all_sem",$this->uri->segment('2')).'"><a href="/ksiegowosc/all_sem">Wszystkie faktury SEM</a></div>
                              <div class="'.getClassName("K_all_afiliant",$this->uri->segment('2')).'"><a href="/ksiegowosc/all_afiliant">Wszystkie płatności afilianta</a></div>
							  <div class="'.getClassName("K_change_pass",$this->uri->segment('2')).'"><a href="/ksiegowosc/change_pass">Zmiana hasła</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">Strona startowa</a></div>
										  <div class="'.getClassName("Tickety",$this->uri->segment('1')).'"><a href="/tickets">Wiadomości</a></div>';
									echo  '<div class="'.getClassName("Moje domeny",$this->uri->segment('2')).'"><a href="/superadmin/domain">Domeny</a></div>
										   <div class="'.getClassName("clients",$this->uri->segment('2')).'"><a href="/superadmin/clients">Klienci</a></div>
										   <div class="'.getClassName("clients",$this->uri->segment('2')).'"><a href="/superadmin/change_pass">Zmiana hasła</a></div>
										  <br />';
					}
					//elseif($this->uri->segment('1') == 'afiliant') 
					elseif(isset($this->session->userdata['id']))
					{
                                    echo '<div class="'.getClassName("Afiliant_start",$this->uri->segment('2')).'"><a href="/afiliant/start">Strona startowa</a></div>';
									echo '<div class="'.getClassName("Tickety",$this->uri->segment('1')).'"><a href="/tickets">Wiadomości</a></div>';						
									echo '<div class="'.getClassName("Afiliant_profile",$this->uri->segment('2')).'"><a href="/afiliant/profile">Mój profil</a></div>';
									echo '<div class="'.getClassName("Afiliant_clients",$this->uri->segment('2')).'"><a href="/afiliant/clients">Klienci</a></div>';
                                    echo '<div class="'.getClassName("Afiliant_clients",$this->uri->segment('2')).'"><a href="/afiliant/newclient">Zgłoszenie klienta</a></div>';
									echo '<div class="'.getClassName("Afiliant_payments",$this->uri->segment('2')).'"><a href="/afiliant/payments">Wypłata środków</a></div>';
									echo '<div class="'.getClassName("Afiliant_rozliczenia",$this->uri->segment('2')).'"><a href="/afiliant/rozliczenia">Rozliczenia</a></div>';
                                    echo '<div class="'.getClassName("Afiliant_regulamin",$this->uri->segment('2')).'"><a href="/afiliant/regulamin">Regulamin</a></div><br />';
					}
					else
					{
									echo '<div class="'.getClassName("Główna",$this->uri->segment('2')).'"><a href="/admin/start">Strona startowa</a></div>
										 <div class="'.getClassName("Tickety",$this->uri->segment('1')).'"><a href="/tickets">Wiadomości</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("Klient_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">Zmiana hasła</a></div>
										 ';
					}
					
				?>
			</div>	
			</td>
		</tr>
		<tr>	
			<td>
				<img height="17" width="236" alt="" src="/files/leftMenuBottom.jpg"/>
			</td>
		</tr>
	</table>
</div>