<h1><?= ucfirst($this->site['metatagi']);?>:</h1>
<?php 
	if($this->session->userdata('group') == 'admin'){
		echo '<input type="button" value="'.ucfirst($this->site['wyczysc']).'" onClick="if(window.confirm(\''.ucfirst($this->site['czy_napewno_usunac']).'\')){window.location=\'/admin/clear_metatags/\';}">'; 
	}	
?>
<table class="table_90procent"><tr><td>
<?php
foreach($types as $type){
	echo '<h3>'.$type['name'].'</h3>';
	foreach($languages as $language){
		echo ucfirst($this->site['jezyk']).': <b>'.$language['fullname'].'</b>';
		echo '<table class="news_data_table"><tr class="admin_table_header"><td>';
		echo ucfirst($this->site['nazwa']).'</td><td>';
		echo ucfirst($this->site['tytul']).'</td><td>';
		echo ucfirst($this->site['slowa_kluczowe']).'</td><td>';
		echo ucfirst($this->site['skrocony_opis']).'</td></tr>';
		$i=0;
		foreach($metatags as $subimg){	
			if($language['idlanguages']==$subimg['idlanguages'] && $type['idmetatag_types']==$subimg['idmetatag_types']){
				echo '<tr class="data_row"><td>';	
					echo $subimg['template'];
				echo '</td><td>';	
					echo $subimg['title'];
				echo '</td><td>';	
					echo $subimg['keywords'];
				echo '</td><td>';	
					echo $subimg['shortdesc'];
				echo '</td><td>';
					echo form_open('admin/edit_metatag/'.$subimg['idmetatags']).form_submit('submit', ucfirst($this->site['edytuj']));
					echo '<input type="button" value="'.ucfirst($this->site['usun']).'" onClick="if(window.confirm(\''.ucfirst($this->site['czy_napewno_usunac']).'\')){window.location=\'/admin/delete_metatags/'.$subimg['idmetatags'].'\';}">';			
					echo form_close();
				
				echo '</td></tr>';
			}
		}
		echo '<tr class="space_row"><td></td><td></td><td></td><td></td><td></td></tr><tr><td><br/></td></tr></table>';
	}
}
?>
</td></tr></table>