<h2>Edytuj nieruchomość: <?php echo (!empty($form_values['name']) ? $form_values['name']:''); ?></h2>
<?php
    if(isset($message))
        echo '<p>'.$message.'</p>';

?>
<form action="" method="post" enctype="multipart/form-data">
    <input type="hidden" name="id" value="<?php echo $form_values['id']; ?>"/>
    <table>
        <?php
        
        if($immovable['building_type_id'] == 3)
        {?>
        <tr>
            <td>Typ działki</td>
            <td>
                <input type="text" name="plot_type" value="<?php echo (!empty($form_values['plot_type']) ? $form_values['plot_type']:''); ?>"/>
            </td>
        </tr>
        <?php } ?>
        <tr>
            <td>Lokalizacja</td>
            <td>
                <input type="text" name="localization" value="<?php echo (!empty($form_values['localization']) ? $form_values['localization']:''); ?>"/>
            </td>
        </tr>
        <tr>
            <td>Cena</td>
            <td>
                <input type="text" name="price" value="<?php echo (!empty($form_values['price']) ? $form_values['price']:''); ?>"/>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('price'); ?></td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('localization'); ?></td>
        </tr>
        <tr>
            <td>Powierchnia</td>
            <td>
                <input type="text" name="surface" value="<?php echo (!empty($form_values['surface']) ? $form_values['surface']:''); ?>"/>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('surface'); ?></td>
        </tr>
        <tr>
            <td>Pietro</td>
            <td>
                <input type="text" name="floor" value="<?php echo (!empty($form_values['floor']) ? $form_values['floor']:''); ?>"/>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('floor'); ?></td>
        </tr>
        <tr>
            <td>Ilość pokoi</td>
            <td>
                <input type="text" name="rooms" value="<?php echo (!empty($form_values['rooms']) ? $form_values['rooms']:''); ?>"/>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('rooms'); ?></td>
        </tr>
        <tr>
            <td>Powierchnia garażowa</td>
            <td>
                <input type="text" name="garage_surface" value="<?php echo (!empty($form_values['garage_surface']) ? $form_values['garage_surface']:''); ?>"/>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('garage_surface'); ?></td>
        </tr>
        <tr>
            <td>Opis</td>
            <td>
                <textarea id="description" name="description" cols="10" rows="10"><?php echo (!empty($form_values['description']) ? $form_values['description']:''); ?></textarea>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="2"><?php echo form_error('description'); ?></td>
        </tr>
        <tr>
            <td>* - pole wymagane</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>
