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.129.210.36


Current Path : /proc/thread-self/root/var/www/html/admission/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/admission/src/qpboardupdate.php

<?php

function getDegreeqp($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data['univcode'];
    $collcode = $aobj_context->mobj_data['collcode'];

    $query = "SELECT  colldeg.fdegree, degree.FDESCPN FROM degree
    INNER JOIN colldeg ON colldeg.FDEGREE=degree.FDEGREE 
    WHERE colldeg.fcollcode='{$collcode}' 
    and ifnull(colldeg.fdeleted,'') <> 'T'
    GROUP BY fdegree";
    
    $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 getSemqp($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data['univcode'];
    $degree = $aobj_context->mobj_data['degree'];

    $query = "SELECT FEXAMNO,FEXAMNAME FROM degree WHERE FDEGREE = '{$degree}' group by FEXAMNO";
    $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 getQpCodeUpdate($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data['univcode'];
    $degree = $aobj_context->mobj_data['degree'];
    $sem = $aobj_context->mobj_data['sem'];

    $query = "SELECT fqpcode,fexamno,fsubname,fdegree FROM subject WHERE FDEGREE = '{$degree}' AND fexamno='{$sem}' GROUP BY fsubname";
    $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 qpupdateBoard($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data['univcode'];
    $degree = $aobj_context->mobj_data['degree'];
    $sem = $aobj_context->mobj_data['sem'];
    $qpcode = $aobj_context->mobj_data['qpcode'];
    
    if($qpcode == 'All'){
        $cond = "AND fqpcode <> ''";
    }else{
        $cond = "AND fqpcode='{$qpcode}'";
    }

    $query = "SELECT fsubname,fdegree,fexamno,fqpcode, fboard FROM  subject WHERE fdegree='{$degree}' AND fexamno='{$sem}' {$cond} GROUP BY fqpcode";

    $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 getboardnameupdate($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data['univcode']; 

    $query = "SELECT fboardname FROM masboard";
    $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 updateQPOnBoard($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $univcode = $aobj_context->mobj_data['univcode'];
    $data = $aobj_context->mobj_data['data'];
   
    $decode_data = json_decode($data, true);
    
    foreach($decode_data as $value){
        $query = "UPDATE subject SET fboard = '{$value['fboard']}' WHERE 
                  fdegree='{$value['fdegree']}' AND fexamno='{$value['fexamno']}' AND fqpcode='{$value['fqpcode']}'";
        
        $result = $aobj_context->pobj_db->execute($query);
    }
   
    if($result)
    {
        $arr['msg'] = 'Successfully Updated';
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
    }
    else
    {
    $arr['msg'] = 'No Data found';
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 	
    }
}

?>