index.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. // check for right of current admin on this module
  3. if (cfr('CARDS')) {
  4. $altcfg = $ubillingConfig->getAlter();
  5. if ($altcfg['PAYMENTCARDS_ENABLED']) {
  6. if (isset($_POST['card_create'])) {
  7. $cards = zb_CardGenerate($_POST['card_create']);
  8. show_window('', wf_modalOpened(__('Cards generated'), $cards, '500', '600'));
  9. }
  10. //cards print
  11. if (isset($_POST['cardactions']) && $_POST['cardactions'] == 'caprint') {
  12. $ids = http_build_query(array('id' => array_keys($_POST['_cards'])));
  13. rcms_redirect(sprintf("?module=printcards&action=list&%s", $ids));
  14. }
  15. //mass actions
  16. if (isset($_POST['cardactions'])) {
  17. zb_CardsMassactions();
  18. }
  19. if (isset($_POST['card_edit']) && isset($_POST['card_edit']['part'])) {
  20. $editCard = $_POST['card_edit'];
  21. zb_CardChange($editCard['part'], $editCard['selling'], $editCard['id']);
  22. rcms_redirect("?module=cards");
  23. }
  24. //if clean brute IP
  25. if (isset($_GET['cleanip'])) {
  26. zb_CardBruteCleanIP($_GET['cleanip']);
  27. rcms_redirect("?module=cards");
  28. }
  29. //total cleanup action
  30. if (wf_CheckGet(array('cleanallbrutes'))) {
  31. zb_CardBruteCleanupAll();
  32. rcms_redirect("?module=cards");
  33. }
  34. // Check cards for dublicate
  35. show_window(__('There are duplicate serial numbers of cards'), zb_GetCardDublicate());
  36. show_window(__('Cards generation'), web_CardsGenerateForm());
  37. show_window(__('Create print card'), wf_Link("?module=printcards&action=setting", web_edit_icon().' '.__('Edit'), true, 'ubButton'));
  38. show_window(__('Cards search'), web_CardsSearchForm());
  39. if (!wf_CheckPost(array('card_search'))) {
  40. show_window(__('Available payment cards'), web_CardsShow());
  41. web_CardShowBrutes();
  42. } else {
  43. show_window(__('Search results'), web_CardsSearch($_POST['card_search']));
  44. show_window('', wf_Link("?module=cards", __('Back'), false, 'ubButton'));
  45. }
  46. } else {
  47. show_error(__('This module is disabled'));
  48. }
  49. } else {
  50. show_error(__('You cant control this module'));
  51. }
  52. ?>