<?php   require __DIR__ . '../autoload.php';  // include_once('../db.php');  include_once('../check.php');  

       use Mike42\Escpos\Printer;
       use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;
       use Mike42\Escpos\PrintConnectors\DummyPrintConnector;
       /* use Mike42\Escpos\PrintConnectors\FilePrintConnector; */


   //  try {
              //  $connector = new WindowsPrintConnector("POS80");
                $connector = new Mike42\Escpos\PrintConnectors\DummyPrintConnector;
                $printer = new Printer($connector);
    
                $date = "Monday 6th of April 2015 02:56:25 PM";

                /* Header */
                $printer -> setJustification(Printer::JUSTIFY_CENTER);
                $printer -> selectPrintMode(Printer::MODE_DOUBLE_WIDTH);
                $printer -> text(" PALS MATATU SACCO \n");
                $printer -> selectPrintMode();
                $printer -> text(" EMAIL: palsmatatusacco@gmail.com !\n ");
                $printer -> text(" PHONE: 0701417861 \n ");
                $printer -> feed(1);
    
                /* Title of receipt */
                $printer -> setEmphasis(true);
                $printer -> text("SAVINGS \n");
                $printer -> setEmphasis(false);
                $printer -> feed(1);
        
                /*  RECEIPT BODY  */
                $printer -> setJustification(Printer::JUSTIFY_LEFT);
                $printer -> text(" PAYEE: 0701417861 \n ");
                $printer -> feed(1);
                $printer -> text(" PAYEE CODE: 0701417861 \n ");
                $printer -> feed(1);
                $printer -> text(" NAME: 0701417861 \n ");
                $printer -> feed(1);
                $printer -> text(" DATE: 0701417861 \n ");
                $printer -> feed(1);
                $printer -> text(" TIME: 0701417861 \n ");
                $printer -> feed(1);
                $printer -> text(" MODE: 0701417861 \n ");
                $printer -> feed(1);

                /* Footer */        
               //  $printer -> feed(2);
               //  $printer -> setJustification(Printer::JUSTIFY_CENTER);
               //  $printer -> text(" YOU WERE SERVED BY \n");
               //  $printer -> cut();
    
                /* Close printer */
                $printer -> close();

               $receiptString = $connector->getData();
               echo $receiptString;
    
// } catch (Exception $e) {   echo "Couldn't print to this printer: " . $e -> getMessage() . "\n"; }
