Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include(dirname(dirname(__FILE__)).'/include/commonInclude.inc.php');
- include(dirname(dirname(__FILE__)).'/include/htmlHeader.inc.php');
- $popup = htmlspecialchars($biuro->pobierzArgument('popup', FALSE, 'string'));
- if ($popup != 'yes')
- include(dirname(dirname(__FILE__)).'/include/header.inc.php');
- /* -------- Warstwa danych ------- */
- $nr_oferty = htmlspecialchars($biuro->pobierzArgument('nr', FALSE, 'string'));
- //echo $nr_oferty;
- if (!nr_oferty or $nr_oferty != '' or $nr_oferty != null) {
- $wynik = strtr($nr_oferty, 'ĘÓˇ¦ŁŻ¬Ńę󱶳żĽćń', 'EOASLZZCNeoaslzzcn');
- $sql = "select Id from Oferta where Numer='" . mysql_escape_string($wynik)."'";
- //echo $sql;
- if (!$result = mysql_query($sql)){
- // echo "błąd";
- }
- if (!$row = mysql_fetch_row($result)) { //echo "brak wynikow";
- } // else { //echo "oferta jest:".$row[0];
- // }
- }
- if (!$nr_oferty)
- $oferta_id = $biuro->pobierzArgument('oferta', FALSE, 'int');
- else
- $oferta_id = $row[0];
- if (!$oferta_id) {
- header("HTTP/1.0 404 Not Found");
- ?>
- <div id="main">
- <div class="row">
- <div class="span9">
- <h1 class="page-header">Nie ma takiej oferty</h2>
- <div class="property-detail">
- Przepraszamy, ale nie mamy oferty o podanej nazwie. Skorzystaj z bocznej wyszukiwarki ofert i znać nieruchomość dla Siebie.
- </div>
- </div>
- <div class="span3">
- <?php include '_parts/search.php'; ?>
- </div>
- </div>
- </div>
- <?php
- } else {
- $ofertaDane = array();
- $oferta = new Oferta($biuro, $oferta_id);
- $ofertaDane['dane'] = $oferta->pobierz();
- $kategoria = new Kategoria($biuro, $oferta->pobierzIdKategorii());
- $kategoria_id=$oferta->pobierzIdKategorii();
- $ofertaDane['nazwaKategorii'] = $kategoria->pobierzNazwe();
- $makler_id = $oferta->pobierzIdMaklera();
- $ofertaDane['makler'] = array();
- if ($makler_id)
- {
- $makler = new Makler($biuro, $makler_id);
- $ofertaDane['makler'] = $makler->pobierz();
- }
- $ofertaDane['cechyPodstawowe'] = array();
- foreach ($oferta->pobierzWartosciCech(7) as $cecha_id => $wartosc)
- if ($wartosc . '' != '')
- $ofertaDane['cechyPodstawowe'][$biuro->pobierzTlumaczenie($cecha_id, false,
- 'Cecha')] = $wartosc;
- $ofertaDane['cechyPozostale'] = array();
- foreach ($oferta->pobierzPozostaleWartosciCech(7) as $cecha_id => $wartosc)
- if ($wartosc . '' != '')
- $ofertaDane['cechyPozostale'][$biuro->pobierzTlumaczenie($cecha_id, false,
- 'Cecha')] = $wartosc;
- $grafika = $oferta->pobierzGrafikeTytulowa();
- if (is_object($grafika))
- {
- $ofertaDane['grafika'] = $grafika->pobierzAdres(true);
- }
- $zdjecia = $biuro->pobierzArgument('zdjecia', 'miniaturki', 'char');
- if ($zdjecia != 'brak')
- {
- $ofertaDane['grafiki'] = array();
- $grafiki = $oferta->pobierzGrafiki();
- }
- if (!is_array($grafiki))
- $grafiki = array();
- $ofertaDane['liczbaGrafik'] = count($grafiki);
- $licznik = 0;
- foreach ($grafiki as $row)
- {
- if (!$licznik)
- {
- $licznik++;
- $tytulowa = $row->pobierzId();
- }
- $ofertaDane['grafiki'][$row->pobierzId()]['adres'] = $row->pobierzAdres($zdjecia ==
- 'miniaturki');
- $ofertaDane['grafiki'][$row->pobierzId()]['szerokosc'] = $row->pobierzSzerokosc($zdjecia ==
- 'miniaturki');
- $ofertaDane['grafiki'][$row->pobierzId()]['wysokosc'] = $row->pobierzWysokosc($zdjecia ==
- 'miniaturki');
- }
- // zbieramy statystyki klikniec w oferte
- $data = date('Y-m-d, H-i-s');
- // metoda wartoscCechyOferty - mozna jej uzyc do sprawdzenia czy oferta jest specjalna, ustawiajac cecha_id na 307, zwroci TAK/NIE
- $czyspecjalna = $biuro->wartoscCechyOferty($biuro->pobierzArgument('oferta'),'307');
- if($czyspecjalna == '') {$czyspecjalna = 'NIE';}
- $biuro->insertStats($ofertaDane['dane']['Numer'],$ofertaDane['dane']['Kategoria_Id'],$data,$czyspecjalna);
- $biuro->zwiekszLiczbeOdslon($ofertaDane['dane']['Numer']);
- $biuro->ostatnioPrzegladane($oferta_id); // dodaje do cookie jesli nie byla juz przegladana
- $video = $oferta->pobierzVideo($ofertaDane['dane']['Numer']);
- /* -------- Warstwa danych ------- */
- $street = $streetGmaps = $ofertaDane['cechyPodstawowe']['ulica'];
- //unset($ofertaDane['cechyPodstawowe']['ulica']);
- $ofnr = $ofertaDane['dane']['Numer'];
- unset($ofertaDane['dane']['Numer']);
- $cityName = $cityGmaps = $ofertaDane['cechyPodstawowe']['miejscowość'];
- //$cityName='<a href="'.seo::link("lista_ofert_prop",array("kategoria"=>$kategoria_id),array("prop_id_48"=>$cityName)).'">'.$cityName.'</a>';
- unset($ofertaDane['cechyPodstawowe']['miejscowość']);
- $district = $districtGmaps = $ofertaDane['cechyPodstawowe']['dzielnica - osiedle'];
- unset($ofertaDane['cechyPodstawowe']['dzielnica - osiedle']);
- if($district != '') {$cityName .= ', '.$district;}
- $stretch = $ofertaDane['cechyPodstawowe']['pow. całkowita [m²]'];
- unset($ofertaDane['cechyPodstawowe']['pow. całkowita [m²]']);
- // dla działki...
- if($stretch == '') {$stretch = $ofertaDane['cechyPodstawowe']['pow. działki [m²]']; unset($ofertaDane['cechyPodstawowe']['pow. działki [m²]']);}
- $price = $ofertaDane['cechyPodstawowe']['cena ofertowa PLN'];
- unset($ofertaDane['cechyPodstawowe']['cena ofertowa PLN']);
- if($price == '') {$price = $ofertaDane['cechyPodstawowe']['czynsz ofertowy PLN'];} // cena dla wynajem
- $price1m = $ofertaDane['cechyPodstawowe']['cena ofertowa za 1 m2'];
- unset($ofertaDane['cechyPodstawowe']['cena ofertowa za 1 m2']);
- if($price1m == '') {$price1m = $ofertaDane['cechyPodstawowe']['czynsz ofertowy za 1m2'];} // cena 1m2 dla wynajem
- //if($street != '') {$city .= ', '.$street;}
- //echo $city;
- $info = array();
- if ($stretch !='') {
- $info[] = array('powierzchnia', $stretch . 'm<sup>2</sup>');
- }
- if ($ofertaDane['cechyPodstawowe']['liczba pokoi']!='') {
- $info[] = array('ilość pokoi', $ofertaDane['cechyPodstawowe']['liczba pokoi']);
- unset($ofertaDane['cechyPodstawowe']['liczba pokoi']);
- }
- if ($ofertaDane['cechyPodstawowe']['piętro']!='') {
- $info[] = array('piętro', ($ofertaDane['cechyPodstawowe']['piętro']==0 ? 'parter' : $ofertaDane['cechyPodstawowe']['piętro']));
- unset($ofertaDane['cechyPodstawowe']['piętro']);
- }
- //debug($ofertaDane);
- if (!$video){
- if (preg_match('#([[:space:]]|[/])((www\.)?youtube\.com/watch\?v=|youtu.be\/)([^[:space:]&]+)#si',str_replace('<br />',"\n<br />\n",str_replace(array('<br>','<br/>'),'<br />',$ofertaDane['dane']['Opis'])),$out)){
- //parse_str( parse_url( $arr['video_url'], PHP_URL_QUERY ), $yt_vars );
- $yt_vars['v']=$out[4];
- $code = '<iframe class="youtube-player" type="text/html" width="360" height="230" src="http://www.youtube.com/embed/'.$yt_vars['v'].'?wmode=opaque" frameborder="0"></iframe>';
- //obejście na przyklejone menu (warstwa trzyma się dzięki temu ładnie na swoim miejscu)
- $code='<div style="height:230px">
- <div style="position:absolute;z-index:100">
- <object width="360" height="230">
- <param name="movie" value="http://www.youtube.com/v/'.$yt_vars['v'].'?version=3&autoplay=0&fs=1"></param>
- <param name="allowScriptAccess" value="always"></param>
- <param name="allowFullScreen" value="true"></param>
- <param name="wmode" value="opaque"></param>
- <embed wmode="opaque" src="http://www.youtube.com/v/'.$yt_vars['v'].'?version=3&autoplay=0&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="360" height="230"></embed>
- </object>
- </div></div>';
- $video=$code;
- }
- //youtube.com/watch?v=tovinPXgGds&feature=youtu.be
- }
- $properties = array();
- $daneOferty = $ofertaDane['cechyPodstawowe'] + $ofertaDane['cechyPozostale'];
- foreach ($daneOferty as $key => $row) {
- if (
- !$key ||
- preg_match('/numer|usd|euro|biuro wprow|agent|waluta wio/', $key) ||
- !$row ||
- $row === '0' ||
- $row === '0.0000' ||
- $row === '0000-00-00 00:00:00'
- ) {
- continue;
- }
- if (is_numeric($row)){
- $row=round($row,2);
- $srow=(string)$row;
- if (strpos($srow,'.')===false){
- $row=number_format($row,0,',',' ');
- } else {
- $row=number_format($row,2,',',' ');
- }
- }
- $key = mb_strtolower($key,"UTF-8");
- switch ($key) {
- case 'cena ofertowa euro':
- $row = '€ '.$row;
- break;
- case 'cena ofertowa usd':
- $row = '$ '.$row;
- break;
- case 'numer licencji':
- case 'rok budowy':
- $row = str_replace(' ', '', $row);
- break;
- case 'data wprowadzenia':
- $row = explode(" ",$row);
- $row = $row[0];
- break;
- case 'cena ofertowa pln':
- case 'czynsz ofertowy pln':
- case 'czynsz dla spółdz./wspólnoty':
- case 'czynsz ofertowy za 1m2':
- case 'cena ofertowa za 1m2':
- $key = str_replace(' 1m2', ' 1m<sup>2</sup>', $key);
- $row .= ' zł';
- break;
- case 'data zaznaczenia do e-net':
- case 'status oferty':
- case 'kraj':
- unset($row);
- break;
- }
- $row = preg_replace('/,$/', '', $row);
- if (!$row) {
- continue;
- }
- $properties[$key] = $row;
- }
- /* ----- Warstwa prezentacji ----- */
- ?>
- <? $kategoria = explode('/', $ofertaDane['nazwaKategorii']); ?>
- <div id="main">
- <div class="row">
- <div class="span9">
- <h1 class="page-header">Oferta nr <?= $ofnr ?> - <?= $kategoria[0] . ' / ' . $kategoria[1]; ?></h1>
- <? /* Mobile karuzela obrazkow. BxSlider. */ ?>
- <style>
- @media (min-width: 168px){
- .carousel-mobile{
- display: none
- }
- }
- @media (max-width: 167px){
- .carousel.property
- {
- display: none
- }
- }
- </style>
- <div class="carousel-mobile">
- <div class="container" style="width:100%">
- <div class="slider">
- <div class="slider__wrapper">
- <div class="slide">
- <ul class="bxslider" style="width:100%">
- <?php foreach ($ofertaDane['grafiki'] as $key => $row): ?>
- <li<?= !$key ? ' class="active"' : ''; ?>>
- <img src="<?= $row['adres']; ?>" rel="<?= str_replace('thumbs/','', $row['adres']); ?>" alt="" class="slide__img" />
- </li>
- <? endforeach; ?>
- </ul>
- </div>
- </div>
- </div>
- <script src="./scriptkar.js"></script>
- </div>
- </div>
- <? /* Karuzela mobilna end */ ?>
- <?php if (!empty ($ofertaDane['grafiki'])): ?>
- <div class="carousel property">
- <div class="preview" style="overflow: hidden; text-align: center;">
- <a href="<?= str_replace('thumbs/','', $ofertaDane['grafika']); ?>" rel="prettyPhoto[gallery]">
- <img src="<?= str_replace('thumbs/','', $ofertaDane['grafika']); ?>" alt="" rel="prettyPhoto[gallery]" style="width: 100%;" class="slide__img" >
- </a>
- </div>
- <div class="content">
- <a class="carousel-prev" href="#">Poprzednia</a>
- <a class="carousel-next" href="#">Następna</a>
- <ul>
- <?php foreach ($ofertaDane['grafiki'] as $key => $row): ?>
- <li<?= !$key ? ' class="active"' : ''; ?>>
- <a href="<?= str_replace('thumbs/','', $row['adres']); ?>" rel="prettyPhoto[gallery]"><img src="<?= $row['adres']; ?>" data-large="<?= str_replace('thumbs/','', $row['adres']); ?>" alt="" /></a>
- </li>
- <? endforeach; ?>
- </ul>
- </div>
- </div>
- <?php endif; ?>
- <div class="property-detail">
- <div class="pull-left overview">
- <div class="row">
- <div class="span3">
- <h2>Dane oferty</h2>
- <table>
- <tr>
- <th>Cena:</th>
- <td><?= $price; ?> zł</td>
- </tr>
- <?php foreach ($info as $i => $data): if (!$data) { continue; } ?>
- <tr>
- <th><?= $data[0]; ?>:</th>
- <td><?= $data[1]; ?></td>
- </tr>
- <?php endforeach; ?>
- <tr>
- <th>miejscowość:</th>
- <td><?= $cityName; ?></td>
- </tr>
- <?php foreach ($ofertaDane['cechyPodstawowe'] as $key => $value): if (!$value) { continue; } ?>
- <tr>
- <th><?= $key; ?>:</th>
- <td><?= $value; ?></td>
- </tr>
- <?php endforeach; ?>
- </table>
- </div>
- <!-- /.span2 -->
- </div>
- <!-- /.row -->
- </div>
- <p><?= preg_replace('#(((http://)|[[:space:]])(([a-zA-Z0-9\._-]+)\.[a-zA-Z]{2,}[/]([a-zA-Z0-9/\?=&%\._-]*)))#si','<a class="new-window" rel="nofolow" href="http://\4">\1</a>',str_replace('<br />',"\n<br />\n",str_replace(array('<br>','<br/>'),'<br />',str_replace("\n","<br />",str_replace(array("\n\r","\r\n","\r"),"\n",$ofertaDane['dane']['Opis'])))));?></p> <br><br>
- <div class="share-box">
- Podziel się:
- <!-- AddThis Button BEGIN -->
- <div class="addthis_toolbox addthis_default_style ">
- <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
- <a class="addthis_button_tweet"></a>
- <a class="addthis_button_pinterest_pinit"></a>
- <a class="addthis_counter addthis_pill_style"></a>
- </div>
- <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-51fbda3937261f34"></script>
- <!-- AddThis Button END -->
- </div>
- <h2 style="clear: both;">Więcej informacji</h2>
- <div class="row">
- <?php $properties = array_chunk ($properties, ceil (count ($properties) / 4), 1); ?>
- <?php foreach ($properties as $column): ?>
- <ul class="span2">
- <?php foreach ($column as $key => $value): ?>
- <li class="checked"><?= $key; ?>: <span><?= $value; ?></span></li>
- <?php endforeach; ?>
- </ul>
- <?php endforeach; ?>
- </div>
- <?php include '_offermod/mapa.php'; ?>
- </div>
- </div>
- <div class="sidebar span3">
- <?php if (!empty($ofertaDane['makler'])): ?>
- <div class="widget our-agents">
- <div class="title">
- <h2>Dane agenta</h2>
- </div>
- <div class="content">
- <div class="agent">
- <?php if (!empty($ofertaDane['makler']['ImageSource'])): ?>
- <div class="image">
- <img src="/images/agents/<?= $ofertaDane['makler']['ImageSource']; ?>" alt="">
- </div>
- <?php endif; ?>
- <div class="name"><?= $ofertaDane['makler']['ImieNazwisko']; ?></div>
- <div class="phone"><?= $ofertaDane['makler']['GaduGadu']; ?></div>
- <div class="phone"><?= $ofertaDane['makler']['Telefon']; ?></div>
- <div class="email"><a href="<?= $ofertaDane['makler']['Email']; ?>"><?= $ofertaDane['makler']['Email']; ?></a></div>
- </div>
- </div>
- </div>
- <?php endif; ?>
- <div class="widget contact">
- <div class="title">
- <h2 class="block-title">Kontakt</h2>
- </div><!-- /.title -->
- <div class="content">
- <form action="#" enctype="multipart/form-data" method="post" id="contact_form2">
- <div class="name control-group">
- <label class="control-label" for="qc_topic">
- Temat
- <span class="form-required" title="Pole wymagane">*</span>
- </label>
- <div class="controls">
- <input type="text" id="qc_topic" name="qc_topic" readonly value="Pytanie o ofertę nr: <?= $ofnr; ?>">
- </div><!-- /.controls -->
- </div><!-- /.control-group -->
- <div class="control-group">
- <label class="control-label" for="qc_email">
- Email
- <span class="form-required" title="Pole wymagane">*</span>
- </label>
- <div class="controls">
- <input type="text" id="qc_email" name="qc_email">
- </div><!-- /.controls -->
- </div><!-- /.control-group -->
- <div class="control-group">
- <label class="control-label" for="qc_text">
- Wiadomość
- <span class="form-required" title="Pole wymagane">*</span>
- </label>
- <div class="controls">
- <textarea id="qc_text" name="qc_text"></textarea>
- </div><!-- /.controls -->
- </div><!-- /.control-group -->
- <div class="control-group">
- <input type="checkbox" name="ia" id="qc_ia" value="1" /> Wyrażam zgodę na przetwarzanie moich danych osobowych.
- </div>
- <div class="form-actions">
- <p class="msg"></p>
- <input type="submit" class="btn btn-primary arrow-right" value="Wyślij">
- </div><!-- /.form-actions -->
- </form>
- </div><!-- /.content -->
- </div>
- <div class="widget contact">
- <div class="title">
- <h2 class="block-title">Opcje oferty</h2>
- </div><!-- /.title -->
- <div class="content">
- <a id="notesik_<?= $ofertaDane['dane']['Id']; ?>" href="#" onclick="operacjListaNotatnikuUsun(<?= $ofertaDane['dane']['Id']; ?>);return false;" class="send-friend notes-list-del" title="Usuń z notesu"<?= $biuro->czyOfertaWNotesie($ofertaDane['dane']['Id']) ? '' : ' style="display: none;"'; ?>>Usuń z notesu</a>
- <a id="notesik_<?= $ofertaDane['dane']['Id']; ?>" href="#" onclick="operacjListaNotatnikuDodaj(<?= $ofertaDane['dane']['Id']; ?>);return false;" class="send-friend notes-list-add" title="Dodaj do notesu"<?= $biuro->czyOfertaWNotesie($ofertaDane['dane']['Id']) ? ' style="display: none;"' : ''; ?>>Dodaj do notesu</a>
- <br />
- <a href="/wyslij_oferte.php?oferta=<?php echo $oferta->pobierzId(); ?>&tryb=<?= $_REQUEST['tryb']; ?>"><span></span>Wyślij ofertę na email</a><br />
- <a class="popup" href="/kalkulator_oplat_dodatkowych.php?cena=<?= trim(str_replace(" ","",$price)); ?>#?custom=true&width=480&height=500"><span></span>Kalkulator opłat dodatkowych</a><br />
- <a href="#" onclick="window.open('/oferta_druk.php?oferta=<?php echo $ofertaDane['dane']['Id']; ?>&styl=druk&zdjecia=powiekszenia', '_blank', 'width=800,height=600,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes'); return false;" title=""><span></span>Drukuj ofertę ze zdjęciami</a><br />
- <a href="#" onclick="window.open('/oferta_druk.php?oferta=<?php echo $oferta_id; ?>&styl=druk&zdjecia=miniatury', '_blank', 'width=800,height=600,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes'); return false;" title=""><span></span>Drukuj ofertę z miniaturami</a><br />
- <a href="#" onclick="window.open('/oferta_druk.php?oferta=<?php echo $oferta_id; ?>&styl=druk&zdjecia=brak', '_blank', 'width=800,height=600,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes'); return false;" title=""><span></span>Drukuj ofertę bez zdjęć</a><br />
- </div>
- </div>
- </div>
- </div>
- </div>
- <?php } ?>
- <?php
- if ($_REQUEST['popup'] != 'yes')
- include(dirname(dirname(__FILE__)).'/include/footer.inc.php');
- seo::meta("title",$cityGmaps.' - '.ucwords(str_replace("/"," / ",$ofertaDane['nazwaKategorii']))." - ".NCMS_SITE_NAME." ");
- seo::meta("description",$ofertaDane['dane']['Opis']);
- seo::meta('keywords',$ofertaDane['cechyPodstawowe']['miejscowość'].', '.$ofertaDane['cechyPodstawowe']['PAŃSTWO'].', '.seo::meta('keywords'));
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement