<h1><?= ucfirst($this->site['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->site['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->site['ustaw'].' '.$this->site['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->site['wyswietlana_nazwa']);
				echo '</td><td>';	
				echo ucfirst($this->site['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->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_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>