Code for Measure C09


Under-prepared
This is a headcount of underprepared students divided by overall credential-seeking headcount. Underprepared is defined as having an ACT of 15 or below, or equivalent score. Up to one compensatory point will be added to total mandatory points based on percentage of students who are underprepared. (Ex: 50% of students are underprepared = 0.50 compensatory point.) Total mandatory points may not exceed six. Working with ACT to determine ACT equivalent scores.

SQL statements are in RED.


<body>

<?php
// THIS REPORT WRITTEN IN PHP SCRIPTING LANGAUGE
// CONNECTION INFO REMOVED
$acadyr = $_POST['acadyr'];

echo("<h2>Students with Test Scores of 15 or lower (ACT or equivalent)</h2>");
echo("<p>These are first-time entering degree/certificate seeking students only
for ACT and SAT Tests Only.");
echo("<br />Academic Year = <b>".$acadyr."</b>.");

echo("<table border=1 cellspacing=0 cellpadding=0>");
echo("<tr valign=center>");
echo("<th>#</th>");
echo("<th>Inst. Type</th>");
echo("<th>Institution</th>");
echo("<th>Underprepared</th>");
echo("<th>First-Timers Seeking Deg/Cert</th>");
echo("<th>Percent</th>");
echo("<th>Entire Student Body</th>");
echo("<th>Percent</th>");

echo("</tr>");

// list of schools
$query1 = " SELECT DISTINCT f.inst_type,
f.school_abbr,
f.fice_code
FROM fice_table f
WHERE f.inst_type IN ('2')
ORDER BY f.inst_type, f.school_abbr;
";

$n = 1;
$result1 = odbc_exec($conn_id, $query1);
while (odbc_fetch_row($result1))
{
$inst_type = odbc_result($result1, "inst_type");
$school_abbr = odbc_result($result1, "school_abbr");
$fice_code = odbc_result($result1, "fice_code");

echo("<tr valign=top>");
echo("<td align=center>".$n++."</td>");
echo("<td align=center>".$inst_type."</td>");
echo("<td align=left>".$school_abbr."</td>");
//echo("<td align=center>".$fice_code."</td>");

// number of under-prepared students
$cnt = 0;
$query2 = "SELECT COUNT(DISTINCT(s.ssn_id)) AS cnt
FROM student_table s
WHERE s.fice_code = '".$fice_code."'
AND s.academic_year = '".$acadyr."'
AND s.enroll_status = '01'
AND s.degree_intent IN ('2', '4', '6', '7', '8')
AND ((s.ent_exam_type = '0' AND s.ent_exam_score <= '15')
OR (s.ent_exam_type = '1' AND s.ent_exam_score <= '740'));
";
//echo("<p>".$query2."</p><br />");

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

// number of first-time degree/certficiate seeking students
$undup = 0;
$query3 = "SELECT COUNT(DISTINCT(s.ssn_id)) AS undup
FROM student_table s
WHERE s.fice_code = '".$fice_code."'
AND s.academic_year = '".$acadyr."'
AND s.enroll_status = '01'
AND s.degree_intent IN ('2', '4', '6', '7', '8');
";
//echo("<p>".$query3."</p><br />");

$result3 = odbc_exec($conn_id, $query3);
while (odbc_fetch_row($result3))
{
$undup = odbc_result($result3, "undup");
$undup_total = $undup_total + $undup;
}
echo("<td align=right>".number_format($undup,0)."</td>");

$perc = ($cnt * 100) / $undup;
echo("<td align=right>".number_format($perc,1)."%</td>");

// number of all students - entire student body
$body = 0;
$query4 = "SELECT COUNT(DISTINCT(s.ssn_id)) AS body
FROM student_table s
WHERE s.fice_code = '".$fice_code."'
AND s.academic_year = '".$acadyr."';
";
//echo("<p>".$query4."</p><br />");

$result4 = odbc_exec($conn_id, $query4);
while (odbc_fetch_row($result4))
{
$body = odbc_result($result4, "body");
$body_total = $body_total + $body;
}
echo("<td align=right>".number_format($body,0)."</td>");

$perc2 = ($cnt * 100) / $body;
echo("<td align=right>".number_format($perc2,1)."%</td>");

echo("</tr>");
}
// this bracket ends list of schools

// all totals
echo("<tr>");
echo("<td colspan=3>Totals</td>");
echo("<td align=right>".number_format($cnt_total,0)."</td>");
echo("<td align=right>".number_format($undup_total,0)."</td>");
$perc_total = ($cnt_total * 100) / $undup_total;
echo("<td align=right>".number_format($perc_total,1)."%</td>");

echo("<td align=right>".number_format($body_total,0)."</td>");
$perc2_total = ($cnt_total * 100) / $body_total;
echo("<td align=right>".number_format($perc2_total,1)."%</td>");

echo("</tr>");

echo("</table>");

odbc_error();
odbc_close($conn_id);
?>
<p></p>

</body>