Fixed printing informations about nearest traficar car. Increased size of printed image from 300 to 370px.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user