-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
33 lines (31 loc) · 855 Bytes
/
test.php
File metadata and controls
33 lines (31 loc) · 855 Bytes
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
<?php
/**
* Created by PhpStorm.
* User: eyinade
* Date: 5/3/2016
* Time: 12:50 PM
*/
require('./Insurance.php');
require('./Patient.php');
$today = date('m-d-y');
$link = new db();
$patients = [];
$info = "";
$query = "SELECT p.pn, p.last, p.first, i._id, i.iname, i.from_date, i.to_date from patient p ";
$query .= 'JOIN insurance as i on p._id = i.patient_id ';
$query .= 'ORDER BY p.pn';
$res = $link->exec($query);
var_dump($res);
while ($row=$res->fetch_assoc()){
$cover = new Insurance($row['_id']);
if($cover->checkPolicyValidity($today) === "True"){
$row['ivalid'] = "Yes";
}else{
$row['ivalid'] = "No";
}
$patients[] = $row;
}
$link->disconnect();
foreach($patients as $patient){
echo $patient['pn'].','.$patient['first'].','.$patient['last'].','.$patient['iname'].','.$patient['ivalid']."\n";
}