Code for Measure C12


Workforce Training
Workforce Education/Training is defined as any postsecondary (primarily non-credit) education or training activity (seminar, workshop, course, customized training, etc.) that is specifically used for developing/enhancing the skills of existing employees or members of any business or industry, and any training provided to individuals, whether employed or unemployed, that is designed to meet the employment needs of the student and/or employer by enhancing occupational, technical, and/or soft (communication, computational, and interpersonal) skills. Workforce training contact hours are reported by colleges annually. An institution may assign up to 2.00 points to this measure. Point(s) earned if number improves. Optional measures may not exceed 4 points.

SQL statements are in RED.


<body>

<?php
// THIS REPORT WRITTEN IN PHP SCRIPTING LANGAUGE
// CONNECTION INFO REMOVED
$year = $_POST["acadyr"];
//$term = $_POST["term"];
$term = array(0, 1, 2, 3);

//---------------------------------------------------------------------------------------
// set up the report table headings
//---------------------------------------------------------------------------------------
echo("<table cellpadding=0 cellspacing=0 border=1>");
echo("<tr>");
echo("<th colspan=14>Workforce Education Summary for Academic Year ".$year."</th>");
echo("</tr>");

echo("<tr>");
echo("<th rowspan=2>#</th>");
echo("<th rowspan=2>IT</th>");
echo("<th rowspan=2>College</th>");

echo("<th colspan=4 align=center>Credit Courses</th>");
echo("<th colspan=4 align=center>Non-Credit Courses</th>");
echo("<th colspan=3 align=center>Totals</th>");
echo("</tr>");

echo("<tr>");
echo("<td align=center width=50>Number of Courses</td>");
echo("<td align=center width=50>Enrollment</td>");
echo("<td align=center width=50>SSCH</td>");
echo("<td align=center width=50>Training Hours</td>");

echo("<td align=center width=50>Number of Courses</td>");
echo("<td align=center width=50>Enrollment</td>");
echo("<td align=center width=50>CEU</td>");
echo("<td align=center width=50>Training Hours</td>");

echo("<td align=center width=50>Number of Courses</td>");
echo("<td align=center width=50>Enrollment</td>");
echo("<td align=center width=50>Training Hours</td>");
echo("</tr>");

//---------------------------------------------------------------------------------------
// get institution name
//---------------------------------------------------------------------------------------
$query1 = "SELECT f.inst_type,
f.school_abbr,
f.fice_code
FROM fice_table f
WHERE f.inst_type IN ('1', '2')
-- AND f.fice_code = '005707'
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");
$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>");

// number of credit courses
$query2 = "SELECT COUNT(w.sequence) AS cr_cnt
FROM workforce_table w
WHERE w.fice_code = '".$fice_code."'
AND w.academic_year = '".$year."'
AND w.cr_hrs > '0'
AND (w.ceu <= '0' OR w.ceu is null);
";

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

// credit courses - enrollment and ssch
$cr_enroll = 0;
$ssch = 0;
$query3 = "SELECT w.sequence,
w.enrollment,
w.cr_hrs
FROM workforce_table w
WHERE w.fice_code = '".$fice_code."'
AND w.academic_year = '".$year."'
AND w.cr_hrs > '0'
AND (w.ceu <= '0' OR w.ceu IS NULL)
--GROUP BY w.sequence, w.enrollment, w.cr_hrs
ORDER BY w.sequence, w.enrollment, w.cr_hrs;
";

$result3 = odbc_exec($conn_id, $query3);
while (odbc_fetch_row($result3))
{
$sequence = odbc_result($result3, "sequence");
$enrollment = odbc_result($result3, "enrollment");
$cr_hrs = odbc_result($result3, "cr_hrs");

// echo("<p>".$enrollment."-".$cr_hrs."</p>");

$cr_enroll = $cr_enroll + $enrollment;
$ssch = $ssch + ($enrollment * $cr_hrs);
}
$cr_trhrs = $ssch * 15;
echo("<td align=right>".number_format($cr_enroll,0)."</td>");
echo("<td align=right>".number_format($ssch,0)."</td>");
echo("<td align=right>".number_format($cr_trhrs,0)."</td>");

// number of ceu courses
$query4 = "SELECT COUNT(w.sequence) AS ceu_cnt
FROM workforce_table w
WHERE w.fice_code = '".$fice_code."'
AND w.academic_year = '".$year."'
AND w.ceu > '0'; ";

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

// credit courses - enrollment and ssch
$ceu_enroll = 0;
$ceu = 0;
$query5 = "SELECT w.sequence,
w.enrollment,
w.ceu
FROM workforce_table w
WHERE w.fice_code = '".$fice_code."'
AND w.academic_year = '".$year."'
AND w.ceu > '0'
ORDER BY w.sequence, w.enrollment, w.ceu;
";

$result5 = odbc_exec($conn_id, $query5);
while (odbc_fetch_row($result5))
{
$sequence = odbc_result($result5, "sequence");
$enrollment = odbc_result($result5, "enrollment");
$ceu_hrs = odbc_result($result5, "ceu");

// echo("<p>".$ceu_enroll."-".$ceu_hrs."</p>");

$ceu_enroll = $ceu_enroll + $enrollment;
$ceu = $ceu + ($enrollment * $ceu_hrs);
}
$ceu_trhrs = $ceu * 10;
echo("<td align=right>".number_format($ceu_enroll,0)."</td>");
echo("<td align=right>".number_format($ceu,0)."</td>");
echo("<td align=right>".number_format($ceu_trhrs,0)."</td>");

$cnt_sum = $cr_cnt + $ceu_cnt;
$enroll_sum = $cr_enroll + $ceu_enroll;
$trhrs_sum = $cr_trhrs + $ceu_trhrs;

$cr_cnt_total = $cr_cnt_total + $cr_cnt;
$cr_enroll_total = $cr_enroll_total + $cr_enroll;
$ssch_total = $ssch_total + $ssch;
$cr_trhrs_total = $cr_trhrs_total + $cr_trhrs;

$ceu_cnt_total = $ceu_cnt_total + $ceu_cnt;
$ceu_enroll_total = $ceu_enroll_total + $ceu_enroll;
$ceu_total = $ceu_total + $ceu;
$ceu_trhrs_total = $ceu_trhrs_total + $ceu_trhrs;

if($inst_type == '1')
{
$cr_cnt_1 = $cr_cnt_1 + $cr_cnt;
$cr_enroll_1 = $cr_enroll_1 + $cr_enroll;
$ssch_1 = $ssch_1 + $ssch;
$cr_trhrs_1 = $cr_trhrs_1 + $cr_trhrs;

$ceu_cnt_1 = $ceu_cnt_1 + $ceu_cnt;
$ceu_enroll_1 = $ceu_enroll_1 + $ceu_enroll;
$ceu_1 = $ceu_1 + $ceu;
$ceu_trhrs_1 = $ceu_trhrs_1 + $ceu_trhrs;
}
if($inst_type == '2')
{
$cr_cnt_2 = $cr_cnt_2 + $cr_cnt;
$cr_enroll_2 = $cr_enroll_2 + $cr_enroll;
$ssch_2 = $ssch_2 + $ssch;
$cr_trhrs_2 = $cr_trhrs_2 + $cr_trhrs;

$ceu_cnt_2 = $ceu_cnt_2 + $ceu_cnt;
$ceu_enroll_2 = $ceu_enroll_2 + $ceu_enroll;
$ceu_2 = $ceu_2 + $ceu;
$ceu_trhrs_2 = $ceu_trhrs_2 + $ceu_trhrs;
}

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

echo("</tr>");
}

// summary
echo("<tr>");
echo("<td colspan=3>4-Year Universities</td>");
echo("<td align=right>".number_format($cr_cnt_1,0)."</td>");
echo("<td align=right>".number_format($cr_enroll_1,0)."</td>");
echo("<td align=right>".number_format($ssch_1,0)."</td>");
echo("<td align=right>".number_format($cr_trhrs_1,0)."</td>");

echo("<td align=right>".number_format($ceu_cnt_1,0)."</td>");
echo("<td align=right>".number_format($ceu_enroll_1,0)."</td>");
echo("<td align=right>".number_format($ceu_1,1)."</td>");
echo("<td align=right>".number_format($ceu_trhrs_1,0)."</td>");

$cnt_grand_1 = $cr_cnt_1 + $ceu_cnt_1;
$enroll_grand_1 = $cr_enroll_1 + $ceu_enroll_1;
$trhrs_grand_1 = $cr_trhrs_1 + $ceu_trhrs_1;

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

echo("</tr>");

echo("<tr>");
echo("<td colspan=3>2-Year Coleges</td>");
echo("<td align=right>".number_format($cr_cnt_2,0)."</td>");
echo("<td align=right>".number_format($cr_enroll_2,0)."</td>");
echo("<td align=right>".number_format($ssch_2,0)."</td>");
echo("<td align=right>".number_format($cr_trhrs_2,0)."</td>");

echo("<td align=right>".number_format($ceu_cnt_2,0)."</td>");
echo("<td align=right>".number_format($ceu_enroll_2,0)."</td>");
echo("<td align=right>".number_format($ceu_2,1)."</td>");
echo("<td align=right>".number_format($ceu_trhrs_2,0)."</td>");

$cnt_grand_2 = $cr_cnt_2 + $ceu_cnt_2;
$enroll_grand_2 = $cr_enroll_2 + $ceu_enroll_2;
$trhrs_grand_2 = $cr_trhrs_2 + $ceu_trhrs_2;

echo("<td align=right>".number_format($cnt_grand_2,0)."</td>");
echo("<td align=right>".number_format($enroll_grand_2,0)."</td>");
echo("<td align=right>".number_format($trhrs_grand_2,0)."</td>");
echo("</tr>");

echo("<tr>");
echo("<td colspan=3>Totals</td>");
echo("<td align=right>".number_format($cr_cnt_total,0)."</td>");
echo("<td align=right>".number_format($cr_enroll_total,0)."</td>");
echo("<td align=right>".number_format($ssch_total,0)."</td>");
echo("<td align=right>".number_format($cr_trhrs_total,0)."</td>");

echo("<td align=right>".number_format($ceu_cnt_total,0)."</td>");
echo("<td align=right>".number_format($ceu_enroll_total,0)."</td>");
echo("<td align=right>".number_format($ceu_total,1)."</td>");
echo("<td align=right>".number_format($ceu_trhrs_total,0)."</td>");

$cnt_grand = $cr_cnt_total + $ceu_cnt_total;
$enroll_grand = $cr_enroll_total + $ceu_enroll_total;
$trhrs_grand = $cr_trhrs_total + $ceu_trhrs_total;

echo("<td align=right>".number_format($cnt_grand,0)."</td>");
echo("<td align=right>".number_format($enroll_grand,0)."</td>");
echo("<td align=right>".number_format($trhrs_grand,0)."</td>");
echo("</tr>");

echo("</table>");
?>

</body>
</html>