Viewing file: report.php (37.03 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include('ea_controller.php');
class Report extends Ea_controller {
// function __construct() {
// parent::Controller();
// }
// ###### start report 001
function report001_search() {
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$ord_rs_pa = array('programalumniName' => '');
$this->contents['rs_pa'] = $this->pa->get_options('',$ord_rs_pa);
$this->contents['acY'] = $this->session->userdata('acY');
$this->output($this->config->item("ea_folder")."v_report001_search");
}
function report001_show() {
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<div class="error">','</div>');
$this->form_validation->set_rules('programAlumniId',' ','trim|required|xss_clean');
$this->form_validation->set_rules('graduateY',' ','trim|required|is_natural_no_zero|callback_checkAdY|xss_clean');
if($this->form_validation->run() == true) {
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$this->load->model($this->config->item("ea_folder").'m_alumnimain','am');
$ord_rs_pa = array('programalumniName' => '');
$this->contents['rs_pa'] = $this->pa->get_options('',$ord_rs_pa);
$programAlumniId = $this->input->post('programAlumniId');
$graduateY = $this->input->post('graduateY');
$con_rs_am = array('amProgramAlumni' => $programAlumniId,
'graduateYear' => $graduateY);
$ord_rs_am = array('studentCode' => "");
$this->contents['rs_am'] = $this->am->qryAmJoinAbPf($con_rs_am, $ord_rs_am);
$this->contents['programAlumniId'] = $programAlumniId;
$this->contents['graduateYear'] = $graduateY;
$this->output($this->config->item("ea_folder")."v_report001_search");
} else {
$this->report001_search();
}
}
function report001_ex() {
$this->load->model($this->config->item("ppc_folder").'mo_config','cfg');
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$this->load->model($this->config->item("ea_folder").'m_alumnimain','am');
$programAlumniId = $this->input->post('programAlumniId');
$graduateYear = $this->input->post('graduateYear');
$this->contents['qu_cfg'] = $this->cfg->qryCfg();
$this->pa->programalumniId = $programAlumniId;
$this->contents['qu_pa'] = $this->pa->get_by_key();
$this->contents['graduateY'] = $graduateYear;
$con_rs_am = array('amProgramAlumni' => $programAlumniId,
'graduateYear' => $graduateYear);
$ord_rs_am = array('studentCode' => "");
$this->contents['rs_am'] = $this->am->qryAmJoinAbPf($con_rs_am, $ord_rs_am);
$this->output_detail($this->config->item("ea_folder")."v_report001");
}
// ###### end report 001
// ###### start report 002
function report002_search() {
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$ord_rs_pa = array('programalumniName' => '');
$this->contents['rs_pa'] = $this->pa->get_options('',$ord_rs_pa);
$this->contents['acY'] = $this->session->userdata('acY');
$this->output($this->config->item("ea_folder")."v_report002_search");
}
function report002_show() {
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<div class="error">','</div>');
$this->form_validation->set_rules('programAlumniId',' ','trim|required|xss_clean');
$this->form_validation->set_rules('graduateY',' ','trim|required|is_natural_no_zero|callback_checkAdY|xss_clean');
$this->form_validation->set_rules('cnt',' ','trim|xss_clean');
$errChkbox = "";
$chkbox = 0;
$arr = array();
$j = 0;
$cnt = $this->input->post('cnt');
for($i=0; $i<$cnt; $i++) {
$this->form_validation->set_rules('fieldNamesArr'.$i,' ','trim|xss_clean');
$fieldNameArr = $this->input->post('fieldNamesArr'.$i);
if($fieldNameArr!="") {
$chkbox = 1;
$arr[$j] = $fieldNameArr;
$j++;
}
}
if($this->form_validation->run() == true && $chkbox==1) {
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$this->load->model($this->config->item("ea_folder").'m_alumnimain','am');
$programAlumniId = $this->input->post('programAlumniId');
$graduateY = $this->input->post('graduateY');
$ord_rs_pa = array('programalumniName' => '');
$this->contents['rs_pa'] = $this->pa->get_options('',$ord_rs_pa);
$con_rs_am = array('amProgramAlumni' => $programAlumniId,
'graduateYear' => $graduateY);
$ord_rs_am = array('studentCode' => "");
$this->contents['rs_am'] = $this->am->qryAmJoinAbPf($con_rs_am, $ord_rs_am);
$this->contents['arr'] = $arr;
$this->output($this->config->item("ea_folder")."v_report002_search");
} else {
if($chkbox==0) {
$this->load->vars(array('errChkbox' => "กรุณาเลือกอย่างน้อย 1 ช่อง"));
}
$this->report002_search();
}
}
function report002_ex() {
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<div class="error">','</div>');
$this->form_validation->set_rules('programAlumniId',' ','trim|required|xss_clean');
$this->form_validation->set_rules('graduateY',' ','trim|required|is_natural_no_zero|callback_checkAdY|xss_clean');
$this->form_validation->set_rules('cnt',' ','trim|xss_clean');
$errChkbox = "";
$chkbox = 0;
$arr = array();
$cnt = $this->input->post('cnt');
for($i=0; $i<$cnt; $i++) {
$this->form_validation->set_rules('fieldNamesArr'.$i,' ','trim|xss_clean');
$fieldNameArr = $this->input->post('fieldNamesArr'.$i);
if($fieldNameArr!="") {
$chkbox = 1;
}
$arr[$i] = $fieldNameArr;
}
if($this->form_validation->run() == true && $chkbox==1) {
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$this->load->model($this->config->item("ea_folder").'m_alumnimain','am');
$this->load->model($this->config->item("ea_folder").'m_alumnibio','ab');
$this->load->model($this->config->item("ppc_folder").'mo_config','cfg');
$programAlumniId = $this->input->post('programAlumniId');
$graduateY = $this->input->post('graduateY');
$ord_rs_pa = array('programalumniName' => '');
$this->contents['rs_pa'] = $this->pa->get_options('',$ord_rs_pa);
$this->pa->programalumniId = $programAlumniId;
$this->contents['qu_pa'] = $this->pa->get_by_key();
$this->contents['graduateY'] = $graduateY;
$this->contents['qu_cfg'] = $this->cfg->qryCfg();
$con_rs_am = array('amProgramAlumni' => $programAlumniId,
'graduateYear' => $graduateY);
$ord_rs_am = array('studentCode' => "");
$this->contents['rs_am'] = $this->am->qryAmJoinAbPf($con_rs_am, $ord_rs_am);
$this->contents['arr'] = $arr;
$this->contents['ab'] = &$this->ab;
$this->output_detail($this->config->item("ea_folder")."v_report002");
} else {
if($chkbox==0) {
$this->load->vars(array('errChkbox' => "กรุณาเลือกอย่างน้อย 1 ช่อง"));
}
$this->report002_search();
}
}
// ###### end report 002
// ###### start report 003
function report003_search() {
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$this->load->model($this->config->item("ea_folder").'m_typeaward','ta');
$this->load->model($this->config->item("ea_folder").'m_levelaward','la');
$ord_rs_pa = array('programalumniName' => '');
$this->contents['rs_pa'] = $this->pa->get_options('',$ord_rs_pa);
$this->contents['acY'] = $this->session->userdata('acY');
$this->contents['rs_ta'] = $this->ta->get_options();
$this->contents['rs_la'] = $this->la->get_options();
$this->output($this->config->item("ea_folder")."v_report003_search");
}
function report003_show() {
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<div class="error">','</div>');
$this->form_validation->set_rules('type',' ','trim|xss_clean');
$type = $this->input->post('type');
if($type=="C") { // รายหลักสูตร
$this->form_validation->set_rules('programAlumniId',' ','trim|required|xss_clean');
$this->form_validation->set_rules('graduateY',' ','trim|required|is_natural_no_zero|callback_checkAdY|xss_clean');
$this->form_validation->set_rules('stdCode',' ','trim|xss_clean');
} else { // รายนักศึกษา
$this->form_validation->set_rules('programAlumniId',' ','trim|xss_clean');
$this->form_validation->set_rules('graduateY',' ','trim|xss_clean');
$this->form_validation->set_rules('stdCode',' ','trim|required|is_natural_no_zero|xss_clean');
}
$this->form_validation->set_rules('typeAward',' ','trim|xss_clean');
$this->form_validation->set_rules('levelAward',' ','trim|xss_clean');
$this->form_validation->set_rules('year1',' ','trim|is_natural_no_zero|callback_checkAdY_2|xss_clean');
$this->form_validation->set_rules('year2',' ','trim|is_natural_no_zero|callback_checkAdY_2|xss_clean');
if($this->form_validation->run() == true) {
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$this->load->model($this->config->item("ea_folder").'m_typeaward','ta');
$this->load->model($this->config->item("ea_folder").'m_levelaward','la');
$this->load->model($this->config->item("ea_folder").'m_hisaward','hw');
$programAlumniId = $this->input->post('programAlumniId');
$graduateY = $this->input->post('graduateY');
$stdCode = $this->input->post('stdCode');
$typeAward = $this->input->post('typeAward');
$levelAward = $this->input->post('levelAward');
$year1 = $this->input->post('year1');
$year2 = $this->input->post('year2');
$ord_rs_pa = array('programalumniName' => '');
$this->contents['rs_pa'] = $this->pa->get_options('',$ord_rs_pa);
$this->contents['type'] = $type;
$this->contents['rs_ta'] = $this->ta->get_options();
$this->contents['rs_la'] = $this->la->get_options();
// start ส่วนแสดงผล
$rs_la_show = $this->la->qryLevAw();
$this->contents['rs_la_show'] = $rs_la_show;
$this->contents['rs_ta_show'] = $this->ta->qryTa();
$i = 0;
$hw = array();
if($rs_la_show->num_rows()) {
if($type=="C") { // รายหลักสูตร
foreach($rs_la_show->result() as $row_la) {
$hw[$i] = $this->hw->qryHwByCurStdLevAndType($row_la->levelAwardId, $row_la->levelAwardNameT, $programAlumniId, $graduateY, $year1, $year2);
$i++;
}
} else { // รายนักศึกษา
foreach($rs_la_show->result() as $row_la) {
$hw[$i] = $this->hw->qryHwByStdLevAndType($row_la->levelAwardId, $row_la->levelAwardNameT, $year1, $year2, $stdCode);
$i++;
}
}
}
$this->contents['hw'] = $hw;
// end ส่วนแสดงผล
$this->output($this->config->item("ea_folder")."v_report003_search");
} else {
$this->report003_search();
}
}
function report003_ex() {
$this->load->model($this->config->item("ea_folder").'m_hisaward','ha');
$this->load->model($this->config->item("ea_folder").'m_alumnimain','am');
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$this->load->model($this->config->item("ppc_folder").'mo_config','cfg');
$levelAward = $this->input->post('levelAward');
$typeAward = $this->input->post('typeAward');
$programAlumniId = $this->input->post('programAlumniId');
$graduateY = $this->input->post('graduateY');
$stdCode = $this->input->post('stdCode');
$this->pa->programalumniId = $programAlumniId;
$this->contents['qu_pa'] = $this->pa->get_by_key();
$this->contents['graduateY'] = $graduateY;
$this->contents['qu_cfg'] = $this->cfg->qryCfg();
if($stdCode=="") { // รายหลักสูตร
$con_rs_am = array('amProgramAlumni' => $programAlumniId,
'graduateYear' => $graduateY);
} else { // รายนักศึกษา
$con_rs_am = array('studentCode' => $stdCode);
}
$this->contents['rs_am'] = $this->am->qryAmJoinAbPf($con_rs_am);
$this->contents['levelAward'] = $levelAward;
$this->contents['typeAward'] = $typeAward;
$this->contents['ha'] = &$this->ha;
$this->output_detail($this->config->item("ea_folder")."v_report003");
}
// ###### end report 003
// ###### start report 004
function report004_search() {
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$ord_rs_pa = array('programalumniName' => '');
$this->contents['rs_pa'] = $this->pa->get_options('',$ord_rs_pa);
$this->contents['acY'] = $this->session->userdata('acY');
$this->output($this->config->item("ea_folder")."v_report004_search");
}
function report004_show() {
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<div class="error">','</div>');
$this->form_validation->set_rules('programAlumniId',' ','trim|required|xss_clean');
$this->form_validation->set_rules('graduateY',' ','trim|required|is_natural_no_zero|callback_checkAdY|xss_clean');
$this->form_validation->set_rules('year',' ','trim|is_natural_no_zero|xss_clean');
if($this->form_validation->run() == true) {
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$this->load->model($this->config->item("ea_folder").'m_alumnimain','am');
$programAlumniId = $this->input->post('programAlumniId');
$graduateY = $this->input->post('graduateY');
$year = $this->input->post('year');
$ord_rs_pa = array('programalumniName' => '');
$this->contents['rs_pa'] = $this->pa->get_options('',$ord_rs_pa);
// ############ start แสดงจำนวน
/* ---------------------[จำนวนผู้สำเร็จการศึกษาที่ได้งานทำ] ---------------
aqStateQn : จำนวนผู้สำเร็จการศึกษาที่ได้งานทำ
1: ทำงานก่อนมาเรียน
2: มีงานทำ
3: ศึกษาต่อ */
$con_work = array('aqStateQn' => 2);
$this->contents['work'] = $this->am->qryAmByAnsQn($programAlumniId, $graduateY, $year, $con_work, 1);
/* ---[จำนวนผู้สำเร็จการศึกษาที่ศึกษาต่อ] */
$con_study = array('aqStateQn' => 3);
$this->contents['study'] = $this->am->qryAmByAnsQn($programAlumniId, $graduateY, $year, $con_study, 1);
/* ---[จำนวนผู้เข้าร่วมพิธีพระราชทานประกาศนียบัตร] */
// aqInvestiture
$con_investiture = array('aqInvestiture' => 'Y');
$this->contents['investiture'] = $this->am->qryAmByAnsQn($programAlumniId, $graduateY, $year, $con_investiture, 2);
/* ---[จำนวนผู้สำเร็จการศึกษาที่ตอบแบบสอบถาม]
amAnsQn = Y */
$this->contents['ansQn'] = $this->am->qryAmByAnsQn($programAlumniId, $graduateY, $year, "", 2);
/* ---[จำนวนผู้สำเร็จการศึกษาที่ประกอบอาชีพอิสระ]
aqWorkStatus = Y, N */
$con_freelance = array('aqWorkStatus' => 'N');
$this->contents['freelance'] = $this->am->qryAmByAnsQn($programAlumniId, $graduateY, $year, $con_freelance, 1);
/* ---[จำนวนผู้สำเร็จการศึกษาที่มีงานทำ หรือมีรายได้ประจำอยู่ก่อนที่จะเข้าศึกษา]
preAdmitPositionId*/
$con_preWork = array('preAdmitPositionId' => $this->config->item('ea_pa2').', '.$this->config->item('ea_pa3'));
//$this->contents['preWork'] = $this->am->qryAmByAnsQn($programAlumniId, $graduateY, $year, $con_preWork, 3);
$this->contents['preWork'] = $this->am->qryAmByAnsQnForLastItem($programAlumniId, $graduateY, $year, $con_preWork, 3);
$this->contents['total'] = $this->am->qryTotalAm($programAlumniId, $graduateY, $year);
$this->contents['programAlumniId'] = $programAlumniId;
$this->contents['graduateY'] = $graduateY;
$this->contents['year'] = $year;
// ############ end แสดงจำนวน
$this->output($this->config->item("ea_folder")."v_report004_search");
} else {
$this->report004_search();
}
}
function report004_ex() {
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$this->load->model($this->config->item("ea_folder").'m_alumnimain','am');
$this->load->model($this->config->item("ea_folder").'m_ea_alumniqn','aq');
$programAlumniId = $this->input->post('programAlumniId');
$graduateY = $this->input->post('graduateY');
$year = $this->input->post('year');
$this->pa->programalumniId = $programAlumniId;
$this->pa->get_by_key(TRUE);
$str = "";
$cnt = intval($graduateY-$year+1);
for($i=0; $i<$year; $i++) {
$str.=$cnt+$i.", ";
}
$graduate_str = substr($str, 0, -2);
$total = $this->am->qryTotalAm($programAlumniId, $graduate_str, $year);
$txml = "";
// ########################### sheet 1 #######################
// ##### หน้าจอ sheet 1
$txml.="<Worksheet ss:Name=\"EAIS004_SUM\">\n";
$txml.="<Table>\n";
$txml.="<Column ss:AutoFitWidth=\"0\" ss:Width=\"380.25\"/>\n";
$txml.="<Column ss:AutoFitWidth=\"0\" ss:Width=\"42\"/>\n";
$txml.="<Column ss:AutoFitWidth=\"0\" ss:Width=\"48.75\"/>\n";
$txml.="<Column ss:AutoFitWidth=\"0\" ss:Width=\"43.5\"/>\n";
$txml.="<Column ss:AutoFitWidth=\"0\" ss:Width=\"267\"/>\n";
$txml.="<Column ss:AutoFitWidth=\"0\" ss:Width=\"92.25\"/>\n";
$txml.="<Row ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:MergeAcross=\"3\" ss:MergeDown=\"5\" ss:StyleID=\"s62\"/>\n";
$txml.="<Cell ss:StyleID=\"s64\"><Data ss:Type=\"String\">วิทยาลัยพยาบาลบรมราชชนนี ชลบุรี</Data></Cell>\n";
$txml.="<Cell ss:MergeDown=\"5\" ss:StyleID=\"s66\"><Data ss:Type=\"String\">EAIS004</Data></Cell>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:Index=\"5\" ss:StyleID=\"s62\"/>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:Index=\"5\" ss:StyleID=\"s62\"/>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:Index=\"5\" ss:StyleID=\"s62\"/>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:Index=\"5\" ss:StyleID=\"s64\"/>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:Index=\"5\" ss:StyleID=\"s64\"><Data ss:Type=\"String\">ระบบทะเบียนศิษย์เก่า</Data></Cell>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:MergeAcross=\"5\" ss:MergeDown=\"2\" ss:StyleID=\"s68\"/>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\" ss:Span=\"1\"/>\n";
$txml.="<Row ss:Index=\"10\" ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:MergeAcross=\"5\" ss:StyleID=\"s70\"><Data ss:Type=\"String\">รายงานสรุปข้อมูลการทำงานของผู้สำเร็จการศึกษา</Data></Cell>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:MergeAcross=\"5\" ss:StyleID=\"s70\"><ss:Data ss:Type=\"String\"
xmlns=\"http://www.w3.org/TR/REC-html40\"><B><Font html:Color=\"#000000\">หลักสูตร </Font></B><Font
html:Color=\"#000000\">".(($programAlumniId==0) ? "-" : $this->pa->programalumniName)."</Font><B><Font
html:Color=\"#000000\">ปีการศึกษาที่จบ </Font></B><Font html:Color=\"#000000\">".(($graduateY==0) ? "-" : $graduate_str)."</Font></ss:Data></Cell>\n";
$txml.="</Row>\n";
// ############ หัวตาราง
$txml.="<Row ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:MergeAcross=\"3\" ss:StyleID=\"s72\"/>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\" ss:Height=\"21\">\n";
$txml.="<Cell ss:MergeDown=\"1\" ss:StyleID=\"m61135040\"><Data ss:Type=\"String\">รายการ</Data></Cell>\n";
$txml.="<Cell ss:MergeAcross=\"2\" ss:StyleID=\"m61135060\"><Data ss:Type=\"String\">จำนวนศิษย์เก่า</Data></Cell>\n";
$txml.="<Cell ss:MergeDown=\"1\" ss:StyleID=\"m61135080\"><Data ss:Type=\"String\">รวม**</Data></Cell>\n";
$txml.="<Cell ss:MergeDown=\"1\" ss:StyleID=\"m61135100\"><Data ss:Type=\"String\">ร้อยละ</Data></Cell>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\" ss:Height=\"21\">\n";
$txml.="<Cell ss:Index=\"2\" ss:StyleID=\"s74\"><Data ss:Type=\"String\">ชาย</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s74\"><Data ss:Type=\"String\">หญิง</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s74\"><Data ss:Type=\"String\">รวม</Data></Cell>\n";
$txml.="</Row>\n";
// ############ จบหัวตาราง
// ############ ข้อมูลในตาราง
for($i=1; $i<=6; $i++) {
switch($i) {
case 1:
$list = "1. จำนวนผู้สำเร็จการศึกษาที่ได้งานทำ [1]";
$con_work = array('aqStateQn' => 2);
$query = $this->am->qryAmByAnsQn($programAlumniId, $graduateY, $year, $con_work, 1);
break;
case 2:
$list = "2. จำนวนผู้สำเร็จการศึกษาที่ศึกษาต่อ [1]";
$con_study = array('aqStateQn' => 3);
$query = $this->am->qryAmByAnsQn($programAlumniId, $graduateY, $year, $con_study, 1);
break;
case 3:
$list = "3. จำนวนผู้เข้าร่วมพิธีพระราชทานประกาศนียบัตร [2]";
$con_investiture = array('aqInvestiture' => 'Y');
$query = $this->am->qryAmByAnsQn($programAlumniId, $graduateY, $year, $con_investiture, 2);
break;
case 4:
$list = "4. จำนวนผู้สำเร็จการศึกษาที่ตอบแบบสอบถาม [2]";
$query = $this->am->qryAmByAnsQn($programAlumniId, $graduateY, $year, "", 2);
break;
case 5:
$list = "5. จำนวนผู้สำเร็จการศึกษาที่ประกอบอาชีพอิสระ (มีกิจการของตนเองที่มีรายได้ประจำ) [1]";
$con_freelance = array('aqWorkStatus' => 'N');
$query = $this->am->qryAmByAnsQn($programAlumniId, $graduateY, $year, $con_freelance, 1);
break;
case 6:
$list = "6. จำนวนผู้สำเร็จการศึกษาที่มีงานทำ หรือมีรายได้ประจำอยู่ก่อนที่จะเข้าศึกษา [3]";
$con_preWork = array('preAdmitPositionId' => $this->config->item('ea_pa2').', '.$this->config->item('ea_pa3'));
//$query = $this->am->qryAmByAnsQn($programAlumniId, $graduateY, $year, $con_preWork, 3);
$query = $this->am->qryAmByAnsQnForLastItem($programAlumniId, $graduateY, $year, $con_preWork, 3);
break;
}
$row_query = $query->row();
$txml.="<Row ss:AutoFitHeight=\"0\" ss:Height=\"18.75\">\n";
$txml.="<Cell ss:StyleID=\"s85\"><Data ss:Type=\"String\">".$list."</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s86\"><Data ss:Type=\"Number\">".$row_query->male."</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s86\"><Data ss:Type=\"Number\">".$row_query->female."</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s86\"><Data ss:Type=\"Number\">".$row_query->totalQn."</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s86\"><Data ss:Type=\"Number\">".$row_query->total."</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s86\"><Data ss:Type=\"Number\">".number_format($row_query->percent, 2)."</Data></Cell>\n";
$txml.="</Row>\n";
}
$txml.="<Row ss:AutoFitHeight=\"0\" ss:Height=\"18.75\">\n";
$txml.="<Cell ss:StyleID=\"s87\"><Data ss:Type=\"String\">รวมจำนวนศิษย์เก่า ย้อนหลัง ".$year." ปี</Data></Cell>\n";
$txml.="<Cell ss:MergeAcross=\"4\" ss:StyleID=\"m61135120\"><Data ss:Type=\"String\">".$total." คน</Data></Cell>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:StyleID=\"s64\"><Data ss:Type=\"String\">หมายเหตุ :</Data></Cell>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:StyleID=\"s94\"><Data ss:Type=\"String\">[1] หมายถึง ไม่รวมลูกจ้างประจำ และข้าราชการ สถานะ/ตำแหน่งก่อนเข้าเรียน</Data></Cell>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:StyleID=\"s94\"><Data ss:Type=\"String\">[2] หมายถึง หมายถึง รวมสถานะ/ตำแหน่งก่อนเข้าเรียนทุกสถานะ</Data></Cell>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:StyleID=\"s94\"><Data ss:Type=\"String\">[3] หมายถึง ลูกจ้างประจำ และข้าราชการ</Data></Cell>\n";
$txml.="</Row>\n";
// ############ end ข้อมูลในตาราง
$txml.="<Row ss:AutoFitHeight=\"0\" ss:Height=\"33\">\n";
$txml.="<Cell ss:MergeAcross=\"5\" ss:MergeDown=\"1\" ss:StyleID=\"s68\"/>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\" ss:Height=\"33\"/>\n";
$txml.="<Row ss:AutoFitHeight=\"0\">\n";
$txml.="<Cell ss:MergeAcross=\"4\" ss:StyleID=\"s96\"><Data ss:Type=\"String\">วันที่พิมพ์ : ".date('d-m-y h:m')."</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s97\"><Data ss:Type=\"String\">หน้า 1/1</Data></Cell>\n";
$txml.="</Row>\n";
$txml.="</Table>\n";
$txml.="<WorksheetOptions xmlns=\"urn:schemas-microsoft-com:office:excel\">\n";
$txml.="<Unsynced/>\n";
$txml.="<Selected/>\n";
$txml.="<DoNotDisplayGridlines/>\n";
$txml.="<ProtectObjects>False</ProtectObjects>\n";
$txml.="<ProtectScenarios>False</ProtectScenarios>\n";
$txml.="</WorksheetOptions>\n";
$txml.="</Worksheet>\n";
// ##### end สิ้นสุด sheet 1
// ########################### sheet 1 #######################
for($sheet=1; $sheet<=6; $sheet++) {
switch($sheet) {
case 1:
$head_rpt = "รายงานแสดงรายชื่อผู้สำเร็จการศึกษาที่ได้งานทำ";
$con_rs_aq = array('aqStateQn' => 2,
'amProgramAlumni' => $programAlumniId);
$ord_rs_aq = array('studentCode' => '');
$rs = $this->aq->qryAqJoinAmPf($con_rs_aq,$ord_rs_aq,"",$graduate_str);
break;
case 2:
$head_rpt = "รายงานแสดงรายชื่อผู้สำเร็จการศึกษาที่ศึกษาต่อ";
$con_rs_aq = array('aqStateQn' => 3,
'amProgramAlumni' => $programAlumniId);
$ord_rs_aq = array('studentCode' => '');
$rs = $this->aq->qryAqJoinAmPf($con_rs_aq,$ord_rs_aq,"",$graduate_str);
break;
case 3:
$head_rpt = "รายงานแสดงรายชื่อผู้สำเร็จการศึกษาที่เข้าร่วมพิธีพระราชทานประกาศนียบัตร";
$con_rs_aq = array('aqInvestiture' => "Y",
'amProgramAlumni' => $programAlumniId);
$ord_rs_aq = array('studentCode' => '');
$rs = $this->aq->qryAqJoinAmPf($con_rs_aq,$ord_rs_aq,"",$graduate_str);
break;
case 4:
$head_rpt = "รายงานแสดงรายชื่อผู้สำเร็จการศึกษาที่ตอบแบบสอบถาม";
$con_rs_aq = array('amProgramAlumni' => $programAlumniId);
$ord_rs_aq = array('studentCode' => '');
$rs = $this->aq->qryAqJoinAmPf($con_rs_aq,$ord_rs_aq,"",$graduate_str);
break;
case 5:
$head_rpt = "รายงานแสดงรายชื่อผู้สำเร็จการศึกษาที่ประกอบอาชีพอิสระ (มีกิจการของตนเองที่มีรายได้ประจำ)";
$con_rs_aq = array('aqWorkStatus' => 'N',
'amProgramAlumni' => $programAlumniId);
$ord_rs_aq = array('studentCode' => '');
$rs = $this->aq->qryAqJoinAmPf($con_rs_aq,$ord_rs_aq,"",$graduate_str);
break;
case 6:
$head_rpt = "รายงานแสดงรายชื่อผู้สำเร็จการศึกษาที่มีงานทำ หรือมีรายได้ประจำอยู่ก่อนที่จะเข้าศึกษา";
$con_rs_am = array('amProgramAlumni' => $programAlumniId);
$ord_rs_am = array('studentCode' => '');
$rs = $this->am->qryAmJoinPf($con_rs_am,$ord_rs_am,"",$graduate_str);
break;
}
$txml.="<Worksheet ss:Name=\"EAIS004_".$sheet."\">\n";
$txml.="<Table>\n";
$txml.="<Column ss:StyleID=\"s109\" ss:AutoFitWidth=\"0\" ss:Width=\"109.5\"/>\n";
$txml.="<Column ss:StyleID=\"s109\" ss:AutoFitWidth=\"0\" ss:Width=\"176.25\"/>\n";
$txml.="<Column ss:StyleID=\"s109\" ss:AutoFitWidth=\"0\" ss:Width=\"451.5\"/>\n";
$txml.="<Column ss:StyleID=\"s109\" ss:AutoFitWidth=\"0\" ss:Width=\"156\"/>\n";
$txml.="<Row>\n";
$txml.="<Cell ss:MergeAcross=\"1\" ss:MergeDown=\"5\" ss:StyleID=\"s106\"/>\n";
$txml.="<Cell ss:StyleID=\"s107\"><Data ss:Type=\"String\">วิทยาลัยพยาบาลบรมราชชนนี ชลบุรี</Data></Cell>\n";
$txml.="<Cell ss:MergeDown=\"5\" ss:StyleID=\"s108\"><Data ss:Type=\"String\">EAIS004</Data></Cell>\n";
$txml.="</Row>\n";
$txml.="<Row>\n";
$txml.="<Cell ss:Index=\"3\" ss:StyleID=\"s110\"/>\n";
$txml.="</Row>\n";
$txml.="<Row>\n";
$txml.="<Cell ss:Index=\"3\" ss:StyleID=\"s110\"/>\n";
$txml.="</Row>\n";
$txml.="<Row>\n";
$txml.="<Cell ss:Index=\"3\" ss:StyleID=\"s110\"/>\n";
$txml.="</Row>\n";
$txml.="<Row>\n";
$txml.="<Cell ss:Index=\"3\" ss:StyleID=\"s107\"/>\n";
$txml.="</Row>\n";
$txml.="<Row>\n";
$txml.="<Cell ss:Index=\"3\" ss:StyleID=\"s107\"><Data ss:Type=\"String\">ระบบทะเบียนศิษย์เก่า</Data></Cell>\n";
$txml.="</Row>\n";
$txml.="<Row>\n";
$txml.="<Cell ss:MergeAcross=\"3\" ss:MergeDown=\"2\"/>\n";
$txml.="</Row>\n";
$txml.="<Row ss:Index=\"10\">\n";
$txml.="<Cell ss:MergeAcross=\"3\" ss:StyleID=\"s113\"><Data ss:Type=\"String\">".$head_rpt."</Data></Cell>\n";
$txml.="</Row>\n";
$txml.="<Row>\n";
$txml.="<Cell ss:MergeAcross=\"3\" ss:StyleID=\"s113\"><ss:Data ss:Type=\"String\"
xmlns=\"http://www.w3.org/TR/REC-html40\"><B><Font html:Color=\"#000000\">หลักสูตร </Font></B><Font
html:Color=\"#000000\">".(($programAlumniId==0) ? "-" : $this->pa->programalumniName)."</Font><B><Font
html:Color=\"#000000\">ปีการศึกษาที่จบ </Font></B><Font html:Color=\"#000000\">".(($graduateY==0) ? "-" : $graduate_str)."</Font></ss:Data></Cell>\n";
$txml.="</Row>\n";
$txml.="<Row>\n";
$txml.="<Cell ss:MergeAcross=\"1\"/>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\" ss:Height=\"21\">\n";
$txml.="<Cell ss:StyleID=\"s115\"><Data ss:Type=\"String\">ลำดับที่</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s115\"><Data ss:Type=\"String\">รหัสนักศึกษา</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s115\"><Data ss:Type=\"String\">ชื่อ - สกุลศิษย์เก่า</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s115\"><Data ss:Type=\"String\">เพศ</Data></Cell>\n";
$txml.="</Row>\n";
$cnt = 1;
if($rs->num_rows()) {
foreach($rs->result() as $row_rs) {
$name = $row_rs->prefixName.$row_rs->studentName." ".$row_rs->studentSurname;
$sex = ($row_rs->defaultSex=="M") ? "ชาย" : "หญิง";
$txml.="<Row ss:AutoFitHeight=\"0\" ss:Height=\"18.75\">\n";
$txml.="<Cell ss:StyleID=\"s116\"><Data ss:Type=\"Number\">".$cnt++."</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s116\"><Data ss:Type=\"Number\">".$row_rs->studentCode."</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s117\"><Data ss:Type=\"String\">".$name."</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s116\"><Data ss:Type=\"String\">".$sex."</Data></Cell>\n";
$txml.="</Row>\n";
}
} else {
$txml.="<Row ss:AutoFitHeight=\"0\" ss:Height=\"18.75\">\n";
$txml.="<Cell ss:MergeAcross=\"3\" ss:StyleID=\"s116\"><Data ss:Type=\"String\">** ไม่ปรากฏรายการในฐานข้อมูล **</Data></Cell>\n";
$txml.="</Row>\n";
}
$txml.="<Row ss:AutoFitHeight=\"0\" ss:Height=\"33\">\n";
$txml.="<Cell ss:MergeAcross=\"3\" ss:MergeDown=\"1\" ss:StyleID=\"m61111052\"/>\n";
$txml.="</Row>\n";
$txml.="<Row ss:AutoFitHeight=\"0\" ss:Height=\"33\"/>\n";
$txml.="<Row>\n";
$txml.="<Cell ss:MergeAcross=\"2\" ss:StyleID=\"s119\"><Data ss:Type=\"String\">วันที่พิมพ์ : ".date('d-m-y h:m')."</Data></Cell>\n";
$txml.="<Cell ss:StyleID=\"s120\"><Data ss:Type=\"String\">หน้า 1/1</Data></Cell>\n";
$txml.="</Row>\n";
$txml.="</Table>\n";
$txml.="<WorksheetOptions xmlns=\"urn:schemas-microsoft-com:office:excel\">\n";
$txml.="<PageSetup>\n";
$txml.="<Header x:Margin=\"0.3\"/>\n";
$txml.="<Footer x:Margin=\"0.3\"/>\n";
$txml.="<PageMargins x:Bottom=\"0.75\" x:Left=\"0.7\" x:Right=\"0.7\" x:Top=\"0.75\"/>\n";
$txml.="</PageSetup>\n";
$txml.="<DoNotDisplayGridlines/>\n";
$txml.="<ProtectObjects>False</ProtectObjects>\n";
$txml.="<ProtectScenarios>False</ProtectScenarios>\n";
$txml.="</WorksheetOptions>\n";
$txml.="</Worksheet>\n";
}
$data['txml'] = $txml;
$this->load->view($this->config->item("ea_folder")."v_report004", $data); //report004_ex
}
// ###### end report 004
// ###### start report 005
function report005_search() {
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$ord_rs_pa = array('programalumniName' => '');
$this->contents['rs_pa'] = $this->pa->get_options('',$ord_rs_pa);
$this->contents['acY'] = $this->session->userdata('acY');
$this->output($this->config->item("ea_folder")."v_report005_search");
}
function report005_show() {
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<div class="error">','</div>');
$this->form_validation->set_rules('programAlumniId',' ','trim|required|xss_clean');
$this->form_validation->set_rules('graduateY',' ','trim|required|is_natural_no_zero|callback_checkAdY|xss_clean');
if($this->form_validation->run() == true) {
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$this->load->model($this->config->item("ea_folder").'m_alumnimain','am');
$programAlumniId = $this->input->post('programAlumniId');
$graduateY = $this->input->post('graduateY');
/*
1: ข้อมูลศิษย์เก่า
2: ข้อมูลที่อยู่
3: ข้อมูลการทำงาน
4: ข้อมูลการเรียนต่อ
5: ข้อมูลการได้รับรางวัล
*/
$ord_rs_pa = array('programalumniName' => '');
$this->contents['rs_pa'] = $this->pa->get_options('',$ord_rs_pa);
$this->contents['programAlumniId'] = $programAlumniId;
$this->contents['graduateYear'] = $graduateY;
$this->contents['rs_am'] = $this->am->qryAmFollowUpdateHistory($graduateY, $programAlumniId);
$this->output($this->config->item("ea_folder")."v_report005_search");
} else {
$this->report005_search();
}
}
function report005_ex() {
$this->load->model($this->config->item("ppc_folder").'mo_config','cfg');
$this->load->model($this->config->item("ea_folder").'m_programalumni','pa');
$this->load->model($this->config->item("ea_folder").'m_alumnimain','am');
$programAlumniId = $this->input->post('programAlumniId');
$graduateYear = $this->input->post('graduateYear');
$this->contents['qu_cfg'] = $this->cfg->qryCfg();
$this->pa->programalumniId = $programAlumniId;
$this->contents['qu_pa'] = $this->pa->get_by_key();
$this->contents['graduateY'] = $graduateYear;
$this->contents['rs_am'] = $this->am->qryAmFollowUpdateHistory($graduateYear, $programAlumniId);
$this->output_detail($this->config->item("ea_folder")."v_report005");
}
// ###### end report 005
}
?>
|