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.227.209.89
<?php
function getstuddet($aobj_context)
{
session_start();
$college = $_SESSION['collcode'];
$regno = trim($aobj_context->mobj_data["regno"]);
if($college == '')
{
//var_dump($college);
$data = 'Login again and enter';
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
$qry = "select s.fname,s.fregno,s.fcollcode,concat(c.fcollname,', ',c.ftown) as collname,
d.fdescpn,s.fdegree,s.fcollcode
from student s inner join college c on s.fcollcode = c.fcollcode
inner join degree d on s.fdegree = d.fdegree and d.fexamno = 'A'
where fregno = '{$regno}'";
$student_exam_details = $aobj_context->mobj_db->GetRow($qry);
if(count($student_exam_details) > 0)
{
echo $aobj_context->mobj_output->ToJSONEnvelope($student_exam_details,0,"success");
return;
}
else
{
$data = 'Invlaid Register No.';
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-2,"failure");
return;
}
}
function savestuddet($aobj_context)
{
$college = $_SESSION['collcode'];
$usr = $_SESSION['usr'];
$fee = trim($aobj_context->mobj_data["fee"]);
$remarks = trim($aobj_context->mobj_data["remarks"]);
$oldcollcode = trim($aobj_context->mobj_data["oldcollcode"]);
$regno = trim($aobj_context->mobj_data["regno"]);
$degree = trim($aobj_context->mobj_data["degree"]);
if($college == '')
{
$data = 'Session Expired Login again and enter';
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"failure");
return;
}
$insert_qry="insert into studlat
(foldcollcode, fcollcode, fregno, fdegree,ffee,fremarks,fyear,fexamtype,flogdate,fuser,flastupddate,fupdateuser)
values
('{$oldcollcode}','{$college}','{$regno}','{$degree}','{$fee}','{$remarks}','2019','1',now(),'{$usr}',NULL,NULL
) ON DUPLICATE KEY UPDATE
foldcollcode = '{$oldcollcode}',
fcollcode = '{$college}',
flastupddate = now(),
fupdateuser = '{$usr}',
ffee = '{$fee}',
fremarks = '{$remarks}'
";
$studresults = $aobj_context->mobj_db->Execute($insert_qry);
//var_dump($insert_qry);
if($studresults)
{
$data = "Updated Successfully";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,0,"success");
return;
}else{
$data = "Sorry Try Again";
echo $aobj_context->mobj_output->ToJSONEnvelope($data,-1,"faliure");
return;
}
}
?>
|