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.249.119
<?php
function admStatsdegwise($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
$fcollcode = $aobj_context->mobj_data['fcollcode'];
$fdeggrp = $aobj_context->mobj_data['fdeggrp'];
$fcollcode != '' ? $colQry = "and cl.fcollcode='{$fcollcode}' " : $colQry="";
$query = "select c.fdegree,c.fdescpn, ifnull(fcount,0) + ifnull(fenterednb,0) as fcount,
ifnull(factive,0) as factive,
ifnull(finsubdone,0) as ffinsubdone,
ifnull(fcount,0) + ifnull(fenterednb,0)-ifnull(finsubdone,0) as fadmpend,
ifnull(fackdone,0) as fackdone,
ifnull(fcount,0) + ifnull(fenterednb,0)-ifnull(fackdone,0) as fackpend,
ifnull(h.fapprdone,0) as fapprdone, (ifnull(fackdone,0) - ifnull(h.fapprdone,0)) as fapprpend
from degree c
left join(select count(fmobileno) as fcount, sum(if(ifnull(factive,'') = 'T',1,0)) as factive, fcollcode,fdegree
from collstud
where ifnull(fdeleted,'') <> 'T' {$colQry}
group by fdegree) s
on c.fdegree = s.fdegree
left join (select count(fappno) as fenterednb, fcollcode,fdegree
from studadm
where ifnull(fcontact_no,'') in(select fid from collstudnb)
and ifnull(fdeleted,'') <> 'T' {$colQry}
group by fdegree
) g on c.fdegree = g.fdegree
left join (select count(fappno) as finsubdone, fcollcode,fdegree
from studadm
where ifnull(ffinsub,'') = 'T' and ifnull(fdeleted,'') <> 'T' {$colQry}
group by fdegree
) e on c.fdegree = e.fdegree
left join (select ifnull(count(fappno),0) as fackdone, fcollcode,fdegree
from studadm where ifnull(ffinsub,'') = 'T'
and ifnull(fappstatus,'') = 'verified' and ifnull(fdeleted,'') <> 'T' {$colQry}
group by fdegree
) f on c.fdegree = f.fdegree
left join (select ifnull(count(fappno),0) as fapprdone, fcollcode,fdegree
from studadm where ifnull(ffinsub,'') = 'T'
and ifnull(fappstatus,'') = 'verified' and fapprstatus = 'approved' and ifnull(fdeleted,'') <> 'T'
{$colQry}
group by fdegree
) h on c.fdegree = h.fdegree
where ifnull(c.fdeleted,'') <> 'T' and c.fdeggrp = '{$fdeggrp}' and ifnull(c.fadmdeg,'') = 'T'
group by c.fdegree
order by c.fdegree
";
$result = $aobj_context->pobj_db->getAll($query);
// var_dump($query);
if($result){
echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
}
else{
echo $aobj_context->mobj_output->TOJSONEnvelope($arr['msg']="Please try later",-1,"failed");
}
}
?>
|