Nearest traficar inforations.

This commit is contained in:
kplaczek
2018-07-04 20:57:28 +02:00
parent db3f7772a6
commit b4aa26ee17
4 changed files with 114 additions and 11 deletions

View File

@@ -109,13 +109,10 @@ class Main extends Controller
// Header("Content-type: image/png");
imagepng($output, $fileName, 9); //to print to screen
$connector = new FilePrintConnector("/dev/usb/lp0");
$printer = new Printer($connector);
$img = EscposImage::load($fileName, false);
$printer->bitImage($img);
$this->paper->getPrinter()->bitImage($img);
$printer->feed(4);
$this->paper->getPrinter()->feed(4);
return back();
}
@@ -152,13 +149,15 @@ class Main extends Controller
return back();
}
public function printNote($noteId){
public function printNote($noteId)
{
$note = DB::table('note')->where('id', $noteId)->first();
$this->paper->sendPrint($note->topic, $note->text, $note->icon);
return $note;
}
public function noteLast(){
public function noteLast()
{
$note = DB::table('note')->orderBy('id', 'desc')->first();
$this->printNote($note->id);
}