<?php if(!empty($nowelty))
{
?>

    <?php if (strtolower($lang['shortname'])=="pl") { ?>
        <div class="title"><img src="/files/img/articles/nieruchomosci/najnowsze_oferty_title_pl.png" height="40" width="171" alt="Najnowsze oferty" /></div>
    <?php } else if (strtolower($lang['shortname'])=="en") { ?>
        <div class="title"><img src="/files/img/articles/nieruchomosci/najnowsze_oferty_title_en.png" height="40" width="171" alt="Newest properties" /></div>
     <?php } ?>
<? }
    else {
        if(!empty($immovables[0]))
            echo '<h2>'.ucfirst($this->site[$immovables[0]['offer_type']]).' | '.ucfirst($this->site[$immovables[0]['building_type']]).'</h2>';
    }
?>
<div class="content">
<?php

    if(!empty($immovables) && is_array($immovables))
    {
   
        foreach($immovables as $k=>$v)
        {
            ?>
                <div class="general_offer_box">
                    <div class="general_offer_image shadow">
                        <?php
                            if(!empty($v['images']))
                            {
                                $imgPath = '/files/img/galleries/'.$v['gallery_id'].'/'.$v['images'][0]['path'];
                                list($width, $height, $type, $attr) = getimagesize(substr($imgPath, 1));
                                echo '<img src="'.$imgPath.'" width="258" height="175" alt="" />';
                            }
                        ?>
                    </div>
                    <div class="general_offer_info">
                    <?php

                        if(!empty($v['localization']))
                            echo '<p class="big_brown">'.$v['localization'].'</p>';

                        if(!empty($v['price']))
                            echo '<p>'.ucfirst($this->site['cena']).': <b>'.$v['price'].'</b></p>';

                        if(!empty($v['surface']))
                            echo '<p>'.ucfirst($this->site['powierzchnia']).': <b>'.$v['surface'].'</b></p>';

                        if(!empty($v['floor']))
                            echo '<p>'.ucfirst($this->site['pietro']).': <b>'.$v['floor'].'</b></p>';

                        if(!empty($v['rooms']))
                            echo '<p>'.ucfirst($this->site['ilosc_pokoi']).': <b>'.$v['rooms'].'</b></p>';

                        if(!empty($v['garage_surface']))
                            echo '<p>'.ucfirst($this->site['powierzchnia_garazowa']).': <b>'.$v['garage_surface'].'</b></p>';
                    ?>
                    <?php echo '<br/><br/>'.word_limiter($v['description'],50); ?>
                    </div>
                    <a href="/<?php echo strtolower($lang['shortname']).'/'.url_title($this->site['nieruchomosc']).'/'.$v['id'].'.html' ?>" class="offer_details_link"><?php echo ucfirst($this->site['szczegoly_oferty']); ?> >></a>
                </div>
            <?php
        }
    }
?>
    <br class="clear"/><br/>
</div>
