diff --git a/app/Paper/Paper.php b/app/Paper/Paper.php index 9421353..385951f 100644 --- a/app/Paper/Paper.php +++ b/app/Paper/Paper.php @@ -75,6 +75,20 @@ class Paper } } + public function saveToHistory($title, $text, $textSource, $image) + { + DB::table('history') + ->insertGetId([ + 'topic' => $title, + 'topic_slug' => str_slug($title, '_'), + 'text' => $text, + 'text_source' => $textSource, + 'icon' => $image, + 'created_at' => time(), + 'updated_at' => time() + ]); + } + public function sendPrint($title, $text = '', $image = false, $imageLocal = true) { @@ -82,6 +96,9 @@ class Paper $this->sendHeaderPrint($title); $htmlToPos = new HtmlToPos(); $convertedData = $htmlToPos->convert($text); + + //zapisuje do pamięci dane o drukowanej notatce, jesli obrazek nie jest ikoną to nie zapisuje go + $this->saveToHistory($title, $convertedData, $text, $imageLocal ? $image : ''); if (is_array($convertedData)) { $this->printer->text($convertedData['text']); } else { diff --git a/app/Paper/Traficar.php b/app/Paper/Traficar.php index ccd0fb3..74a9f09 100644 --- a/app/Paper/Traficar.php +++ b/app/Paper/Traficar.php @@ -16,7 +16,7 @@ class Traficar private $traficarJson; //dystans w kilometrach w którym auta brane są pod uwagę - const CLOSEST_DISTANCE = 2; + const CLOSEST_DISTANCE = 2.5; /** * @param $lat1