dates->date as $avgdatagraph) { $avgconc[$g] = $avgdatagraph->concentration; $avgaqi[$g] = $avgdatagraph->aqi; if($type=="aqi"){ $avggraphvalue = $avgaqi[$g]; }else{ $avggraphvalue = $avgconc[$g]; }; if($avggraphvalue !=""){ $avggraphdata .= $avggraphvalue.","; } $g=$g+1; }; if($pollutant == "pm10"){ $pollutantname = "PM10"; $pollutantnamegraph = "PM10"; if($type == "conc"){ $graphmax=180; $usglinegraph = "155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155"; }else { $graphmax=140; $usglinegraph = "101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101"; }; }; if($pollutant == "pm25"){ $pollutantname = "PM2.5"; $pollutantnamegraph = "PM2.5"; if($type == "conc"){ $graphmax=40; $usglinegraph= "35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35"; }else { $graphmax=140; $usglinegraph = "101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101"; }; }; if($pollutant == "ozone"){ $pollutantname = "Ozone"; $pollutantnamegraph = "Ozone"; if($type == "conc"){ $graphmax=90; $usglinegraph = "71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71,71"; }else{ $graphmax=140; $usglinegraph = "101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101"; }; }; //Pull data from xml files $filename = "https://static.azdeq.gov/aqd/forecast/data/yeartodate/" . $year . "_" . $location . "_" . $pollutant . ".xml"; $xml = simplexml_load_file($filename); foreach ($xml->dates->date as $date) { // Pull data from XML and place into array $month_ytd[$j] = $date->month; //$sitename_ytd[$j] = $date->sitename; $concentration_ytd[$j] = $date->concentration; $aqi_ytd[$j] = $date->aqi; //$hourly_ytd[$j] = $date->hourly; $catcheck = $aqi_ytd[$j]; if($catcheck == "null"){ $catcheck=9999; }; if($type == "aqi"){ $value = $aqi_ytd[$j]; if($value == "null"){ $value = ""; }; }else{ $value = $concentration_ytd[$j]; if($value == "null"){ $value = ""; }; }; if($value !=""){ $actualgraphdata .= $value.","; }else{ $actualgraphdata .= "null,"; } // Pick if concentrations or AQI will be displayed based on user input if($month_ytd[$j] == "1"){ $janvalue[$cjan] = $value; if ($catcheck < 51) { $daycolor_jan[$cjan] = "good"; $goodcount = $goodcount + 1; } ; if ($catcheck > 50 && $catcheck < 101) { $daycolor_jan[$cjan] = "moderate"; $moderatecount = $moderatecount + 1; } ; if ($catcheck > 100 && $catcheck < 151) { $daycolor_jan[$cjan] = "usg"; $excount = $excount + 1; } ; if ($catcheck > 150 && $catcheck < 201) { $daycolor_jan[$cjan] = "unhealthy"; $excount = $excount + 1; } ; if ($catcheck > 200 && $catcheck < 301) { $daycolor_jan[$cjan] = "veryunhealthy"; $excount = $excount + 1; } ; if ($catcheck > 300 && $catcheck !=9999) { $daycolor_jan[$cjan] = "hazardous"; $excount = $excount + 1; } ; if ($catcheck == 9999) { $daycolor_jan[$cjan] = "notavailable"; } ; $cjan=$cjan+1; }; if($month_ytd[$j] == "2"){ $febvalue[$cfeb] = $value; if ($catcheck < 51) { $daycolor_feb[$cfeb] = "good"; $goodcount = $goodcount + 1; } ; if ($catcheck > 50 && $catcheck < 101) { $daycolor_feb[$cfeb] = "moderate"; $moderatecount = $moderatecount + 1; } ; if ($catcheck > 100 && $catcheck < 151) { $daycolor_feb[$cfeb] = "usg"; $excount = $excount + 1; } ; if ($catcheck > 150 && $catcheck < 201) { $daycolor_feb[$cfeb] = "unhealthy"; $excount = $excount + 1; } ; if ($catcheck > 200 && $catcheck < 301) { $daycolor_feb[$cfeb] = "veryunhealthy"; $excount = $excount + 1; } ; if ($catcheck > 300 && $catcheck !=9999) { $daycolor_feb[$cfeb] = "hazardous"; $excount = $excount + 1; } ; if ($catcheck == 9999) { $daycolor_feb[$cfeb] = "notavailable"; } ; $cfeb=$cfeb+1; }; if($month_ytd[$j] == "3"){ $marvalue[$cmar] = $value; if ($catcheck < 51) { $daycolor_mar[$cmar] = "good"; $goodcount = $goodcount + 1; } ; if ($catcheck > 50 && $catcheck < 101) { $daycolor_mar[$cmar] = "moderate"; $moderatecount = $moderatecount + 1; } ; if ($catcheck > 100 && $catcheck < 151) { $daycolor_mar[$cmar] = "usg"; $excount = $excount + 1; } ; if ($catcheck > 150 && $catcheck < 201) { $daycolor_mar[$cmar] = "unhealthy"; $excount = $excount + 1; } ; if ($catcheck > 200 && $catcheck < 301) { $daycolor_mar[$cmar] = "veryunhealthy"; $excount = $excount + 1; } ; if ($catcheck > 300 && $catcheck !=9999) { $daycolor_mar[$cmar] = "hazardous"; $excount = $excount + 1; } ; if ($catcheck == 9999) { $daycolor_mar[$cmar] = "notavailable"; } ; $cmar=$cmar+1; }; if($month_ytd[$j] == "4"){ $aprvalue[$capr] = $value; if ($catcheck < 51) { $daycolor_apr[$capr] = "good"; $goodcount = $goodcount + 1; } ; if ($catcheck > 50 && $catcheck < 101) { $daycolor_apr[$capr] = "moderate"; $moderatecount = $moderatecount + 1; } ; if ($catcheck > 100 && $catcheck < 151) { $daycolor_apr[$capr] = "usg"; $excount = $excount + 1; } ; if ($catcheck > 150 && $catcheck < 201) { $daycolor_apr[$capr] = "unhealthy"; $excount = $excount + 1; } ; if ($catcheck > 200 && $catcheck < 301) { $daycolor_apr[$capr] = "veryunhealthy"; $excount = $excount + 1; } ; if ($catcheck > 300 && $catcheck !=9999) { $daycolor_apr[$capr] = "hazardous"; $excount = $excount + 1; } ; if ($catcheck == 9999) { $daycolor_apr[$capr] = "notavailable"; } ; $capr=$capr+1; }; if($month_ytd[$j] == "5"){ $mayvalue[$cmay] = $value; if ($catcheck < 51) { $daycolor_may[$cmay] = "good"; $goodcount = $goodcount + 1; } ; if ($catcheck > 50 && $catcheck < 101) { $daycolor_may[$cmay] = "moderate"; $moderatecount = $moderatecount + 1; } ; if ($catcheck > 100 && $catcheck < 151) { $daycolor_may[$cmay] = "usg"; $excount = $excount + 1; } ; if ($catcheck > 150 && $catcheck < 201) { $daycolor_may[$cmay] = "unhealthy"; $excount = $excount + 1; } ; if ($catcheck > 200 && $catcheck < 301) { $daycolor_may[$cmay] = "veryunhealthy"; $excount = $excount + 1; } ; if ($catcheck > 300 && $catcheck !=9999) { $daycolor_may[$cmay] = "hazardous"; $excount = $excount + 1; } ; if ($catcheck == 9999) { $daycolor_may[$cmay] = "notavailable"; } ; $cmay=$cmay+1; }; if($month_ytd[$j] == "6"){ $junvalue[$cjun] = $value; if ($catcheck < 51) { $daycolor_jun[$cjun] = "good"; $goodcount = $goodcount + 1; } ; if ($catcheck > 50 && $catcheck < 101) { $daycolor_jun[$cjun] = "moderate"; $moderatecount = $moderatecount + 1; } ; if ($catcheck > 100 && $catcheck < 151) { $daycolor_jun[$cjun] = "usg"; $excount = $excount + 1; } ; if ($catcheck > 150 && $catcheck < 201) { $daycolor_jun[$cjun] = "unhealthy"; $excount = $excount + 1; } ; if ($catcheck > 200 && $catcheck < 301) { $daycolor_jun[$cjun] = "veryunhealthy"; $excount = $excount + 1; } ; if ($catcheck > 300 && $catcheck !=9999) { $daycolor_jun[$cjun] = "hazardous"; $excount = $excount + 1; } ; if ($catcheck == 9999) { $daycolor_jun[$cjun] = "notavailable"; } ; $cjun=$cjun+1; }; if($month_ytd[$j] == "7"){ $julvalue[$cjul] = $value; if ($catcheck < 51) { $daycolor_jul[$cjul] = "good"; $goodcount = $goodcount + 1; } ; if ($catcheck > 50 && $catcheck < 101) { $daycolor_jul[$cjul] = "moderate"; $moderatecount = $moderatecount + 1; } ; if ($catcheck > 100 && $catcheck < 151) { $daycolor_jul[$cjul] = "usg"; $excount = $excount + 1; } ; if ($catcheck > 150 && $catcheck < 201) { $daycolor_jul[$cjul] = "unhealthy"; $excount = $excount + 1; } ; if ($catcheck > 200 && $catcheck < 301) { $daycolor_jul[$cjul] = "veryunhealthy"; $excount = $excount + 1; } ; if ($catcheck > 300 && $catcheck !=9999) { $daycolor_jul[$cjul] = "hazardous"; $excount = $excount + 1; } ; if ($catcheck == 9999) { $daycolor_jul[$cjul] = "notavailable"; } ; $cjul=$cjul+1; }; if($month_ytd[$j] == "8"){ $augvalue[$caug] = $value; if ($catcheck < 51) { $daycolor_aug[$caug] = "good"; $goodcount = $goodcount + 1; } ; if ($catcheck > 50 && $catcheck < 101) { $daycolor_aug[$caug] = "moderate"; $moderatecount = $moderatecount + 1; } ; if ($catcheck > 100 && $catcheck < 151) { $daycolor_aug[$caug] = "usg"; $excount = $excount + 1; } ; if ($catcheck > 150 && $catcheck < 201) { $daycolor_aug[$caug] = "unhealthy"; $excount = $excount + 1; } ; if ($catcheck > 200 && $catcheck < 301) { $daycolor_aug[$caug] = "veryunhealthy"; $excount = $excount + 1; } ; if ($catcheck > 300 && $catcheck !=9999) { $daycolor_aug[$caug] = "hazardous"; $excount = $excount + 1; } ; if ($catcheck == 9999) { $daycolor_aug[$caug] = "notavailable"; } ; $caug=$caug+1; }; if($month_ytd[$j] == "9"){ $sepvalue[$csep] = $value; if ($catcheck < 51) { $daycolor_sep[$csep] = "good"; $goodcount = $goodcount + 1; } ; if ($catcheck > 50 && $catcheck < 101) { $daycolor_sep[$csep] = "moderate"; $moderatecount = $moderatecount + 1; } ; if ($catcheck > 100 && $catcheck < 151) { $daycolor_sep[$csep] = "usg"; $excount = $excount + 1; } ; if ($catcheck > 150 && $catcheck < 201) { $daycolor_sep[$csep] = "unhealthy"; $excount = $excount + 1; } ; if ($catcheck > 200 && $catcheck < 301) { $daycolor_sep[$csep] = "veryunhealthy"; $excount = $excount + 1; } ; if ($catcheck > 300 && $catcheck !=9999) { $daycolor_sep[$csep] = "hazardous"; $excount = $excount + 1; } ; if ($catcheck == 9999) { $daycolor_sep[$csep] = "notavailable"; } ; $csep=$csep+1; }; if($month_ytd[$j] == "10"){ $octvalue[$coct] = $value; if ($catcheck < 51) { $daycolor_oct[$coct] = "good"; $goodcount = $goodcount + 1; } ; if ($catcheck > 50 && $catcheck < 101) { $daycolor_oct[$coct] = "moderate"; $moderatecount = $moderatecount + 1; } ; if ($catcheck > 100 && $catcheck < 151) { $daycolor_oct[$coct] = "usg"; $excount = $excount + 1; } ; if ($catcheck > 150 && $catcheck < 201) { $daycolor_oct[$coct] = "unhealthy"; $excount = $excount + 1; } ; if ($catcheck > 200 && $catcheck < 301) { $daycolor_oct[$coct] = "veryunhealthy"; $excount = $excount + 1; } ; if ($catcheck > 300 && $catcheck !=9999) { $daycolor_oct[$coct] = "hazardous"; $excount = $excount + 1; } ; if ($catcheck == 9999) { $daycolor_oct[$coct] = "notavailable"; } ; $coct=$coct+1; }; if($month_ytd[$j] == "11"){ $novvalue[$cnov] = $value; if ($catcheck < 51) { $daycolor_nov[$cnov] = "good"; $goodcount = $goodcount + 1; } ; if ($catcheck > 50 && $catcheck < 101) { $daycolor_nov[$cnov] = "moderate"; $moderatecount = $moderatecount + 1; } ; if ($catcheck > 100 && $catcheck < 151) { $daycolor_nov[$cnov] = "usg"; $excount = $excount + 1; } ; if ($catcheck > 150 && $catcheck < 201) { $daycolor_nov[$cnov] = "unhealthy"; $excount = $excount + 1; } ; if ($catcheck > 200 && $catcheck < 301) { $daycolor_nov[$cnov] = "veryunhealthy"; $excount = $excount + 1; } ; if ($catcheck > 300 && $catcheck !=9999) { $daycolor_nov[$cnov] = "hazardous"; $excount = $excount + 1; } ; if ($catcheck == 9999) { $daycolor_nov[$cnov] = "notavailable"; } ; $cnov=$cnov+1; }; if($month_ytd[$j] == "12"){ $decvalue[$cdec] = $value; if ($catcheck < 51) { $daycolor_dec[$cdec] = "good"; $goodcount = $goodcount + 1; } ; if ($catcheck > 50 && $catcheck < 101) { $daycolor_dec[$cdec] = "moderate"; $moderatecount = $moderatecount + 1; } ; if ($catcheck > 100 && $catcheck < 151) { $daycolor_dec[$cdec] = "usg"; $excount = $excount + 1; } ; if ($catcheck > 150 && $catcheck < 201) { $daycolor_dec[$cdec] = "unhealthy"; $excount = $excount + 1; } ; if ($catcheck > 200 && $catcheck < 301) { $daycolor_dec[$cdec] = "veryunhealthy"; $excount = $excount + 1; } ; if ($catcheck > 300 && $catcheck !=9999) { $daycolor_dec[$cdec] = "hazardous"; $excount = $excount + 1; } ; if ($catcheck == 9999) { $daycolor_dec[$cdec] = "notavailable"; } ; $cdec=$cdec+1; }; $j = $j + 1; } ; $yearprevious = $year-1; $yearnext = $year+1; ?> This report displays the daily ozone Air Quality Index (AQI) for 2018. Each daily value represents the highest monitor for the Phoenix area. The graph above displays the daily value (blue), the 15-year average (black), and the current EPA standard (orange). All data are preliminary.

Good Days
Moderate Days
Exceedance days
Number of Days

Daily Maximum 10 "; }else if($pollutant=="pm25"){ echo " PM2.5 "; } else { echo "Ozone"; }; if($type=="aqi"){ echo "Air Quality Index (AQI)"; }; if($pollutant=="pm10" && $type=="conc"){ echo "Concentrations (µg/m)"; }; if($pollutant=="pm25" && $type=="conc"){ echo "Concentrations (µg/m)"; }; if($pollutant=="ozone" && $type=="conc"){ echo "Concentrations (ppb)"; }; ?> [Switch to concentration]"; }else{ echo "[Switch to AQI]"; }; ?>

Day
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
"; do { if($jjj < 10){ $daylink = "0".$jjj; } else{ $daylink = $jjj; }; echo "
".$jjj."
"; $jjj = $jjj+1; $jj = $jj + 1; } while ($jj < 31); echo "
"; ?>