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


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

<?php
function getPriSubFreeze($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $degree = $aobj_context->mobj_data['degree'];
    $exam = $aobj_context->mobj_data['exam'];	
    $univcode = $aobj_context->mobj_data['univcode'];						 
	
    $qry = "select s.fcsubcode,concat(s.fsubname,'-',s.fssubname) AS fsubname,
    (case
        when c.ffreezed = 'L' then 'University FREEZED'
        when c.ffreezed= 'T' then 'FREEZED'
        when c.ffreezed = 'F' then 'PENDING'
        when ifnull(c.ffreezed,'F') = 'F' then 'PENDING'
        end)as ffreezed,
        ifnull(ffreezed2,'F') as ffreezed1
    FROM `subject` s inner join collia c  on s.FDEGREE = c.fdegree AND s.FEXAMNO = c.fexamno 
    AND  s.fcsubcode = c.fsubcode 
    WHERE s.fdegree = '{$degree}' AND s.fexamno='{$exam}' 
    group by s.fcsubcode
    order by s.fcsubcode";
//     var_dump($qry);
// die();
    $result = $aobj_context->pobj_db->GetAll($qry);

    
    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"); 	
    }	
}

function savePriFreez($aobj_context){
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
    $req = $aobj_context->req_body;
    // var_dump($req);
    // die();
    $data = $req['data'];
    $view = $data['priview'];
    $degree = $data['degree'];
    $exam = $data['exam'];
    

    $truearray = array();
    $falsearray = array();
    $freezearray = array();

    foreach ($view as $k => $v) {
       
        if($v['ffreezed1'] == 'T' || $v['ffreezed1'] == 'true')
            array_push($truearray, $v['fcsubcode']);
        elseif($v['ffreezed1']== 'L')
            array_push($freezearray,$v['fcsubcode']);
        else
            array_push($falsearray, $v['fcsubcode']);
    }
    
    $true = implode("','", $truearray);
    $false = implode("','", $falsearray);
    $freeze = implode("','", $freezearray);

    $query = "update collia set ffreezed2 = 'F' where fsubcode in ('{$false}')";
    
    $result = $aobj_context->pobj_db->Execute($query);
    // var_dump($result);
    // die();
    if (!$result) {
        $arr['msg'] = 'Insertion / Updation Failed';
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
        return;
    }

    $query = "update collia set ffreezed2 = 'F' where fsubcode in ('{$freeze}')";
    
    $result = $aobj_context->pobj_db->Execute($query);

    if (!$result) {
        $arr['msg'] = 'Insertion / Updation Failed';
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
        return;
    }

    $query = "update collia set ffreezed2 = 'T' where fsubcode in ('{$true}')";
    
    $result = $aobj_context->pobj_db->Execute($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"); 	
    }	
}

?>