index.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. if (cfr('PRINTCARD')) {
  3. if ($ubillingConfig->getAlterParam('PAYMENTCARDS_ENABLED')) {
  4. // create form
  5. if (extension_loaded('gd')) {
  6. function settingTemplate() {
  7. if (wf_CheckPost(array('back'))) {
  8. rcms_redirect("?module=cards");
  9. }
  10. if (wf_CheckPost(array('delete'))) {
  11. web_DeleteImege();
  12. }
  13. if (wf_CheckPost(array('print_card')) && wf_CheckPost(array('save'))) {
  14. zb_SaveCardPrint($_POST['print_card']);
  15. web_CreateTemplateCardPrint();
  16. }
  17. if (wf_CheckPost(array('upload'))) {
  18. web_UploadFileCopy($_FILES['filename']['tmp_name']);
  19. }
  20. show_window(__('Create print card'), web_PrintCardCreateForm());
  21. }
  22. function cardsList() {
  23. if (wf_CheckGet(array('id'))) {
  24. show_window(__('Card for print'), web_PrintCardLister($_GET['id']));
  25. }
  26. }
  27. // card for print
  28. function printCards() {
  29. $cardList = web_GenerateImages($_GET['id']);
  30. web_CreatePdf($cardList);
  31. }
  32. // card for page
  33. function pageCards() {
  34. print(web_PageCard($_GET['id']));
  35. die;
  36. }
  37. switch (true) {
  38. case array_key_exists('action', $_GET) && $_GET['action'] == 'setting':
  39. settingTemplate();
  40. break;
  41. case array_key_exists('action', $_GET) && $_GET['action'] == 'list':
  42. cardsList();
  43. break;
  44. case array_key_exists('action', $_GET) && $_GET['action'] == 'print':
  45. printCards();
  46. break;
  47. case array_key_exists('action', $_GET) && $_GET['action'] == 'page':
  48. pageCards();
  49. break;
  50. default:
  51. show_error(__('You cant control this action'));
  52. }
  53. } else {
  54. show_error(__('You need install php extension GD'));
  55. }
  56. } else {
  57. show_error(__('This module is disabled'));
  58. }
  59. } else {
  60. show_error(__('You cant control this module'));
  61. }