Merge pull request #766 from bogey3/patch-1

Resolved division by 0 error that occurs in a weekly report for the first week of use where no previous data exists.
This commit is contained in:
ehpersonal38
2023-02-28 17:18:05 -05:00
committed by GitHub
+4
View File
@@ -100,6 +100,7 @@ if(isset($_GET['ascii'])) {
$priorweekcount = $totalcount['COUNT(*)'];
// really percent changed
if($priorweekcount > 0){
$percentagediff = round( (($scount - $priorweekcount) / $priorweekcount) * 100 );
if($percentagediff > 0) {
@@ -109,6 +110,9 @@ if(isset($_GET['ascii'])) {
}
echo $com_name." - ".$scount." (".$percentagediff.")<br>";
} else {
echo $com_name." - ".$scount ."<br>";
}
}
}