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


Current Path : /proc/thread-self/root/var/www/html/univadmin_bkp/univadmin/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/univadmin_bkp/univadmin/src/uSubjectList.php

<?php

function uniclareGetStudentSubject($aobj_context)
{
    $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);

    $degree = $aobj_context->mobj_data['degree'];
    $univcode = $aobj_context->mobj_data['univcode'];
    $regno = $aobj_context->mobj_data['regno'];
    $examno = $aobj_context->mobj_data['examno'];

    $query = "select su.fdegree, d.fdescpn, d.fexamno, d.fexamname, su.fsubcode, su.fqpcode, 
    su.fsubname
    from student st inner join subject su on st.fdegree = su.fdegree inner join degree d on d.fdegree = su.fdegree and su.fexamno = d.fexamno
    where st.fregno = '{$regno}' and st.fdegree = '{$degree}' and su.fexamno = '{$examno}' group by su.fsubcode;";
    // var_dump($query);
    $result = $aobj_context->pobj_db->GetAll($query);
    
    if(count($result) <= 0)
    {
        $arr['msg'] = 'Subject Details Not Found';
        echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
        return;
    }

    $i = 0;
    $subarr = array();
    foreach($result as $k => $v)
    {
        $subarr[$i]['fslno'] = "";
        $subarr[$i]['fsubcode'] = $v['fsubcode'];
        $subarr[$i]['fqpcode'] = $v['fqpcode'];
        $subarr[$i]['fsubname'] = $v['fsubname'];
        $i++;
    }

    $res['fdegree'] = $result[0]['fdegree'];
    $res['fdegname'] = $result[0]['fdescpn'];
    $res['fexamname'] = $result[0]['fexamname'];
   

    $response['header'] = $res;
    $response['subjects'] = $subarr;

    $arr['subjectlist'] = $response;
    echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 

    
}