-
Notifications
You must be signed in to change notification settings - Fork 0
/
InsertDeviceInfo.php
118 lines (89 loc) · 2.86 KB
/
InsertDeviceInfo.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
<?php
require_once('DeviceInfo.php');
$timestamp="";
$brand="";
$device_level="";
$device_name ="";
$ip="";
$manufacturer="";
$model="";
$timezone="";
$user_agent="";
$vesion="";
$api_level="";
$application_name="";
$install_reference="";
$is_emulator="";
$is_tablet="";
$new_user="";
$timestamp = round(microtime(true) * 1000);
// $usertimestamp = round(microtime(true) * 1000);
if($_SERVER['REQUEST_METHOD']=='POST'){
$db = new DeviceInfo();
if (isset($_POST["brand"])) {
$brand = $_POST['brand'];
}
if (isset($_POST["deviceLevel"])) {
$device_level = $_POST['deviceLevel'];
}
if (isset($_POST["deviceName"])) {
$device_name = $_POST['deviceName'];
}
if (isset($_POST["ipAddress"])) {
$ip = $_POST['ipAddress'];
}
if (isset($_POST["manufacturer"])) {
$manufacturer = $_POST['manufacturer'];
}
if (isset($_POST["model"])) {
$model = $_POST['model'];
}
if (isset($_POST["timezone"])) {
$timezone = $_POST['timezone'];
}
if (isset($_POST["userAgent"])) {
$user_agent = $_POST['userAgent'];
}
if (isset($_POST["version"])) {
$vesion = $_POST['version'];
}
if (isset($_POST["apiLevel"])) {
$api_level = $_POST['apiLevel'];
}
if (isset($_POST["applicationName"])) {
$application_name = $_POST['applicationName'];
}
if (isset($_POST["installReference"])) {
$install_reference = $_POST['installReference'];
}
if (isset($_POST["isEmulator"])) {
$is_emulator = $_POST['isEmulator'];
}
if (isset($_POST["isTablet"])) {
$is_tablet = $_POST['isTablet'];
}
if (isset($_POST["ts"])) {
$ts= $_POST['ts'];
}
if(isset($POST["new_user"])){
$new_user = $_POST['new_user'];
}
// echo "hello"
if(!$db->insertDevice($timestamp,$brand,$device_level,$device_name,$ip,$manufacturer,$model,$timezone,$user_agent,$vesion,$api_level,$application_name,$install_reference,$is_emulator,$is_tablet,$timestamp,$new_user))
{
// echo "success";
$e['success']="true";
echo json_encode($e);
}
else{
$e['error']="true";
echo json_encode($e);
}
// $myObj->userid = $userid;
// $myObj->tp = $usertimestamp;
// $myObj->profile ="http://18.191.179.1/ItFeelsYou/Users/".$usertimestamp."/".$userid."/".$usertimestamp.".jpg" ;
// $myObj->nickname=$nickname;
// $myJSON = json_encode($myObj);
// echo $myJSON;
}
?>