Fixed printing informations about nearest traficar car. Increased size of printed image from 300 to 370px.

This commit is contained in:
kplaczek
2018-08-12 12:21:16 +02:00
parent 7a5e7a5d9d
commit 23220819d5
5 changed files with 31 additions and 29 deletions

View File

@@ -79,23 +79,12 @@ class HtmlToPos
public function traficar($posText)
{
$data = $posText;
if (strstr($posText, '[traficar]')) {
$data = [];
$traficar = new Traficar();
$nearest = $traficar->nearestCar();
$data['text'] = "Najbliższy traficar:\n" .
'Model: ' . $nearest['car']['model'] . "\n" .
'Numer boczny: ' . $nearest['car']['orderNumber'] . "\n" .
'Rejestracja: ' . $nearest['car']['regNumber'] . "\n" .
'Lokalizacja: ' . $nearest['car']['location'] . "\n" .
'Odległość: ' . $nearest['distance'] . "km\n";
// $data['image'] = $nearest['imageName'];
// $data['image'] = 'https://staticmapmaker.com/img/cartodb_placeholder.png';
$nearest = $traficar->nearestCarText();
$posText = str_replace('[traficar]', $nearest, $posText);
}
return $data;
return $posText;
}