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


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/pmarks.php

<?php
    function getBatchWisePRDegree($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        session_start();
        $collcode = $_SESSION['collcode'];
        
        $userID = $_SESSION['user_id'];
        $usrtype = $_SESSION['usrtype'];
        
        if($usrtype =='40' || $usrtype =='14' )
        {
            $ltable = '';
        }
        else
        {
            $ltable = "inner join usersub us on c.fdegree = us.fdegree 
            and c.fcollcode = us.fcollegecode 
            and us.fuser = '{$userID}'";
    
        }

        $query = "select d.fdegree, d.fdescpn from degree d 
                inner join marks_pr c on d.fdegree = c.fdegree and c.fexamno = d.fexamno
                {$ltable}
                where  c.fcollcode='{$collcode}'  group by c.fdegree";
        //var_dump($query);        
        $result = $aobj_context->mobj_db->GetAll($query); 
        echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
        // if($result){
        //     echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
        // }else{
        //     $data = 'Fail to load semester';
        //     echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
        // }  
    }

    function getBatchWisePRSemister($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $collcode = $_SESSION['collcode'];
        $degree = $aobj_context->mobj_data["degree"];

        $query = "select distinct d.fexamname, m.fexamno from marks_pr m 
                  inner join degree d on d.fexamno = m.fexamno and 
                  d.fdegree = m.fdegree where m.fdegree='{$degree}' 
                  and m.fcollcode='{$collcode}';";
        $result = $aobj_context->mobj_db->GetAll($query); 
        if($result){
		echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
        }else{
            $data = 'Fail to load Subject';
            echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure"); 
        }  
    }

    function getBatchWisePRSubject($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $collcode = $_SESSION['collcode'];
        session_start();
        $examno = trim($aobj_context->mobj_data["examno"]);
	    $degree = trim($aobj_context->mobj_data["degree"]); 
        $userID = $_SESSION['user_id'];
        $usrtype = $_SESSION['usrtype'];

        if($usrtype =='40' || $usrtype =='14' )
        {
            $ltable = '';
        }
        else
        {
            $ltable = "inner join usersub us on m.fdegree = us.fdegree and instr(us.fprsubcode,m.fsubcode) > 0 and m.fcollcode = us.fcollegecode and us.fuser = '{$userID}'";
    
        }

        $query = "select * from s_sysdb where internal_code = '{$userID}'";
        $res = $aobj_context->mobj_db->GetRow($query);


        $usrtype = $res['user_type'];   

        $query = "select sum(case when DATE_FORMAT(NOW(),'%Y-%m-%d') 
                not between ifnull(FPRFROM,'1990-01-01') AND 
                ifnull(FPRTO,'1990-01-01') then 1 else 0 end) as flastdate,
                fsuspend from collexam where fcollcode = '{$college_code}' 
                and fdegree = '{$degree}' and fexamno = '{$examno}' 
                group by fsuspend";
        $result = $aobj_context->mobj_db->GetRow($query);


        $query = "select distinct fcsubcode as id,fcsubcode,concat(fcsubcode,' - ',fsubname) as fsubname,fssubname,
                    concat(fshortname,'(',fsubshort,')') as fshortname,fvalmax as 
                    fsmaxmarks from subject s inner join marks_pr m on 
                    s.fdegree = m.fdegree and s.fexamno = m.fexamno and 
                    s.fcsubcode = m.fsubcode 
                    {$ltable}
                    where m.FCOLLCODE = '{$collcode}'  
                    and s.fdegree = '{$degree}' 
                    and s.fexamno = '{$examno}'
                    group by s.fdegree,s.fexamno,s.fcsubcode
                    ";
        //  var_dump($query);           
        $res = $aobj_context->mobj_db->GetAll($query);
            

        if($result['fsuspend'] == 'T'){	
            $arr = "This degree is suspended temporarily";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
            return; 
        }else if($result['flastdate'] > 0){
            $arr = "Last date is over for the given details";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-2,"Failure");
            return;
	    }else if(strtoupper($_SESSION['user_type'])=='SUPERUSER'){
            echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success");
        }else{
            echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success");
        }
    }

    function GetVivaSubjectPR($aobj_context){
        $collcode = $_SESSION['collcode'];
        $examno = trim($aobj_context->mobj_data["exam_no"]);
	    $degree = trim($aobj_context->mobj_data["degcode"]);
        $subcode = trim($aobj_context->mobj_data["subcode"]); 

        $query = "select fvalmax from subject where fdegree = '{$degree}' 
                  and fexamno='{$examno}' and fcsubcode='{$subcode}';";
        $result = $aobj_context->mobj_db->GetRow($query);

        $qry = "select pm.FVVCODE,s.FSUBNAME,fvalmax as fsmaxmarks 
                from practical_master pm inner join subject s on 
                s.FEXAMNO=pm.FEXAMNO and s.FDEGREE=pm.FDEGREE 
                and s.FCSUBCODE=pm.FVVCODE where pm.FDEGREE='{$degree}' and pm.FEXAMNO='{$examno}' 
                and pm.FPRCODE='{$subcode}' and pm.FVVCODE!=''";
        $res = $aobj_context->mobj_db->GetRow($qry);
        
        if($result)
        {
            $arr['fvalmax'] = $result['fvalmax'];
            $arr['viva'] = $res;
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"Success");
            return;
        }else{
            $arr['msg']="No Viva found";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"Success");
            return;
        } 
    }




?>