diff --git a/index.php b/index.php index 3304e1a..a82b96f 100644 --- a/index.php +++ b/index.php @@ -41,7 +41,8 @@ if ($result->num_rows > 0 && $result2->num_rows >0 && $result3->num_rows && $res $row4 = $result4->fetch_assoc(); $saved_lifetime = round(($row["lifetime"] / 1000) * $price,2); $saved_year = round(($row["year"] / 1000) * $price,2); - $jsonres = array("today"=>$row["today"], "yesterday"=>$row4["today"], "week"=>$row2["week"], "last_week"=>$row3["week"], "month"=>$row["month"], "year"=>$row["year"], "lifetime"=>$row["lifetime"], "current"=>$row["current"], "saved_lifetime"=>$saved_lifetime, "saved_year"=>$saved_year, "last_update"=>$row["last_update"]); + $saved = round(($row["today"] / 1000) * $price,2); + $jsonres = array("today"=>$row["today"], "yesterday"=>$row4["today"], "week"=>$row2["week"], "last_week"=>$row3["week"], "month"=>$row["month"], "year"=>$row["year"], "lifetime"=>$row["lifetime"], "current"=>$row["current"], "saved"=>$saved, "saved_lifetime"=>$saved_lifetime, "saved_year"=>$saved_year, "last_update"=>$row["last_update"]); } } else { $jsonres = array("Error"=>"No result from database.");