0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.139.69.53


Current Path : /var/www/html/admission/src/
Upload File :
Current File : /var/www/html/admission/src/teachReport.php

<?php

function collDet($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data["univcode"];
    $fcurcollcode = $aobj_context->mobj_data["fcurcollcode"];

    if($fcurcollcode == "" ){
        $cond = "";
    }else{
        $cond = "and fcollcode = '{$fcurcollcode}'";
    }
    $query = "select fcollcode,fcollname,ftown from college 
    where ifnull(fdeleted,'') <> 'T' $cond";
//    var_dump($query);die();
    $result = $aobj_context->pobj_db->GetAll($query);
    
    if(count($result) > 0)
    {
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
    }
    else
    {
        $arr['msg'] = [];
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
    }
}

function boardDet($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data["univcode"];
    $colldet = $aobj_context->mobj_data["colldetail"];
    $colldet_arr= (explode(",",$colldet));
    foreach($colldet_arr as $key => $val){ 
        $coll .= "'".$val."',";
    }

    $coll_arr = substr_replace($coll ,"",-1);
    
    if($coll_arr === "'All'"){
        $con = "";
    }else{
      $con = "and c.fcollcode in ($coll_arr)";
    }
    
    $query = "select distinct m.fboard , b.fboardname from subject m 
    inner join masboard b on m.fboard = b.fboardcode inner join degree d on 
    d.fdegree = m.fdegree and d.fexamno = m.fexamno inner join colldeg c on
    c.fdegree = d.fdegree
    where ifnull(fboard, '') <> '' $con ";
    
    $result = $aobj_context->pobj_db->GetAll($query);
    
    if($result)
    {
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
    }
    else
    {
        $arr['msg'] = 'No Data Found';
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
    }
}

function teachDet($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data["univcode"];
    $colldet = $aobj_context->mobj_data["colldetail"];
    $boarddet = $aobj_context->mobj_data["boarddet"];
    
    $colldet_arr= (explode(",",$colldet));
    $boarddet_arr= (explode(",",$boarddet));

    foreach($colldet_arr as $key => $val){ 
        $coll .= "'".$val."',";
    }
    $coll_arr = substr_replace($coll ,"",-1);

    
    if($coll_arr === "'All'"){
        $con = "fcollcode <> ''";
    }else{
      $con = "fcollcode in ($coll_arr)";
    }

    foreach($boarddet_arr as $key => $val){
        $board .= "'".$val."',";
    }

    $boardarr = substr_replace($board ,"",-1);


    if($boardarr === "'All'"){
        $con1 = "and fboard <> ''";
    }else{
      $con1 = "and fboard in ($boardarr)";
    }

    $query = "select distinct fteachcode , fteachname from masteach
    where $con $con1 ";
    
    $result = $aobj_context->pobj_db->GetAll($query);
    
    if(count($result) > 0)
    {
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
    }
    else
    {
        $arr['msg'] = 'No Data Found';
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
    }
}

function getTeach($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data["univcode"];
    $colldet = $aobj_context->mobj_data["colldetail"];
    $boarddet = $aobj_context->mobj_data["boarddet"];
    $teachdet = $aobj_context->mobj_data["teachdet"];
    $fcurcollcode = $aobj_context->mobj_data["fcurcollcode"];
    $fcurtype = $aobj_context->mobj_data["fcurtype"];

    $colldet_arr= (explode(",",$colldet));
    $boarddet_arr= (explode(",",$boarddet));
    $teachdet_arr= (explode(",",$teachdet));

    foreach($colldet_arr as $key => $val){ 
        $coll .= "'".$val."',";
    }
    $coll_arr = substr_replace($coll ,"",-1);

    if($fcurtype !== '500' && $fcurtype !== '501'){
        if($coll_arr === "'All'"){
            $con = "c.fcollcode <> ''";
        }else{
        $con = "c.fcollcode in ($coll_arr)";
        }
    }else{
        $con = "c.fcollcode = '$fcurcollcode'";
    }
    
    foreach($boarddet_arr as $key => $val){
        $board .= "'".$val."',";
    }

    $board_arr = substr_replace($board ,"",-1);

    if($board_arr === "'All'"){
        $con1 = "";
    }else{
      $con1 = "and m.fboard in ($board_arr)";
    }

    foreach($teachdet_arr as $key => $val){
        $teach .= "'".$val."',";
    }

    $teach_arr = substr_replace($teach ,"",-1);

    if($teach_arr === "'All'"){
        $con2 = "and m.fteachcode <> ''";
    }else{
      $con2 = "and m.fteachcode in ($teach_arr)";
    }

    $query = "select distinct ifnull(m.fteachcode, '') as fteachcode ,
     ifnull(m.fteachname, '')as fteachname, ifnull(fqual, '') as fqual, 
     ifnull(fscale, '')as fscale, ifnull(fmobile, '')as fmobile, 
     ifnull(femail, '') as femail, ifnull(fgender, '') as fgender, 
     ifnull(fdob, '') as fdob
    from masteach m 
    inner join colldeg c on m.fcollcode = c.fcollcode
    where $con
    $con1
    $con2";
    
    
    $result = $aobj_context->pobj_db->GetAll($query);
    
    if(count($result) > 0)
    {
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
    }
    else
    {
        $arr['msg'] = 'No Data Found';
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
    }
}
?>