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.21.93.159
<?php
function uRvAppStatus($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$regno = $aobj_context->mobj_data['regno'];
$query = "select r.fsubcode,r.fregno, r.fexamno, d.fexamname, s.fqpcode,
concat(s.fsubname, ' - ', s.fssubname) as fsubname, d.FRESEXAMDATE as fexamdate,
d.fdegree, d.fdescpn, d.fmeyear, d.fmeexamtyp, r.fcorrtype,
if(ifnull(fxrpath, '') = '', 'abc.pdf',fxrpath) as fxrpath,
if(ifnull(f.fcorrtype,'') = r.fcorrtype, 'T', 'F') as frvstatus
from res_stud r inner join subject s on r.fdegree = s.fdegree
and r.fexamno = s.fexamno and r.fsubcode = s.fcsubcode
inner join res_fee f on r.fregno = f.fregno and r.fexamno = f.fexamno inner join degree d
on r.fdegree = d.fdegree and r.fexamno = d.fexamno
where r.fregno = '{$regno}' and ifnull(r.fpaymentstatus,'') = 'success'
order by r.fsubcode, r.fcorrtype desc";
$result = $aobj_context->pobj_db->GetAll($query);
if(sizeof($result)>0){
$corrtype = array( 'XR' => 'Photo Copy', 'PC' => 'Photo Copy', 'RV' => 'Re-Valuation', 'RT' => 'Re-Totalling',
'CV' => 'Challenge Valuation', 'RI' => 'Result Improvement' );
$main_src = realpath(__DIR__ . '/../../..');
// var_dump($main_src);
$xrpath = $main_src.'/studentportal2/photocopy'.'/';
// var_dump($xrpath);
$arr = array(); $i=0;
$protocol = stripos($_SERVER['SERVER_PROTOCOL'],'https') === 0 ? 'https://' : 'http://';
foreach ($result as $value) {
$value['fxrexist'] = 'F';
if($value['fcorrtype'] == 'XR' || $value['fcorrtype'] == 'PC')
{
$value['fcorrtype'] = 'XR';
$pcurl = "https://university-photocopy.s3.ap-south-1.amazonaws.com/".$value['fxrpath'];
$curl1 = curl_init();
curl_setopt($curl1, CURLOPT_URL, $pcurl);
curl_setopt($curl1, CURLOPT_NOBODY, true);
$response_pc = curl_exec($curl1);
$httpCode_pc = curl_getinfo($curl1 , CURLINFO_HTTP_CODE);
// var_dump($httpCode_pc);
if($httpCode_pc == 200) {
$value['fxrpath'] = $pcurl;
$value['fxrexist'] = 'T';
}
// $value['fxrpath'] = $protocol."studentportal.universitysolutions.in/photocopy/".$value['fxrpath'];
// $value['fxrexist'] = 'T';
}
$value['fcorrdescpn'] = $corrtype[$value['fcorrtype']];
$arr[$i] = $value;
$i++;
}
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$errMsg ="No data found!";
echo $aobj_context->mobj_output->ToJSONEnvelope($errMsg,-1,"failure");
}
}
?>
|