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.142.198.148
<?php
function uniclareINeedHelp($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->req_body['univcode'];
$fregno = $aobj_context->req_body['fregno'];
$name = $aobj_context->req_body['name'];
$mobileno = $aobj_context->req_body['mobileno'];
$subject = $aobj_context->req_body['subject'];
$body = $aobj_context->req_body['body'];
$email = $aobj_context->req_body['email'];
$docpath = $aobj_context->req_body['docpath'];
$type = $aobj_context->req_body['type'];
if($univcode == '' || $name == '' || $mobileno == '' || $subject == '' || $body == '' || $email == '')
{
$arr['msg'] = 'Invalid Params.';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,1,"failure");
return;
}
$query = "select * from logisys3_comexam.dbname
where funivcode = '{$univcode}'";
$result = $aobj_context->mobj_db->GetRow($query);
$query = "insert into logisys3_grv.grvhead(fgrvdate, fregno, fgrvfrom,fgrvemail,fgrvmobile,fgrvsub,
fgrvmsg,fgrvuser,fgrvmode,funivcode,fstudemail,fgrvgroup)
values (now(),'{$fregno}','{$name}','{$email}','{$mobileno}',
'{$subject}','{$body}','Student','stud. App.','{$univcode}','{$email}', '{$result['FHDNO']}')";
$result = $aobj_context->mobj_db->Execute($query);
$last_inserted_id = $aobj_context->mobj_db->Insert_ID();
if($last_inserted_id)
{
$id = $last_inserted_id;
$docpath = base64_decode($docpath);
if ($docpath === false)
{
}else
{
$dir = dirname(__DIR__, 1);
$folder = $dir . DIRECTORY_SEPARATOR . 'grvdocs';
if(!file_exists($folder))
{
mkdir($folder);
}
$type = explode('/',$type);
$file = $folder."/".$last_inserted_id.".".$type[1];
$res = file_put_contents($file, $docpath);
if($res)
{
$path = "grvdocs/$last_inserted_id." . $type[1];
$query = "update logisys3_grv.grvhead set ffilepath = '{$path}'
where fgrvid = '{$last_inserted_id}'";
$result = $aobj_context->mobj_db->Execute($query);
}
}
$arr['msg'] = "Query has been submitted successfully. Your query number is {$id}.keep this number for future reference.<br>You will get email comunication on this issue.";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$res['msg'] = 'Not able to submit the query. please try after some time.';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
?>
|