<?php

include_once('header.php'); 

if(!empty($lokalita[0]))echo '<a href="/admin/lokality/'.$lokalita[0]['parent_id'].'/">nadlokalita</a><hr>';
	echo '<form name="lokality" method="post">';
	foreach($lokality as $k => $v)
	{
		echo '<input type="text" name="lok['.$v['id'].'][lokalita]" value="'.$v['lokalita'].'" size="50">';
		echo '<select name="lok['.$v['id'].'][parent_id]"><option value="0">koren</option>';
		foreach($alllokality as $k2 => $v2)
		{
			echo '<option value="'.$v2['id'].'"';
			if($v2['id'] == $v['parent_id'])echo ' selected ';
			echo '>'.$v2['lokalita'].'</option>';
		}
		echo '</select>';
		echo '<a href="/admin/lokality/'.$v['id'].'/">podlokality</a><hr>';
	}
	echo '<input type="submit"></form>';

include_once('footer.php'); 

?>