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 : 13.58.214.43
<?php
function getThtimetable($aobj_context)
{
$data_json = file_get_contents("php://input");
$data = json_decode($data_json,true);
if($_SERVER['PHP_AUTH_USER'] == 'revaapiuser' && $_SERVER['PHP_AUTH_PW'] == 'reva@124')
{
}else
{
$arry='Unauthorized User';
echo $aobj_context->mobj_output->ToJSONEnvelope($arry,-1,"Failure");
return;
}
if(count($data) <=0)
{
$arry='Kindaly Pass Data';
echo $aobj_context->mobj_output->ToJSONEnvelope($arry,-1,"Failure");
return;
}
$regno = $data['regno'];
if($regno == '')
{
$arry='Kindly Send USN No.';
echo $aobj_context->mobj_output->ToJSONEnvelope($arry,-1,"Failure");
return;
}
$resrayy = [];
$error = 0;
$succes = 0;
$query = "select cd.fregno, dg.fexamname, cd.fexamno, st.fname,
concat(cd.fdegree,' - ',dg.fdescpn) as fdegree, cd.fexamtype,
concat(dg.fexamdate, '') as fexamdate, cd.fyear,
su.fqpcode, su.fsubname, su.fsubshort,
if(ifnull(t.fdoe,'0000-00-00') = '0000-00-00','-',concat(date_format(t.fdoe,'%d/%m/%Y'),' [',dayname(t.fdoe),']')) as fdoe,
if(ifnull(t.fsession,'') = '','-',re.fdescpn) as fdescpn,
'' as centre
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.fregno =st.fregno
inner join candsum cs on cd.fcollcode = cs.fcollcode and cd.fregno = cs.fregno
and cs.fyear = cd.fyear and cs.fexamtype = cd.fexamtype
inner join timetable t on su.fqpcode = t.fqpcode
and t.fyear and cs.fyear and t.fexamtype = cs.fexamtype and ifnull(cd.fbatch,'1') = t.fbatch
left join reason re on t.fsession = re.freasoncd
where cd.fregno = '{$regno}' and ifnull(cd.fpassmth,'') = ''
#and INSTR(cs.fhtenable,cd.fexamno) >0
and ifnull(cd.fpresent,'') = 'P'
and ifnull(cd.fthpr,'') <> 'T'
and ifnull(t.fdoe,'') <> ''
and su.ftheory = 'T'";
$res9 = $aobj_context->mobj_db->getAll($query);
if($res9)
{
foreach($res9 as $val)
{
$res['regno'] = $val['fregno'];
$res['sem'] = $val['fexamname'];
$res['examdate'] = $val['fexamdate'];
$res['subshort'] = $val['fsubshort'];
$res['qpcode'] = $val['fqpcode'];
$res['fsubname'] = $val['fsubname'];
$res['doe'] = $val['fdoe'];
$res['session'] = $val['fdescpn'];
array_push($resrayy,$res);
}
$msg = "success";
$arry['resdata'] = $resrayy;
echo $aobj_context->mobj_output->ToJSONEnvelope($arry,0,$msg);
return;
}else
{
$arry='time table not available';
echo $aobj_context->mobj_output->ToJSONEnvelope($arry,-1,"Failure");
return;
}
}
?>
|