<h2><?= ucfirst($this->site['edycja_artykulu']);?></h2>
<table>
<?php
	echo form_open_multipart('admin/edit_article_language');
	echo form_hidden('idarticles', $idarticles);
	echo form_hidden('idarticle_languages', $idarticle_languages);
		echo '<tr><td>'.ucfirst($this->site['tytul']).': </td><td>'.form_input(array('name'=>'title', 'value'=>$title, 'size'=>'50')).'</td></tr>';
		echo '<tr><td>'.ucfirst($this->site['skrocony_tytul']).': </td><td>'.form_input(array('name'=>'seotitle', 'value'=>$titleseo, 'size'=>'50')).'</td></tr>';
		echo '<tr><td>'.ucfirst($this->site['jezyk']).': </td><td>'.form_dropdown('idlanguage', $languages, 'large').'</td></tr>';//
		echo '<tr><td>'.ucfirst($this->site['obrazek']).' 1: </td><td>'.form_upload(array('name'=>'image1')).'</td></tr>';//

        if(!empty($image1))
            echo '<tr><td></td><td><a href="" class="screenshot" rel="'.base_url().'files/img/articles/'.$image1.'" title="">'.$image1.'</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="del_image" href="/admin/del_article_image/'.$idarticles.'/1">USUŃ</a></td>';

        echo '<tr><td>'.ucfirst($this->site['obrazek']).' 2: </td><td>'.form_upload(array('name'=>'image2')).'</td></tr>';//
        
        if(!empty($image2))
            echo '<tr><td></td><td><a href="'.base_url().'files/img/articles/'.$image2.'" class="screenshot" rel="'.base_url().'files/img/articles/'.$image2.'" title="">'.$image2.'</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="del_image" href="/admin/del_article_image/'.$idarticles.'/2">USUŃ</a></td>';

        echo '<tr><td>'.ucfirst($this->site['lista']).': </td><td>'.form_dropdown('idlists', $list, 'large').'</td></tr>';//



		echo '<tr><td>'.ucfirst($this->site['tresc']).': </td><td>'.form_textarea(array('name'=>'artcontent', 'value'=>$content)).'</td></tr>';
		echo '<tr><td>'.ucfirst($this->site['skrocony_opis']).': </td><td>'.form_textarea(array('name'=>'shortdesc', 'value'=>$shortdesc)).'</td></tr>';
		echo '<tr><td>'.ucfirst($this->site['slowa_kluczowe']).': </td><td>'.form_input(array('name'=>'keywords', 'value'=>$keywords, 'size'=>'180')).'</td></tr>';
		echo '<tr><td>Abstract: </td><td>'.form_input(array('name'=>'abstract', 'value'=>$abstract, 'size'=>'180')).'</td></tr>';
		echo '<tr><td>Subject: </td><td>'.form_input(array('name'=>'subject', 'value'=>$subject, 'size'=>'180')).'</td></tr>';
		echo '<tr><td>Topic: </td><td>'.form_input(array('name'=>'topic', 'value'=>$topic, 'size'=>'180')).'</td></tr>';
		echo '<tr><td>'.ucfirst($this->site['prawa_autorskie']).': </td><td>'.form_input(array('name'=>'copyrights', 'value'=>$copyrights, 'size'=>'50')).'</td></tr>';
		echo '<tr><td>URL: </td><td>'.form_input(array('name'=>'friendlyurl', 'value'=>$friendlyurl, 'size'=>'50')).'</td></tr>';
		echo '<tr><td>'.ucfirst($this->site['cos_jeszcze']).': </td><td>'.form_textarea(array('name'=>'additional_data', 'value'=>$additional_data)).'</td></tr>';
		echo '<tr><td>'.ucfirst($this->site['aktywny']).': </td><td>'.form_checkbox('active', '1', $active).'</td></tr>';//	
		echo '<tr><td></td><td>'.form_submit('submit', ucfirst($this->site['wyslij'])).'</td></tr>';
	echo form_close();
?>
	<script type="text/javascript">
		window.onload = function()
		{
            var oFCKeditor = new FCKeditor( 'artcontent' ) ;
            oFCKeditor.Height = '300';
            oFCKeditor.BasePath = "/files/fckeditor/" ;
            oFCKeditor.ReplaceTextarea();
		}
        $(document).ready(function(){
           $("a.del_image").click(function(){
                var link = $(this).attr('href');
                var anhor =$(this);
                $.ajax({url:link,success:function(data){
                    if(data == 1)
                        anhor.parent().html('');
                    else
                        alert("wystąpił błąd");
                }});
                return false;
           });
        });
	</script>
</table>