index.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. $altCfg = $ubillingConfig->getAlter();
  3. if ($altCfg['TELEPONY_ENABLED']) {
  4. if (cfr('TELEPONY')) {
  5. $telePony = new TelePony();
  6. //rendering module controls
  7. show_window('', $telePony->renderControls());
  8. if (ubRouting::checkGet($telePony::ROUTE_INCALLSTATS)) {
  9. //basic calls stats
  10. show_window(__('Stats') . ' ' . __('Incoming calls'), $telePony->renderNumLog());
  11. }
  12. if ($altCfg['TELEPONY_CDR']) {
  13. //CDR renderers here
  14. if (ubRouting::checkGet($telePony::ROUTE_CALLSHIST)) {
  15. //showing call history form
  16. show_window(__('Calls history'), $telePony->renderCdrDateForm());
  17. //downloading raw CDR as array dump
  18. if (ubRouting::checkGet($telePony::ROUTE_DLOADCDR)) {
  19. zb_DownloadFile($telePony::PATH_CDRDEBUG, 'text');
  20. }
  21. //getting calls history json data
  22. if (ubRouting::checkGet($telePony::ROUTE_AJCALLSHIST)) {
  23. $telePony->getCDRJson();
  24. }
  25. //rendering calls history container here
  26. show_window(__('TelePony') . ' - ' . __('Calls history'), $telePony->renderCDR());
  27. }
  28. if (ubRouting::checkGet($telePony::ROUTE_NIGHTCALLS)) {
  29. show_window(__('TelePony') . ' - ' . __('Calls during non-business hours'), $telePony->renderNightCalls());
  30. }
  31. }
  32. //no extra routes or extra post data received
  33. if (sizeof(ubRouting::rawGet()) == 1 AND sizeof(ubRouting::rawPost()) == 1) {
  34. show_error(__('Strange exception'));
  35. show_window('', wf_tag('center') . wf_img('skins/teleponywrong.png') . wf_tag('center', true));
  36. }
  37. zb_BillingStats(true);
  38. } else {
  39. show_error(__('Permission denied'));
  40. }
  41. } else {
  42. show_error(__('This module is disabled'));
  43. }