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


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

<?php
    function getMarkDegreeName($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $collcode = $_SESSION['collcode'];
        $userID = $_SESSION['user_id'];
        $teachcode = $_SESSION['usr'];
        $db = $aobj_context->mobj_data["db"];  
                
        $query = "select * from s_sysdb where internal_code = '{$userID}'";
        $res = $aobj_context->mobj_db->GetRow($query);
        $user_type = $res['user_type'];							
        // var_dump($query);
        $join = "INNER JOIN usersub u ON m.fdegree = u.fdegree AND u.fuser = '{$userID}'"; 
        
        if($user_type =='40' || $user_type =='14')
            $join = "";

            if($db == 'nmamit' || $db == 'srun' || $db == 'jsstu' || $db == 'sjbit' || $db == 'rrit' || $db == 'epcet')
            {
                $query = "SELECT d.fdegree, d.fdescpn FROM degree d 
                INNER JOIN student m ON d.fdegree = m.fdegree
                WHERE m.fcollcode = '{$collcode}' 
                AND IFNULL(m.fdeleted ,'') <> 'T' 
                group by d.fdegree";
            }else
            {
                    $query = "SELECT d.fdegree, d.fdescpn FROM degree d 
                    INNER JOIN marks m ON d.fdegree = m.fdegree  AND d.fexamno = m.fexamno
                    {$join}
                    WHERE m.fcollcode = '{$collcode}' 
                    AND IFNULL(m.fdeleted ,'') <> 'T' 
                    group by d.fdegree";
            }

            $result = $aobj_context->mobj_db->GetAll($query);
        
            if($result){
                echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
            }else{
                $data = 'Fail to load degree';
                echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
            }  
    }
    
    function getMarkExamName($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $degree_ = $aobj_context->mobj_data["degree"];
        $db = $aobj_context->mobj_data["db"];        
        if($db == 'nmamit' || $db == 'srun' || $db == 'jsstu' || $db == 'sjbit' || $db == 'rrit' || $db == 'epcet')
        {
            $query = "SELECT d.fexamname, d.fexamno FROM degree d 
            WHERE d.fdegree = '{$degree_}' GROUP BY d.fexamno";
        }else
        {
            $query = "SELECT d.fexamname, m.fexamno FROM marks m INNER JOIN degree d 
            ON m.fexamno = d.fexamno AND m.fdegree = d.fdegree
            WHERE m.fdegree = '{$degree_}' GROUP BY m.fexamno";
        }
        
        // var_dump($query);
        // die();
        $result_sem = $aobj_context->mobj_db->GetAll($query);  
    
        if($result_sem){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result_sem,0,"success"); 
        }else{
            $data = 'Fail to load semester';
            echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
        }  
    }
    
    function getMarkSubjName($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $degree_ = $aobj_context->mobj_data["degree"];
        $sem = $aobj_context->mobj_data["sems"];
        $collcode = $_SESSION['collcode'];
        $userID = $_SESSION['user_id'];
        $teachcode = $_SESSION['usr'];
        // var_dump($userID);
        // die();
        $query = "select * from s_sysdb where internal_code = '{$userID}'";
        $res = $aobj_context->mobj_db->GetRow($query);
        $user_type = $res['user_type'];							
    
        $join = "INNER JOIN usersub u ON c.fdegree = u.fdegree  
        AND INSTR(u.fsubcode,concat(c.fsubcode,'*'))>0
        AND u.fuser = '{$userID}'";
        // "INNER JOIN usersub u ON c.fdegree = u.fdegree  AND 
        // u.fuser = '{$teachcode}'";
        
         if($user_type =='40' || $user_type =='14')
            $join = "";
        
        $query = "SELECT  fcsubcode,fsubname FROM subject s 
        INNER JOIN marks c ON s.fdegree = c.fdegree and s.fexamno = c.fexamno 
        and s.fcsubcode = c.fsubcode
        {$join}
         WHERE c.fcollcode= '{$collcode}'
        AND s.fdegree = '{$degree_}' AND s.fexamno = '{$sem}'  
        AND s.Fretain ='T' AND s.FINTASS = 'T' group by fcsubcode";
    
    
        $result = $aobj_context->mobj_db->GetAll($query);
        // var_dump($result);
        // die();
            if($result){
                echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
                return;
            }else{
                $data = 'Fail to load degree';
                echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
                return;
            }  
    }
    
    function getMaxMarkSubj($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $degree_ = $aobj_context->mobj_data["degree"];
        $subj = $aobj_context->mobj_data["subj"];
        $sem = $aobj_context->mobj_data["sems"];
        
    
        $query = "SELECT fvalmax FROM subject 
        WHERE fdegree = '{$degree_}' AND fexamno = '{$sem}' AND 
        fcsubcode = '{$subj}'
        GROUP BY fexamno";
        // var_dump($query);
        // die();
        $result_mark = $aobj_context->mobj_db->GetRow($query);  
        
        if($result_mark){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result_mark,0,"success"); 
        }else{
            $data = 'Fail to load semester';
            echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
        }  
    }
    
    function loadSectionDetails($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $degree_ = $aobj_context->mobj_data["degree"];
        $subj = $aobj_context->mobj_data["subj"];
        $sem = $aobj_context->mobj_data["sems"];
        $collcode = $_SESSION['collcode'];
    
        $query = "SELECT IFNULL(fsection, '') AS fsections FROM student s
        INNER JOIN subject a ON s.fdegree = a.fdegree AND s.fexamno = a.fexamno 
        WHERE s.fcollcode = '{$collcode}' AND s.fdegree = '{$degree_}' AND s.fexamno = '{$sem}'
         AND a.fcsubcode = '{$subj}'";
        // var_dump($query);
        // die();
        $result =  $aobj_context->mobj_db->GetRow($query); 
        
        if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result_mark,0,"success");
        }else{
            $data = 'Fail to load semester';
            echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
        }  
    }
    
    function getSubjectDegreeName($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $collcode = $_SESSION['collcode'];
        $userID = $_SESSION['user_id'];
        $teachcode = $_SESSION['usr'];
        // var_dump($userID);
        // die();
        $query = "select * from s_sysdb where internal_code = '{$userID}'";
        $res = $aobj_context->mobj_db->GetRow($query);
        $user_type = $res['user_type'];							
        
        $join = "INNER JOIN usersub u ON m.fdegree = u.fdegree AND u.fuser = '{$userID}'"; 
        
        if($user_type =='40' || $user_type =='14')
            $join = "";
    
        $query = "SELECT d.fdegree, d.fdescpn FROM degree d 
        INNER JOIN colldeg m ON d.fdegree = m.fdegree 
        {$join}
        WHERE m.fcollcode = '{$collcode}' 
        AND IFNULL(d.fdeleted ,'') <> 'T' 
        group by d.fdegree";
    
        // var_dump($query);
        // die();
        $result = $aobj_context->mobj_db->GetAll($query);
        
    
            if($result){
                echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
            }else{
                $data = 'Fail to load degree';
                echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
            }  
    }

?>