index.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. if (cfr('PAYEXPORT')) {
  3. $alter_conf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
  4. if ($alter_conf['EXPORT_ENABLED']) {
  5. $export_filepath = 'exports/';
  6. $export_fileext = '.export';
  7. if (wf_CheckGet(array('dlexf'))) {
  8. zb_DownloadFile($export_filepath . vf($_GET['dlexf'], 3) . $export_fileext, 'default');
  9. }
  10. show_window(__('Export payments data'), zb_ExportForm());
  11. if ((isset($_POST['fromdate'])) AND ( isset($_POST['todate']))) {
  12. $from_date = $_POST['fromdate'];
  13. $to_date = $_POST['todate'];
  14. //export types
  15. //xml
  16. if ($alter_conf['EXPORT_FORMAT'] == 'xml') {
  17. $export_result = zb_ExportPayments($from_date, $to_date);
  18. }
  19. //dbf
  20. if ($alter_conf['EXPORT_FORMAT'] == 'dbf') {
  21. //need to be written
  22. }
  23. $export_filename = time();
  24. $exported_link = wf_Link('?module=payexport&dlexf=' . $export_filename, wf_img('skins/icon_download.png') . ' ' . __('Exported data download'), false, 'ubButton');
  25. file_write_contents($export_filepath . $export_filename . $export_fileext, $export_result);
  26. show_window('', $exported_link);
  27. }
  28. } else {
  29. show_error(__('Payments export not enabled'));
  30. }
  31. } else {
  32. show_error(__('You cant control this module'));
  33. }
  34. ?>