<h1><?= ucfirst($this->localization['metatagi']);?>:</h1>
<?php 
	if($this->session->userdata('group') == 'admin'){
		echo '<input type="button" value="'.ucfirst($this->localization['wyczysc']).'" onClick="if(window.confirm(\''.ucfirst($this->localization['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->localization['jezyk']).': <b>'.$language['fullname'].'</b>';
		echo '<table class="news_data_table"><tr class="admin_table_header"><td>';
		echo ucfirst($this->localization['nazwa']).'</td><td>';
		echo ucfirst($this->localization['tytul']).'</td><td>';
		echo ucfirst($this->localization['slowa_kluczowe']).'</td><td>';
		echo ucfirst($this->localization['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->localization['edytuj']));
					echo '<input type="button" value="'.ucfirst($this->localization['usun']).'" onClick="if(window.confirm(\''.ucfirst($this->localization['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>