Viewing file: search_alumni.php (5.77 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include('ea_controller.php');
class Search_alumni extends Ea_controller {
// function __construct() {
// parent::Controller();
// }
function search_am() {
$this->load->model($this->config->item("ea_folder").'m_ea_curriculumdetails','curd');
$ord_rs_curd = array('curName' => '');
$this->contents['rs_curd'] = $this->curd->get_options('',$ord_rs_curd);
$this->output($this->config->item("ea_folder")."v_searchAlumni");
}
function result_search() {
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<div class="error">','</div>');
$this->form_validation->set_rules('stdCode',' ','trim|integer|xss_clean');
$this->form_validation->set_rules('citizenId',' ','trim|integer|xss_clean');
$this->form_validation->set_rules('name',' ','trim|xss_clean');
$this->form_validation->set_rules('curId',' ','trim|xss_clean');
$this->form_validation->set_rules('graduateY',' ','trim|integer|xss_clean');
$this->form_validation->set_rules('graduateY_2',' ','trim|integer|xss_clean');
if($this->form_validation->run() == true) {
$this->load->model($this->config->item("ea_folder").'m_alumnimain','am');
$this->load->model($this->config->item("ea_folder").'m_ea_curriculumdetails','curd');
$stdCode = $this->input->post('stdCode');
$citizenId = $this->input->post('citizenId');
$name = $this->input->post('name');
$curId = $this->input->post('curId');
$graduateY = $this->input->post('graduateY');
$graduateY_2 = $this->input->post('graduateY_2');
if($stdCode!="" || $citizenId!="" || $name!="" || $curId!="" || $graduateY!="" || $graduateY_2!="") {
$rs_am = $this->am->qryAmJoinAbPfCurd($stdCode, $citizenId, $name, $curId, $graduateY, $graduateY_2);
$ord_rs_curd = array('curName' => '');
$this->contents['rs_curd'] = $this->curd->get_options('',$ord_rs_curd);
$this->contents['rs_am'] = $rs_am;
$this->output($this->config->item("ea_folder")."v_searchAlumni");
} else {
$this->contents['fault'] = $this->config->item('str_fault');
$this->search_am();
}
} else {
$this->search_am();
}
}
function search_amQn() {
$this->load->model($this->config->item("ea_folder").'m_ea_curriculumdetails','curd');
$this->load->model($this->config->item("ea_folder").'m_timeqn','tq');
$ord_rs_curd = array('curName' => '');
$this->contents['rs_curd'] = $this->curd->get_options('',$ord_rs_curd);
$undefine_tq = $this->tq->qryGraduateYNotDefineTq();
if($undefine_tq!="") {
$this->contents['undefine_tq'] = $undefine_tq;
}
$this->output($this->config->item("ea_folder")."v_searchAlumniQn");
}
function result_searchQn() {
$this->load->library('form_validation');
$this->form_validation->set_error_delimiters('<div class="error">','</div>');
$this->form_validation->set_rules('stdCode',' ','trim|integer|xss_clean');
$this->form_validation->set_rules('citizenId',' ','trim|integer|xss_clean');
$this->form_validation->set_rules('name',' ','trim|xss_clean');
$this->form_validation->set_rules('curId',' ','trim|xss_clean');
$this->form_validation->set_rules('graduateY',' ','trim|xss_clean');
$this->form_validation->set_rules('graduateY_2',' ','trim|integer|xss_clean');
$this->form_validation->set_rules('ansQn',' ','trim|xss_clean');
if($this->form_validation->run() == true) {
$this->load->model($this->config->item("ea_folder").'m_alumnimain','am');
$this->load->model($this->config->item("ea_folder").'m_ea_curriculumdetails','curd');
$stdCode = $this->input->post('stdCode');
$citizenId = $this->input->post('citizenId');
$name = $this->input->post('name');
$curId = $this->input->post('curId');
$graduateY = $this->input->post('graduateY');
$graduateY_2 = $this->input->post('graduateY_2');
$ansQn = $this->input->post('ansQn');
if($stdCode!="" || $citizenId!="" || $name!="" || $curId!="" || $graduateY!="" || $graduateY_2!="" || $ansQn!="") {
$rs_am = $this->am->qryAmJoinAbPfCurdAq($stdCode, $citizenId, $name, $curId, $graduateY, $graduateY_2, $ansQn);
$ord_rs_curd = array('curName' => '');
$this->contents['rs_curd'] = $this->curd->get_options('',$ord_rs_curd);
$this->contents['rs_am'] = $rs_am;
$this->output($this->config->item("ea_folder")."v_searchAlumniQn");
} else {
$this->contents['fault'] = $this->config->item('str_fault');
$this->search_amQn();
}
} else {
$this->search_amQn();
}
}
function alumni_del() {
$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("ea_ums_folder").'m_umuser','umuser');
$this->load->model($this->config->item("ea_ums_folder").'m_umusergroup','umg');
$alumniId = $this->input->post('alumniId');
$this->am->alumniId = $alumniId;
$this->ab->alumniId = $alumniId;
$this->am->get_by_key(TRUE);
$this->am->studentCode;
$con_qu_am = array("studentCode" => $this->am->studentCode);
$qu_um = $this->am->qryAlumniInUm($con_qu_am);
$this->db->trans_begin();
if($qu_um->num_rows()) {
$row_um = $qu_um->row();
$this->umg->UgGpID = '191001';
$this->umg->UgUsID = $row_um->UsID;
$this->umg->delete();
//$this->umuser->UsID = $row_um->UsID;
$this->umuser->delete($row_um->UsID);
}
$this->ab->delete();
$this->am->delete();
if($this->db->trans_status() === false) {
$this->db->trans_rollback();
$this->session->set_flashdata('flgSave', $this->config->item('ea_flgDel_21'));
} else {
$this->db->trans_commit();
$this->session->set_flashdata('flgSave', $this->config->item('ea_flgDel_30'));
}
redirect($this->config->item("ea_folder")."search_alumni/search_am");
}
}
?>
|