Code for Measure U13


Transfer Graduates
This is a count of any graduate earning any credential in which the student transferred from another Arkansas public institution of higher education. The institution “receiving” the student is counted.


SQL Statement are in RED.

<body>

<!-- <p>This is the total number of unduplicated graduates - individual students are counted only once. </p>-->
<?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 = 'Credentials Awarded to Transfer Students from Arkansas Public Institutions of Higher Education';
$Credentials_text = 'Credentials';
}
if($credgrad == 'B')
{
$distinct = "DISTINCT ";
$Credentials = 'Credentials Awarded to Transfer Students from Arkansas Public Institutions of Higher Education';
$Credentials_text = 'Graduates';
}

switch($degree_level)
{
case "A": $dl_code = " ";
$degree_text = "All Credentials";
$er_code = "AND s.enroll_status IN ('03', '11') ";
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";
$er_code = "AND s.enroll_status IN ('03', '11') ";
break;

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

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

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

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

echo("<h3>".$Credentials."</h3>");
echo("<p><b>Academic Year selected = ".$acadyr." for graduates with ".$degree_text.".
<br />Credit for RECEIVING/GRADUATING Institution</b></p>");

echo("<table border=1 cellspacing=0 cellpadding=0>");
echo("<tr>");
echo("<th>#</th>");
echo("<th>IT</th>");
echo("<th>College</th>");
echo("<th>Transfer Student ".$Credentials_text."</th>");
echo("</tr>");

// LIST OF COLLEGES
$query1 = "SELECT DISTINCT f.inst_type,
f.school_abbr AS abbr,
f.fice_code
FROM sisdb.dbo.fice_table f
WHERE f.inst_type IN ('1', '2')
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");
$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 COUNT(".$distinct."(g.ssn_id)) AS cnt
FROM sisdb.dbo.graduated_student_table g
JOIN sisdb.dbo.student_table s
ON g.ssn_id = s.ssn_id
JOIN sisdb.dbo.fice_table f
ON s.transfer_fice = f.fice_code
WHERE f.fice_code = '".$fice_code."'
AND g.academic_year = '".$acadyr."'
AND g.init_enroll_status IN ('3', '9')
".$er_code."
AND (
s.transfer_fice IN ('001090', '001089', '001098', '001107', '001108', '001110', '001101', '001085', '001109', '001086', '001092')
OR s.transfer_fice IN ('012860', '001091', '901090', '011949', '020522', '022209',
'009976', '012260', '023482', '012261', '012105', '030633', '020870', '001104', '020753', '021111', '020746', '007738', '005707', '020735', '005732', '005245')
)
AND s.academic_year <= '".$acadyr."'
".$dl_code." ;
";
// echo("<p>".$query2."</p><hr />");
$cnt = 0;
$result2 = odbc_exec($conn_id, $query2);
while (odbc_fetch_row($result2))
{
$cnt = odbc_result($result2, "cnt");

$total_cnt = $total_cnt + $cnt;
if ($inst_type == '1')
{
$cnt_1 = $cnt_1 + $cnt;
}
if ($inst_type == '2')
{
$cnt_2 = $cnt_2 + $cnt;
}
}
echo("<td align=right>".number_format($cnt,0)."</td>");

echo("</tr>");
}

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

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

echo("<tr>");
echo("<td colspan=3>Total</td>");
echo("<td align=right>".number_format($total_cnt,0)."</td>");
echo("</tr>");

echo("</table>");

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

</body>