json(null, 'refresh'); } else { if ('subscriberemove' == $action) { need_auth('admin'); $subscribe = Table::Fetch('subscribe', $id); if ($subscribe) { ZSubscribe::Unsubscribe($subscribe); Session::Set('notice', "邮件地址:{$subscribe['email']}退订成功"); } json(null, 'refresh'); } else { if ('smssubscriberemove' == $action) { need_auth('admin'); $subscribe = Table::Fetch('smssubscribe', $id); if ($subscribe) { ZSMSSubscribe::Unsubscribe($subscribe['mobile']); Session::Set('notice', "手机号码:{$subscribe['mobile']}退订成功"); } json(null, 'refresh'); } else { if ('partnerremove' == $action) { need_auth('market'); $partner = Table::Fetch('partner', $id); $count = Table::Count('team', array('partner_id' => $id)); if ($partner && $count == 0) { $partner_pay = Table::Fetch('partner_pay', $id); Table::Delete('partner', $id); if ($partner_pay) { Table::Delete('partner_pay', $id); } Session::Set('notice', "商户:{$id} 删除成功");
} else { $html = render('ajax_dialog_smscode'); sms_secret($mobile, $secret, true); } json($html, 'dialog'); } else { json('captcha_again();', 'eval'); } } else { if ('codeyes' == $action) { $mobile = trim(strval($_GET['mobile'])); $secretcode = trim(strval($_GET['secretcode'])); $sms = Table::Fetch('smssubscribe', $mobile, 'mobile'); if (!$sms) { json(array(array('data' => '非法访问!', 'type' => 'alert'), array('data' => 'X.boxClose();', 'type' => 'eval')), 'mix'); } if ($sms['secret'] != $secretcode) { json('短信认证码不正确,请重新输入!', 'alert'); } if ($sms['enable'] == 'Y') { ZSMSSubscribe::Unsubscribe($mobile); $html = render('ajax_dialog_smsunsuc'); json($html, 'dialog'); } else { ZSMSSubscribe::Enable($mobile, true); $html = render('ajax_dialog_smssuc'); json($html, 'dialog'); } } } }