<script type="text/javascript">
	function get_domain(client,s1,s2,tab)
	{
		//alert(domain.options[domain.selectedIndex].value);
		window.location	= "http://panel.networds.pl/"+s1+"/"+s2+"/"+client.options[client.selectedIndex].value+tab;
		//alert("http://panel.networds.pl/"+s1+"/"+s2+"/"+domain.options[domain.selectedIndex].value);
	}
</script>

<?php
	$ile_klientow = count($clients);
	
    //print_r($clients);

	if($ile_klientow > 1)
	{
		$s1 = $this->uri->segment(1);
		$s2 = $this->uri->segment(2);
		$s3 = $this->uri->segment(3);
		
		echo '<b>Wybierz klienta:</b> <select name="clients" onchange="return get_domain(this,\''.$s1.'\',\''.$s2.'\',aktualny_tab)"><option>- - - - - - - - - - - - - - - - - - - - - - - -</option>';
		
		foreach($clients as $c)
		{
			($c['active']==1) ? $stan='aktywny' : $stan='nieaktywny';
			
			if($c['id']==$s3)
				echo '<option value="'.$c['id'].'" selected="selected">'.$c['name'].' - '.$stan.'</option>';	
			else
				echo '<option value="'.$c['id'].'">'.$c['name'].' - '.$stan.'</option>';
		}
		
		echo '</select><br /><br />';
	}
?>

	