Code for Measure C15


Minority Graduates
This is an overall headcount of any credential (Technical Certificates and above) awarded to persons identified as Asian only, Black only, Hispanic any, American Indian/Alaska Native only, Hawaiian/Pacific Islander only or Two or More Races. Unknowns, Non-Resident Aliens, White and Other graduates are not included.


SQL Statement are in RED.

<body>

<?php
// THIS REPORT WRITTEN IN PHP SCRIPTING LANGAUGE
// CONNECTION INFO REMOVED
$acadyr = $_POST['acadyr'];
$degree_level = $_POST['degree_level'];
$credgrad = $_POST['credgrad'];
if($credgrad == 'A')
{
$distinct = " ";
$Credentials = 'Minority Credentials Awarded';
}
if($credgrad == 'B')
{
$distinct = " DISTINCT ";
$Credentials = 'Distinct Minority Graduates';
}

switch($degree_level)
{
case "A": $dl_code = " ";
$degree_text = "All Credentials";
break;

case "B": $dl_code = "AND g.degree_level IN ('02', '03', '04', '05', '06', '07', '08', '09', '10', '11','12', '17', '18', '19') ";
$degree_text = "All Credentials without CPs";
break;

case "C": $dl_code = "AND g.degree_level IN ('05') ";
$degree_text = "Bachelors Only";
break;

case "D": $dl_code = "AND g.degree_level IN ('03') ";
$degree_text = "Associates Only";
break;

case "E": $dl_code = "AND g.degree_level IN ('01', '02', '03', '04', '05') ";
$degree_text = "Undergraduates Only";
break;

case "F": $dl_code = "AND g.degree_level IN ('02', '03', '04', '05') ";
$degree_text = "Undergraduates Only without CPs";
break;
}

echo("<h2>".$Credentials."</h2>");

echo("<p>Academic Year = <b>".$acadyr."</b> Degree Level = <b>".$degree_text."</b></p>");

// use old race codes
if ($acadyr <= '2009')
{
$query1 = " SELECT DISTINCT
f.inst_type,
f.fice_code,
f.school_abbr
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);

echo("<table border=1 cellspacing=0 cellpadding=0>");
echo("<tr>");
echo("<th colspan=12>Academic Year <b>".$acadyr."</b> Unduplicated Graduates by Race/Ethnicity</b></th>");
echo("</tr>");

echo("<tr>");
echo("<th>#</th>");
echo("<th>Inst.<br />Type</th>");
echo("<th>School<br />Abbrev.</th>");
// Numbers
echo("<th>Asian</th>");
echo("<th>Black</th>");
echo("<th>Hispanic</th>");
echo("<th>Am. Indian or Alaskan</th>");
echo("<th>White</th>");
echo("<th>Non-Resident Alien</th>");
echo("<th>Unknown</th>");
echo("<th>Total</th>");
echo("<th>Total Minorities</th>");
echo("</tr>");

$n = 1;

while (odbc_fetch_row($result1))
{
echo("<tr valign=top>");

echo("<td align=center>");
echo($n++);
echo("</td>");

echo("<td align=center>");
$inst_type = (odbc_result($result1, "inst_type"));
echo($inst_type);
echo("</td>");

$fice_code = (odbc_result($result1, "fice_code"));

echo("<td>");
echo(odbc_result($result1, "school_abbr"));
echo("</td>");

// TOTAL COUNT OF ALL STUDENTS
$cnt = 0;
$asian = 0;
$black = 0;
$hispanic = 0;
$amerind = 0;
$white = 0;
$nra = 0;
$unknown = 0;
$minority = 0;

$queryX = "SELECT COUNT(".$distinct."(g.ssn_id)) AS cnt,
COUNT(".$distinct."(CASE g.race WHEN 01 THEN g.ssn_id ELSE NULL END)) AS asian,
COUNT(".$distinct."(CASE g.race WHEN 02 THEN g.ssn_id ELSE NULL END)) AS black,
COUNT(".$distinct."(CASE g.race WHEN 03 THEN g.ssn_id ELSE NULL END)) AS hispanic,
COUNT(".$distinct."(CASE g.race WHEN 04 THEN g.ssn_id ELSE NULL END)) AS amerind,
COUNT(".$distinct."(CASE g.race WHEN 05 THEN g.ssn_id ELSE NULL END)) AS white,
COUNT(".$distinct."(CASE g.race WHEN 06 THEN g.ssn_id ELSE NULL END)) AS nra,
COUNT(".$distinct."(CASE g.race WHEN 09 THEN g.ssn_id ELSE NULL END)) AS unknown
FROM graduated_student_table g
WHERE g.fice_code = '".$fice_code."'
".$dl_code."
AND g.academic_year = '".$acadyr."'
";

//echo($queryX."<br>");
$resultX = odbc_exec($conn_id, $queryX);
while (odbc_fetch_row($resultX))
{
$cnt = odbc_result($resultX, "cnt");
$asian = odbc_result($resultX, "asian");
$black = odbc_result($resultX, "black");
$hispanic = odbc_result($resultX, "hispanic");
$amerind = odbc_result($resultX, "amerind");
$white = odbc_result($resultX, "white");
$nra = odbc_result($resultX, "nra");
$unknown = odbc_result($resultX, "unknown");
}

echo("<td align=right>".number_format($asian,0)."</td>");
echo("<td align=right>".number_format($black,0)."</td>");
echo("<td align=right>".number_format($hispanic,0)."</td>");
echo("<td align=right>".number_format($amerind,0)."</td>");
echo("<td align=right>".number_format($white,0)."</td>");
echo("<td align=right>".number_format($nra,0)."</td>");
echo("<td align=right>".number_format($unknown,0)."</td>");
echo("<td align=right>".number_format($cnt,0)."</td>");

$minority = $asian + $black + $hispanic + $amerind;

echo("<td align=right>".number_format($minority,0)."</td>");

$asian_total = $asian_total + $asian;
if ($inst_type == '1') { $asian_1 = $asian_1 + $asian; }
if ($inst_type == '2') { $asian_2 = $asian_2 + $asian; }
if ($inst_type == 'P') { $asian_P = $asian_P + $asian; }
if ($inst_type == 'V') { $asian_V = $asian_V + $asian; }
$black_total = $black_total + $black;
if ($inst_type == '1') { $black_1 = $black_1 + $black; }
if ($inst_type == '2') { $black_2 = $black_2 + $black; }
if ($inst_type == 'P') { $black_P = $black_P + $black; }
if ($inst_type == 'V') { $black_V = $black_V + $black; }
$hispanic_total = $hispanic_total + $hispanic;
if ($inst_type == '1') { $hispanic_1 = $hispanic_1 + $hispanic; }
if ($inst_type == '2') { $hispanic_2 = $hispanic_2 + $hispanic; }
if ($inst_type == 'P') { $hispanic_P = $hispanic_P + $hispanic; }
if ($inst_type == 'V') { $hispanic_V = $hispanic_V + $hispanic; }
$amerind_total = $amerind_total + $amerind;
if ($inst_type == '1') { $amerind_1 = $amerind_1 + $amerind; }
if ($inst_type == '2') { $amerind_2 = $amerind_2 + $amerind; }
if ($inst_type == 'P') { $amerind_P = $amerind_P + $amerind; }
if ($inst_type == 'V') { $amerind_V = $amerind_V + $amerind; }
$white_total = $white_total + $white;
if ($inst_type == '1') { $white_1 = $white_1 + $white; }
if ($inst_type == '2') { $white_2 = $white_2 + $white; }
if ($inst_type == 'P') { $white_P = $white_P + $white; }
if ($inst_type == 'V') { $white_V = $white_V + $white; }
$nra_total = $nra_total + $nra;
if ($inst_type == '1') { $nra_1 = $nra_1 + $nra; }
if ($inst_type == '2') { $nra_2 = $nra_2 + $nra; }
if ($inst_type == 'P') { $nra_P = $nra_P + $nra; }
if ($inst_type == 'V') { $nra_V = $nra_V + $nra; }
$unknown_total = $unknown_total + $unknown;
if ($inst_type == '1') { $unknown_1 = $unknown_1 + $unknown; }
if ($inst_type == '2') { $unknown_2 = $unknown_2 + $unknown; }
if ($inst_type == 'P') { $unknown_P = $unknown_P + $unknown; }
if ($inst_type == 'V') { $unknown_V = $unknown_V + $unknown; }
$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; }
$minority_total = $minority_total + $minority;
if ($inst_type == '1') { $minority_1 = $minority_1 + $minority; }
if ($inst_type == '2') { $minority_2 = $minority_2 + $minority; }
if ($inst_type == 'P') { $minority_P = $minority_P + $minority; }
if ($inst_type == 'V') { $minority_V = $minority_V + $minority; }

echo("</tr>");
}

// SUMMARY
echo("<tr>");
echo("<td colspan=3>4-Year Universities (1)</td>");
echo("<td align=right>".number_format($asian_1,0)."</td>");
echo("<td align=right>".number_format($black_1,0)."</td>");
echo("<td align=right>".number_format($hispanic_1,0)."</td>");
echo("<td align=right>".number_format($amerind_1,0)."</td>");
echo("<td align=right>".number_format($white_1,0)."</td>");
echo("<td align=right>".number_format($nra_1,0)."</td>");
echo("<td align=right>".number_format($unknown_1,0)."</td>");
echo("<td align=right>".number_format($cnt_1,0)."</td>");
echo("<td align=right>".number_format($minority_1,0)."</td>");
echo("</tr>");

// TOTALS FOR 2-YEAR COLLEGES
echo("<tr>");
echo("<td colspan=3>2-Year Colleges (2)</td>");
echo("<td align=right>".number_format($asian_2,0)."</td>");
echo("<td align=right>".number_format($black_2,0)."</td>");
echo("<td align=right>".number_format($hispanic_2,0)."</td>");
echo("<td align=right>".number_format($amerind_2,0)."</td>");
echo("<td align=right>".number_format($white_2,0)."</td>");
echo("<td align=right>".number_format($nra_2,0)."</td>");
echo("<td align=right>".number_format($unknown_2,0)."</td>");
echo("<td align=right>".number_format($cnt_2,0)."</td>");
echo("<td align=right>".number_format($minority_2,0)."</td>");
echo("</tr>");

// TOTALS FOR PRIVATES
/*echo("<tr>");
echo("<td colspan=3>Private Institutions (P)</td>");
echo("<td align=right>".number_format($asian_P,0)."</td>");
echo("<td align=right>".number_format($black_P,0)."</td>");
echo("<td align=right>".number_format($hispanic_P,0)."</td>");
echo("<td align=right>".number_format($amerind_P,0)."</td>");
echo("<td align=right>".number_format($white_P,0)."</td>");
echo("<td align=right>".number_format($nra_P,0)."</td>");
echo("<td align=right>".number_format($unknown_P,0)."</td>");
echo("<td align=right>".number_format($cnt_P,0)."</td>");
echo("<td align=right>".number_format($minority_P,0)."</td>");
echo("</tr>"); */

// TOTALS FOR BSN AND JSN
/*echo("<tr>");
echo("<td colspan=3>Vocational Institutions (V)</td>");
echo("<td align=right>".number_format($asian_V,0)."</td>");
echo("<td align=right>".number_format($black_V,0)."</td>");
echo("<td align=right>".number_format($hispanic_V,0)."</td>");
echo("<td align=right>".number_format($amerind_V,0)."</td>");
echo("<td align=right>".number_format($white_V,0)."</td>");
echo("<td align=right>".number_format($nra_V,0)."</td>");
echo("<td align=right>".number_format($unknown_V,0)."</td>");
echo("<td align=right>".number_format($cnt_V,0)."</td>");
echo("<td align=right>".number_format($minority_V,0)."</td>");
echo("</tr>"); */

// TOTALS FOR ALL
echo("<tr>");
echo("<td colspan=3>Totals</td>");
echo("<td align=right>".number_format($asian_total,0)."</td>");
echo("<td align=right>".number_format($black_total,0)."</td>");
echo("<td align=right>".number_format($hispanic_total,0)."</td>");
echo("<td align=right>".number_format($amerind_total,0)."</td>");
echo("<td align=right>".number_format($white_total,0)."</td>");
echo("<td align=right>".number_format($nra_total,0)."</td>");
echo("<td align=right>".number_format($unknown_total,0)."</td>");
echo("<td align=right>".number_format($cnt_total,0)."</td>");
echo("<td align=right>".number_format($minority_total,0)."</td>");
echo("</tr>");

echo("</table>");
// ends if statement for if ($acadyr <= '2009')
}

// starts new if statement - years >= 2010
if ($acadyr >= '2010')
{
$query1 = " SELECT DISTINCT
f.inst_type,
f.fice_code,
f.school_abbr
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);

echo("<table border=1 cellspacing=0 cellpadding=0>");
echo("<tr>");
echo("<th>#</th>");
echo("<th>Inst.<br />Type</th>");
echo("<th>School<br />Abbrev.</th>");
// Numbers
echo("<th>Asian Only</th>");
echo("<th>Black Only</th>");
echo("<th>Hispanic Any</th>");
echo("<th>Am. Indian or Alaskan Only</th>");
echo("<th>White Only</th>");
echo("<th>Hawaiian Only</th>");
echo("<th>Two or More Races</th>");
echo("<th>Non-Resident Alien</th>");
echo("<th>Unknown</th>");
echo("<th>Other</th>");
echo("<th>Total</th>");
echo("<th>Total Minorities</th>");
echo("</tr>");

$n = 1;
while (odbc_fetch_row($result1))
{
echo("<tr valign=top>");

echo("<td align=center>");
echo($n++);
echo("</td>");

echo("<td align=center>");
$inst_type = (odbc_result($result1, "inst_type"));
echo($inst_type);
echo("</td>");

$fice_code = (odbc_result($result1, "fice_code"));

echo("<td>");
echo(odbc_result($result1, "school_abbr"));
echo("</td>");

// asian
$asian = 0;

$query_asian = "SELECT COUNT(".$distinct."(g.ssn_id)) AS asian
FROM graduated_student_table g
WHERE g.fice_code = '".$fice_code."'
AND g.academic_year = '".$acadyr."'
AND g.non_resident_alien = '0'
AND g.asian = '1'
AND g.black IN ('0', '2')
AND g.hispanic IN ('0', '2')
AND g.amerind IN ('0', '2')
AND g.white IN ('0', '2')
AND g.hawaiian IN ('0', '2')
".$dl_code."

";

$result_asian = odbc_exec($conn_id, $query_asian);

while (odbc_fetch_row($result_asian))
{
$asian = (odbc_result($result_asian, "asian"));
}

echo("<td align=right>".number_format($asian,0)."</td>");

// black
$black = 0;
$query_black = "SELECT COUNT(".$distinct."(g.ssn_id)) AS black
FROM graduated_student_table g
WHERE g.fice_code = '".$fice_code."'
AND g.academic_year = '".$acadyr."'
AND g.non_resident_alien = '0'
AND g.black = '1'
AND g.asian IN ('0', '2')
AND g.hispanic IN ('0', '2')
AND g.amerind IN ('0', '2')
AND g.white IN ('0', '2')
AND g.hawaiian IN ('0', '2')
".$dl_code."

";

$result_black = odbc_exec($conn_id, $query_black);

while (odbc_fetch_row($result_black))
{
$black = (odbc_result($result_black, "black"));
}

echo("<td align=right>".number_format($black,0)."</td>");

// hispanic
$hispanic = 0;

$query_hispanic = " SELECT COUNT(".$distinct."(g.ssn_id)) AS hispanic
FROM graduated_student_table g
WHERE g.fice_code = '".$fice_code."'
AND g.academic_year = '".$acadyr."'
AND g.non_resident_alien = '0'
AND g.hispanic = '1'
".$dl_code."

";

$result_hispanic = odbc_exec($conn_id, $query_hispanic);

while (odbc_fetch_row($result_hispanic))
{
$hispanic = (odbc_result($result_hispanic, "hispanic"));
}

echo("<td align=right>".number_format($hispanic,0)."</td>");

// amerind
$amerind = 0;

$query_amerind = " SELECT COUNT(".$distinct."(g.ssn_id)) AS amerind
FROM graduated_student_table g
WHERE g.fice_code = '".$fice_code."'
AND g.academic_year = '".$acadyr."'
AND g.non_resident_alien = '0'
AND g.amerind = '1'
AND g.asian IN ('0', '2')
AND g.hispanic IN ('0', '2')
AND g.black IN ('0', '2')
AND g.white IN ('0', '2')
AND g.hawaiian IN ('0', '2')
".$dl_code."

";

$result_amerind = odbc_exec($conn_id, $query_amerind);

while (odbc_fetch_row($result_amerind))
{
$amerind = (odbc_result($result_amerind, "amerind"));
}

echo("<td align=right>".number_format($amerind,0)."</td>");

// white
$white = 0;
$query_white = "SELECT COUNT(".$distinct."(g.ssn_id)) AS white
FROM graduated_student_table g
WHERE g.fice_code = '".$fice_code."'
AND g.academic_year = '".$acadyr."'
AND g.non_resident_alien = '0'
AND g.white = '1'
AND g.asian IN ('0', '2')
AND g.hispanic IN ('0', '2')
AND g.black IN ('0', '2')
AND g.amerind IN ('0', '2')
AND g.hawaiian IN ('0', '2')
".$dl_code."

";

$result_white = odbc_exec($conn_id, $query_white);

while (odbc_fetch_row($result_white))
{
$white = (odbc_result($result_white, "white"));
}

echo("<td align=right>".number_format($white,0)."</td>");

// hawaiian
$hawaiian = 0;
$query_hawaiian = " SELECT COUNT(".$distinct."(g.ssn_id)) AS hawaiian
FROM graduated_student_table g
WHERE g.fice_code = '".$fice_code."'
AND g.academic_year = '".$acadyr."'
AND g.non_resident_alien = '0'
AND g.hawaiian = '1'
AND g.asian IN ('0', '2')
AND g.hispanic IN ('0', '2')
AND g.black IN ('0', '2')
AND g.amerind IN ('0', '2')
AND g.white IN ('0', '2')
".$dl_code."

";

$result_hawaiian = odbc_exec($conn_id, $query_hawaiian);

while (odbc_fetch_row($result_hawaiian))
{
$hawaiian = (odbc_result($result_hawaiian, "hawaiian"));
}

echo("<td align=right>".number_format($hawaiian,0)."</td>");

// two or more races
$multi = '';
$multix = 0;
$query_multi = "SELECT ".$distinct."(g.ssn_id),
(g.asian + g.black + g.amerind + g.white + g.hawaiian) AS multi
FROM graduated_student_table g
WHERE g.fice_code = '".$fice_code."'
AND g.academic_year = '".$acadyr."'
AND g.non_resident_alien = '0'
AND g.hispanic IN ('0', '2')
".$dl_code."
GROUP BY g.ssn_id, g.asian, g.black, g.amerind, g.white, g.hawaiian
ORDER BY g.ssn_id, multi
";

$result_multi = odbc_exec($conn_id, $query_multi);

while (odbc_fetch_row($result_multi))
{
$multi = odbc_result($result_multi, "multi");
$multi_cnt = substr_count($multi, '1');

if ($multi_cnt > 1)
{
$multix++;
}
}
echo("<td align=right>".number_format($multix,0)."</td>");

// non-resident aliens
$nra = 0;
$query_nra = " SELECT COUNT(".$distinct."(g.ssn_id)) AS nra
FROM graduated_student_table g
WHERE g.fice_code = '".$fice_code."'
AND g.academic_year = '".$acadyr."'
AND g.non_resident_alien = '6'
".$dl_code."

";

$result_nra = odbc_exec($conn_id, $query_nra);

while (odbc_fetch_row($result_nra))
{
$nra = (odbc_result($result_nra, "nra"));
}

echo("<td align=right>".number_format($nra,0)."</td>");

// unknown
$uk = 0;
$query_uk = " SELECT COUNT(".$distinct."(g.ssn_id)) AS uk
FROM graduated_student_table g
WHERE g.fice_code = '".$fice_code."'
AND g.academic_year = '".$acadyr."'
AND g.non_resident_alien = '9'
".$dl_code."

";

$result_uk = odbc_exec($conn_id, $query_uk);

while (odbc_fetch_row($result_uk))
{
$uk = odbc_result($result_uk, "uk");
}

echo("<td align=right>".number_format($uk,0)."</td>");

// TOTAL COUNT OF ALL STUDENTS
$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 = '".$acadyr."'
".$dl_code."

";

$resultX = odbc_exec($conn_id, $queryX);

while (odbc_fetch_row($resultX))
{
$cnt = (odbc_result($resultX, "cnt"));
}

// other (second unknown)
$other = 0;
$other = $cnt - ($nra + $uk + $asian + $black + $hispanic + $amerind + $white + $hawaiian + $multix);
if ($other >= 0)
{
echo("<td align=right>".number_format($other,0)."</td>");
}
else
{
echo("<td align=right>0</td>");
}
// display cnt here after other
echo("<td align=right>".number_format($cnt,0)."</td>");

$minority = 0;
$minority = $asian + $black + $hispanic + $amerind + $hawaiian + $multix;
echo("<td align=right>".number_format($minority,0)."</td>");

// TOTAL CALCS
if ($inst_type == '1')
{
$total_1_asian = $total_1_asian + $asian;
$total_1_black = $total_1_black + $black;
$total_1_hispanic = $total_1_hispanic + $hispanic;
$total_1_amerind = $total_1_amerind + $amerind;
$total_1_white = $total_1_white + $white;
$total_1_hawaiian = $total_1_hawaiian + $hawaiian;
$total_1_multix = $total_1_multix + $multix;
$total_1_nra = $total_1_nra + $nra;
$total_1_other = $total_1_other + $other;
$total_1_uk = $total_1_uk + $uk;
$total_1_cnt = $total_1_cnt + $cnt;
$total_1_minority = $total_1_minority + $minority;
}
if ($inst_type == '2')
{
$total_2_asian = $total_2_asian + $asian;
$total_2_black = $total_2_black + $black;
$total_2_hispanic = $total_2_hispanic + $hispanic;
$total_2_amerind = $total_2_amerind + $amerind;
$total_2_white = $total_2_white + $white;
$total_2_hawaiian = $total_2_hawaiian + $hawaiian;
$total_2_multix = $total_2_multix + $multix;
$total_2_nra = $total_2_nra + $nra;
$total_2_other = $total_2_other + $other;
$total_2_uk = $total_2_uk + $uk;
$total_2_cnt = $total_2_cnt + $cnt;
$total_2_minority = $total_2_minority + $minority;
}
if ($inst_type == 'P')
{
$total_P_asian = $total_P_asian + $asian;
$total_P_black = $total_P_black + $black;
$total_P_hispanic = $total_P_hispanic + $hispanic;
$total_P_amerind = $total_P_amerind + $amerind;
$total_P_white = $total_P_white + $white;
$total_P_hawaiian = $total_P_hawaiian + $hawaiian;
$total_P_multix = $total_P_multix + $multix;
$total_P_nra = $total_P_nra + $nra;
$total_P_other = $total_P_other + $other;
$total_P_uk = $total_P_uk + $uk;
$total_P_cnt = $total_P_cnt + $cnt;
$total_P_minority = $total_P_minority + $minority;
}
if ($inst_type == 'V')
{
$total_V_asian = $total_V_asian + $asian;
$total_V_black = $total_V_black + $black;
$total_V_hispanic = $total_V_hispanic + $hispanic;
$total_V_amerind = $total_V_amerind + $amerind;
$total_V_white = $total_V_white + $white;
$total_V_hawaiian = $total_V_hawaiian + $hawaiian;
$total_V_multix = $total_V_multix + $multix;
$total_V_nra = $total_V_nra + $nra;
$total_V_other = $total_V_other + $other;
$total_V_uk = $total_V_uk + $uk;
$total_V_cnt = $total_V_cnt + $cnt;
$total_V_minority = $total_V_minority + $minority;
}

$TOTALASIAN = $total_1_asian + $total_2_asian + $total_P_asian + $total_V_asian;
$TOTALBLACK = $total_1_black + $total_2_black + $total_P_black + $total_V_black;
$TOTALHISPANIC = $total_1_hispanic + $total_2_hispanic + $total_P_hispanic + $total_V_hispanic;
$TOTALAMERIND = $total_1_amerind + $total_2_amerind + $total_P_amerind + $total_V_amerind;
$TOTALWHITE = $total_1_white + $total_2_white + $total_P_white + $total_V_white;
$TOTALHAWAIIAN = $total_1_hawaiian + $total_2_hawaiian + $total_P_hawaiian + $total_V_hawaiian;
$TOTALMULTIX = $total_1_multix + $total_2_multix + $total_P_multix + $total_V_multix;
$TOTALNRA = $total_1_nra + $total_2_nra + $total_P_nra + $total_V_nra;
$TOTALUK = $total_1_uk + $total_2_uk + $total_P_uk + $total_V_uk;
$TOTALOTHER = $total_1_other + $total_2_other + $total_P_other + $total_V_other;
$TOTALCNT = $total_1_cnt + $total_2_cnt + $total_P_cnt + $total_V_cnt;
$TOTALMINORITY = $total_1_minority + $total_2_minority + $total_P_minority + $total_V_minority;

//$GRANDTOTAL = $total_1 + $total_2 + $total_P;

echo("</tr>");
}

// SUMMARY // TOTALS FOR 4-YEAR COLLEGES - NUMBERS
echo("<tr>");
echo("<td colspan=3>4-Year Universities</td>");
echo("<td align=right>".number_format($total_1_asian,0)."</td>");
echo("<td align=right>".number_format($total_1_black,0)."</td>");
echo("<td align=right>".number_format($total_1_hispanic,0)."</td>");
echo("<td align=right>".number_format($total_1_amerind,0)."</td>");
echo("<td align=right>".number_format($total_1_white,0)."</td>");
echo("<td align=right>".number_format($total_1_hawaiian,0)."</td>");
echo("<td align=right>".number_format($total_1_multix,0)."</td>");
echo("<td align=right>".number_format($total_1_nra,0)."</td>");
echo("<td align=right>".number_format($total_1_uk,0)."</td>");
echo("<td align=right>".number_format($total_1_other,0)."</td>");
echo("<td align=right>".number_format($total_1_cnt,0)."</td>");
echo("<td align=right>".number_format($total_1_minority,0)."</td>");
echo("</tr>");

// SUMMARY // TOTALS FOR 2-YEAR COLLEGES - NUMBERS
echo("<tr>");
echo("<td colspan=3>2-Year Colleges</td>");
echo("<td align=right>".number_format($total_2_asian,0)."</td>");
echo("<td align=right>".number_format($total_2_black,0)."</td>");
echo("<td align=right>".number_format($total_2_hispanic,0)."</td>");
echo("<td align=right>".number_format($total_2_amerind,0)."</td>");
echo("<td align=right>".number_format($total_2_white,0)."</td>");
echo("<td align=right>".number_format($total_2_hawaiian,0)."</td>");
echo("<td align=right>".number_format($total_2_multix,0)."</td>");
echo("<td align=right>".number_format($total_2_nra,0)."</td>");
echo("<td align=right>".number_format($total_2_uk,0)."</td>");
echo("<td align=right>".number_format($total_2_other,0)."</td>");
echo("<td align=right>".number_format($total_2_cnt,0)."</td>");
echo("<td align=right>".number_format($total_2_minority,0)."</td>");
echo("</tr>");

// SUMMARY // TOTALS FOR PRIVATE - NUMBERS
/*echo("<tr>");
echo("<td colspan=3>Private Institutions</td>");
echo("<td align=right>".number_format($total_P_asian,0)."</td>");
echo("<td align=right>".number_format($total_P_black,0)."</td>");
echo("<td align=right>".number_format($total_P_hispanic,0)."</td>");
echo("<td align=right>".number_format($total_P_amerind,0)."</td>");
echo("<td align=right>".number_format($total_P_white,0)."</td>");
echo("<td align=right>".number_format($total_P_hawaiian,0)."</td>");
echo("<td align=right>".number_format($total_P_multix,0)."</td>");
echo("<td align=right>".number_format($total_P_nra,0)."</td>");
echo("<td align=right>".number_format($total_P_uk,0)."</td>");
echo("<td align=right>".number_format($total_P_other,0)."</td>");
echo("<td align=right>".number_format($total_P_cnt,0)."</td>");
echo("<td align=right>".number_format($total_P_minority,0)."</td>");
echo("</tr>"); */

// SUMMARY // TOTALS FOR VOCATIONAL - BSN AND JSN ONLY - NUMBERS
/*echo("<tr>");
echo("<td colspan=3>Vocational (Nursing) Schools</td>");
echo("<td align=right>".number_format($total_V_asian,0)."</td>");
echo("<td align=right>".number_format($total_V_black,0)."</td>");
echo("<td align=right>".number_format($total_V_hispanic,0)."</td>");
echo("<td align=right>".number_format($total_V_amerind,0)."</td>");
echo("<td align=right>".number_format($total_V_white,0)."</td>");
echo("<td align=right>".number_format($total_V_hawaiian,0)."</td>");
echo("<td align=right>".number_format($total_V_multix,0)."</td>");
echo("<td align=right>".number_format($total_V_nra,0)."</td>");
echo("<td align=right>".number_format($total_V_uk,0)."</td>");
echo("<td align=right>".number_format($total_V_other,0)."</td>");
echo("<td align=right>".number_format($total_V_cnt,0)."</td>");
echo("<td align=right>".number_format($total_V_minority,0)."</td>");
echo("</tr>"); */

// GRAND TOTALS
echo("<tr>");
echo("<td colspan=3>Totals</td>");
echo("<td align=right>".number_format($TOTALASIAN,0)."</td>");
echo("<td align=right>".number_format($TOTALBLACK,0)."</td>");
echo("<td align=right>".number_format($TOTALHISPANIC,0)."</td>");
echo("<td align=right>".number_format($TOTALAMERIND,0)."</td>");
echo("<td align=right>".number_format($TOTALWHITE,0)."</td>");
echo("<td align=right>".number_format($TOTALHAWAIIAN,0)."</td>");
echo("<td align=right>".number_format($TOTALMULTIX,0)."</td>");
echo("<td align=right>".number_format($TOTALNRA,0)."</td>");
echo("<td align=right>".number_format($TOTALUK,0)."</td>");
echo("<td align=right>".number_format($TOTALOTHER,0)."</td>");
echo("<td align=right>".number_format($TOTALCNT,0)."</td>");
echo("<td align=right>".number_format($TOTALMINORITY,0)."</td>");
echo("</tr>");

echo("</table>");
// ends if statement for if ($acadyr >= '2010')
}

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($resultx);
odbc_error();
odbc_close($conn_id);
?>
</body>
</html>