index.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * @author Open Mind
  4. * @date 09/04/2018
  5. * @time 11:33
  6. */
  7. //error_reporting(E_ALL);
  8. require 'vendor/autoload.php';
  9. $f3 = \Base::instance();
  10. $config = gzuncompress(base64_decode(file_get_contents("config.bin")));
  11. $f3->config('config.ini', true);
  12. $f3->config('labels.ini', true);
  13. $f3->set('DB',
  14. new \DB\SQL(
  15. $f3->get('DBSETTINGS'),
  16. $f3->get('dbuser'),
  17. $f3->get('dbpass'),
  18. array(\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_PERSISTENT => TRUE))
  19. );
  20. //// TODO: per testare le api
  21. //$CORE_SETTINGS = $f3->get('CORE.fb');
  22. //$findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
  23. //$label = new \SmartESL($findBoxCore, ['01076733']);
  24. //$label->Display(1004, '1111');
  25. //sleep(1);
  26. //$label->BlinkSpecial(0, 1, 1000, 20, 0);
  27. //sleep(1);
  28. //$label->BlinkOff();
  29. //
  30. //$f3->set('USERID', 0);
  31. //$CORE_SETTINGS = $f3->get('CORE.fb');
  32. //$findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
  33. //$label = new \SmartESL($findBoxCore, ['010A19ED']);
  34. //$label->BlinkSpecial(0, 1, 1000, 20, 0);
  35. //$distinta = new \Distinta($f3);
  36. //$ret = $distinta->SaveProductsForLabel7('010A19ED', '81891252');
  37. //$ret = $label->Display(1017, '010A19ED');
  38. //
  39. //
  40. // Pages
  41. $f3->route('GET /', "Modules\Pages->Login", $f3->get('CACHE_TTL'));
  42. $f3->route('GET /homemenu', "Modules\Pages->HomeMenu", $f3->get('CACHE_TTL'));
  43. $f3->route('GET|POST /pick2light/@step', "Modules\Pages->Pick2Light", $f3->get('CACHE_TTL'));
  44. $f3->route("GET|POST /bind/@step", 'Modules\Pages->Bind', $f3->get('CACHE_TTL'));
  45. $f3->route('GET /elencodistinta', "Modules\Pages->ElencoDistinta", $f3->get('CACHE_TTL'));
  46. // Services
  47. $f3->route("POST /login", 'Modules\BaseController->Login');
  48. $f3->route("GET /logout", 'Modules\BaseController->Logout');
  49. $f3->run();