-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexportFollowupU.php
35 lines (26 loc) · 1.16 KB
/
exportFollowupU.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
<?php
// Include Database connection
include("config/config.php");
// Include SimpleXLSXGen library
include("SimpleXLSXGen.php");
$followUps = [
['OB Number', 'Incident Type', 'Incident Date',
'Follow Up Date/Time', 'Follow Name', 'Case Description', 'Action Taken', 'Case Status']
];
$sql = "SELECT * FROM followedup_table";
$res = mysqli_query($conn, $sql);
if($res == TRUE){
?>
$image1 = <img src="<?php echo SITEURL;?>OB Images/ObImage<?php echo $img1;?>">
<?php
$count = mysqli_num_rows($res);
if($count>0){
while($row = mysqli_fetch_assoc($res)){
$followUps = array_merge($followUps, array(array($row['ob_number'],
$row['incident_type'], $row['date_time'], $row['incident_date'], $row['follower_name'],
$row['case_desc'], $row['action_taken'], $row['case_status'])));
}
}
}
$xlsx = SimpleXLSXGen::fromArray($followUps);
$xlsx->downloadAs('followUps.xlsx');