= '$minYear' and model_year <= '$maxYear' group by model_year, model_name, haspopout"; $result = mysql_query($stmt); if (mysql_num_rows($result)) { echo "

Poll Summary
Only Affected Model Years

\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $currModel = ""; $currYear = ""; $lastModel = ""; $lastYear = ""; $started = 0; $ttlOverall = 0; $ttlPopout = 0; $ttlNoPopout = 0; while ($row = mysql_fetch_array($result)) { $currYear = $row["model_year"]; $currModel = $row["model_name"]; if (($lastYear != $currYear)||($lastModel != $currModel)) { if (($started)&&($havePopout > 0)) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; $ttl = (int) $noPopout + (int) $havePopout; echo "\n"; echo "\n"; $ttlPopout += $havePopout; $ttlNoPopout += $noPopout; $ttlOverall += $ttl; $noPopout = 0; $havePopout = 0; } $lastYear = $row["model_year"]; $lastModel = $row["model_name"]; } $started++; if ($row["haspopout"] == "N") $noPopout = $row["cnt"]; if ($row["haspopout"] == "Y") $havePopout = $row["cnt"]; } if ($started) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; $ttl = (int) $noPopout + (int) $havePopout; echo "\n"; echo "\n"; $ttlPopout += $havePopout; $ttlNoPopout += $noPopout; $ttlOverall += $ttl; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
ModelNo PopoutPopoutTotal
$lastYear $lastModel$noPopout$havePopout$ttl
$lastYear $lastModel$noPopout$havePopout$ttl
$ttlNoPopout$ttlPopout$ttlOverall
\n"; } $stmt = "select first_name, last_name, model_name, model_year, v_mileage, haspopout, p_mileage, fixed, kept_parts, warranted, out_of_warranty from fifth_popout order by model_year, model_name, v_mileage"; $result = mysql_query($stmt); if (mysql_num_rows($result)) { echo "

Poll Result Details

\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $ttlAnswers = 0; $ttlHasIt = 0; $ttlFixed = 0; $ttlKP = 0; $ttlWR = 0; $ttlOW = 0; while ($row = mysql_fetch_array($result)) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($row["haspopout"] == "Y") { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } $ttlAnswers++; if ($row["haspopout"] == "Y") $ttlHasIt++; if ($row["fixed"] == "Y") $ttlFixed++; if ($row["kept_parts"] == "Y") $ttlKP++; if ($row["warranted"] == "Y") $ttlWR++; if ($row["out_of_warranty"] == "Y") $ttlOW++; echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
NameModelMileageHas ItStartedFixedKPWROW
", $row["first_name"], " ", $row["last_name"], "", $row["model_year"], " ", $row["model_name"], "", $row["v_mileage"], "", $row["haspopout"], "", $row["p_mileage"], "", $row["fixed"], "", $row["kept_parts"], "", $row["warranted"], "", $row["out_of_warranty"], "
$ttlAnswers$ttlHasIt$ttlFixed$ttlKP$ttlWR$ttlOW
\n"; } ?>