<?php

	if(isset($filters)){
		print $this->Html->css('filter_side', null, array('inline' => false));
?>
		<div id="filters" class="open">
<?php
				$l_form = $this->Form->create('Filter', array('url' => $this->action, 'id' => (!empty($dom_id_form) ? $dom_id_form : 'filter-form'), 'class' => 'filter-form'));
				$l_form = str_replace(' action=', 'onsubmit="return false;" action=', $l_form);
				print $l_form;
				
				foreach($filters as $filter => $options):
						echo $this->Form->input($filter, $options['form_options']);
				endforeach;
				
				$l_submit = $this->Form->submit(__('Search', true));
				$l_submit = str_replace('<input ', '<input onclick="submit_report('.$l_rbr_report.'); return false;" ', $l_submit);
				print $l_submit;
?>
			<?/*?>
			<div class="reset"><?php echo $this->Form->button(__('Reset', true), array('type' => 'reset', 'id' => 'filter-reset')); ?></div>
			<?*/?>
			<?php echo $this->Form->end(); ?>
			<div class="clear"></div>
		</div>
<?
	}else{
		
		if(strstr($_SERVER['QUERY_STRING'], '/kolicina_materijala_po_stolovima')){
			
			$l_brisanje_stolova = '<br><br><br><input type="submit" onclick="brisanje_stolova(); return false;" value="Isprazni stolove">';
			
			print "<br><br><br><br><br><center>";
			$l_submit = $this->Form->submit(__('Izradi izvješće', true));
			$l_submit = str_replace('<input ', '<input onclick="submit_report('.$l_rbr_report.'); return false;" ', $l_submit);
			print $l_submit.$l_brisanje_stolova."</center><br><br>";
			
			//print_r($_SERVER);
		}
		
		
	}
?>