Academic Year = ".$acadyr." Degree Level = ".$degree_text." //and ".$distinct_text."

"); // Set up report headings $year = array($year - 4, $year -3, $year -2, $year -1, $year); // FIRST ROW OF LABELS echo(""); echo(""); echo(""); echo(""); echo(""); echo(""); echo(""); echo(""); echo(""); echo(""); echo(""); echo(""); echo(""); echo(""); $query1 = "SELECT DISTINCT f.inst_type, f.school_abbr, f.fice_code FROM fice_table f WHERE f.inst_type in ('1','2') --OR f.fice_code IN ('031052', '016498')) --AND f.fice_code <> '010311' ORDER BY f.inst_type, f.school_abbr"; $result1 = odbc_exec($conn_id, $query1); $n = 1; while (odbc_fetch_row($result1)) { $inst_type = (odbc_result($result1, "inst_type")); $fice_code = (odbc_result($result1, "fice_code")); $school_abbr = (odbc_result($result1, "school_abbr")); echo(""); echo(""); echo(""); echo(""); for ($b = 0; $b <= 4; $b++) // BEGIN LOOP #2 FOR EACH YEAR { // graduates $cnt = 0; $queryX = "SELECT COUNT(".$distinct."(g.ssn_id)) AS cnt FROM graduated_student_table g WHERE g.fice_code = '".$fice_code."' AND g.academic_year = '".$year[$b]."' ".$dl_code." "; $resultX = odbc_exec($conn_id, $queryX); while (odbc_fetch_row($resultX)) { $cnt = odbc_result($resultX, "cnt"); } echo(""); $cnt_total = $cnt_total + $cnt; /* if ($inst_type == '1') { $cnt_1 = $cnt_1 + $cnt; } if ($inst_type == '2') { $cnt_2 = $cnt_2 + $cnt; } if ($inst_type == 'P') { $cnt_P = $cnt_P + $cnt; } if ($inst_type == 'V') { $cnt_V = $cnt_V + $cnt; } */ } // END LOOP #2 FOR YEARS echo(""); } /* //******************** THIS DOES NOT TOTAL UNDUPLICATED GRADS CORRECTLY*********************** //============ FOUR YEAR TOTALS =============================================================== echo(""); echo(""); for ($b = 0; $b <= 4; $b++) // BEGIN LOOP #2 FOR EACH YEAR { // graduates $cnt_1 = 0; $queryX = "SELECT COUNT(".$distinct."(g.ssn_id)) AS cnt_1 FROM graduated_student_table g inner join fice_table f on g.fice_code = f.fice_code WHERE g.academic_year = '".$year[$b]."' and f.inst_type = '1' ".$dl_code." "; $resultX = odbc_exec($conn_id, $queryX); while (odbc_fetch_row($resultX)) { $cnt_1 = odbc_result($resultX, "cnt_1"); } echo(""); } // END LOOP #2 FOR YEARS echo(""); //============ TWO YEAR TOTALS =============================================================== echo(""); echo(""); for ($b = 0; $b <= 4; $b++) // BEGIN LOOP #2 FOR EACH YEAR { // graduates $cnt_2 = 0; $queryX = "SELECT COUNT(".$distinct."(g.ssn_id)) AS cnt_2 FROM graduated_student_table g inner join fice_table f on g.fice_code = f.fice_code WHERE g.academic_year = '".$year[$b]."' and f.inst_type = '2' ".$dl_code." "; $resultX = odbc_exec($conn_id, $queryX); while (odbc_fetch_row($resultX)) { $cnt_2 = odbc_result($resultX, "cnt_2"); } echo(""); } // END LOOP #2 FOR YEARS echo(""); //============ PUBLIC TOTALS =============================================================== echo(""); echo(""); for ($b = 0; $b <= 4; $b++) // BEGIN LOOP #2 FOR EACH YEAR { // graduates $cnt_public = 0; $queryX = "SELECT COUNT(".$distinct."(g.ssn_id)) AS cnt_public FROM graduated_student_table g inner join fice_table f on g.fice_code = f.fice_code WHERE g.academic_year = '".$year[$b]."' and f.inst_type in ( '1', '2') ".$dl_code." "; $resultX = odbc_exec($conn_id, $queryX); while (odbc_fetch_row($resultX)) { $cnt_public = odbc_result($resultX, "cnt_public"); } echo(""); } // END LOOP #2 FOR YEARS echo(""); //=========================================================================== */ echo("
".$degree_text.", ".$distinct_text."
#Inst TypeInstitutionAY".$year[0]."AY".$year[1]."AY".$year[2]."AY".$year[3]."AY".$year[4]."
"); echo($n++); echo(""); echo($inst_type); echo(""); echo($school_abbr); echo("".number_format($cnt,0)."
Four-Year Totals".number_format($cnt_1,0)."
Two-Year Totals".number_format($cnt_2,0)."
Public Totals".number_format($cnt_public,0)."
"); odbc_free_result($result1); odbc_free_result($result2); odbc_free_result($result3); odbc_free_result($result4); odbc_free_result($result5); odbc_free_result($result6); odbc_free_result($result7); odbc_free_result($result8); odbc_free_result($resultX); odbc_free_result($resultY); odbc_error(); odbc_close($conn_id); ?>