Exemplo n.º 1
0
 $email = strval($_POST['email']);
 $fullname = strval($_POST['fullname']);
 // 验证邮箱格式
 if (preg_match("/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)\$/i", $email)) {
     // "邮箱地址正确!";
 } else {
     $rs['code'] = '-4';
     $rs['ok'] = '-4';
     $rs['msg'] = "邮箱不符合邮箱规则,请重新核对您的邮箱地址^_^";
     echo json_encode($rs);
     return;
 }
 // 用户名,全名记录DB
 if (!empty($email)) {
     $inviteParicipant = new \Ss\Market\InviteParticipant();
     if (empty($inviteParicipant->GetInviteParticipantArray($email))) {
         $inviteParicipant->AddInviteParticipant($email, $fullname);
         $rs['code'] = '1';
         $rs['ok'] = '1';
         $rs['p'] = '1';
         $rs['msg'] = "提交成功";
         setcookie("PUE", base64_encode($email), time() + 300);
         //            header("Location:invite_game.php?p=1");
         //            return;
     } else {
         $rs['code'] = '-2';
         $rs['ok'] = '-2';
         $rs['msg'] = "该用户已参加过该活动";
     }
 } else {
     $rs['code'] = '-1';
Exemplo n.º 2
0
    if (in_array($id, $subjectIds)) {
        continue;
    } else {
        array_push($subjectIds, $id);
    }
}
$subjectContents = $inviteSubject->GetInviteSubjectArray($subjectIds);
$inviteParticipant = new \Ss\Market\InviteParticipant();
// 设置活动上限数为50个用户
if ($inviteParticipant->GetInviteParticipantArrayCount() >= 50) {
    $curStep = -1;
}
// 初始化流量
$gameResultGPRS = rand(0, 2048);
if ($curStep == 2 && !empty($_COOKIE['PUE'])) {
    $inviteParticipantData = $inviteParticipant->GetInviteParticipantArray(strval(base64_decode($_COOKIE['PUE'])));
    if ($inviteParticipantData['init_gprs'] == 0) {
        $inviteParticipant->UpdateInviteParticipantInitGPRS($gameResultGPRS, strval(base64_decode($_COOKIE['PUE'])));
    } else {
        $gameResultGPRS = $inviteParticipantData['init_gprs'];
    }
}
?>

    <?php 
if ($curStep == 0) {
    ?>
        <div class="row marketing" style="text-align: center;margin-top: 10%;
        margin-left: 50px;margin-right: 50px;">
            <h3>Lumos邀请码活动正在进行中...</h3>