<script>
	function checkName(){
		if(document.getElementById("newNazovSpolocnosti").value!=""){
			if(document.getElementById("newNazovSpolocnosti").value.length<2){
				document.getElementById("nameError").innerHTML="Minimálne 2 znaky.";
				document.getElementById("nameStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";			
				document.getElementById("nameChecker").innerHTML="0";
			}else{
				document.getElementById("nameError").innerHTML="";
				document.getElementById("nameStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/yes.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";	
				document.getElementById("nameChecker").innerHTML="1";
			};	
		}else{
			document.getElementById("nameError").innerHTML="";
			document.getElementById("nameStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";	
			document.getElementById("nameChecker").innerHTML="0";
		};
	};
	
	function checkType(){
		if(document.getElementById("newDruhSpolocnosti").value!=0){		
				document.getElementById("typeError").innerHTML="";
				document.getElementById("typeStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/yes.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";	
				document.getElementById("typeChecker").innerHTML="1";
					
		}else{
			document.getElementById("typeError").innerHTML="";
			document.getElementById("typeStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";	
			document.getElementById("typeChecker").innerHTML="0";
		};
	};
	
	function checkCity(){
		if(document.getElementById("newMestoSpolocnosti").value!=""){
			if(document.getElementById("newMestoSpolocnosti").value.length<2){
				document.getElementById("cityError").innerHTML="Minimálne 2 znaky.";
				document.getElementById("cityStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";			
				document.getElementById("cityChecker").innerHTML="0";
			}else{
				document.getElementById("cityError").innerHTML="";
				document.getElementById("cityStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/yes.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";	
				document.getElementById("cityChecker").innerHTML="1";
			};	
		}else{
			document.getElementById("cityError").innerHTML="";
			document.getElementById("cityStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";	
			document.getElementById("cityChecker").innerHTML="0";
		};
	};
	
	function checkStreet(){
		if(document.getElementById("newUlicaSpolocnosti").value!=""){
			if(document.getElementById("newUlicaSpolocnosti").value.length<2){
				document.getElementById("streetError").innerHTML="Minimálne 2 znaky.";
				document.getElementById("streetStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";			
				document.getElementById("streetChecker").innerHTML="0";
			}else{
				document.getElementById("streetError").innerHTML="";
				document.getElementById("streetStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/yes.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";	
				document.getElementById("streetChecker").innerHTML="1";
			};	
		}else{
			document.getElementById("streetError").innerHTML="";
			document.getElementById("streetStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";	
			document.getElementById("streetChecker").innerHTML="0";
		};
	};
	
	function checkNumber(){
		if(document.getElementById("newCisloSpolocnosti").value!=""){			
				document.getElementById("numberError").innerHTML="";
				document.getElementById("numberStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/yes.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";	
				document.getElementById("numberChecker").innerHTML="1";	
		}else{
			document.getElementById("numberError").innerHTML="";
			document.getElementById("numberStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";	
			document.getElementById("numberChecker").innerHTML="0";
		};
	};
	
	function checkCustomerPostCode(){
	if(document.getElementById("newPSCSpolocnosti").value!=""){		
		if(isNaN(document.getElementById("newPSCSpolocnosti").value)===true) {
			document.getElementById("PSCError").innerHTML="Iba číslice.";
			document.getElementById("PSCStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";			
			document.getElementById("PSCChecker").innerHTML="0";		
		}else if(document.getElementById("newPSCSpolocnosti").value.length!=5){
			document.getElementById("PSCError").innerHTML="5 číslic.";
			document.getElementById("PSCStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";			
			document.getElementById("PSCChecker").innerHTML="0";
		}else{
			document.getElementById("PSCError").innerHTML="";
			document.getElementById("PSCStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/yes.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";	
			document.getElementById("PSCChecker").innerHTML="1";
		}		
	}else{
		document.getElementById("PSCError").innerHTML="";
		document.getElementById("PSCStatus").innerHTML = "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";	
		document.getElementById("PSCChecker").innerHTML="0";
	}
};
//kontrola ci sa vobec moze vytvorit novy zakaznik
document.addEventListener("click", function(){
	if(document.getElementById("nameChecker").innerHTML=="1" && document.getElementById("typeChecker").innerHTML=="1" && document.getElementById("cityChecker").innerHTML=="1" && document.getElementById("streetChecker").innerHTML=="1" && document.getElementById("numberChecker").innerHTML=="1" && document.getElementById("PSCChecker").innerHTML=="1"){
		var status=0;
		var countCustomers=parseInt(document.getElementById("countCustomers").innerHTML);
		for(i = 1; i < (countCustomers+1); i++){
			if(
				(document.getElementById("newNazovSpolocnosti").value.toUpperCase()==document.getElementById("companyName"+i).innerHTML.toUpperCase())&&
				(document.getElementById("newMestoSpolocnosti").value.toUpperCase()==document.getElementById("companyCity"+i).innerHTML.toUpperCase())&&
				(document.getElementById("newUlicaSpolocnosti").value.toUpperCase()==document.getElementById("companyStreet"+i).innerHTML.toUpperCase()) &&
				(document.getElementById("newCisloSpolocnosti").value.toUpperCase()==document.getElementById("companyNumber"+i).innerHTML.toUpperCase())
				){
				status=1;
			};
		}	 
		if(status==0){
			document.getElementById("finallyCheckerCustomer").innerHTML="<h3 style='padding-top:12px'><img src='http://martinbendik.studenthosting.sk/pictures/yes.png' height='20' width='20' align='middle' style='padding-bottom:12px;padding-right:15px'>Nový zákazník</h3>";		
			document.getElementById("submitSpan").style.visibility = "visible";	
		}else{
			document.getElementById("finallyCheckerCustomer").innerHTML="<h3 style='padding-top:12px'><img src='http://martinbendik.studenthosting.sk/pictures/yes.png' height='20' width='20' align='middle' style='padding-bottom:12px;padding-right:15px'>Tento zákazník už existuje!</h3>";					
			document.getElementById("submitSpan").style.visibility = "hidden";
		}
		
	}else{
		document.getElementById("finallyCheckerCustomer").innerHTML="<h3 style='padding-top:12px'><img src='http://martinbendik.studenthosting.sk/pictures/Exclamation.png' height='20' width='20' align='middle' style='padding-bottom:12px;padding-right:15px'>Nový zákazník</h3>";			
		document.getElementById("submitSpan").style.visibility = "hidden";
	}
});
 
document.addEventListener("keyup", function(){
	if(document.getElementById("nameChecker").innerHTML=="1" && document.getElementById("typeChecker").innerHTML=="1" && document.getElementById("cityChecker").innerHTML=="1" && document.getElementById("streetChecker").innerHTML=="1" && document.getElementById("numberChecker").innerHTML=="1" && document.getElementById("PSCChecker").innerHTML=="1"){
		var status=0;
		var countCustomers=parseInt(document.getElementById("countCustomers").innerHTML);
		for(i = 1; i < (countCustomers+1); i++){
			if(
				(document.getElementById("newNazovSpolocnosti").value.toUpperCase()==document.getElementById("companyName"+i).innerHTML.toUpperCase())&&
				(document.getElementById("newMestoSpolocnosti").value.toUpperCase()==document.getElementById("companyCity"+i).innerHTML.toUpperCase())&&
				(document.getElementById("newUlicaSpolocnosti").value.toUpperCase()==document.getElementById("companyStreet"+i).innerHTML.toUpperCase()) &&
				(document.getElementById("newCisloSpolocnosti").value.toUpperCase()==document.getElementById("companyNumber"+i).innerHTML.toUpperCase())
				){
				status=1;
			};
		}	
		if(status==0){
			document.getElementById("finallyCheckerCustomer").innerHTML="<h3 style='padding-top:12px'><img src='http://martinbendik.studenthosting.sk/pictures/yes.png' height='20' width='20' align='middle' style='padding-bottom:12px;padding-right:15px'>Nový zákazník</h3>";		
			document.getElementById("submitSpan").style.visibility = "visible";	
		}else{
			document.getElementById("finallyCheckerCustomer").innerHTML="<h3 style='padding-top:12px'><img src='http://martinbendik.studenthosting.sk/pictures/yes.png' height='20' width='20' align='middle' style='padding-bottom:12px;padding-right:15px'>Tento zákazník už existuje!</h3>";					
			document.getElementById("submitSpan").style.visibility = "hidden";
		}
		
	}else{
		document.getElementById("finallyCheckerCustomer").innerHTML="<h3 style='padding-top:12px'><img src='http://martinbendik.studenthosting.sk/pictures/Exclamation.png' height='20' width='20' align='middle' style='padding-bottom:12px;padding-right:15px'>Nový zákazník</h3>";			
		document.getElementById("submitSpan").style.visibility = "hidden";
	}
});
//HLADANIE do DIV ci uz taky zakaznik existuje
document.addEventListener("keyup", function(){
	if(document.getElementById("nameChecker").innerHTML=="1" && document.getElementById("cityChecker").innerHTML=="1" && document.getElementById("streetChecker").innerHTML=="1" && document.getElementById("numberChecker").innerHTML=="1"){
		var countCustomers=parseInt(document.getElementById("countCustomers").innerHTML);
		document.getElementById("divForAssumedCusomers").innerHTML="";
			for(i = 1; i < (countCustomers+1); i++){
				if((document.getElementById("companyName"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newNazovSpolocnosti").value.toUpperCase())>-1) && (document.getElementById("companyCity"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newMestoSpolocnosti").value.toUpperCase())>-1) && (document.getElementById("companyStreet"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newUlicaSpolocnosti").value.toUpperCase())>-1) && (document.getElementById("companyNumber"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newCisloSpolocnosti").value.toUpperCase())>-1)){
				document.getElementById("divForAssumedCusomers").innerHTML=document.getElementById("divForAssumedCusomers").innerHTML+"<b>"+document.getElementById("companyName"+i).innerHTML+" - "+document.getElementById("companyCity"+i).innerHTML+", "+document.getElementById("companyStreet"+i).innerHTML+" "+document.getElementById("companyNumber"+i).innerHTML+"</b><br>";
				};	
			};
	}else if(document.getElementById("nameChecker").innerHTML=="1" && document.getElementById("cityChecker").innerHTML=="1" && document.getElementById("streetChecker").innerHTML=="1"){
		var countCustomers=parseInt(document.getElementById("countCustomers").innerHTML);
		document.getElementById("divForAssumedCusomers").innerHTML="";
			for(i = 1; i < (countCustomers+1); i++){
				if((document.getElementById("companyName"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newNazovSpolocnosti").value.toUpperCase())>-1) && (document.getElementById("companyCity"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newMestoSpolocnosti").value.toUpperCase())>-1) && (document.getElementById("companyStreet"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newUlicaSpolocnosti").value.toUpperCase())>-1)){
				document.getElementById("divForAssumedCusomers").innerHTML=document.getElementById("divForAssumedCusomers").innerHTML+"<b>"+document.getElementById("companyName"+i).innerHTML+" - "+document.getElementById("companyCity"+i).innerHTML+", "+document.getElementById("companyStreet"+i).innerHTML+"</b> "+document.getElementById("companyNumber"+i).innerHTML+"<br>";
				};	
			};
	}else if(document.getElementById("nameChecker").innerHTML=="1" && document.getElementById("cityChecker").innerHTML=="1"){
		var countCustomers=parseInt(document.getElementById("countCustomers").innerHTML);
		document.getElementById("divForAssumedCusomers").innerHTML="";
		for(i = 1; i < (countCustomers+1); i++){
			if((document.getElementById("companyName"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newNazovSpolocnosti").value.toUpperCase())>-1) && (document.getElementById("companyCity"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newMestoSpolocnosti").value.toUpperCase())>-1)){
			document.getElementById("divForAssumedCusomers").innerHTML=document.getElementById("divForAssumedCusomers").innerHTML+"<b>"+document.getElementById("companyName"+i).innerHTML+" - "+document.getElementById("companyCity"+i).innerHTML+"</b>, "+document.getElementById("companyStreet"+i).innerHTML+" "+document.getElementById("companyNumber"+i).innerHTML+"<br>";
		};	
		};
	}else if(document.getElementById("nameChecker").innerHTML=="1"){
		var countCustomers=parseInt(document.getElementById("countCustomers").innerHTML);
		document.getElementById("divForAssumedCusomers").innerHTML="";
		for(i = 1; i < (countCustomers+1); i++){
			if(document.getElementById("companyName"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newNazovSpolocnosti").value.toUpperCase())>-1){
			document.getElementById("divForAssumedCusomers").innerHTML=document.getElementById("divForAssumedCusomers").innerHTML+"<b>"+document.getElementById("companyName"+i).innerHTML+"</b> - "+document.getElementById("companyCity"+i).innerHTML+", "+document.getElementById("companyStreet"+i).innerHTML+" "+document.getElementById("companyNumber"+i).innerHTML+"<br>";
		};	
		};
	}else{
		document.getElementById("divForAssumedCusomers").innerHTML="";
	}		
});

document.addEventListener("click", function(){
	if(document.getElementById("nameChecker").innerHTML=="1" && document.getElementById("cityChecker").innerHTML=="1" && document.getElementById("streetChecker").innerHTML=="1" && document.getElementById("numberChecker").innerHTML=="1"){
		var countCustomers=parseInt(document.getElementById("countCustomers").innerHTML);
		document.getElementById("divForAssumedCusomers").innerHTML="";
			for(i = 1; i < (countCustomers+1); i++){
				if((document.getElementById("companyName"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newNazovSpolocnosti").value.toUpperCase())>-1) && (document.getElementById("companyCity"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newMestoSpolocnosti").value.toUpperCase())>-1) && (document.getElementById("companyStreet"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newUlicaSpolocnosti").value.toUpperCase())>-1) && (document.getElementById("companyNumber"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newCisloSpolocnosti").value.toUpperCase())>-1)){
				document.getElementById("divForAssumedCusomers").innerHTML=document.getElementById("divForAssumedCusomers").innerHTML+"<b>"+document.getElementById("companyName"+i).innerHTML+" - "+document.getElementById("companyCity"+i).innerHTML+", "+document.getElementById("companyStreet"+i).innerHTML+" "+document.getElementById("companyNumber"+i).innerHTML+"</b><br>";
				};	
			};
	}else if(document.getElementById("nameChecker").innerHTML=="1" && document.getElementById("cityChecker").innerHTML=="1" && document.getElementById("streetChecker").innerHTML=="1"){
		var countCustomers=parseInt(document.getElementById("countCustomers").innerHTML);
		document.getElementById("divForAssumedCusomers").innerHTML="";
			for(i = 1; i < (countCustomers+1); i++){
				if((document.getElementById("companyName"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newNazovSpolocnosti").value.toUpperCase())>-1) && (document.getElementById("companyCity"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newMestoSpolocnosti").value.toUpperCase())>-1) && (document.getElementById("companyStreet"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newUlicaSpolocnosti").value.toUpperCase())>-1)){
				document.getElementById("divForAssumedCusomers").innerHTML=document.getElementById("divForAssumedCusomers").innerHTML+"<b>"+document.getElementById("companyName"+i).innerHTML+" - "+document.getElementById("companyCity"+i).innerHTML+", "+document.getElementById("companyStreet"+i).innerHTML+"</b> "+document.getElementById("companyNumber"+i).innerHTML+"<br>";
				};	
			};
	}else if(document.getElementById("nameChecker").innerHTML=="1" && document.getElementById("cityChecker").innerHTML=="1"){
		var countCustomers=parseInt(document.getElementById("countCustomers").innerHTML);
		document.getElementById("divForAssumedCusomers").innerHTML="";
		for(i = 1; i < (countCustomers+1); i++){
			if((document.getElementById("companyName"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newNazovSpolocnosti").value.toUpperCase())>-1) && (document.getElementById("companyCity"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newMestoSpolocnosti").value.toUpperCase())>-1)){
			document.getElementById("divForAssumedCusomers").innerHTML=document.getElementById("divForAssumedCusomers").innerHTML+"<b>"+document.getElementById("companyName"+i).innerHTML+" - "+document.getElementById("companyCity"+i).innerHTML+"</b>, "+document.getElementById("companyStreet"+i).innerHTML+" "+document.getElementById("companyNumber"+i).innerHTML+"<br>";
		};	
		};
	}else if(document.getElementById("nameChecker").innerHTML=="1"){
		var countCustomers=parseInt(document.getElementById("countCustomers").innerHTML);
		document.getElementById("divForAssumedCusomers").innerHTML="";
		for(i = 1; i < (countCustomers+1); i++){
			if(document.getElementById("companyName"+i).innerHTML.toUpperCase().indexOf(document.getElementById("newNazovSpolocnosti").value.toUpperCase())>-1){
			document.getElementById("divForAssumedCusomers").innerHTML=document.getElementById("divForAssumedCusomers").innerHTML+"<b>"+document.getElementById("companyName"+i).innerHTML+"</b> - "+document.getElementById("companyCity"+i).innerHTML+", "+document.getElementById("companyStreet"+i).innerHTML+" "+document.getElementById("companyNumber"+i).innerHTML+"<br>";
		};	
		};
	}else{
		document.getElementById("divForAssumedCusomers").innerHTML="";
	}		
});





</script>
<?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'));
		echo '<table id="customerInfoTable" hidden>';
			echo '<td id="countCustomers">'.count($customers).'</td>';	
			$countCustomers=0;
			foreach($customers as $customer){
				$countCustomers++;
				echo "<td id='companyName".$countCustomers."'>".$customer->Nazov_spolocnosti."</td><td id='companyCity".$countCustomers."'>".$customer->Mesto."</td><td id='companyStreet".$countCustomers."'>".$customer->Ulica."</td><td id='companyNumber".$countCustomers."'>".$customer->Cislo."</td>";
			}
		echo '</table>';
		echo '<div id="default_container">';
			echo '<span id="finallyCheckerCustomer">';
				echo "<h3 style='padding-top:12px'><img src='http://martinbendik.studenthosting.sk/pictures/Exclamation.png' height='20' width='20' align='middle' style='padding-bottom:12px;padding-right:15px'>Nový zákazník</h3>";
			echo '</span>';
			echo form_open(base_url('manager/createNewCustomer'),'onkeypress="return event.keyCode != 13;"'); 							
			echo '<div id="errors" >'; 
			echo validation_errors();
			echo "</div>";
			echo '<table id="newCustomerInfoTable" style="margin-left:50px; margin-top:10px">';				
				echo "<tr>";
					echo "<td style='width:130px'>";
						echo "Názov spoločnosti: ";
					echo "</td>";
					echo "<td>";										
						echo form_input("newNazovSpolocnosti",'' , 'onkeyup="checkName()" id="newNazovSpolocnosti" class="login_textarea"');
					echo "</td>";
					echo "<td id='nameStatus'>";
						echo "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18'  style='margin-left:10px;margin-top:6px'>";
					echo "</td>";
					echo "<td id='nameError'>";

					echo "</td>";
					echo "<td id='nameChecker' hidden>";
						echo "0";
					echo "</td>";					
				echo "</tr>";
				
				echo "<tr>";
					echo "<td style='width:100px'>";
						echo "Druh spoločnosti: ";
					echo "</td>";
					echo "<td>";										
						$options = array(
                  			'0'  => '',
							'1'  => 'Lekáreň',
                  			'2'  => 'Hračkárstvo',
                  			'3'  => 'Kníhkupectvo',
                  			'4'  => 'Supermarket',
							'5'  => 'Pošta',
							'6'  => 'Odevy',
							'7'  => 'Papierníctvo',
							'8'  => 'Kvetinárstvo',
							'9'  => 'Potraviny',
							'10'  => 'Železiarstvo',
							'11'  => 'Drogéria',	
							'12'  => 'Iné',	
											  
                );
						echo form_dropdown('newDruhSpolocnosti', $options,'' , 'onclick="checkType()" id="newDruhSpolocnosti" class="login_textarea" style="width:228px"');
					echo "</td>";
					echo "<td id='typeStatus'>";
						echo "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18'  style='margin-left:10px;margin-top:6px'>";
					echo "</td>";
					echo "<td id='typeError'>";
					echo "</td>";
					echo "<td id='typeChecker' hidden>";
						echo "0";
					echo "</td>";					
				echo "</tr>";
				
				echo "<tr>";
					echo "<td style='width:100px'>";
						echo "Mesto: ";
					echo "</td>";
					echo "<td>";										
						echo form_input("newMestoSpolocnosti",'' , 'onkeyup="checkCity()" id="newMestoSpolocnosti" class="login_textarea"');
					echo "</td>";
					echo "<td id='cityStatus'>";
						echo "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18'  style='margin-left:10px;margin-top:6px'>";
					echo "</td>";
					echo "<td id='cityError'>";
					echo "</td>";
					echo "<td id='cityChecker' hidden>";
						echo "0";
					echo "</td>";
				echo "</tr>";
				
				echo "<tr>";
					echo "<td style='width:100px'>";
						echo "Ulica: ";
					echo "</td>";
					echo "<td>";										
						echo form_input("newUlicaSpolocnosti",'' , 'onkeyup="checkStreet()" id="newUlicaSpolocnosti" class="login_textarea"');
					echo "</td>";
					echo "<td id='streetStatus'>";
						echo "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18'  style='margin-left:10px;margin-top:6px'>";
					echo "</td>";
					echo "<td id='streetError'>";
					echo "</td>";
					echo "<td id='streetChecker' hidden>";
						echo "0";
					echo "</td>";					
				echo "</tr>";
				
				echo "<tr>";
					echo "<td style='width:100px'>";
						echo "Číslo domu: ";
					echo "</td>";
					echo "<td>";										
						echo form_input("newCisloSpolocnosti",'' , 'onkeyup="checkNumber()" id="newCisloSpolocnosti" class="login_textarea"');
					echo "</td>";
					echo "<td id='numberStatus'>";
						echo "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";
					echo "</td>";
					echo "<td id='numberError'>";
					echo "</td>";
					echo "<td id='numberChecker' hidden>";
						echo "0";
					echo "</td>";					
				echo "</tr>";
				
				echo "<tr>";
					echo "<td style='width:100px'>";
						echo "PSČ: ";
					echo "</td>";
					echo "<td>";										
						echo form_input("newPSCSpolocnosti",'' , 'id="newPSCSpolocnosti" onkeyup="checkCustomerPostCode()" class="login_textarea"');
					echo "</td>";
					echo "<td id='PSCStatus'>";
						echo "<img src='http://martinbendik.studenthosting.sk/pictures/no.png' height='17' width='18' style='margin-left:10px;margin-top:6px'>";
					echo "</td>";
					echo "<td id='PSCError'>";
					echo "</td>";
					echo "<td id='PSCChecker' hidden>";
						echo "0";
					echo "</td>";
				echo "</tr>";
								
			echo '</table>';
			
			echo '<div class="divForAssumedCusomers" id="divForAssumedCusomers">';
 
			echo '</div>';
			
			echo "<div class='vehicle_div' style='align:center; margin-top:15px;'></div>";
			echo '<div class="button-group" style="margin-left:50px;margin-top:20px">';
				echo '<a class="button" href="javascript:window.history.go(-1); ">Späť</a>';
				echo '<span id="submitSpan">';
					echo form_submit('submit_newCustomer', 'Vytvoriť', 'class="button"');
				echo '<span>';
			echo '</div>';
			
		echo '</div>';	
		
	} else {
		redirect(base_url('main/restricted'));
	}	
?>
	


