index.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. if (cfr('PLFEES')) {
  3. if (ubRouting::checkGet('username')) {
  4. $login = ubRouting::get('username');
  5. $funds = new FundsFlow();
  6. $allFees = $funds->getFees($login);
  7. if (!empty($allFees)) {
  8. $tablecells = wf_TableCell(__('Date'));
  9. $tablecells .= wf_TableCell(__('Time'));
  10. $tablecells .= wf_TableCell(__('Sum'));
  11. $tablecells .= wf_TableCell(__('From'));
  12. $tablecells .= wf_TableCell(__('To'));
  13. $tablerows = wf_TableRow($tablecells, 'row1');
  14. if (!empty($allFees)) {
  15. foreach ($allFees as $io => $each) {
  16. $feeTimestamp = strtotime($each['date']);
  17. $feeDate = date("Y-m-d", $feeTimestamp);
  18. $feeTime = date("H:i:s", $feeTimestamp);
  19. $tablecells = wf_TableCell($feeDate);
  20. $tablecells .= wf_TableCell($feeTime);
  21. $tablecells .= wf_TableCell($each['summ']);
  22. $tablecells .= wf_TableCell($each['from']);
  23. $tablecells .= wf_TableCell($each['to']);
  24. $tablerows .= wf_TableRow($tablecells, 'row3');
  25. }
  26. }
  27. $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
  28. } else {
  29. $messages = new UbillingMessageHelper();
  30. $result = $messages->getStyledMessage(__('Nothing to show'), 'warning');
  31. }
  32. show_window(__('Money fees'), $result);
  33. $moduleControls = '';
  34. //manual fees harvester controls here
  35. if (cfr('ROOT')) {
  36. if ($ubillingConfig->getAlterParam('FEES_HARVESTER')) {
  37. $moduleControls .= wf_Link('?module=feesharvesterimport&username=' . $login, wf_img('skins/icon_restoredb.png') . ' ' . __('Migrate previous fees data into database'), false, 'ubButton');
  38. $moduleControls .= wf_delimiter();
  39. }
  40. }
  41. $moduleControls .= web_UserControls($login);
  42. show_window('', $moduleControls);
  43. } else {
  44. show_error(__('Strange exception') . ': ' . __('Empty login'));
  45. show_window('', wf_tag('center') . wf_img('skins/unicornwrong.png') . wf_tag('center', true));
  46. }
  47. } else {
  48. show_error(__('You cant control this module'));
  49. }