index.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. if (cfr('SMSHIST')) {
  3. if ($ubillingConfig->getAlterParam('SMS_HISTORY_ON')) {
  4. $SMSHist = new SMSHistory();
  5. $inputs = $SMSHist->renderControls();
  6. $FilterDateFrom = ( wf_CheckGet(array('smshistdatefrom')) ) ? $_GET['smshistdatefrom'] : '"' . curdate() . '"';
  7. $FilterDateTo = ( wf_CheckGet(array('smshistdateto')) ) ? $_GET['smshistdateto'] : '"' . curdate() . '"';
  8. $FilterMsgStatus = ( wf_CheckGet(array('msgstatus')) ) ? $_GET['msgstatus'] : 'all';
  9. if ($FilterDateFrom == $FilterDateTo) {
  10. $WhereString = " WHERE DATE(`date_send`) = " . $FilterDateFrom;
  11. } else {
  12. $WhereString = " WHERE DATE(`date_send`) BETWEEN " . $FilterDateFrom . " AND " . $FilterDateTo;
  13. }
  14. switch ($FilterMsgStatus) {
  15. case 'delivered':
  16. $WhereString .= " AND `delivered` = 1";
  17. break;
  18. case 'undelivered':
  19. $WhereString .= " AND `delivered` = 0";
  20. break;
  21. case 'unknown':
  22. $WhereString .= " AND `delivered` = 0 AND `no_statuschk` = 0";
  23. break;
  24. }
  25. if (wf_CheckGet(array('ajax'))) {
  26. $WhereString = ( wf_CheckGet(array('usrlogin')) ) ? " WHERE `login` = '" . $_GET['usrlogin'] . "'" : $WhereString;
  27. $SMSHistoryData = $SMSHist->getSMSHistoryData($WhereString);
  28. $SMSHist->renderJSON($SMSHistoryData);
  29. }
  30. show_window(__('SMS messages history'), $inputs . $SMSHist->renderJQDT());
  31. zb_BillingStats(true);
  32. } else {
  33. show_error(__('This module is disabled'));
  34. }
  35. } else {
  36. show_error(__('Access denied'));
  37. }
  38. ?>