-
Notifications
You must be signed in to change notification settings - Fork 0
/
check6.php
50 lines (45 loc) · 915 Bytes
/
check6.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
<?php
session_start();
error_reporting(0);
include 'connect.php';
include 'security.php';
$casesheet = $_SESSION['caseid'];
$var = "eye_".$_SESSION['hospital_id'];
$eye = $client->$var;
$collection = $eye->$casesheet;
$k = 0;
$m = 0;
for($i=0;$i<6;$i++)
{
$str = "b".$i;
if(isset($_POST[$str]))
{
if($k==0)
{
$collection->insertOne(['_id' => 'HISTORY OF EXPOSURE']);
$k = 1;
}
$str1 = "a".$m;
$collection->updateOne(['_id'=>'HISTORY OF EXPOSURE'],['$set' => [$str1 => encrypt($_POST[$str])]]);
$m+=1;
}
}
$r = 0;
$n = 0;
for($i=0;$i<4;$i++)
{
$str = "a".$i;
if(isset($_POST[$str]))
{
if($r==0)
{
$collection->insertOne(['_id' => 'FAMILY HISTORY']);
$r = 1;
}
$str1 = "a".$n;
$collection->updateOne(['_id'=>'FAMILY HISTORY'],['$set' => [$str1 => encrypt($_POST[$str])]]);
$n +=1;
}
}
header('Location:page9.php');
?>