/var/www/hkosl.com/m.musiccircle/register.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
<?php
    
include('_init.php');

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <?php include('_head.php'); ?>
    <link href="css/style_k.css?v=<?= time(); ?>" type="text/css" rel="stylesheet">
    <style>
        .form-control-feedback {
            left: 0 !important;
        }

        .has-feedback i {
            border-bottom: 1px solid #fff !important;
        }

        .has-feedback .form-control {
            padding-left: 35px;
            padding-right: 0;
            background-color: inherit;
            border: none;
            border-bottom: 1px solid #555;;
            box-shadow: none;
            border-radius: 0;
        }

        .error {
            padding-left: 35px;
        }

        #sms_box .error {
            padding-left: 0;
        }

        .inputs{
            text-align: center;
            padding: 0;
        }
    </style>
</head>

<body>
<?php include('_header.php'?>

<?php //include('_dialog.php') ?>

<div class="ProfileContent">
    <div class="Profilecontainer">
        <div class="row">
            <div class="col-md-12 faq">
                <h1 class="tc">
                    <?php
                        
/*if ($_GET["type"] == "student") {
                            echo _lang("Student Registration");
                        } else if ($_GET["type"] == "tutor") {
                            echo _lang("Tutor Registration");
                        }*/
                    
?>

                    <img src="<?=$site_info["url"]."img/logo2.png"?>">
                </h1>
                <hr>

                <form action="_process.php" method="post" enctype="multipart/form-data" role="form" id="LiTutorSignUpForm">
                    <?php
                        
if ($_GET["type"] == "student") {
                            echo 
'<input type="hidden" name="action" value="student_signup"/>';
                        } else if (
$_GET["type"] == "tutor") {
                            echo 
'<input type="hidden" name="action" value="tutor_signup"/>';
                        }
                    
?>

                    <div class="form-group has-feedback">
                        <input type="text" name="email" class="form-control" placeholder="<?= _lang("Email"?>"/>
                        <i class="form-control-feedback glyphicon glyphicon-envelope" style="color:#555;"></i>
                        <div style="color:#F00; display:none;" class="error" id="emailError"><?= _lang("Please enter email."?></div>
                        <div style="color:#F00; display:none;" class="error" id="emailError2"><?= _lang("Please check email format."?></div>
                        <div style="color:#F00; display:none;" class="error" id="emailError3"><?= _lang("This email has used by someone."?></div>
                    </div>
                    <div class="form-group has-feedback">
                        <input name="password" type="password" class="form-control" placeholder="<?= _lang("Password"?>" maxlength="15"/>
                        <i class="form-control-feedback glyphicon glyphicon-lock" style="color:#555;"></i>
                        <div style="color:#0012ff; padding-left: 35px;" id="passwordBox"><?= _lang('Password should between 8-15, include lower letter, upper letter, number and special characters.'); ?></div>
                        <div style="color:#F00; display:none;" class="error" id="passwordError"><?= _lang("Please enter password."?></div>
                        <div style="color:#F00; display:none;" class="error" id="passwordError3"><?= _lang("Password must contain at least 8 characters."?></div>
                        <div style="color:#F00; display:none;" class="error" id="passwordError2"><?= _lang("Password and confirm password should be same."?></div>
                        <div style="color:#F00; display:none;" class="error" id="passwordError4"><?= _lang("Password strength is not enough. Password should include lower letter, upper letter, number and special characters."?></div>
                    </div>
                    <div class="form-group has-feedback">
                        <input type="password" name="repassword" class="form-control" placeholder="<?= _lang("Confirm Password"?>"/>
                        <i class="form-control-feedback glyphicon glyphicon-lock" style="color:#555;"></i>
                        <div style="color:#F00; display:none;" class="error" id="repasswordError"><?= _lang("Please enter confirm password."?></div>
                    </div>

                    <div class="form-group has-feedback">
                        <input name="mobno" type="text" class="form-control" placeholder="<?= _lang("Mobile"?>" maxlength="8"/>
                        <i class="form-control-feedback glyphicon glyphicon-phone" style="color:#555;"></i>
                        <div style="color:#F00; display:none;" class="error" id="mobnoError"><?= _lang("Please enter mobile number."?></div>
                        <div style="color:#F00; display:none;" class="error" id="mobnoError2"><?= _lang("Mobile number should be 8 digital number."?></div>
                        <div style="color:#F00; display:none;" class="error" id="mobnoError3"><?= _lang("Mobile number has used by someone."?></div>

                        <div style="padding-left: 35px;">
                            <!--<button type="button" class="btn btn-default"></button>-->
                            <div class="tc">
                                <button type="button" class="btn btn-primary" onClick="sendSMS()" id="LiConnectSMS"><?= _lang("Send Verification Code"?></button>

                                <button type="button" class="btn btn-primary" onClick="sms_box_popup();" id="enter_verification_code" style="display: none;"><?= _lang("輸入驗證碼"?></button>
                            </div>

                            <img src="img/loading_icon.gif" height="36" style="margin-left:5px; display:none;" class="loading_icon"/>
                            <div id="sms_box" style="margin-top:5px; display: none; text-align: center;">
                                <h4>驗證手機號碼</h4>

                                <p>驗證碼已用簡訊寄送至852<span id="sms_to_tel"></span>。<br>請輸入您的6位數字驗證碼。</p>

                                <br>

                                <div class="row" style="margin-right: 0;">
                                    <div class="col-xs-2" style="padding-right: 0;"><input type="text" class="inputs form-control" maxlength="1"></div>
                                    <div class="col-xs-2" style="padding-right: 0;"><input type="text" class="inputs form-control" maxlength="1"></div>
                                    <div class="col-xs-2" style="padding-right: 0;"><input type="text" class="inputs form-control" maxlength="1"></div>
                                    <div class="col-xs-2" style="padding-right: 0;"><input type="text" class="inputs form-control" maxlength="1"></div>
                                    <div class="col-xs-2" style="padding-right: 0;"><input type="text" class="inputs form-control" maxlength="1"></div>
                                    <div class="col-xs-2" style="padding-right: 0;"><input type="text" class="inputs form-control" maxlength="1"></div>

                                </div>

                                <input type="hidden" name="sms_tel" class="inputPrice" value="" style="width:100px; height:36px;" maxlength="6"/>
                                <hr>
                                <button type="button" class="btn btn-primary" id="confirmSMS"><?= _lang("Verify"?></button>
                                <div style="color:#F00; display:none;" class="error" id="smstelError"><?= _lang('Please enter verification code.'?></div>
                                <div style="color:#F00; display:none;" class="error" id="smstelError2"><?= _lang('Verification code is wrong.'?></div>
                                <div style="color:#F00; display:none;" class="error" id="smstelError3"><?= _lang("Mobile number has used by someone."?></div>
                                <div style="color:#F00; display:none;" class="error" id="smstelError4"><?= _lang("Mobile number send fail"?></div>
                                <div style="color:#F00; display:none;" class="error" id="smstelError6"><?= _lang("Please try again after 15 mins"?></div>
                                <div style="color:#F00; display:none;" class="error" id="smstelError5"><?= _lang("Please verify mobile number."?></div>
                            </div>
                        </div>
                    </div>

                    <div class="AgreeTerms" style="margin-bottom: 15px;"><?= _lang('By click "Sign up" you confirm that you agree to our'?>
                        <a href="tnc.php"><?= _lang('terms of service'?></a></div>

                    <input type="button" id="LiTutorSignUpBtn" class="SignUpSubmit" value="<?= _lang('Register'?>">
                </form>

                <br>

                <div class="tc" style="font-size: 18px; font-weight: bold;">
                    <?= _lang('Already have an account?'?>
                    <a href="login.php"><?= _lang('Sign in'?>?</a>
                </div>

            </div>
        </div>
    </div>
</div>
<? include('_footer.php'?>

<!--<script src='https://www.google.com/recaptcha/api.js?hl=en'></script>-->
<script>
    function refreshcode() {
        $('#LiCodeiframe').html('<iframe width="160" height="50" src="../_verifyCode.php" frameborder="0" scrolling="no" marginwidth="0"></iframe>');
    }
    var sms_process = true;
    function sendSMS() {
        $("#mobnoError").hide();
        $("#mobnoError2").hide();
        var mobno = $("input[name='mobno']");
        if (!mobno.val()) {
            $("#mobnoError").show();
            return;
        } else {
            if (isNaN(mobno.val()) || parseInt(mobno.val()) < 10000000 || parseInt(mobno.val()) > 99999999) {
                $("#mobnoError2").show();
                return;
            }
        }

        if (sms_process == true) {
            sms_process = false;
            $('.loading_icon').show();
            $('#sms_box,#smstelError3').hide();
            $.post('_ajax.php', {
                ajax: 'sendSMS',
                type: '<?=$_GET["type"]?>',
                tel: $("input[name='mobno']").val(),
                timeout: 20000,
            }, function (json) {

                var json = JSON.parse(json);
                //console.log(json);
                if (json.sms_status == 'true') {
                    //$('#sms_box').slideDown(1000);
                    sms_box_popup();
                    $('.loading_icon').hide();
                    sms_process = true;
                    $('#enter_verification_code').show();
                } else if (json.sms_status == 'false') {
                    $('#smstelError4').show();
                } else if (json.sms_status == 'same') {
                    $('#smstelError3').show();
                } else if (json.sms_status == 'time') {
                    $('.loading_icon').hide();
                    $('#smstelError6').show();
                }
            });
        }
    }
    $(function () {
        $('#confirmSMS').click(
            function () {
                var tel = "";
                $(".inputs").each(function (index, element) {
                    tel = tel.concat($(element).val());
                });

                if(tel){
                    $("input[name='sms_tel']").val(tel);
                }

                $('#smstelError6,#smstelError5,#smstelError4,#smstelError3,#smstelError2,#smstelError').hide();
                if (!$('input[name="sms_tel"]').val()) {
                    $("#smstelError").show();
                    $('input[name="sms_tel"]').focus();
                } else {
                    $('.loading_icon').show();
                    $.post('_ajax.php', {
                        ajax: 'confirmSMSCode',
                        type: '<?=$_GET["type"]?>',
                        tel: $('input[name="mobno"]').val(),
                        code: $('input[name="sms_tel"]').val()
                    }, function (json) {
                        var json = JSON.parse(json);
                        //console.log(json);
                        $('.loading_icon').hide();
                        if (json.status == false) {
                            $("#smstelError2").show();
                        } else {
                            $('#LiConnectSMS').text('<?=_lang("Verified")?>');
                            $('.loading_icon').hide();
                            //$('#sms_box').slideUp(1000);
                            $.fancybox.close();
                        }
                    });
                }
            }
        );
        $('#submitBTN').click(
            function () {
                var thisform = $('#LiForm');
                $.post('_ajax.php', {
                    async: false,
                    ajax: 'checkverifyCode',
                    verifyCode: $('input[name="verifyCode"]', thisform).val(),
                    type: 'tutor'
                }, function (json) {
                    var json = JSON.parse(json);
                    var error = false;
                    $('.error').hide();
                    if (!$('input[name="verifyCode"]', thisform).val()) {
                        $("#verifyCodeError").show();
                        error = true;
                    } else {
                        if (json.status == false) {
                            $("#verifyCode2Error").show();
                            error = true;
                        }
                    }
                    if (json.smsstatus == false) {
                        $("#smstelError5").show();
                        error = true;
                    }
                    if ($('input[name="is_provision"]:checked', thisform).val() != 1) {
                        $("#provisionError").show();
                        error = true;
                    }
                    if (error == false) {
                        $('#LiForm').submit();
                    } else {
                        return false;
                    }
                });
            }
        );
    });
</script>
<script type="text/javascript" src="js/facebook.js"></script>
<link rel="stylesheet" href="js/fancybox/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen"/>
<script type="text/javascript" src="js/fancybox/jquery.fancybox.pack.js?v=2.1.5"></script>

<script type="text/javascript">
    function sms_box_popup() {
        $("#sms_to_tel").text($("input[name='mobno']").val());
        $(".inputs").val("");
        $.fancybox({
            //settings
            'type': 'inline',
            'fitToView': false,
            'maxWidth': 800,
            'maxHeight': 230,
            'width': '100%',
            'height': '80%',
            'autoSize': false,
            'closeClick': false,
            'openEffect': 'none',
            'closeEffect': 'none',
            'href': '#sms_box',
        });
    }

    $(function () {
        $(".inputs").keyup(function () {
            if (this.value.length == this.maxLength) {
                $(this).parent().next('.col-xs-2').find(".inputs").focus();
            }
        });
    });
</script>
</body>
</html>