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.133.149.244
<?php
function loadhostelfeedetails($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$query1 = "select fname, fmobileno, fappno, fpaystatus, fcreatedate, IFNULL(fpayid, ' ') as fpayid FROM
entstudadm where fmobileno = '{$_SESSION['MOBILE']}'";
//var_dump($query1);
$result1 = $aobj_context->mobj_db->GetAll($query1);
$hotstal = 'T';
// $arr['msg']="Last Date is over";
// echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
// return;
$fappno = $result1[0]['fappno'];
$query2 = "SELECT IFNULL(ead.fname,'') AS fname,
IFNULL(eal.fappno,'') AS fappno,
IFNULL(eal.fallotno,'') AS fallotno,
IFNULL(eal.fregno,'') AS fregno,
IFNULL(eal.fpaymentstatus,'') AS fpaymentstatus,
IFNULL(ead.fcategory,'') AS fcategory,
IFNULL(ec.fcollname,'') AS fcollname,
IFNULL(eal.fdegree,'') AS fdegree,
IFNULL(eal.fpamount,'') AS famount,
ifnull(eal.fquota,'') as fquota,
ifnull(fstudfrom,'') as fstudfrom
FROM entseatallot eal
INNER JOIN entstudadm ead ON eal.fappno = ead.fappno
INNER JOIN entoptdeg ede ON eal.fappno = ede.fappno
AND ede.fdegree = eal.fdegree
INNER JOIN entdeg d ON eal.fdegree = d.fdegree
INNER JOIN entcoll ec ON eal.fcollcode = ec.fcollcode
WHERE IFNULL(eal.fpaymentstatus,'') = 'success'
and eal.fallotround = '2'
AND eal.fappno = '{$fappno}'";
// var_dump($query2);
$result2 = $aobj_context->mobj_db->GetRow($query2);
$query3 = "select ifnull(fbankname,'') as fbankname, ifnull(faccno,'') as faccno,
ifnull(fifsc,'') as fifsc,
ifnull(fbranch,'') as fbranch,
ifnull(fpaymentstatus,'') as fpaymentstatus,
fappno
from entstudhostel
where fappno = '{$fappno}'";
$result3 = $aobj_context->mobj_db->GetRow($query3);
$arr['stud'] = $result2;
$arr['bank'] = $result3;
$arr['hotstal'] = $hotstal;
if($result2){
echo $aobj_context->mobj_output->TOJSONEnvelope($arr,0,"success");
return;
}
else{
$arr['msg']="Failed to load";
echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
return;
}
}
function savebankdetails($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$bankname = $aobj_context->mobj_data["bankname"];
$accno = $aobj_context->mobj_data["accno"];
$ifsc = $aobj_context->mobj_data["ifsc"];
$branch = $aobj_context->mobj_data["branch"];
$appno = $aobj_context->mobj_data["appno"];
$fmobile = $_SESSION['MOBILE'];
$famount = $aobj_context->mobj_data["famount"];
if($fmobile == '')
{
$data = 'Login and try again';
echo $aobj_context->mobj_output->TOJSONEnvelope($data,-1,"failed");
return;
}
$query = "select * From entstudhostel where fmobileno = '{$fmobile}'";
$res = $aobj_context->mobj_db->GetRow($query);
if($res)
{
$upd = "update entstudhostel set
fbankname = '{$bankname}',
faccno = '{$accno}',
fifsc = '{$ifsc}',
fbranch = '{$branch}'
where fappno = '{$appno}'";
$result = $aobj_context->mobj_db->Execute($upd);
}else
{
$query = "insert into entstudhostel (fappno,fmobileno,fregno,fname,fcategory,fcollcode,fdegree,famount,
fbankname,faccno,fifsc,fbranch,fcreateddate)
SELECT
IFNULL(eal.fappno,'') AS fappno,
'{$fmobile}',
IFNULL(eal.fregno,'') AS fregno,
IFNULL(ead.fname,'') AS fname,
IFNULL(ead.fcategory,'') AS fcategory,
IFNULL(eal.fcollcode,'') AS fcollcode,
IFNULL(eal.fdegree,'') AS fdegree,
'{$famount}',
'{$bankname}',
'{$accno}',
'{$ifsc}',
'{$branch}',
now()
FROM entseatallot eal
INNER JOIN entstudadm ead ON eal.fappno = ead.fappno
INNER JOIN entoptdeg ede ON eal.fappno = ede.fappno
AND ede.fdegree = eal.fdegree
INNER JOIN entdeg d ON eal.fdegree = d.fdegree
INNER JOIN entcoll ec ON eal.fcollcode = ec.fcollcode
WHERE IFNULL(ead.fpaystatus,'') = 'success'
AND eal.fappno = '{$appno}'";
$result = $aobj_context->mobj_db->Execute($query);
}
if($result){
$query = "select * From entstudhostel where fmobileno = '{$fmobile}'";
$res = $aobj_context->mobj_db->GetRow($query);
$data['fhostalid'] = $res['fhostalid'];
echo $aobj_context->mobj_output->TOJSONEnvelope($data,0,"success");
return;
}
else{
$data = 'Failed save';
echo $aobj_context->mobj_output->TOJSONEnvelope($data,-1,"failed");
return;
}
}
?>
|