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.221.221.171
<?php
function uniclareNotification($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$funivcode = $aobj_context->mobj_data['funivcode'];
$fregno = $aobj_context->mobj_data['fregno'];
$fromlimit = $aobj_context->mobj_data['fromlimit'];
$tolimit = $aobj_context->mobj_data['tolimit'];
if($funivcode == '' || $fregno == '' || $fromlimit == '' || $tolimit == '')
{
$arr['msg'] = 'Invalid Params.';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
$query = "select ftitle, fbody, fenttype ,ifnull(fcolor,'green') as fcolor,ifnull(ficon,'') as ficon, fpushdate
from pushnotif where funivcode = '{$funivcode}' and fregno = '{$fregno}'
and date_format(fpushdate,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
limit {$fromlimit}, {$tolimit}";
$result = $aobj_context->mobj_db->GetAll($query);
if($result)
{
$i = 0;
foreach($result as $k => $v)
{
$push_array[$i] = $v;
$i++;
}
$arr["notification"] = $push_array;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$arr['msg'] = 'No Notification Found.';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
function uniclareNotificationFilter($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$funivcode = $aobj_context->mobj_data['funivcode'];
$fregno = $aobj_context->mobj_data['fregno'];
$fromlimit = $aobj_context->mobj_data['fromlimit'];
$tolimit = $aobj_context->mobj_data['tolimit'];
$enttype = $aobj_context->mobj_data['enttype'];
$fromdate = $aobj_context->mobj_data['fromdate'];
$todate = $aobj_context->mobj_data['todate'];
if($funivcode == '' || $fregno == '' || $fromlimit == '' || $tolimit == '' || $enttype == '' ||
$fromdate == '' || $todate == '')
{
$arr['msg'] = 'Invalid Params.';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
$cnd = "and fenttype = '{$enttype}'";
if($enttype == 'all')
{
$cnd = "";
}
$query = "select ftitle, fbody, fenttype ,ifnull(fcolor,'green') as fcolor,ifnull(ficon,'') as ficon, fpushdate
from pushnotif where funivcode = '{$funivcode}' and fregno = '{$fregno}'
and left(fpushdate,10) between
DATE_FORMAT(str_to_date('{$fromdate}','%d/%m/%Y'),'%Y-%m-%d') and DATE_FORMAT(str_to_date('{$todate}','%d/%m/%Y'),'%Y-%m-%d')
{$cnd}
order by fpushdate desc
limit {$fromlimit} ,8";
//var_dump($query);die();
$result = $aobj_context->mobj_db->GetAll($query);
if($result)
{
$i = 0;
foreach($result as $k => $v)
{
$push_array[$i] = $v;
$i++;
}
$arr["notification"] = $push_array;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
else
{
$arr['msg'] = 'No Notification Found.';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
}
}
?>
|