index.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. if (cfr('PLDOCS')) {
  3. $altcfg = $ubillingConfig->getAlter();
  4. if ($altcfg['DOCX_SUPPORT']) {
  5. $documents = new ProfileDocuments();
  6. $date = (wf_CheckPost(array('showdate'))) ? $_POST['showdate'] : '';
  7. $documents->loadAllUsersDocuments($date);
  8. //existing document downloading
  9. if (wf_CheckGet(array('documentdownload'))) {
  10. zb_DownloadFile($documents::DOCUMENTS_PATH . $_GET['documentdownload'], 'docx');
  11. }
  12. //document deletion from database
  13. if (wf_CheckGet(array('deletedocument'))) {
  14. $documents->unregisterDocument($_GET['deletedocument']);
  15. rcms_redirect('?module=report_documents');
  16. }
  17. //controls
  18. $actionLinks = wf_Link('?module=report_documents', __('Grid view') . ' ' . wf_img('skins/icon_table.png'), false, 'ubButton');
  19. $actionLinks.= wf_Link('?module=report_documents&calendarview=true', __('As calendar') . ' ' . wf_img('skins/icon_calendar.gif'), false, 'ubButton');
  20. show_window('', $actionLinks);
  21. if (!wf_CheckGet(array('calendarview'))) {
  22. //show calendar control
  23. show_window(__('By date'), $documents->dateControl());
  24. //list available documents
  25. show_window(__('Previously generated documents'), $documents->renderAllUserDocuments());
  26. } else {
  27. //or calendar view
  28. show_window(__('Previously generated documents'), $documents->renderAllUserDocumentsCalendar());
  29. }
  30. } else {
  31. show_error(__('This module is disabled'));
  32. }
  33. } else {
  34. show_error(__('You cant control this module'));
  35. }
  36. ?>