This repository was archived by the owner on Jul 15, 2020. It is now read-only.
forked from meoncstudio/starry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequestCheckIn.php
More file actions
70 lines (45 loc) · 1.41 KB
/
requestCheckIn.php
File metadata and controls
70 lines (45 loc) · 1.41 KB
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
<?php
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
Session_Start();
require('database.php');
require('method.php');
require('ini.php');
$ADM = false;
@$ADM = $_SESSION['ADM'];
if($ADM != true){
echo '{"code": -2, "message": "No enough authority"}';
die();
}
$lang = 'zh_CN';
@$lang = $_REQUEST['lang'];
@$_COOKIE['lang'] = $lang;
$serialCode = $_REQUEST['serialCode'];
$ret = SQL("SELECT * FROM `graduation_prom_2018_tickets` WHERE `serialCode` = '$serialCode' ");
if($ret[0]['status'] != 'ACTIVATED'){
echo '{"code": -3, "message": "Incorrect status"}';
die();
}
$username = $ret[0]['username'];
$ret3 = SQL("SELECT * FROM `graduation_prom_2018_account` WHERE `username` = '$username' ");
$ret2 = SQL("UPDATE `graduation_prom_2018_tickets` SET `status`='ENTERED' WHERE `serialCode` = '$serialCode' ");
if(!$ret2){
echo '{"code": -1, "message": "Invalid QR Entrance Ticket"}';
die();
}
$phone = $ret3[0]['phone'];
$var = array();
$var[0]['key'] = 'name';
$var[0]['value'] = $ret3[0]['firstName'] . ' ' . $ret3[0]['lastName'];
if($lang == 'zh_CN'){
$template = 'Aj1Wl';
}else if($lang == 'en_US'){
$template = 'nB39T2';
}else{
$template = 'Aj1Wl';
}
sendSMS($phone, $template, $var);
echo '{"code": 0, "message": "Entered"}';
?>