index.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. if (cfr('INSURANCE')) {
  3. $insuranceEnabled = $ubillingConfig->getAlterParam('INSURANCE_ENABLED');
  4. if ($insuranceEnabled) {
  5. $insurance = new Insurance();
  6. //rendering home insurance requests list
  7. if (ubRouting::checkGet($insurance::ROUTE_AJHINSLIST)) {
  8. $insurance->ajHinsList();
  9. }
  10. //sets home insurance request as done if required
  11. if (ubRouting::checkGet($insurance::ROUTE_HINSDONE)) {
  12. $hinsReqId = ubRouting::get($insurance::ROUTE_HINSDONE);
  13. $insurance->setHinsDone($hinsReqId);
  14. ubRouting::nav($insurance::URL_ME . '&' . $insurance::ROUTE_VIEWHINSREQ . '=' . $hinsReqId);
  15. }
  16. //sets home insurance request as undone if required
  17. if (ubRouting::checkGet($insurance::ROUTE_HINSUNDONE)) {
  18. $hinsReqId = ubRouting::get($insurance::ROUTE_HINSUNDONE);
  19. $insurance->setHinsUnDone($hinsReqId);
  20. ubRouting::nav($insurance::URL_ME . '&' . $insurance::ROUTE_VIEWHINSREQ . '=' . $hinsReqId);
  21. }
  22. //some viewers here
  23. if (!ubRouting::checkGet($insurance::ROUTE_VIEWHINSREQ)) {
  24. show_window(__('Home insurance requests'), $insurance->renderHinsRequestsList());
  25. } else {
  26. $viewHinsId = ubRouting::get($insurance::ROUTE_VIEWHINSREQ);
  27. show_window(__('Request') . ': ' . $viewHinsId, $insurance->renderHinsRequest($viewHinsId));
  28. }
  29. } else {
  30. show_error(__('This module is disabled'));
  31. }
  32. } else {
  33. show_error(__('Access denied'));
  34. }