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.224.45.82
<?php
function uniclareGetIaMarks($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$fregno = $aobj_context->mobj_data['regno'];
$fcollcode = $aobj_context->mobj_data['collcode'];
$fdegree = $aobj_context->mobj_data['degree'];
$univcode = $aobj_context->mobj_data['univcode'];
if($fcollcode == '' || $fdegree == '' || $fregno == '' || $univcode == '')
{
$arr['msg'] = 'Invalid Params';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,1,"failure");
return;
die();
}
$cond = "and DATE_FORMAT(NOW(),'%Y-%m-%d') between
DATE_ADD(collexam.fiato,INTERVAL 2 DAY)
AND DATE_ADD(collexam.fiato,INTERVAL 180 DAY)";
if($univcode == 'xxx')
$cond = '';
$query = "select distinct fexamno from marks where fregno = '{$fregno}'";
$res = $aobj_context->pobj_db->GetRow($query);
$exam = $res['fexamno'];
$query = "select DATE_FORMAT(NOW(),'%Y-%m-%d') as presentdate,
DATE_ADD(collexam.fiato, INTERVAL 1 DAY) AS FROMDATE,
DATE_FORMAT(collexam.fiato, '%Y-%m-%d') as lastdate,
DATE_FORMAT(DATE_SUB(collexam.fiato, INTERVAL 3 DAY), '%d/%m/%Y') as bforelaste
from collexam
where fcollcode = '{$fcollcode}'
and fdegree = '{$fdegree}'
and fexamno = '{$exam}'
{$cond}";
//var_dump($query);die();
$result = $aobj_context->pobj_db->GetAll($query);
if(count($result) == 0)
{
$arr['msg'] = 'IA Marks not Available';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
$cnd = "";
if($univcode == '041' || $univcode == '042' || $univcode == '023')
$cnd = "and mr.fdegree not like 'bed%'";
$query = "select mr.fregno, dg.fexamname,
concat(dg.fexamdate, ' Examination') as fexamdate,mr.fexamno,
concat(mr.fdegree,' - ',dg.fdescpn) as fdegree, mr.fcollcode, su.fcsubcode,
concat(su.fsubname,' - ',su.fssubname) as fsubname,
ifnull(su.fvalmax,'') as fvalmax,su.fsubshort, su.fshortname,
if(ifnull(mr.fmarks,'') = '-2','Ab.',mr.fmarks) as fmarks
from marks mr inner join degree dg on mr.fdegree = dg.fdegree
and mr.fexamno = dg.fexamno
inner join subject su on mr.fdegree = su.fdegree and mr.fexamno = su.fexamno
and mr.fsubcode = su.fcsubcode
where mr.fregno = '{$fregno}' and ifnull(mr.fmarks,'') <> '-1' {$cnd}
order by fcsubcode";
$result = $aobj_context->pobj_db->GetAll($query);
if(count($result) > 0)
{
$i = 0;
$subarr = array();
foreach($result as $k => $v)
{
$subarr[$i]['fslno'] = '';
$subarr[$i]['fcsubcode'] = $v['fcsubcode'];
$subarr[$i]['fsubshort'] = $v['fsubname'];
$subarr[$i]['fvalmax'] = $v['fvalmax'];
$subarr[$i]['fmarks'] = $v['fmarks'];
$i++;
}
$res['fdegree'] = $result[0]['fdegree'];
$res['fexamdate'] = $result[0]['fexamdate'];
$res['fexamname'] = $result[0]['fexamname'];
$res['fregno'] = $result[0]['fregno'];
$response['header'] = $res;
$response['subjects'] = $subarr;
$arr['iamarks'] = $response;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
else
{
$arr['msg'] = 'IA Marks not Available';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
|