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.144.89.197
Current Path : /var/www/oasis/src_old/ |
| Current File : /var/www/oasis/src_old/remove_exam_ack.php |
<?php
function RemoveExamAck($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
@session_start();
$fappno = $aobj_context->mobj_data["fappno"];
$fflag = $aobj_context->mobj_data["fflag"];
//var_dump($fappno);
$log_name = $_SESSION['usr'];
$update ="update appcandsum
set fackdate = null, fackuser = null,
fpaymentconfirm = null, fpaymentstatus = null, FPAYGATEWAY = null,
fpaymentremarks = null, frecptdate = null
where appno = '{$apk}'";
$lobj_get_data = $aobj_context->mobj_db->Execute($update);
$update_cand_sum = "UPDATE appcandsumview a, candsum c, appcandsum ac
SET
c.FEXAMFEEA = if(ifnull(a.FEXAMFEEA,0) > 0,ifnull(a.FEXAMFEEA,0),ifnull(c.FEXAMFEEA,0)),
c.FEXAMFEEB = if(ifnull(a.FEXAMFEEB,0) > 0,ifnull(a.FEXAMFEEB,0),ifnull(c.FEXAMFEEB,0)),
c.FEXAMFEEC = if(ifnull(a.FEXAMFEEC,0) > 0,ifnull(a.FEXAMFEEC,0),ifnull(c.FEXAMFEEC,0)),
c.FEXAMFEED = if(ifnull(a.FEXAMFEED,0) > 0,ifnull(a.FEXAMFEED,0),ifnull(c.FEXAMFEED,0)),
c.FEXAMFEEE = if(ifnull(a.FEXAMFEEE,0) > 0,ifnull(a.FEXAMFEEE,0),ifnull(c.FEXAMFEEE,0)),
c.FEXAMFEEF = if(ifnull(a.FEXAMFEEF,0) > 0,ifnull(a.FEXAMFEEF,0),ifnull(c.FEXAMFEEF,0)),
c.FEXAMFEEG = if(ifnull(a.FEXAMFEEG,0) > 0,ifnull(a.FEXAMFEEG,0),ifnull(c.FEXAMFEEG,0)),
c.FEXAMFEEH = if(ifnull(a.FEXAMFEEH,0) > 0,ifnull(a.FEXAMFEEH,0),ifnull(c.FEXAMFEEH,0)),
c.FEXAMFEEI = if(ifnull(a.FEXAMFEEI,0) > 0,ifnull(a.FEXAMFEEI,0),ifnull(c.FEXAMFEEI,0)),
c.FEXAMFEEJ = if(ifnull(a.FEXAMFEEJ,0) > 0,ifnull(a.FEXAMFEEJ,0),ifnull(c.FEXAMFEEJ,0)),
c.FTOTALFEE = a.FTOTALFEE,
c.frecptdate = date(ac.FACKDATE)
WHERE a.fregno = c.FREGNO and ac.fregno = c.fregno and ac.fdegree = c.fdegree
and ac.APPNO='{$apk}'";
$lobj_update_cand_sum = $this->aobj_context->mobj_db->Execute($update_cand_sum);
$lquery = "select fregno from appcandsum where appno = '{$apk}'";
$lresult = $aobj_context->mobj_db->getRow($lquery);
$fregno = $lresult['fregno'];
$insert_into_student_fee = "insert ignore into studfee
(FDEGREE,FEXAMNO, FCOLLCODE, FREGNO, FFEECODE, FAMOUNT, FLOGNAME, FLOGDATE)
select fdegree, fexamno, fcollcode, fregno, ffeecode, famount, '{$log_name}', now()
from tmpstudfeeupd where fregno='{$fregno}'";
if($fflag == 'T')
{
$update_cand_sum = "UPDATE appcandsumview a, candsum c, appcandsum ac
SET
c.FEXAMFEEA = null,
c.FEXAMFEEB = null,
c.FEXAMFEEC = null,
c.FEXAMFEED = null,
c.FEXAMFEEE = null,
c.FEXAMFEEF = null,
c.FEXAMFEEG = null,
c.FEXAMFEEH = null,
c.FEXAMFEEI = null,
c.FEXAMFEEJ = null,
c.FTOTALFEE = null,
c.frecptdate = null
WHERE a.fregno = c.FREGNO and ac.fregno = c.fregno and ac.fdegree = c.fdegree
and ac.APPNO='{$apk}'";
$lobj_update_cand_sum = $aobj_context->mobj_db->Execute($update_cand_sum);
$lquery = "update canddet cd, appcanddet ad set cd.fpresent = null, cd.finserted = null
where cd.fcollcode = ad.fcollcode and cd.fdegree = ad.fdegree and cd.fexamno = ad.fexamno
and cd.fsubcode = ad.fsubcode and cd.fregno = ad.fregno
and cd.fregno='{$fregno}'
and ad.appno = '{$apk}'";
$lobj_get_app_cand_det = $aobj_context->mobj_db->Execute($lquery);
$lquery = "delete from studfee where fregno = '{$fregno}'";
$lobj_get_app_cand_det = $aobj_context->mobj_db->Execute($lquery);
}
if(!$lobj_get_data)
{
$arr['msg'] = "Acknowledge Removal Failure. Please try again";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
else
{
$arr['msg'] = "Acknowledgement Deleted successfully.";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
return;
}
}
?>
|