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


Current Path : /proc/thread-self/root/var/www/oasis/src/
Upload File :
Current File : //proc/thread-self/root/var/www/oasis/src/updatedegreegroup.php

<?php
    function loadudg($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);

        $query='SELECT IFNULL(fdeggrp,"") AS dg,IFNULL(fdescpn,"")AS ddesc,
        IFNULL(fexamdate,"") AS ed FROM deggrp ';

        $lobj_get_data = $aobj_context->mobj_db->GetAll($query);
        if($lobj_get_data)
	{	
		echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_data,0,"success"); 
		return;
	}
	else
	{
		$data = "No data found..!";
		echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
		return;
	}

}

    function editdeg($aobj_context){

    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $fdeggrp=$aobj_context->mobj_data["dg"];
    $fdescpn=$aobj_context->mobj_data["desn"];
    $query="SELECT fdeggrp AS dg, fdescpn AS desn, fyear AS yr, fexamtype AS et, fexamdate AS ed 
    FROM deggrp where fdeggrp='{$fdeggrp}'";
 
    $lobj_get_data = $aobj_context->mobj_db->GetAll($query);
        if($lobj_get_data)
        {	
            echo $aobj_context->mobj_output->ToJSONEnvelope($lobj_get_data,0,"success"); 
            return;
        }
        else
        {
            $data = "No data found..!";
            echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
            return;
        }
    }

    function saveUpdatedDegree($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $fdeggrp=$aobj_context->mobj_data["deg_grp"];
        $fdescpn=$aobj_context->mobj_data["descpn"];
        $fyear=$aobj_context->mobj_data["year"];
        $fexamtype=$aobj_context->mobj_data["examtype"];
        $fexamdate=$aobj_context->mobj_data["examdate"];
        $edit=$aobj_context->mobj_data["edit"];

        $query="INSERT INTO deggrp (fdeggrp, fdescpn, fyear, fexamtype, fexamdate)
        VALUES('{$fdeggrp}','{$fdescpn}','{$fyear}','{$fexamtype}','{$fexamdate}')";
      
         $result = $aobj_context->mobj_db->Execute($query);
       
        if(!$result){	 

            $query="UPDATE deggrp SET fdescpn='$fdescpn', fyear='$fyear', fexamtype='$fexamtype', fexamdate=' $fexamdate' WHERE fdeggrp='$fdeggrp'";
            $lobj_get_data = $aobj_context->mobj_db->Execute($query);
           
            if($lobj_get_data){	 
         
             $arr['msg']="Updated";
             echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
             return;
             }
             else
             {  
             $arr['msg']="failed";
             echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 
             return;
             }
        }
        else
        {
         
            $arr['msg']="saved successfully";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
            return;
        }
    }

//    function update($aobj_context){
//     $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
//     $fdeggrp=$aobj_context->mobj_data["deg_grp"];
//     $fdescpn=$aobj_context->mobj_data["descpn"];
//     $fyear=$aobj_context->mobj_data["year"];
//     $fexamtype=$aobj_context->mobj_data["examtype"];
//     $fexamdate=$aobj_context->mobj_data["examdate"];

  
// }

?>