Created
August 26, 2013 17:31
-
-
Save kevinvangelder/6344156 to your computer and use it in GitHub Desktop.
Country Restoration Satisfaction Old
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$total = db_query_row("SELECT SUM(overall_customer_service) FROM surveys WHERE approved = 1"); | |
$survey_count = db_count("surveys", "WHERE approved = 1"); | |
$added_up = $total["SUM(overall_customer_service)"]; | |
$average = ((103 * 9.733) + $added_up) / (103 + $survey_count); // this is taking into account the previous (103) unadded surveys | |
$rating = number_format((($average * 1000) / 100), 2); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment