-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataD3.php
130 lines (106 loc) · 6.25 KB
/
dataD3.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
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
error_reporting(0);
header("Access-Control-Allow-Origin: *");
header('Access-Control-Allow-Methods: POST, GET, DELETE, PUT, PATCH, OPTIONS');
header('Access-Control-Max-Age: 90000');
header("Access-Control-Allow-Credentials", "true");
header("Access-Control-Allow-Headers", "Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers");
?>
<?php
$con = mysqli_connect("localhost", "root", "", "sims");
?>
<?php
if(isset($_POST['Entry_Date']) && !empty($_POST['Entry_Date']))
{
$DA3_childID=$_POST['DA3_childID'];
$DA3_Q101_code =$_POST['DA3_Q101_code'];
$DA3_Q102_code =$_POST['DA3_Q102_code'];
$DA3_Q103_code =$_POST['DA3_Q103_code'];
$DA3_Q104_code =$_POST['DA3_Q104_code'];
$DA3_Q105_code =$_POST['DA3_Q105_code'];
$DA3_Q106_code =$_POST['DA3_Q106_code'];
$DA3_Q107 =$_POST['DA3_Q107'];
$DA3_Q108_code =$_POST['DA3_Q108_code'];
$DA3_Q109 =$_POST['DA3_Q109'];
$DA3_Q110 =$_POST['DA3_Q110'];
$DA3_Q111 =$_POST['DA3_Q111'];
$DA3_Q112 =$_POST['DA3_Q112'];
$DA3_Q113 =$_POST['DA3_Q113'];
$DA3_Q114 =$_POST['DA3_Q114'];
$DA3_Q115 =$_POST['DA3_Q115'];
$DA3_Q116 =$_POST['DA3_Q116'];
$DA3_Q117Date =$_POST['DA3_Q117Date'];
$DA3_Q117Time =$_POST['DA3_Q117Time'];
$DA3_Q201 =$_POST['DA3_Q201'];
$DA3_Q202a =$_POST['DA3_Q202a'];
$DA3_Q202b =$_POST['DA3_Q202b'];
$DA3_Q202c =$_POST['DA3_Q202c'];
$DA3_Q202d =$_POST['DA3_Q202d'];
$DA3_Q203 =$_POST['DA3_Q203'];
$DA3_Q204 =$_POST['DA3_Q204'];
$DA3_Q204O =$_POST['DA3_Q204O'];
$DA3_Q205 =$_POST['DA3_Q205'];
$DA3_Q206=$_POST['DA3_Q206'];
$DA3_Q207 =$_POST['DA3_Q207'];
$DA3_Q301 =$_POST['DA3_Q301'];
$DA3_Q302 =$_POST['DA3_Q302'];
$DA3_Q303 =$_POST['DA3_Q303'];
$DA3_Q400 =$_POST['DA3_Q400'];
$Entry_User_ID =$_POST['Entry_User_ID'];
$Entry_Date=$_POST['Entry_Date'];
$QCUser=$_POST['Entry_User_ID'];
for($count = 0; $count<count($DA3_childID); $count++){
$DA3_childID_clean = mysqli_real_escape_string($con,$DA3_childID[$count]);
$DA3_Q101_code_clean = mysqli_real_escape_string($con,$DA3_Q101_code[$count]);
$DA3_Q102_code_clean = mysqli_real_escape_string($con,$DA3_Q102_code[$count]);
$DA3_Q103_code_clean = mysqli_real_escape_string($con,$DA3_Q103_code[$count]);
$DA3_Q104_code_clean = mysqli_real_escape_string($con,$DA3_Q104_code[$count]);
$DA3_Q105_code_clean = mysqli_real_escape_string($con,$DA3_Q105_code[$count]);
$DA3_Q106_code_clean = mysqli_real_escape_string($con,$DA3_Q106_code[$count]);
$DA3_Q107_clean = mysqli_real_escape_string($con,$DA3_Q107[$count]);
$DA3_Q108_code_clean = mysqli_real_escape_string($con,$DA3_Q108_code[$count]);
$DA3_Q109_clean = mysqli_real_escape_string($con,$DA3_Q109[$count]);
$DA3_Q110_clean = mysqli_real_escape_string($con,$DA3_Q110[$count]);
$DA3_Q111_clean = mysqli_real_escape_string($con,$DA3_Q111[$count]);
$DA3_Q112_clean = mysqli_real_escape_string($con,$DA3_Q112[$count]);
$DA3_Q113_clean = mysqli_real_escape_string($con,$DA3_Q113[$count]);
$DA3_Q114_clean = mysqli_real_escape_string($con,$DA3_Q114[$count]);
$DA3_Q115_clean = mysqli_real_escape_string($con,$DA3_Q115[$count]);
$DA3_Q116_clean = mysqli_real_escape_string($con,$DA3_Q116[$count]);
$DA3_Q117Date_clean = mysqli_real_escape_string($con,$DA3_Q117Date[$count]);
$DA3_Q117Time_clean = mysqli_real_escape_string($con,$DA3_Q117Time[$count]);
$DA3_Q201_clean = mysqli_real_escape_string($con,$DA3_Q201[$count]);
$DA3_Q202a_clean = mysqli_real_escape_string($con,$DA3_Q202a[$count]);
$DA3_Q202b_clean = mysqli_real_escape_string($con,$DA3_Q202b[$count]);
$DA3_Q202c_clean = mysqli_real_escape_string($con,$DA3_Q202c[$count]);
$DA3_Q202d_clean = mysqli_real_escape_string($con,$DA3_Q202d[$count]);
$DA3_Q203_clean = mysqli_real_escape_string($con,$DA3_Q203[$count]);
$DA3_Q204_clean = mysqli_real_escape_string($con,$DA3_Q204[$count]);
$DA3_Q204O_clean = mysqli_real_escape_string($con,$DA3_Q204O[$count]);
$DA3_Q205_clean = mysqli_real_escape_string($con,$DA3_Q205[$count]);
$DA3_Q206_clean = mysqli_real_escape_string($con,$DA3_Q206[$count]);
$DA3_Q207_clean = mysqli_real_escape_string($con,$DA3_Q207[$count]);
$DA3_Q301_clean = mysqli_real_escape_string($con,$DA3_Q301[$count]);
$DA3_Q302_clean = mysqli_real_escape_string($con,$DA3_Q302[$count]);
$DA3_Q303_clean = mysqli_real_escape_string($con,$DA3_Q303[$count]);
$DA3_Q400_clean = mysqli_real_escape_string($con,$DA3_Q400[$count]);
$Entry_User_ID_clean = mysqli_real_escape_string($con,$Entry_User_ID[$count]);
$Entry_Date_clean = mysqli_real_escape_string($con,$Entry_Date[$count]);
$QC_cleanUser = mysqli_real_escape_string($con, $QCUser[$count]);
if(!empty($Entry_Date_clean)){
if($QC_cleanUser=='5551' || $QC_cleanUser=='5552' || $QC_cleanUser=='5553'){$QC_clean = '1';} else{$QC_clean ='2';}
$q .= 'INSERT ignore INTO `da3`(
`QC`,`DA3_childID`,`DA3_Q101_code`,`DA3_Q102_code`,`DA3_Q103_code`,`DA3_Q104_code`,`DA3_Q105_code`,`DA3_Q106_code`,`DA3_Q107`,`DA3_Q108_code`,`DA3_Q109`,`DA3_Q110`,`DA3_Q111`,`DA3_Q112`,`DA3_Q113`,`DA3_Q114`,`DA3_Q115`,`DA3_Q116`,`DA3_Q117Date`,`DA3_Q117Time`,`DA3_Q201`,`DA3_Q202a`,`DA3_Q202b`,`DA3_Q202c`,`DA3_Q202d`,`DA3_Q203`,`DA3_Q204`,`DA3_Q204O`,`DA3_Q205`,`DA3_Q206`,`DA3_Q207`,`DA3_Q301`,`DA3_Q302`,`DA3_Q303`,`DA3_Q400`,`Entry_User_ID`,`Entry_Date`, `dataTransferredOn`) VALUES("'.$QC_clean.'","'.$DA3_childID_clean.'","'.$DA3_Q101_code_clean.'","'.$DA3_Q102_code_clean.'","'.$DA3_Q103_code_clean.'","'.$DA3_Q104_code_clean.'","'.$DA3_Q105_code_clean.'","'.$DA3_Q106_code_clean.'","'.$DA3_Q107_clean.'","'.$DA3_Q108_code_clean.'","'.$DA3_Q109_clean.'","'.$DA3_Q110_clean.'","'.$DA3_Q111_clean.'","'.$DA3_Q112_clean.'","'.$DA3_Q113_clean.'","'.$DA3_Q114_clean.'","'.$DA3_Q115_clean.'","'.$DA3_Q116_clean.'","'.$DA3_Q117Date_clean.'","'.$DA3_Q117Time_clean.'","'.$DA3_Q201_clean.'","'.$DA3_Q202a_clean.'","'.$DA3_Q202b_clean.'","'.$DA3_Q202c_clean.'","'.$DA3_Q202d_clean.'","'.$DA3_Q203_clean.'","'.$DA3_Q204_clean.'","'.$DA3_Q204O_clean.'","'.$DA3_Q205_clean.'","'.$DA3_Q206_clean.'","'.$DA3_Q207_clean.'","'.$DA3_Q301_clean.'","'.$DA3_Q302_clean.'","'.$DA3_Q303_clean.'","'.$DA3_Q400_clean.'","'.$Entry_User_ID_clean.'",
"'.$Entry_Date_clean.'", CURDATE());';
}
}
if($q!=''){
mysqli_multi_query($con,$q);
}
else{
echo "error";
}
echo "success";
}
?>