<div class="form"> <div class="row"> <label>会员卡</label> <span class="word"><?php echo $check['card_no']; ?></span> </div> <div class="row"> <label>卡类型</label> <span class="word"><?php echo MCard::getCardType($check['type']); ?></span> </div> <div class="row"> <label>手机号</label> <span class="word"><?php echo $check['mobile']; ?></span> </div> <div class="row"> <label>会员名</label>
<?php /** * 会员卡AJAX 请求处理 * @author abei<*****@*****.**> */ require_once dirname(dirname(__FILE__)) . '/app.php'; $action = strval($_GET['action']); /* 验证账户 */ if ($action == 'checkuser') { $username = $_GET['u']; $password = $_GET['p']; $result = MCard::checkUser($username, $password); if ($result) { Session::Set('apply_card_real_u', $result['id']); $arr_step_1 = array('user_id' => $result['id'], 'create_time' => time(), 'step' => 1); DB::Insert('mcard', $arr_step_1); $json = array('done' => true); echo formatJSON($json); die; } else { // 无信息 $json = array('done' => false); echo formatJSON($json); die; } } else { if ($action == 'sendsms') { $mobile = $_GET['m']; $card_user_id = abs(intval($_SESSION['apply_card_real_u'])); $card = DB::GetTableRow('mcard', array('user_id' => $card_user_id));
} if ($_POST) { $type = $_POST['type']; $mobile_type = in_array('mobile', $type) ? '1' : '0'; $card_type = in_array('card', $type) ? '1' : '0'; $pay_password = $_POST['pay_password']; if (empty($pay_password)) { Session::Set('error', '支付密码不能为空。'); } if ($mobile_type == '1') { // check $mobile = $_POST['mobile']; $code = $_POST['code']; if ($card['code'] != $code) { Session::Set('error', '手机验证码填写不正确。'); } } if ($card_type == '1') { } $type = $mobile_type . $card_type; $update = array('type' => $type); $update['state'] = '10'; $update['card_no'] = MCard::createCardNo(); DB::Update('mcard', $card['id'], $update); Session::Set('notice', '恭喜您申请成功。'); redirect(WEB_ROOT . '/card/apply.php?step=3'); } } if ($step == 3) { } include template('card_apply');