	<div class="visWrap">
<?
		if($_GET['table']){
			switch($_GET['type']){
				case 1:
					$l_table = 'meta_prikaz';
					break;
					
				case 2:
					$l_table = 'meta_forma';
					break;
			}
			$l_bc_3 = get_item('select ime from '.$l_table.' where rbr = '.$_GET['table']);
		}
		if($_GET['type']){
			switch($_GET['type']){
				case 1:
					$l_bc_2 = 'Index forme';
					break;
					
				case 2:
					$l_bc_2 = 'Podaci forme';
					break;
			}
		}
		if($_GET['lang']){
			$l_bc_1 = get_item('select ime from jezik where rbr = '.$_GET['lang']);
		}
?>
		<p>
			<a href="default.php?a=<?=$_GET['a']?>&b=<?=$_GET['b']?>">Prijevod home</a> ->
			<a href="default.php?a=<?=$_GET['a']?>&b=<?=$_GET['b']?>&lang=<?=$_GET['lang']?>"><?=$l_bc_1?></a> ->
			<a href="default.php?a=<?=$_GET['a']?>&b=<?=$_GET['b']?>&lang=<?=$_GET['lang']?>&type=<?=$_GET['type']?>"><?=$l_bc_2?></a> ->
			<a href="default.php?a=<?=$_GET['a']?>&b=<?=$_GET['b']?>&lang=<?=$_GET['lang']?>&type=<?=$_GET['type']?>&table=<?=$_GET['table']?>"><?=$l_bc_3?></a>
		</p>
<?
		
		
		
		
		if($_GET['table']){
			$la_aktivan = array(' (Neaktivan)', ' (Aktivan)');
			$la_bold = array('', '<b>');
			$la_bold_end = array('', '</b>');
			
			switch($_GET['type']){
				case 1:
					$x = get_data('select rbr, rbr_atribut, label, aktivan '.
						' from meta_prikaz_item '.
						' where rbr_meta_prikaz = '.$_GET['table'].
						' and rbr_atribut > 0 '.
						' order by rbr, rbr_atribut ', 1);
						
					$l_table = 'meta_prikaz_item_lang';
					break;
					
				case 2:
					$la_grupa_rbr = get_data('select meta_grupa.rbr '.
						' from meta_grupa, meta_tab '.
						' where meta_grupa.rbr_meta_tab = meta_tab.rbr '.
						' and meta_tab.rbr_meta_forma = '.$_GET['table'], 1);
					$la_gr_str = '0';
					for($i = 0; $i < sizeof($la_grupa_rbr['rbr']); $i++){
						$la_gr_str .= ', '.$la_grupa_rbr['rbr'][$i];
					}
				
					$x = get_data('select rbr, rbr_atribut, label, aktivan '.
						' from meta_item '.
						' where rbr_meta_grupa in ('.$la_gr_str.')'.
						' and rbr_atribut > 0 '.
						' order by rbr, rbr_atribut ', 1);
						
					$l_table = 'meta_item_lang';
					break;
			}
				
			$l_ima_li = get_item('select count(*) as zbr from '.$l_table.' where rbr = '.$_GET['table'].' and rbr_jezik = '.$_GET['lang']);
			if($l_ima_li){
				$y = get_data('select rbr, rbr_atribut, label '.
					' from '.$l_table.
					' where rbr = '.$_GET['table'].
					' and rbr_atribut > 0 '.
					' and rbr_jezik = '.$_GET['lang'].
					' order by rbr, rbr_atribut ', 1);
			}else{
				$y = $x;
				//print "aaaa";
			}
				
				
?>
			<form name="fjezici" method="post" action="default.php?prijevod=1">
				<input type="hidden" name="plang" value="<?=$_GET['lang']?>">
				<input type="hidden" name="ptype" value="<?=$_GET['type']?>">
				<input type="hidden" name="ptable" value="<?=$_GET['table']?>">
				<ul class="jezikMenu2">
<?
					$l_max_rbr = -1;
					for($i = 0; $i < sizeof($x['rbr']); $i++){
						if($l_max_rbr < $x['rbr_atribut'][$i]){
							$l_max_rbr = $x['rbr_atribut'][$i];
						}
?>
						<li><?=$la_bold[$x['aktivan'][$i]]?><?=$x['label'][$i]?><?=$la_bold_end[$x['aktivan'][$i]]?></li>
						<li><input type="text" name="f_<?=$y['rbr_atribut'][$i]?>" value="<?=$y['label'][$i]?>" class="input2"></li>
						<li><?=$la_aktivan[$x['aktivan'][$i]]?></li>
<?
					}
?>
				</ul>
				<input type="hidden" name="max_rbr" value="<?=$l_max_rbr?>">
				<input type="submit" value="Potvrdi">
			</form>
<?
			
		}else{
			if($_GET['type']){
				switch($_GET['type']){
					case 1:
						$x = get_data('select rbr, ime from meta_prikaz order by rbr ', 1);
						break;
						
					case 2:
						$x = get_data('select rbr, ime from meta_forma order by rbr ', 1);
						break;
				}
?>
				<ul class="jezikMenu">
<?
					for($i = 0; $i < sizeof($x['rbr']); $i++){
?>
						<li><a href="default.php?a=<?=$_GET['a']?>&b=<?=$_GET['b']?>&lang=<?=$_GET['lang']?>&type=<?=$_GET['type']?>&table=<?=$x['rbr'][$i]
							?>"><?=$x['ime'][$i]?></a></li>
<?
					}
?>
				</ul>
<?
			}else{
				if($_GET['lang']){
?>
					<p><b>Odaberite vrstu prikaza</b></p>
					<ul class="jezikMenu">
						<li><a href="default.php?a=<?=$_GET['a']?>&b=<?=$_GET['b']?>&lang=<?=$_GET['lang']?>&type=1">Index forme</a></li>
						<li><a href="default.php?a=<?=$_GET['a']?>&b=<?=$_GET['b']?>&lang=<?=$_GET['lang']?>&type=2">Podaci forme</a></li>
					</ul>
<?
				}else{
?>
					<p><b>Odaberite jezik</b></p>
					<ul class="jezikMenu">
<?
						$x = get_data('select rbr, ime from jezik where rbr <> 1 order by rbr ', 1);
						for($i = 0; $i < sizeof($x['rbr']); $i++){
?>
							<li><a href="default.php?a=<?=$_GET['a']?>&b=<?=$_GET['b']?>&lang=<?=$x['rbr'][$i]?>"><?=$x['ime'][$i]?></a></li>
<?
						}
?>
					</ul>
<?
				}
			}
		}
?>
	</div>
