<h2><?= ucfirst($this->localization['nowy_element']);?></>:</h2>
<?php
    if(isset($message))
        echo '<p>'.$message.'</p>';

?>
<form action="" method="post" enctype="multipart/form-data">
    <table>
        <tr>
            <td>Element nadrzędny</td>
            <td>
                <select name="parent_id">
                    <option value=""></option>
                    <?php
                        if(!empty($lists) && is_array($lists))
                            foreach($lists as $k=>$v)
                                echo '<option value="'.$v['id'].'" '.(($v['id'] == set_value('group_id')) ? "selected=\"selected\"":"").'>'.$v['name'].'</option>';
                    ?>
                </select>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('parent_id'); ?></td>
        </tr>

        <tr>
            <td>Nazwa</td>
            <td>
                <input type="text" name="name" value="<?php echo set_value('name') ?>"/>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('name'); ?></td>
        </tr>


        <tr>
            <td>Opis</td>
            <td>
                <textarea name="description"><?php echo set_value('description') ?></textarea>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('description'); ?></td>
        </tr>


        <tr>
            <td>Kolejność</td>
            <td>
                <input type="text" name="show_order" value="<?php echo set_value('show_order') ?>"/>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('show_order'); ?></td>
        </tr>

        <tr>
            <td>Link</td>
            <td>
                <input type="text" name="link" value="<?php echo set_value('link') ?>"/>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('link'); ?></td>
        </tr>


        <tr>
            <td>Obrazek</td>
            <td>
                <input type="file" name="image" value="<?php echo set_value('image') ?>"/>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('image'); ?></td>
        </tr>

        <tr>
            <td>Galeria</td>
            <td>
                <select name="id_galleries">
                    <option value=""></option>
                    <?php
                        if(!empty($galleries) && is_array($galleries))
                            foreach($galleries as $k=>$v)
                                echo '<option value="'.$v['idgalleries'].'" '.(($v['idgalleries'] == set_value('id_galleries')) ? "selected=\"selected\"":"").'>'.$v['title'].'</option>';
                    ?>
                </select>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('id_galleries'); ?></td>
        </tr>

        <tr>
            <td>Atrybut 1</td>
            <td>
                <input type="text" name="param1" value="<?php echo set_value('param1') ?>"/>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('param1'); ?></td>
        </tr>

        <tr>
            <td>Atrybut 2</td>
            <td>
                <input type="text" name="param2" value="<?php echo set_value('param2') ?>"/>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('param2'); ?></td>
        </tr>

        <tr>
            <td>Atrybut 3</td>
            <td>
                <input type="text" name="param3" value="<?php echo set_value('param3') ?>"/>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('param3'); ?></td>
        </tr>

        <tr>
            <td>Atrybut 4</td>
            <td>
                <input type="text" name="param4" value="<?php echo set_value('param4') ?>"/>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('param4'); ?></td>
        </tr>

        <tr>
            <td></td>
            <td><input type="submit" value="Zatwierdź"/></td>
            <td></td>
        </tr>
    </table>
</form>
<script type="text/javascript">
    window.onload = function()
    {
        var oFCKeditor = new FCKeditor( 'description' ) ;
        oFCKeditor.Height = '300' ;
        oFCKeditor.Width = '600' ;
        oFCKeditor.BasePath = "/files/fckeditor/" ;
        oFCKeditor.ReplaceTextarea() ;
    }
</script>