-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.php
More file actions
35 lines (31 loc) · 1.04 KB
/
data.php
File metadata and controls
35 lines (31 loc) · 1.04 KB
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
<?php
$myData = "";
$query = "SELECT est_end_date, end_date FROM tasks WHERE est_end_date = end_date ";
$onTime = 0;
$before = 0;
$afterr = 0;
$total = 0;
$result= $db->query($query);
if (mysqli_num_rows($result) > 0)
while($r = mysqli_fetch_array($result)) {
$onTime++;
$total++;
}
$query = "SELECT est_end_date, end_date FROM tasks WHERE est_end_date > end_date";
$result= $db->query($query);
if (mysqli_num_rows($result) > 0)
while($r = mysqli_fetch_array($result)) {
$before++;
$total++;
}
$query = "SELECT est_end_date, end_date FROM tasks WHERE est_end_date < end_date";
$result= $db->query($query);
if (mysqli_num_rows($result) > 0)
while($r = mysqli_fetch_array($result)) {
$afterr++;
$total++;
}
$myData .= "[ 'On Time', " . (($onTime/$total)*100). " ], ";
$myData .= "[ 'Delayed', " . (($afterr/$total)*100). " ], ";
$myData .= "[ 'Early', " . (($before/$total)*100). " ]";
?>