<h1><?= ucfirst($this->localization['galerie']);?></h1>

<form action="/admin/galleries" method="post">
    Język: <?php echo form_dropdown('lang_id', $languages, $lang_id)?> <input type="submit" name="submit" value="<?php echo $this->localization['zatwierdz']; ?>"/>
</form>

<hr class="default"/>
<table id="data_table" class="data_table dragable" data-dragurl="/admin/rearrange_galleries">
    <thead>
        <tr>
            <th width="30">Id</th>
            <th>Nazwa</th>
            <th>Kategoria</th>
            <th>Kolejność</th>
            <th width="400">Akcje</th>
        </tr>
    </thead>
    <tbody>
    <?php
        foreach($galleries as $k=>$v)
        {
            if($v['idlanguages'] != $lang_id)
                continue;

            echo '<tr id="'.$v['idgalleries'].'">';
                echo '<td>'.$v['idgalleries'].'</td>';
                echo '<td>'.$v['name'].'</td>';
                echo '<td>'.$v['category']['name'].'</td>';
                echo '<td>'.$v['showorder'].'</td>';
                echo '<td><div style="position:relative;">';
                    echo '<div style="float:left;">'.form_open('admin/show_gallery/'.$v['idgalleries'].'/'.$v['idlanguages']).form_submit('submit', ucfirst($this->localization['pokaz_zdjecia'])).form_close().'</div>';
                    echo '<div style="float:left;">'.form_open('admin/edit_gallery_language/'.$v['idgalleries_languages'].'/'.$v['idgalleries'].'/'.$v['idlanguages']).form_submit('submit', ucfirst($this->localization['edytuj'])).form_close().'</div>';
                    echo '<div style="float:left;">'.form_open('admin/add_gallery_language/'.$v['idgalleries']).form_submit('submit', ucfirst($this->localization['dodaj_wersje_jezykowa'])).form_close().'</div>';
                    
                    echo '<br /><div style="float:left;margin-top:3px;">'.form_open('admin/change_gallery_priority/'.$v['idgalleries']).form_input(array('name'=>'priority', 'size'=>'3', 'value'=>$v['showorder'])).form_submit('submit', ucfirst($this->localization['ustaw'].' '.$this->localization['kolejnosc'])).form_close().'</div>';

                    echo '<a href="/admin/delete_gallery_language/'.$v['idgalleries'].'/'.$v['idgalleries_languages'].'" class="form_button delete_link" style="position:absolute; top:0px; right:0px;">'.$this->localization['usun'].'</a>';
                echo '</div></td>';
            echo '</tr>';
        }
    ?>
    </tbody>
</table>















