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.147.77.119
<?php
function uHallticketDownload($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
$fregno = $aobj_context->mobj_data['regno'];
$fdegree = $aobj_context->mobj_data['degree'];
$fcollcode = $aobj_context->mobj_data['collcode'];
$folder = $aobj_context->mobj_data['folder'];
if($univcode == '' || $fregno == '' || $fdegree == '' || $fcollcode == '' || $folder == '')
{
$arr['msg'] = 'Invalid Params';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,1,"failure");
return;
}
$query = "select DATE_FORMAT(NOW(),'%Y-%m-%d') as presentdate,
DATE_FORMAT(collexam.fhtfrom, '%d/%m/%Y') AS FROMDATE,
DATE_FORMAT(collexam.fhtto, '%d/%m/%Y') as lastdate from collexam
where fcollcode = '{$fcollcode}'
and fdegree = '{$fdegree}'
and DATE_FORMAT(NOW(),'%Y-%m-%d') between collexam.fhtfrom
AND collexam.fhtto";
$result = $aobj_context->pobj_db->GetAll($query);
if($result)
{
$dateQuery = "select * from canddet where fregno = '{$fregno}'
and fdegree = '{$fdegree}'
and fcollcode = '{$fcollcode}' and fpresent = 'P'";
$result = $aobj_context->pobj_db->GetAll($dateQuery);
if($result)
{
$Query = "select * from candsum where
fregno = '{$fregno}' and fhtblk = '0123456789'";
$result = $aobj_context->pobj_db->GetRow($Query);
if($result)
{
$univcode1 = $univcode == 'xxx' ? '003' : $univcode;
$uploadRequest = array(
'degree_code' => $fdegree,
'fcollcode' => $fcollcode,
'reg_starts' => $fregno,
'reg_ends' => $fregno,
'FUNIVCODE' => $univcode1
);
// Execute remote upload
$curl = curl_init();
if($univcode == 'xxx') {
curl_setopt($curl, CURLOPT_URL, 'https://oasis.logisys.org/demo/oasis/app.php?a=generatePostAdmissionTicket.demo');
}
else {
curl_setopt($curl, CURLOPT_URL, 'https://oasis.logisys.org/'.$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);
curl_close($curl);
if($univcode == 'xxx') {
$path = '/var/www/html/demo/halltickets/HT_003_'.$fregno.'.pdf';
}
else {
$path = "/var/www/html/".$folder.'/halltickets/'.'HT_'.$univcode.'_'.$fregno.'.pdf';
}
if(file_exists($path))
{
$strUpdateQuery = "update candsum set fhtstatus = 'A', FHTTIME = now()
where fdegree = '{$fdegree}'
and fcollcode = '{$fcollcode}'
and fregno = '{$fregno}' and ifnull(fhtstatus,'') = ''";
$result = $aobj_context->pobj_db->Execute($strUpdateQuery);
if($univcode == 'xxx') {
// $durl='http://oasis.logisys.org/demo/oasis/halltickets/'.'HT_'.$univcode.'_'.$fregno.'.pdf';
$durl='https://oasis.logisys.org/demo/oasis/halltickets/'.'HT_003_'.$fregno.'.pdf';
}
else {
$durl='https://oasis.logisys.org/'.$folder.'/halltickets/'.'HT_'.$univcode.'_'.$fregno.'.pdf';
}
$res['durl'] = $durl;
echo $aobj_context->mobj_output->ToJSONEnvelope($res,0,"success");
return;
}else
{
$arr['msg'] = 'Hall Ticket will be available in college';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}else
{
$arr['msg'] = 'Hall Ticket is blocked. Contact college.';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}else
{
$arr['msg'] = 'Exam Fee Not paid. Contact college';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}else
{
$arr['msg'] = 'Hall Ticket Not Enabled';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
?>
|