card.ctrl.php 878 B

123456789101112131415161718192021222324
  1. <?php
  2. defined('IN_IA') or exit('Access Denied');
  3. global $_GPC;
  4. $card = pdo_get('mc_card', array('uniacid' => $_GPC['uniacid']));
  5. if (!empty($card)) {
  6. if ($card['source'] == 2) {
  7. $code = pdo_getcolumn('coupon_record', array('uniacid' => $_GPC['uniacid'], 'card_id' => $card['card_id']), 'code');
  8. $status = empty($code) ? 3 : 1;
  9. if (empty($code)) {
  10. load()->classs('coupon');
  11. $coupon_api = new coupon($_GPC['acid']);
  12. $card_id = trim($card['card_id']);
  13. $result = $coupon_api->BuildCardExt($card['card_id'], '', 'membercard');
  14. message(error(3, array('card_ext' => $result['card_ext'], 'card_id' => $card['card_id'])), '', 'ajax');
  15. } else {
  16. message(error(1, array('code' => $code, 'card_id' => $card['card_id'])), '', 'ajax');
  17. }
  18. }
  19. if ($card['source'] == 1) {
  20. message(error(2), '', 'ajax');
  21. }
  22. } else {
  23. message(error(0, $_W['uniacid']), '', 'ajax');
  24. }