<?php
include_once(_DIR_EXT.'/HTML/c_page_TXT.php') ;
class c_services_qrcode extends c_page_txt
{
  function body()
  { include(_DIR_TO_ROOT.'/AddOns/phpqrcode/qrlib.php');

    $arr=explode('/',$_SERVER['REQUEST_URI']) ;
    $param = $arr[3]; // remember to sanitize that - it is user input!
    //print_r($_GET) ; return ;

        // we need to be sure ours script does not output anything!!!
        // otherwise it will break up PNG binary!

        ob_start();

        // here DB request or some processing
        $codeText = $param;

        // end of processing here
        $debugLog = ob_get_contents();
        ob_end_clean();

        // outputs image directly into browser, as PNG stream
        if ($_GET['dest']=='doc') QRcode::png($codeText,false,QR_ECLEVEL_H,7);
        elseif ($_GET['dest']=='terminal') QRcode::png($codeText,false,QR_ECLEVEL_H,10);
        else                           QRcode::png($codeText,false,QR_ECLEVEL_H,5);
  }


}



?>