getMessage(); } $dbh->exec('SET NAMES utf8'); $html = ''; if(isset($_GET['id']) && !empty($_GET['id']) && is_numeric($_GET['id'])){ $sql = 'SELECT * FROM `car_offers` WHERE `id`='.$_GET['id'].' AND `active`=1 LIMIT 1;'; $sth = $dbh->prepare($sql); $sth->execute(); $car = $sth->fetch(PDO::FETCH_ASSOC); if($car && !empty($car)){ $gallery = ''; $json = file_get_contents(LIST_SERVICE.'?id='.$car['id']); if ($photos = json_decode($json)){ if(is_array($photos) && !empty($photos)){ shuffle($photos); foreach($photos as $index => $photo){ if($index == 0){ $gallery .= ''; }else{ if($index == 1){ $gallery .= '
';
$html .= ' ';
$html .= $gallery;
$html .= ' ';
$html .= '
| ';
$html .= '||||||||||||||||
Opis | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
'.nl2br($car['description']).' | ||||||||||||||||
Wyposażenie | ||||||||||||||||
'.nl2br($car['equipment']).' |
Zdjęcie | '; $html .= 'Marka | '; $html .= 'Model | '; $html .= 'Rok produkcji | '; $html .= 'Silnik | '; $html .= 'Przebieg | '; $html .= 'Cena brutto | '; $html .= '
---|---|---|---|---|---|---|
'.$photo.' | '; $html .= ''.$car['brand'].' | '; $html .= ''.$car['model'].' | '; $html .= ''.$car['production_year'].' | '; $html .= ''.$car['engine'].' | '; $html .= ''.$car['mileage'].' | '; $html .= ''.$car['price'].' PLN | '; $html .= '
Warszawa
ul. Fort Wola 22
01-258
Biuro otwarte 7-19
Warszawa
ul. Goplańska 7A
02-954
Warszawa
ul. Ostrobramska 73b
04-175
Kraków
ul. Głowackiego 56
30-085
Katowice
ul. Leopolda 15
40-189