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 : 18.116.52.29


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

<?php
    function getFinalQuestionPaperNew($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $univcode = $aobj_context->mobj_data["univcode"];
        $data = json_decode($aobj_context->mobj_data["data"], true);

        $split = explode("*", $data['exam']);
        $deggrp = $split[0];
        $splitYearAndMode = explode("-", $split[1]);
        $year = $splitYearAndMode[0];
        $type = $splitYearAndMode[1];
        $board = $data['board'];
        $qpcode = $data['qpcode'];
        $degree = $data['degree'];
        $sem = $data['sem'];
        $status = $data['status'];

        $board === "All" ? $boardCond = "" : $boardCond = "and s.fboard='{$board}'";
        $qpcode === "All" ? $qpCond = "" : $qpCond = "and s.fqpcode='{$qpcode}'";
        $degree === "All" ? $degreeCond = "" : $degreeCond = "and s.fdegree='{$degree}'";
        $sem === "All" ? $semCond = "" : $semCond = "and s.fexamno='{$sem}'";

        $query ="select d.fdeggrp, ifnull(s.fboard, '')as fboard, q.fyear, 
                q.fexamtype, q.fqpcode, d.fdegree, d.fexamno, 
                count(fset)as fset, d.fdegree,
                concat(s.fsubname, ' - ', s.fsubshort) as fsubname,
                sum(if(ifnull(fqpfilepath, '')<> '', 1, 0))as fqpcount,
                sum(if(ifnull(fmodqpupd, '')<> '', 1, 0))as fmodcount from qpseterdet1 q
                inner join subject s on s.fqpcode = q.fqpcode
                inner join degree d on d.fdegree = s.fdegree and d.fexamno = s.fexamno
                inner join deggrp dg on dg.fdeggrp = d.fdeggrp 
                and dg.fexamtype = q.fexamtype and dg.fyear = q.fyear 
                where dg.fdeggrp='{$deggrp}'	 
                and q.fyear='{$year}' and q.fexamtype='{$type}' 
                {$degreeCond}
                {$qpCond}
                {$boardCond}
                {$semCond}
                group by q.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");
            return;
        }
    }


    function showFinalQPFinalDetdata($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $univcode = $aobj_context->mobj_data["univcode"];
        $data = json_decode($aobj_context->mobj_data["data"], true);
        $stateData = json_decode($aobj_context->mobj_data["stateData"], true);

        $query = "select q.fyear, q.fexamtype, q.fqpcode, concat(s.fsubname, ' - ', s.fsubshort) as fsubname,
                q.fset, q.fqpcodeno, 
                ifnull(q.fmodqpupd, '')as fmodqpupd, 
                ifnull(q.fmodanskey, '')as fmodanskey, 
                ifnull(q.fmodform, '')as fmodform, 
                ifnull(ffinalpaper, '')as  fstatus
                from qpseterdet1 q inner join subject s on s.fqpcode = q.fqpcode
                inner join degree d on d.fdegree = s.fdegree and d.fexamno = s.fexamno
                inner join deggrp dg on dg.fdeggrp = d.fdeggrp
                where dg.fdeggrp='{$data['fdeggrp']}' and q.fyear='{$data['fyear']}' and q.fexamtype='{$data['fexamtype']}'
                and d.fdegree='{$data['fdegree']}' and d.fexamno='{$data['fexamno']}' and q.fqpcode='{$data['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");
            return;
        }
    }

    function saveFinalQuestionPaperNew($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $univcode = $aobj_context->mobj_data["univcode"];
        $data = json_decode($aobj_context->mobj_data["data"], true);

        foreach($data as $val){
            $query = "update qpseterdet1 set ffinalpaper='{$val['fstatus']}',
                      ffinalpaperdate=now() where fyear='{$val['fyear']}' and 
                      fexamtype='{$val['fexamtype']}'
                      and fqpcode='{$val['fqpcode']}'
                      and fset='{$val['fset']}' and fqpcodeno='{$val['fqpcodeno']}'";

            $result = $aobj_context->pobj_db->Execute($query);
        }

        if($result){
             $arr['msg'] = 'Updated successfully';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
        }else{
            $arr['msg'] = 'Failed to save';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
            return;
        }
    }

?>