index.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. $altCfg = $ubillingConfig->getAlter();
  3. if ($altCfg['PAYMENTCARDS_ENABLED']) {
  4. // check for right of current admin on this module
  5. if (cfr('SELLING')) {
  6. if (isset($_POST['new_selling']['name'])) {
  7. $name = $_POST['new_selling']['name'];
  8. unset($_POST['new_selling']['name']);
  9. if (!empty($name)) {
  10. zb_CreateSellingData($name, $_POST['new_selling']);
  11. rcms_redirect('?module=selling');
  12. } else {
  13. show_error(__('Empty selling name'));
  14. }
  15. }
  16. if (isset($_GET['action'])) {
  17. if (isset($_GET['id'])) {
  18. $sellingId = $_GET['id'];
  19. if ($_GET['action'] == 'delete') {
  20. zb_DeleteSellingData($sellingId);
  21. rcms_redirect('?module=selling');
  22. }
  23. if ($_GET['action'] == 'edit') {
  24. if (isset($_POST['edit_selling'])) {
  25. zb_UpdateSellingData($sellingId, $_POST['edit_selling']);
  26. rcms_redirect('?module=selling');
  27. }
  28. show_window(__('Edit Selling'), web_SellingEditForm($sellingId));
  29. }
  30. }
  31. }
  32. // create form
  33. if (!wf_CheckGet(array('action'))) {
  34. show_window(__('Create new selling'), web_SellingCreateForm());
  35. }
  36. //list
  37. show_window(__('Available selling'), web_SellingLister());
  38. } else {
  39. show_error(__('You cant control this module'));
  40. }
  41. } else {
  42. show_error(__('This module is disabled'));
  43. }
  44. ?>