index.php 1.2 KB

12345678910111213141516171819202122232425262728
  1. <?php
  2. if (cfr('PT')) {
  3. $enableOption = $ubillingConfig->getAlterParam('PT_ENABLED');
  4. if ($enableOption) {
  5. $userLogin = ubRouting::get('username');
  6. if (!empty($userLogin)) {
  7. $powerTariffs = new PowerTariffs(true);
  8. if (ubRouting::checkPost($powerTariffs::PROUTE_EDITOFFSET)) {
  9. if (ubRouting::checkPost($powerTariffs::PROUTE_AGREE)) {
  10. $powerTariffs->saveUserOffsetDay($userLogin, ubRouting::post($powerTariffs::PROUTE_EDITOFFSET));
  11. ubRouting::nav($powerTariffs::ROUTE_BACK . '&username=' . $userLogin);
  12. } else {
  13. show_error(__('You are not mentally prepared for this'));
  14. }
  15. }
  16. show_window(__('Edit personal fee date'), $powerTariffs->renderUserOffsetEditForm($userLogin));
  17. show_window(__('Logs'), $powerTariffs->renderPowerUserLog($userLogin));
  18. show_window('', web_UserControls($userLogin));
  19. } else {
  20. show_error(__('Something went wrong'));
  21. }
  22. } else {
  23. show_error(__('This module is disabled'));
  24. }
  25. } else {
  26. show_error(__('Access denied'));
  27. }