-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataD2.php
444 lines (428 loc) · 13.5 KB
/
dataD2.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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
<?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['DA2_EnDt']) && !empty($_POST['DA2_EnDt']))
{
$Child_ID=$_POST['Child_ID'];
$Upazila_Code=$_POST['Upazila_Code'];
$Union_code=$_POST['Union_code'];
$Village_code=$_POST['Village_code'];
$Bari_code=$_POST['Bari_code'];
$HH_code=$_POST['HH_code'];
$CC_code=$_POST['CC_code'];
$Child_PID=$_POST['Child_PID'];
$Child_name=$_POST['Child_name'];
$Mother_name=$_POST['Mother_name'];
$MCID=$_POST['MCID'];
$MPID=$_POST['MPID'];
$Father_name=$_POST['Father_name'];
$Mobile=$_POST['Mobile'];
$ChDob=$_POST['ChDob'];
$ChildAge=$_POST['ChildAge'];
$ChildSex=$_POST['ChildSex'];
$CHCP_code=$_POST['CHCP_code'];
$IntStartDate=$_POST['IntStartDate'];
$IntStartTime=$_POST['IntStartTime'];
$Q119=$_POST['Q119'];
$Q119Other=$_POST['Q119Other'];
$Q120=$_POST['Q120'];
$Q120Other=$_POST['Q120Other'];
$Q201a=$_POST['Q201a'];
$Q201a_day=$_POST['Q201a_day'];
$Q201b=$_POST['Q201b'];
$Q201b_day=$_POST['Q201b_day'];
$Q201c=$_POST['Q201c'];
$Q201c_day=$_POST['Q201c_day'];
$Q201d=$_POST['Q201d'];
$Q201d_day=$_POST['Q201d_day'];
$Q201e=$_POST['Q201e'];
$Q201e_day=$_POST['Q201e_day'];
$Q202=$_POST['Q202'];
$Q202_day=$_POST['Q202_day'];
$Q203=$_POST['Q203'];
$Q203_day=$_POST['Q203_day'];
$Q204=$_POST['Q204'];
$Q204_day=$_POST['Q204_day'];
$Q205_1=$_POST['Q205_1'];
$Q205_2=$_POST['Q205_2'];
$Q205_3a_1=$_POST['Q205_3a_1'];
$Q205_3a_2=$_POST['Q205_3a_2'];
$Q205_3a_3=$_POST['Q205_3a_3'];
$Q205_3b_1=$_POST['Q205_3b_1'];
$Q205_3b_2=$_POST['Q205_3b_2'];
$Q205_3b_3=$_POST['Q205_3b_3'];
$Q205_3c_1=$_POST['Q205_3c_1'];
$Q205_3c_2=$_POST['Q205_3c_2'];
$Q205_3c_3=$_POST['Q205_3c_3'];
$Q301=$_POST['Q301'];
$Q302=$_POST['Q302'];
$Q302Other=$_POST['Q302Other'];
$Q401=$_POST['Q401'];
$Q402a=$_POST['Q402a'];
$Q402b=$_POST['Q402b'];
$Q403=$_POST['Q403'];
$Q404=$_POST['Q404'];
$Q405=$_POST['Q405'];
$Q501=$_POST['Q501'];
$Q502=$_POST['Q502'];
$Q503=$_POST['Q503'];
$Q504=$_POST['Q504'];
$Q505=$_POST['Q505'];
$Q506=$_POST['Q506'];
$Q601=$_POST['Q601'];
$Q602=$_POST['Q602'];
$Q603a=$_POST['Q603a'];
$Q603b=$_POST['Q603b'];
$Q603c=$_POST['Q603c'];
$Q604=$_POST['Q604'];
$Q605=$_POST['Q605'];
$Q701=$_POST['Q701'];
$Q702=$_POST['Q702'];
$Q703=$_POST['Q703'];
$Q704a=$_POST['Q704a'];
$Q704a_time=$_POST['Q704a_time'];
$Q704a_day=$_POST['Q704a_day'];
$Q704b=$_POST['Q704b'];
$Q704b_time=$_POST['Q704b_time'];
$Q704b_day=$_POST['Q704b_day'];
$Q704c=$_POST['Q704c'];
$Q704c_time=$_POST['Q704c_time'];
$Q704c_day=$_POST['Q704c_day'];
$Q704d=$_POST['Q704d'];
$Q704d_time=$_POST['Q704d_time'];
$Q704d_day=$_POST['Q704d_day'];
$Q704e=$_POST['Q704e'];
$Q704e_time=$_POST['Q704e_time'];
$Q704e_day=$_POST['Q704e_day'];
$Q704f=$_POST['Q704f'];
$Q704f_time=$_POST['Q704f_time'];
$Q704f_day=$_POST['Q704f_day'];
$Q801=$_POST['Q801'];
$Q901=$_POST['Q901'];
$DA2_UserID=$_POST['DA2_UserID'];
$DA2_EnDt=$_POST['DA2_EnDt'];
$QCUser=$_POST['DA2_UserID'];
for($count = 0; $count<count($Child_ID); $count++){
$Child_ID_clean=mysqli_real_escape_string($con,$Child_ID[$count]);
$Upazila_Code_clean=mysqli_real_escape_string($con,$Upazila_Code[$count]);
$Union_code_clean=mysqli_real_escape_string($con,$Union_code[$count]);
$Village_code_clean=mysqli_real_escape_string($con,$Village_code[$count]);
$Bari_code_clean=mysqli_real_escape_string($con,$Bari_code[$count]);
$HH_code_clean=mysqli_real_escape_string($con,$HH_code[$count]);
$CC_code_clean=mysqli_real_escape_string($con,$CC_code[$count]);
$Child_PID_clean=mysqli_real_escape_string($con,$Child_PID[$count]);
$Child_name_clean=mysqli_real_escape_string($con,$Child_name[$count]);
$Mother_name_clean=mysqli_real_escape_string($con,$Mother_name[$count]);
$MCID_clean=mysqli_real_escape_string($con,$MCID[$count]);
$MPID_clean=mysqli_real_escape_string($con,$MPID[$count]);
$Father_name_clean=mysqli_real_escape_string($con,$Father_name[$count]);
$Mobile_clean=mysqli_real_escape_string($con,$Mobile[$count]);
$ChDob_clean=mysqli_real_escape_string($con,$ChDob[$count]);
$ChildAge_clean=mysqli_real_escape_string($con,$ChildAge[$count]);
$ChildSex_clean=mysqli_real_escape_string($con,$ChildSex[$count]);
$CHCP_code_clean=mysqli_real_escape_string($con,$CHCP_code[$count]);
$IntStartDate_clean=mysqli_real_escape_string($con,$IntStartDate[$count]);
$IntStartTime_clean=mysqli_real_escape_string($con,$IntStartTime[$count]);
$Q119_clean=mysqli_real_escape_string($con,$Q119[$count]);
$Q119Other_clean=mysqli_real_escape_string($con,$Q119Other[$count]);
$Q120_clean=mysqli_real_escape_string($con,$Q120[$count]);
$Q120Other_clean=mysqli_real_escape_string($con,$Q120Other[$count]);
$Q201a_clean=mysqli_real_escape_string($con,$Q201a[$count]);
$Q201a_day_clean=mysqli_real_escape_string($con,$Q201a_day[$count]);
$Q201b_clean=mysqli_real_escape_string($con,$Q201b[$count]);
$Q201b_day_clean=mysqli_real_escape_string($con,$Q201b_day[$count]);
$Q201c_clean=mysqli_real_escape_string($con,$Q201c[$count]);
$Q201c_day_clean=mysqli_real_escape_string($con,$Q201c_day[$count]);
$Q201d_clean=mysqli_real_escape_string($con,$Q201d[$count]);
$Q201d_day_clean=mysqli_real_escape_string($con,$Q201d_day[$count]);
$Q201e_clean=mysqli_real_escape_string($con,$Q201e[$count]);
$Q201e_day_clean=mysqli_real_escape_string($con,$Q201e_day[$count]);
$Q202_clean=mysqli_real_escape_string($con,$Q202[$count]);
$Q202_day_clean=mysqli_real_escape_string($con,$Q202_day[$count]);
$Q203_clean=mysqli_real_escape_string($con,$Q203[$count]);
$Q203_day_clean=mysqli_real_escape_string($con,$Q203_day[$count]);
$Q204_clean=mysqli_real_escape_string($con,$Q204[$count]);
$Q204_day_clean=mysqli_real_escape_string($con,$Q204_day[$count]);
$Q205_1_clean=mysqli_real_escape_string($con,$Q205_1[$count]);
$Q205_2_clean=mysqli_real_escape_string($con,$Q205_2[$count]);
$Q205_3a_1_clean=mysqli_real_escape_string($con,$Q205_3a_1[$count]);
$Q205_3a_2_clean=mysqli_real_escape_string($con,$Q205_3a_2[$count]);
$Q205_3a_3_clean=mysqli_real_escape_string($con,$Q205_3a_3[$count]);
$Q205_3b_1_clean=mysqli_real_escape_string($con,$Q205_3b_1[$count]);
$Q205_3b_2_clean=mysqli_real_escape_string($con,$Q205_3b_2[$count]);
$Q205_3b_3_clean=mysqli_real_escape_string($con,$Q205_3b_3[$count]);
$Q205_3c_1_clean=mysqli_real_escape_string($con,$Q205_3c_1[$count]);
$Q205_3c_2_clean=mysqli_real_escape_string($con,$Q205_3c_2[$count]);
$Q205_3c_3_clean=mysqli_real_escape_string($con,$Q205_3c_3[$count]);
$Q301_clean=mysqli_real_escape_string($con,$Q301[$count]);
$Q302_clean=mysqli_real_escape_string($con,$Q302[$count]);
$Q302Other_clean=mysqli_real_escape_string($con,$Q302Other[$count]);
$Q401_clean=mysqli_real_escape_string($con,$Q401[$count]);
$Q402a_clean=mysqli_real_escape_string($con,$Q402a[$count]);
$Q402b_clean=mysqli_real_escape_string($con,$Q402b[$count]);
$Q403_clean=mysqli_real_escape_string($con,$Q403[$count]);
$Q404_clean=mysqli_real_escape_string($con,$Q404[$count]);
$Q405_clean=mysqli_real_escape_string($con,$Q405[$count]);
$Q501_clean=mysqli_real_escape_string($con,$Q501[$count]);
$Q502_clean=mysqli_real_escape_string($con,$Q502[$count]);
$Q503_clean=mysqli_real_escape_string($con,$Q503[$count]);
$Q504_clean=mysqli_real_escape_string($con,$Q504[$count]);
$Q505_clean=mysqli_real_escape_string($con,$Q505[$count]);
$Q506_clean=mysqli_real_escape_string($con,$Q506[$count]);
$Q601_clean=mysqli_real_escape_string($con,$Q601[$count]);
$Q602_clean=mysqli_real_escape_string($con,$Q602[$count]);
$Q603a_clean=mysqli_real_escape_string($con,$Q603a[$count]);
$Q603b_clean=mysqli_real_escape_string($con,$Q603b[$count]);
$Q603c_clean=mysqli_real_escape_string($con,$Q603c[$count]);
$Q604_clean=mysqli_real_escape_string($con,$Q604[$count]);
$Q605_clean=mysqli_real_escape_string($con,$Q605[$count]);
$Q701_clean=mysqli_real_escape_string($con,$Q701[$count]);
$Q702_clean=mysqli_real_escape_string($con,$Q702[$count]);
$Q703_clean=mysqli_real_escape_string($con,$Q703[$count]);
$Q704a_clean=mysqli_real_escape_string($con,$Q704a[$count]);
$Q704a_time_clean=mysqli_real_escape_string($con,$Q704a_time[$count]);
$Q704a_day_clean=mysqli_real_escape_string($con,$Q704a_day[$count]);
$Q704b_clean=mysqli_real_escape_string($con,$Q704b[$count]);
$Q704b_time_clean=mysqli_real_escape_string($con,$Q704b_time[$count]);
$Q704b_day_clean=mysqli_real_escape_string($con,$Q704b_day[$count]);
$Q704c_clean=mysqli_real_escape_string($con,$Q704c[$count]);
$Q704c_time_clean=mysqli_real_escape_string($con,$Q704c_time[$count]);
$Q704c_day_clean=mysqli_real_escape_string($con,$Q704c_day[$count]);
$Q704d_clean=mysqli_real_escape_string($con,$Q704d[$count]);
$Q704d_time_clean=mysqli_real_escape_string($con,$Q704d_time[$count]);
$Q704d_day_clean=mysqli_real_escape_string($con,$Q704d_day[$count]);
$Q704e_clean=mysqli_real_escape_string($con,$Q704e[$count]);
$Q704e_time_clean=mysqli_real_escape_string($con,$Q704e_time[$count]);
$Q704e_day_clean=mysqli_real_escape_string($con,$Q704e_day[$count]);
$Q704f_clean=mysqli_real_escape_string($con,$Q704f[$count]);
$Q704f_time_clean=mysqli_real_escape_string($con,$Q704f_time[$count]);
$Q704f_day_clean=mysqli_real_escape_string($con,$Q704f_day[$count]);
$Q801_clean=mysqli_real_escape_string($con,$Q801[$count]);
$Q901_clean=mysqli_real_escape_string($con,$Q901[$count]);
$DA2_UserID_clean=mysqli_real_escape_string($con,$DA2_UserID[$count]);
$DA2_EnDt_clean=mysqli_real_escape_string($con,$DA2_EnDt[$count]);
$QC_cleanUser = mysqli_real_escape_string($con, $QCUser[$count]);
if(!empty($DA2_EnDt_clean)){
if($QC_cleanUser=='5551' || $QC_cleanUser=='5552' || $QC_cleanUser=='5553'){$QC_clean = '1';} else{$QC_clean ='2';}
$q .= 'INSERT ignore INTO `d2`(
`QC`,
`Child_ID`,
`Upazila_Code`,
`Union_code`,
`Village_code`,
`Bari_code`,
`HH_code`,
`CC_code`,
`Child_PID`,
`Child_name`,
`Mother_name`,
`MCID`,
`MPID`,
`Father_name`,
`Mobile`,
`ChDob`,
`ChildAge`,
`ChildSex`,
`CHCP_code`,
`IntStartDate`,
`IntStartTime`,
`Q119`,
`Q119Other`,
`Q120`,
`Q120Other`,
`Q201a`,
`Q201a_day`,
`Q201b`,
`Q201b_day`,
`Q201c`,
`Q201c_day`,
`Q201d`,
`Q201d_day`,
`Q201e`,
`Q201e_day`,
`Q202`,
`Q202_day`,
`Q203`,
`Q203_day`,
`Q204`,
`Q204_day`,
`Q205_1`,
`Q205_2`,
`Q205_3a_1`,
`Q205_3a_2`,
`Q205_3a_3`,
`Q205_3b_1`,
`Q205_3b_2`,
`Q205_3b_3`,
`Q205_3c_1`,
`Q205_3c_2`,
`Q205_3c_3`,
`Q301`,
`Q302`,
`Q302Other`,
`Q401`,
`Q402a`,
`Q402b`,
`Q403`,
`Q404`,
`Q405`,
`Q501`,
`Q502`,
`Q503`,
`Q504`,
`Q505`,
`Q506`,
`Q601`,
`Q602`,
`Q603a`,
`Q603b`,
`Q603c`,
`Q604`,
`Q605`,
`Q701`,
`Q702`,
`Q703`,
`Q704a`,
`Q704a_time`,
`Q704a_day`,
`Q704b`,
`Q704b_time`,
`Q704b_day`,
`Q704c`,
`Q704c_time`,
`Q704c_day`,
`Q704d`,
`Q704d_time`,
`Q704d_day`,
`Q704e`,
`Q704e_time`,
`Q704e_day`,
`Q704f`,
`Q704f_time`,
`Q704f_day`,
`Q801`,
`Q901`,
`Entry_User_ID`,
`Entry_Date`,
`dataTransferredOn`) VALUES(
"'.$QC_clean.'",
"'.$Child_ID_clean.'",
"'.$Upazila_Code_clean.'",
"'.$Union_code_clean.'",
"'.$Village_code_clean.'",
"'.$Bari_code_clean.'",
"'.$HH_code_clean.'",
"'.$CC_code_clean.'",
"'.$Child_PID_clean.'",
"'.$Child_name_clean.'",
"'.$Mother_name_clean.'",
"'.$MCID_clean.'",
"'.$MPID_clean.'",
"'.$Father_name_clean.'",
"'.$Mobile_clean.'",
"'.$ChDob_clean.'",
"'.$ChildAge_clean.'",
"'.$ChildSex_clean.'",
"'.$CHCP_code_clean.'",
"'.$IntStartDate_clean.'",
"'.$IntStartTime_clean.'",
"'.$Q119_clean.'",
"'.$Q119Other_clean.'",
"'.$Q120_clean.'",
"'.$Q120Other_clean.'",
"'.$Q201a_clean.'",
"'.$Q201a_day_clean.'",
"'.$Q201b_clean.'",
"'.$Q201b_day_clean.'",
"'.$Q201c_clean.'",
"'.$Q201c_day_clean.'",
"'.$Q201d_clean.'",
"'.$Q201d_day_clean.'",
"'.$Q201e_clean.'",
"'.$Q201e_day_clean.'",
"'.$Q202_clean.'",
"'.$Q202_day_clean.'",
"'.$Q203_clean.'",
"'.$Q203_day_clean.'",
"'.$Q204_clean.'",
"'.$Q204_day_clean.'",
"'.$Q205_1_clean.'",
"'.$Q205_2_clean.'",
"'.$Q205_3a_1_clean.'",
"'.$Q205_3a_2_clean.'",
"'.$Q205_3a_3_clean.'",
"'.$Q205_3b_1_clean.'",
"'.$Q205_3b_2_clean.'",
"'.$Q205_3b_3_clean.'",
"'.$Q205_3c_1_clean.'",
"'.$Q205_3c_2_clean.'",
"'.$Q205_3c_3_clean.'",
"'.$Q301_clean.'",
"'.$Q302_clean.'",
"'.$Q302Other_clean.'",
"'.$Q401_clean.'",
"'.$Q402a_clean.'",
"'.$Q402b_clean.'",
"'.$Q403_clean.'",
"'.$Q404_clean.'",
"'.$Q405_clean.'",
"'.$Q501_clean.'",
"'.$Q502_clean.'",
"'.$Q503_clean.'",
"'.$Q504_clean.'",
"'.$Q505_clean.'",
"'.$Q506_clean.'",
"'.$Q601_clean.'",
"'.$Q602_clean.'",
"'.$Q603a_clean.'",
"'.$Q603b_clean.'",
"'.$Q603c_clean.'",
"'.$Q604_clean.'",
"'.$Q605_clean.'",
"'.$Q701_clean.'",
"'.$Q702_clean.'",
"'.$Q703_clean.'",
"'.$Q704a_clean.'",
"'.$Q704a_time_clean.'",
"'.$Q704a_day_clean.'",
"'.$Q704b_clean.'",
"'.$Q704b_time_clean.'",
"'.$Q704b_day_clean.'",
"'.$Q704c_clean.'",
"'.$Q704c_time_clean.'",
"'.$Q704c_day_clean.'",
"'.$Q704d_clean.'",
"'.$Q704d_time_clean.'",
"'.$Q704d_day_clean.'",
"'.$Q704e_clean.'",
"'.$Q704e_time_clean.'",
"'.$Q704e_day_clean.'",
"'.$Q704f_clean.'",
"'.$Q704f_time_clean.'",
"'.$Q704f_day_clean.'",
"'.$Q801_clean.'",
"'.$Q901_clean.'",
"'.$DA2_UserID_clean.'",
"'.$DA2_EnDt_clean.'",
CURDATE());';
}
}
if($q!=''){
mysqli_multi_query($con,$q);
}
else{
echo "error";
}
echo "success";
}
?>