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.191.116.61
<?php
function uniclareAnsUpdate($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->req_body['univcode'];
//var_dump($univcode);die();
$regno = $aobj_context->req_body['regno'];
$qpcode = $aobj_context->req_body['qpcode'];
$ansbookno = $aobj_context->req_body['ansbookno'];
if($qpcode == '' || $regno == '' || $ansbookno == '')
{
$arr['msg'] = 'Invalid Params.';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,1,"failure");
return;
}
$query = "insert into ansstud(fregno,fdegree,fqpcode,fansbookno,fyear,fexamtype)
select c.fregno,c.fdegree,s.fqpcode,'{$ansbookno}',c.fyear,c.fexamtype from canddet c inner join subject s on
c.fdegree = s.fdegree and c.fexamno = s.fexamno and c.fsubcode = s.fsubcode where c.fregno = '{$regno}'
and s.fqpcode = '{$qpcode}'
ON DUPLICATE KEY UPDATE fansbookno = '{$ansbookno}'";
// var_dump($query);die();
$result = $aobj_context->pobj_db->Execute($query);
if($result)
{
$arr['msg'] = "Updated Successfully";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$res['msg'] = 'Updation Failure Please Try Again';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
?>
|