-
Notifications
You must be signed in to change notification settings - Fork 0
/
admintest2.php
66 lines (50 loc) · 1.86 KB
/
admintest2.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
<?php
include "db.php";
include "header.php";
$trabahongtamad = "select * from member where reltohh = '1'";
$process1 = mysqli_query($db, $trabahongtamad);
foreach($process1 as $member){
$arrayofencoded[] = $member['memberprimary'];
}
echo "Array of primary member encoded<br>";
// print_r($arrayofencoded);
// $filter = "select * from beneficiary where "
$getallbens = "select * from beneficiary";
$process2 = mysqli_query($db, $getallbens);
foreach($process2 as $ben){
$arrayofallbeneficiaries[] = $ben['id'];
}
echo "<br>";
echo "arrayofallbeneficiaries: <br>";
// print_r($arrayofallbeneficiaries);
echo "<br>BREAK<br>";
echo "<br>";
echo "<br>BREAK<br>";
foreach($arrayofallbeneficiaries as $beneficiary){
if(!in_array($beneficiary, $arrayofencoded)){
$dinaencodearray[] = $beneficiary;
}
}
echo "<br>BREAK<br>";
echo "# of dinaencode <br>";
// $count = count($dinaencodearray);
// echo "$count<br>";
// print_r($count);
echo "<br>BREAK<br>";
echo "Di naencode array:<br>";
print_r($dinaencodearray);
// foreach($dinaencodearray as $tobeadded){
// $lname = $tobeadded['lastname'];
// $fname = $tobeadded['firstname'];
// $mname = $tobeadded['middlename'];
// $ext = $tobeadded['extension'];
// $sex = $tobeadded['sex'];
// $dob = $tobeadded['dob'];
// $work = $tobeadded['work'];
// $sectorid = $tobeadded['sectorid'];
// $health = $tobeadded['healthconditionid'];
// $memberprim = $tobeadded['id'];
// $addtomembertable = "INSERT INTO member(lastname, firstname, middlename, extension, reltohh, sex, dob, work, sectorid, healthconditionid, memberprimary, enteredby) VALUES ('$lname', '$fname', '$mname', '$ext', '1', '$sex', '$dob', '$work', '$sectorid', '$health', '$memberprim', '11')";
// mysqli_query($db, $addtomembertable) or trigger_error("Query failed: ".mysqli_error($db), E_USER_ERROR);
// }
?>