Code for Measure U10


Non-Traditional Graduates
This is an overall headcount of Non-Traditional students earning any credential (Technical Certificates and above). Non-Traditional Graduates are defined as age 25 or older at the time of graduation.


SQL Statement are in RED.

<body>
<h2>Credentials Awarded to Non-Traditional Students</h2>
<p>This is a simple age calculation of subtracting the student's birth year and month from the year and month of graduation.</p>

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

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("<p><b>Academic Year = ".$acadyr." Inst. Type = ".$inst_type." for ".$degree_text."</b>
<br />Each separate degree code/credential is counted.</p>");

echo("<table border=1 cellspacing=0 cellpadding=0>");
echo("<tr>");
echo("<th rowspan=2>#</th>");
echo("<th rowspan=2>IT</th>");
echo("<th rowspan=2>College</th>");
echo("<th colspan=2>Bachelor Degrees</th>");
echo("<th colspan=2>Advanced Certificates</th>");
echo("<th colspan=2>Associate Degrees</th>");
echo("<th colspan=2>Technical Certificates</th>");
echo("<th colspan=2>Certificates of Profiency</th>");
echo("<th colspan=2>Total</th>");

echo("</tr>");

echo("<tr>");
echo("<td align=center width=40>All</td>");
echo("<td align=center width=40>Age >= 25</td>");

echo("<td align=center width=40>All</td>");
echo("<td align=center width=40>Age >= 25</td>");

echo("<td align=center width=40>All</td>");
echo("<td align=center width=40>Age >= 25</td>");

echo("<td align=center width=40>All</td>");
echo("<td align=center width=40>Age >= 25</td>");

echo("<td align=center width=40>All</td>");
echo("<td align=center width=40>Age >= 25</td>");

echo("<td align=center width=40>All</td>");
echo("<td align=center width=40>Age >= 25</td>");

echo("</tr>");

// LIST OF COLLEGES
$query1 = "SELECT f.school_abbr AS abbr,
f.fice_code
FROM sisdb.dbo.fice_table f
WHERE f.inst_type IN ('".$inst_type."')
ORDER BY f.school_abbr
";

$result1 = odbc_exec($conn_id, $query1);
$n = 1;
while (odbc_fetch_row($result1))
{
$abbr = odbc_result($result1, "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>".$abbr."</td>");
//echo("<td align=center>".$fice_code."</td>");

$query2 = "SELECT DISTINCT g.ssn_id,
g.degree_level AS dl,
g.degree_1,
g.graduation_date,
s.date_of_birth AS dob
FROM sisdb.dbo.graduated_student_table g
JOIN sisdb.dbo.student_table s
ON g.fice_code = s.fice_code
AND g.ssn_id = s.ssn_id
WHERE g.fice_code = '".$fice_code."'
AND g.academic_year = '".$acadyr."'
".$dl_code."
;";
//echo("<p>".$query2."</p><hr />");

//echo("<p>".$query2."</p>");
$grd = 0;
$grd25 = 0;
$bacc = 0;
$bacc25 = 0;
$ac = 0;
$ac25 = 0;
$assoc = 0;
$assoc25 = 0;
$tc = 0;
$tc25 = 0;
$cp = 0;
$cp25 = 0;

$result2 = odbc_exec($conn_id, $query2);
while (odbc_fetch_row($result2))
{
$ssn_id = odbc_result($result2, "ssn_id");
$dl = odbc_result($result2, "dl");
$graduation_date = odbc_result($result2, "graduation_date");
$dob = odbc_result($result2, "dob");

if ($dl == '05')
{
$bacc++;

$grad_mo = (substr($graduation_date,0,2) / 12);
$grad_yr = substr($graduation_date,2,4);
$dob_mo = (substr($dob,2,2) / 12);
$dob_yr = substr($dob,4,4);

$age_bacc = ($grad_yr - $dob_yr) + ($grad_mo - $dob_mo);
// echo(number_format($age_bacc,2)."<br />");
if ($age_bacc >= 25.00)
{ $bacc25++; }
}

if ($dl == '04')
{
$ac++;

$grad_mo = (substr($graduation_date,0,2) / 12);
$grad_yr = substr($graduation_date,2,4);
$dob_mo = (substr($dob,2,2) / 12);
$dob_yr = substr($dob,4,4);

$age_ac = ($grad_yr - $dob_yr) + ($grad_mo - $dob_mo);
// echo(number_format($age_ac,2)."<br />");
if ($age_ac >= 25.00)
{ $ac25++; }
}

if ($dl == '03')
{
$assoc++;

$grad_mo = (substr($graduation_date,0,2) / 12);
$grad_yr = substr($graduation_date,2,4);
$dob_mo = (substr($dob,2,2) / 12);
$dob_yr = substr($dob,4,4);

$age_assoc = ($grad_yr - $dob_yr) + ($grad_mo - $dob_mo);
// echo(number_format($age_assoc,2)."<br />");
if ($age_assoc >= 25.00)
{ $assoc25++; }
}

if ($dl == '02')
{
$tc++;

$grad_mo = (substr($graduation_date,0,2) / 12);
$grad_yr = substr($graduation_date,2,4);
$dob_mo = (substr($dob,2,2) / 12);
$dob_yr = substr($dob,4,4);

$age_tc = ($grad_yr - $dob_yr) + ($grad_mo - $dob_mo);
// echo(number_format($age_tc,2)."<br />");
if ($age_tc >= 25.00)
{ $tc25++; }
}

if ($dl == '01')
{
$cp++;

$grad_mo = (substr($graduation_date,0,2) / 12);
$grad_yr = substr($graduation_date,2,4);
$dob_mo = (substr($dob,2,2) / 12);
$dob_yr = substr($dob,4,4);

$age_cp = ($grad_yr - $dob_yr) + ($grad_mo - $dob_mo);
// echo(number_format($age_cp,2)."<br />");
if ($age_cp >= 25.00)
{ $cp25++; }
}

if (($dl == '06') || ($dl == '07') || ($dl == '08') || ($dl == '09') || ($dl == '10') || ($dl == '11') || ($dl == '12') || ($dl == '17') || ($dl == '18') || ($dl == '19'))
{
$grd++;

$grad_mo = (substr($graduation_date,0,2) / 12);
$grad_yr = substr($graduation_date,2,4);
$dob_mo = (substr($dob,2,2) / 12);
$dob_yr = substr($dob,4,4);

$age_grd = ($grad_yr - $dob_yr) + ($grad_mo - $dob_mo);
// echo(number_format($age_cp,2)."<br />");
if ($age_grd >= 25.00)
{ $grd25++; }
}

}

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

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

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

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

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

$all = $bacc + $ac + $assoc + $tc + $cp;
$all25 = $bacc25 + $ac25 + $assoc25 + $tc25 + $cp25;

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

// all graduates above bachelors
//echo("<td align=right>".number_format($grd,0)."</td>");
//echo("<td align=right>".number_format($grd25,0)."</td>");

$bacc_total = $bacc_total + $bacc;
$ac_total = $ac_total + $ac;
$assoc_total = $assoc_total + $assoc;
$tc_total = $tc_total + $tc;
$cp_total = $cp_total + $cp;

$bacc25_total = $bacc25_total + $bacc25;
$ac25_total = $ac25_total + $ac25;
$assoc25_total = $assoc25_total + $assoc25;
$tc25_total = $tc25_total + $tc25;
$cp25_total = $cp25_total + $cp25;

$grand_total = ($bacc_total + $ac_total + $assoc_total + $tc_total + $cp_total);
$grand25_total = ($bacc25_total + $ac25_total + $assoc25_total + $tc25_total + $cp25_total);

echo("</tr>");
}

// all totals
echo("<tr>");
echo("<td colspan=3>Grand Totals</td>");

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

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

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

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

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

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

echo("</tr>");

echo("</table>");

odbc_error();
odbc_close($conn_id);
?>

</body>
</html>