/var/www/hkosl.com/sinomax/survey/registration_step1_verify.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
    
require_once('webadmin/basic_info.php');

    
$id = (int)$_SESSION["id"];
    
$campaign get_campaign($id1);

    if (!isset(
$_SESSION["id"]) || (int)$_SESSION["id"] <= || empty($campaign)) {
        
missing_campaign_id();
    } else {
        
check_campaign_date($campaign);
    }
?>

<!DOCTYPE html>
<html>
<head>
    <?php require_once('html_head.php'); ?>
    <link rel="stylesheet" type="text/css" media="screen" href="js/form_builder/assets/css/form-builder.min.css">

    <?php
        
if (empty($_SESSION["telephone"])) {
            echo 
"<script>alert('Please enter your mobile number.\\n請輸入你的手提電話號碼。'); location.href='registration_step1.php?id=" $id "';</script>";
            exit;
        }
    
?>

    <script type="text/javascript">
        var countdown = 60*2;
        var start_time = new Date().getTime();
        var end_time = parseInt(start_time) + (countdown * 1000);

        function resend_sms() {
            var start_time = new Date().getTime();
            //check time
            if (start_time > end_time) {
                //alert("Verification Code SMS has resent.\n驗證碼短訊已重發。");
                location.href = 'registration_step1_post.php?telephone=<?=$_SESSION["telephone"]?>&send=1';
            } else {
                alert("Please wait for the countdown of timer.\n請等待重發驗證碼倒數完成。");
            }
        }

        var _send = <?=!empty($_GET["send"])?1:0?>;

        if(_send == 1){

            //var start_time = new Date().getTime(), end_time = parseInt(start_time) + (30 * 1000);
            interval = setInterval(function () {
                if (end_time > new Date().getTime()) {
                    $("#countdown").text("("+countdown+")");
                    $(".resend_sms_btn").css("background-color","gray");
                }else{
                    $("#countdown").text("");
                    $(".resend_sms_btn").css("background-color","#092E6E");
                    clearInterval(interval);
                }

                countdown--;
            }, 1000);
        }

    </script>
</head>
<body>

<div class="container">
    <?php
        
if ($campaign["hide_campaign_name"] == 0) {
            echo 
"<h1 style='margin-bottom: 30px;'>";
            foreach (
$arraylangcode as $langcode => $langname) {
                if (!empty(
$campaign["name_" $langcode])) {
                    echo 
$campaign["name_" $langcode] . "<br>";
                }
            }
            echo 
"</h1>";
        }
    
?>

    <div style="<?=$campaign["hide_campaign_name"] == 1?"padding-top:30px;":""?>">
        <form action="registration_step1_verify_post.php" method="post" name="register" id="register" enctype="multipart/form-data">
            <h4>Register Sinomax Member 登記 Sinomax 會員<br><br>Step 1. Verify Mobile Phone Number<br>步驟一 驗證手提電話號碼</h4>

            <div class="user_info_field">
                <div class="required_field">Mobile Phone Number 手提電話號碼</div>
                <?= ($_SESSION["telephone"]); ?>

            </div>

            <div class="user_info_field">
                <div class="required_field">Code 認證碼</div>
                <input class="form-control text-input" name="code" type="text"> <br>

                <div>
                    <span style="color: red;;">* </span> Required Fields 必須填寫
                </div>
            </div>

            <button type="button" class="btn resend_sms_btn" onClick="resend_sms();">Resend Code 重發認證碼 <span id="countdown"></span>
            </button>

            <div class="tc">
                <a href="registration_step1.php?id=<?= $id ?>" style="margin-right: 20px;">
                    <button type="button" class="btn">Previous Step 上一步</button>
                </a>
                <button type="submit" class="btn">提交 Submit</button>
            </div>

        </form>
    </div>

</div>

<?php require_once('html_footer.php'); ?>
</body>
</html>