<h1><?= ucfirst($this->localization['newsy']);?></h1>
<table class="table_90procent"><tr><td>
	
<?php
	foreach($newses as $news){
		echo '<table class="table_100procent"><tr>';
		echo '<td>News: <b>['.$news['idnewses'].']</b></td><td>'.form_open('admin/add_news_language/'.$news['idnewses']).form_submit('submit', ucfirst($this->localization['dodaj_wersje_jezykowa'])).form_close().'</td><td>'.form_open('admin/change_news_priority/'.$news['idnewses']).form_input(array('name'=>'priority', 'size'=>'3', 'value'=>$news['showorder'])).form_submit('submit', ucfirst($this->localization['ustaw'].' '.$this->localization['kolejnosc'])).form_close().'</td></tr></table>';
		$have_versions = 0;
		foreach($news_languages as $news_language){	
			if($news_language['idnewses']==$news['idnewses']){
				$have_versions = 1;
				break;
			}
		}
		if($have_versions){
				echo '<table class="news_data_table"><tr class="admin_table_header"><td>';
				echo ucfirst($this->localization['wyswietlana_nazwa']);
				echo '</td><td>';	
				echo ucfirst($this->localization['jezyk']);
				echo '</td></tr>';
				
				foreach($news_languages as $news_language){	
					if($news_language['idnewses']==$news['idnewses']){
						echo '<tr class="data_row"><td><b>';
							echo '<a href="/frontsite/show_news/'.$news_language['friendlyurl'].'-'.$news_language['idnews_languages'].'.html" target="_blank">'.$news_language['title'].'</a>';
						echo '</b></td><td>';	
							echo $news_language['fullname'];
						echo '</td><td>';	
							echo form_open('admin/edit_news_language/'.$news_language['idnews_languages']).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_news_language/'.$news_language['idnewses'].'/'.$news_language['idnews_languages'].'\';}">';
							echo form_close();
						//echo '</td><td>';							
						//-------------------
						echo '</td></tr>';	
					}
				}
				echo '<tr class="space_row"><td></td><td></td><td></td></tr><tr><td><br/></td></tr></table>';
			}
	}	
?>
</td></tr></table>