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


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

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

        $query = "select ifnull(fid, '')as fid, ifnull(fheadname, '')as fheadname
                  from notifhead where ifnull(fdeleted, '') <> 'T'";
        $result = $aobj_context->pobj_db->GetAll($query);	
        if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success");
        }else{
            $result = "No heads found";
            echo $aobj_context->mobj_output->ToJSONEnvelope($result, -1, "failure");
            return;
        }
    }

    function getNotificationDegree($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $univcode = $aobj_context->mobj_data['univcode'];
        $deggrp = $aobj_context->mobj_data['deggrp'];

        $query = "select distinct fdegree, fdescpn from degree where fdeggrp='{$deggrp}';";
        $result = $aobj_context->pobj_db->GetAll($query);	
        if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success");
        }else{
            $result = "No degree found";
            echo $aobj_context->mobj_output->ToJSONEnvelope($result, -1, "failure");
            return;
        }
    }

    function getNotificationSem($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $univcode = $aobj_context->mobj_data['univcode'];
        $deggrp = $aobj_context->mobj_data['deggrp'];
        $degeree = $aobj_context->mobj_data['degeree'];

        $query = "select distinct fexamno, fexamname from degree where fdeggrp='{$deggrp}' and fdegree='{$degeree}';";
        $result = $aobj_context->pobj_db->GetAll($query);	
        if($result){
            echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success");
        }else{
            $result = "No degree found";
            echo $aobj_context->mobj_output->ToJSONEnvelope($result, -1, "failure");
            return;
        }
    }

    function closeQpSettings($aobj_context){
        $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
        $univcode = $aobj_context->mobj_data['univcode'];
        $exam = $aobj_context->mobj_data['exam'];
        $board = $aobj_context->mobj_data['board'];
        $qpcode = $aobj_context->mobj_data['qpcode'];
        $degree = $aobj_context->mobj_data['degree'];
        $sem = $aobj_context->mobj_data['sem'];
        $data = json_decode($aobj_context->mobj_data['data'], true);

        $explode = explode("*", $exam);
        $deggrp = $explode[0];
        $yearExplode = explode("-", $explode[1]);
        $year = $yearExplode[0];
        $examType = $yearExplode[1];
       
        foreach($data as $val){
            if($val['fpurgeStatus'] === true){
                $query1 = "insert ignore into qpseter_bkp 
                        select * from qpseter where 
                        fyear='{$year}' and fexamtype='{$examType}' 
                        and fqpcode='{$val['fqpcode']}'";

                $result1 = $aobj_context->pobj_db->Execute($query1);

                if($result1){
                    $query3 = "delete from qpseter where fyear='{$year}' and fexamtype='{$examType}' 
                               and fqpcode='{$val['fqpcode']}'";
                            
                    $result3 = $aobj_context->pobj_db->Execute($query3);
                }
                $query2 = "insert ignore into qpseterdet_bkp
                           select * from qpseterdet where 
                           fyear='{$year}' and fexamtype='{$examType}' 
                           and fqpcode='{$val['fqpcode']}' 
                           and fset='{$val['fset']}'";

                        
                $result2 = $aobj_context->pobj_db->Execute($query2);

                if($result2){
                    $query4 = "delete from qpseterdet where 
                           fyear='{$year}' and fexamtype='{$examType}' 
                           and fqpcode='{$val['fqpcode']}' 
                           and fset='{$val['fset']}'";

                    $result4 = $aobj_context->pobj_db->Execute($query4);
                } 
            }
            
            if($result2){
                $result = "Qp settings closed";
                echo $aobj_context->mobj_output->ToJSONEnvelope($result, 0, "success");
            }else{
                $result = "Failed to close qp settings";
                echo $aobj_context->mobj_output->ToJSONEnvelope($result, -1, "failure");
                return;
            }

        }

    }
?>