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.149.239.254
<?php
function downloadStudHalltiket($aobj_context)
{
$data_json = file_get_contents("php://input");
$data = json_decode($data_json,true);
if($_SERVER['PHP_AUTH_USER'] == 'revaapiuser' && $_SERVER['PHP_AUTH_PW'] == 'reva@124')
{
}else
{
$arry='Unauthorized User';
echo $aobj_context->mobj_output->ToJSONEnvelope($arry,-1,"Failure");
return;
}
if(count($data) <=0)
{
$arry='Kindaly Pass Data';
echo $aobj_context->mobj_output->ToJSONEnvelope($arry,-1,"Failure");
return;
}
$regno = $data['regno'];
$query = "select fcollcode, fregno, fdegree from student where fregno = '{$regno}'";
$res1 = $aobj_context->mobj_db->getRow($query);
if($res1)
{
}else
{
$arry['msg']='Student Details not found';
$arry['regno']=$regno;
echo $aobj_context->mobj_output->ToJSONEnvelope($arry,-1,"Failure");
return;
}
$fcollcode = $res1['fcollcode'];
$fregno = $res1['fregno'];
$fdegree = $res1['fdegree'];
$folder = 'reva';
$FUNIVCODE = '030';
$durl = 'https://universitysolutions.in/'.$folder.'/halltickets/'.'HT_'.$FUNIVCODE.'_'.$fregno.'.pdf';
$uploadRequest = array(
'degree_code' => $fdegree,
'fcollcode' => $fcollcode,
'reg_starts' => $fregno,
'reg_ends' => $fregno,
'FUNIVCODE' =>$FUNIVCODE
);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://universitysolutions.in/'.$folder.'/app.php?a=generatePostAdmissionTicket.demo');
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $uploadRequest);
$response = curl_exec($curl);
$httpCode = curl_getinfo($curl , CURLINFO_HTTP_CODE);
curl_close($curl);
$curl1 = curl_init();
curl_setopt($curl1, CURLOPT_URL, $durl);
curl_setopt($curl1, CURLOPT_NOBODY, true);
$response_hall = curl_exec($curl1);
$httpCode_hall = curl_getinfo($curl1 , CURLINFO_HTTP_CODE);
if($httpCode_hall == 200 && $httpCode == 200) //file_exists($path)
{
$arry['regno']= $fregno;
$arry['url']= $durl;
$arry['msg'] = "Download HallTiket";
echo $aobj_context->mobj_output->ToJSONEnvelope($arry,0,"success");
return;
}else
{
$arry['regno']= $fregno;
$arry['url']= "-";
$arry['msg'] = "Download HallTiket Failure";
echo $aobj_context->mobj_output->ToJSONEnvelope($arry,-1,"Failure");
return;
}
}
?>
|