Code for Measure U11


Remedial Graduates
This is an overall headcount of any remediated student earning any credential (Technical Certificates and above). Remedial Graduates are defined those failing to achieve the score of 19 on the ACT test or its equivalent test and score.


SQL Statement are in RED.

<body>
<h2>Remedial Graduates</h2>
<?php
// THIS REPORT WRITTEN IN PHP SCRIPTING LANGAUGE
// CONNECTION INFO REMOVED
$acadyr = $_POST['acadyr'];
$degree_level = $_POST['degree_level'];
$inst_type = $_POST['inst_type'];
$credgrad = $_POST['credgrad'];

if($credgrad == 'A')
{
$distinct = " ";
$distinct_text = "All Credentials are counted";
}
if($credgrad == 'B')
{
$distinct = "DISTINCT ";
$distinct_text = "Unduplicated Graduates are counted";
}

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', 'A') ";
$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("<p>Academic Year = <b>".$acadyr."</b> Degree Level = <b>".$degree_text."</b>
and ".$distinct_text."</p>");

$query1 = "SELECT DISTINCT
f.inst_type,
f.school_abbr,
f.fice_code
FROM fice_table f
WHERE f.inst_type = '".$inst_type."'
--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=4>AY<b>".$acadyr."</b></th>");
echo("</tr>");

echo("<tr>");
echo("<th>#</th>");
echo("<th>Inst. Type</th>");
echo("<th>Institution</th>");
echo("<th>Total</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>");

// remedial graduates
$cnt = 0;
$queryX = "SELECT COUNT(".$distinct."(g.ssn_id)) AS cnt
FROM graduated_student_table g
JOIN student_table s
ON g.ssn_id = s.ssn_id
WHERE g.fice_code = '".$fice_code."'
".$dl_code."
AND g.academic_year = '".$acadyr."'
AND s.enroll_status = '01'
AND s.degree_intent IN ('2', '4', '6')
AND (
((s.test_type_math = '0' and s.test_math < 19 and s.math_placement_stat = '3')
OR (s.test_type_math = '1' and s.test_math < 460 and s.math_placement_stat = '3')
OR (s.test_type_math = '2' and s.test_math < 39 and s.math_placement_stat = '3')
OR (s.test_type_math = '2' and s.test_math = 999 and s.math_placement_stat = '3')
OR (s.test_type_math = '3' and s.test_math < 41 and s.math_placement_stat = '3'))

OR ((s.test_type_english = '0' and s.test_english < 19 and s.english_placement_stat = '3')
OR (s.test_type_english = '1' and s.test_english < 470 and s.english_placement_stat = '3')
OR (s.test_type_english = '2' and s.test_english < 45 and s.english_placement_stat = '3')
OR (s.test_type_english = '2' and s.test_english = 999 and s.english_placement_stat = '3')
OR (s.test_type_english = '3' and s.test_english < 75 and s.english_placement_stat = '3'))

OR ((s.test_type_reading = '0' and s.test_reading < 19 and s.reading_placement_stat = '3')
OR (s.test_type_reading = '1' and s.test_reading < 470 and s.reading_placement_stat = '3')
OR (s.test_type_reading = '2' and s.test_reading < 43 and s.reading_placement_stat = '3')
OR (s.test_type_reading = '2' and s.test_reading = 999 and s.reading_placement_stat = '3')
OR (s.test_type_reading = '3' and s.test_reading < 82 and s.reading_placement_stat = '3'))
)

";

$resultX = odbc_exec($conn_id, $queryX);
while (odbc_fetch_row($resultX))
{
$cnt = odbc_result($resultX, "cnt");
}
echo("<td align=right>".number_format($cnt,0)."</td>");

$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; }

echo("</tr>");
}
// SUMMARY
echo("<tr>");
echo("<td colspan=3>4-Year Universities</td>");
echo("<td align=right>".number_format($cnt_1,0)."</td>");
echo("</tr>");

// TOTALS FOR 2-YEAR COLLEGES
echo("<tr>");
echo("<td colspan=3>2-Year Colleges</td>");
echo("<td align=right>".number_format($cnt_2,0)."</td>");
echo("</tr>");

// TOTALS FOR PRIVATES
/*echo("<tr>");
echo("<td align=right>".number_format($cnt_P,0)."</td>");
echo("</tr>"); */

// TOTALS FOR BSN AND JSN
/*echo("<tr>");
echo("<td align=right>".number_format($cnt_V,0)."</td>");
echo("</tr>"); */

// TOTALS FOR ALL
echo("<tr>");
echo("<td colspan=3>Totals</td>");
echo("<td align=right>".number_format($cnt_total,0)."</td>");
echo("</tr>");

echo("</table>");

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>