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.227.183.161
<?php
function getExmStats($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.fcollcode, c.fcollname, fcount , fpendcount, fsuccesscount,
ifnull(Razorpay,0) as Razorpay,ifnull(Paytm,0) as Paytm, ifnull(POSTOFFICE,0) as POSTOFFICE,
ifnull(HDFC,0) as HDFC,ifnull(axis,0) as axis, ifnull(HDFC_BANK,0) as HDFC_BANK
from
(select cs.fcollcode, concat(cl.fcollname,', ', cl.ftown) as fcollname,
sum(if(ifnull(frecptdate,'') = '', 1, 0)) as fpendcount,
sum(if(ifnull(frecptdate,'') <> '', 1, 0)) as fsuccesscount,
count(*) as fcount from candsum cs inner join degree dg
on cs.fdegree = dg.fdegree and dg.fexamno = cs.fexamno
inner join college cl on cs.fcollcode=cl.fcollcode
where dg.fdeggrp = '{$fdeggrp}' {$colQry}
group by fcollcode) c
left join (
select ac.fcollcode, concat(ac.fcollcode,' - ',ac.fcollname) as fcollname,
sum(if(ac.fpaygateway = 'razorpay',1,0)) as Razorpay,
sum(if(ac.fpaygateway = 'Paytm',1,0)) as Paytm,
sum(if(ac.fpaymentype = 'POSTOFFICE',1,0)) as POSTOFFICE,
sum(if(ac.fpaygateway = 'HDFC',1,0)) as HDFC,
sum(if(ac.fpaygateway = 'axis',1,0)) as axis,
sum(if(ac.fpaygateway = 'HDFC BANK (Challan)',1,0)) as HDFC_BANK
from
(select cl.fcollcode,cl.fcollname,fpaygateway,fpaymentstatus,fregno,fpaymentype
from appcandsum a
inner join degree d on d.fdegree = a.fdegree and d.fexamno = a.fexamno
inner join college cl on a.fcollcode=cl.fcollcode
where fdeggrp = '{$fdeggrp}' and ifnull(a.fpaymentstatus,'') = 'success' {$colQry}
group by fregno) ac
group by ac.fcollcode) b on c.fcollcode = b.fcollcode";
$result = $aobj_context->pobj_db->getAll($query);
// var_dump($query,$result);
// die();
if($result && $result != boolean){
$res['det'] = $result;
echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success");
}else{
$arr = 'Data not Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
?>
|