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.14.134.195
<?php
function getunivmcf($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$query =" select distinct d.funivcode ,c.funivname
from logisys3_empty.daylog d
inner join logisys3_empty.masuniv c on c.funivcode = d.funivcode;";
// var_dump($query);
$result=$aobj_context->pobj_db->GetAll($query);
if($result && count($result)>1){
echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
}
else{
$arr['msg']="Please try later";
echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
}
}
function getmcfsubmit($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$univcodemcf = $aobj_context->mobj_data["univcodemcf"];
$datefrom = $aobj_context->mobj_data["datefrom"];
$dateto = $aobj_context->mobj_data["dateto"];
$query =" select ifnull(funivcode,'') as funivcode, fslno,date_format(fdate,'%d/%m/%Y') as fdate, ifnull(fcompname,'') as fcompname ,ifnull(flogname,'') as flogname, ifnull(fremarks,'') as fremarks,ifnull(fhostname,'') as fhostname, ifnull(fclientid,'') as fclientid,
ifnull(fdbname,'') as fdbname,ifnull(fverifystatus,'') as fverifystatus
from logisys3_empty.daylog
where funivcode = '{$univcodemcf}'
and fdate between date_format(str_to_date('{$datefrom}','%d/%m/%Y'),'%Y-%m-%d') and
date_format(str_to_date('{$dateto}','%d/%m/%Y'),'%Y-%m-%d')
order by fdate;";
// var_dump($query);
$result=$aobj_context->pobj_db->GetAll($query);
if($result && count($result)>1){
echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
}
else{
$arr['msg']="Please try later";
echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
}
}
function savemcfverify($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$req = $aobj_context->req_body;
$savemcf = $req['data']['savemcf'];
$user = $req['data']['user'];
$univcodemcf = $req['data']['univcodemcf'];
// var_dump($req['data']['savemcf']);
// die();
foreach ($savemcf as $key => $value) {
$fverifystatus = $value['fverifystatus'];
$fslno = $value['fslno'];
$unic = $value['funivcode'];
$query = "update logisys3_empty.daylog set
fverifystatus = '{$fverifystatus}',
fverifydate = now(),
fverifyuser = '{$user}'
where fslno = '{$fslno}' and funivcode = '{$unic}';";
// var_dump($query);
// die();
$result=$aobj_context->pobj_db->Execute($query);
}
if($result){
$arr['msg'] = 'Updated Successfully...!';
echo $aobj_context->mobj_output->TOJSONEnvelope($arr,0,"success");
}
else{
$arr['msg']="Failed to update..!";
echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
}
}
function mcfverifynew($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$date = $aobj_context->mobj_data["date"];
// var_dump($req['data']['savemcf']);
// die();
$query = "SELECT m.funivcode, IFNULL(DATE_FORMAT(e.fdate,'%d*%m*%Y'),'') AS fdate,m.funivname,IFNULL(m.fincharge,'') AS fincharge,
IFNULL(m.fmobileno,'') AS fmobileno, COUNT(e.fslno) AS cnt
FROM logisys3_empty.masuniv m
LEFT JOIN logisys3_empty.daylog e ON m.funivcode = e.funivcode
AND fdate = DATE_FORMAT(STR_TO_DATE('{$date}','%d/%m/%Y'),'%Y-%m-%d')
WHERE m.fstatus = 'Active' AND m.fincharge <> ''
GROUP BY m.funivcode
ORDER BY funivcode";
// $query = "select * from control";
// var_dump($query);
$result=$aobj_context->pobj_db->GetAll($query);
// var_dump($result);
// die();
if($result){
echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
}
else{
$arr['msg']="Failed..!";
echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
}
}
function mcfviewdetails($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$date = $aobj_context->mobj_data["date"];
$univcode1 = $aobj_context->mobj_data["univcode1"];
$query = "SELECT m.funivname,IFNULL(e.funivcode,'') AS funivcode, fslno,DATE_FORMAT(e.fdate,'%d/%m/%Y') AS fdate,
IFNULL(m.fincharge,'') AS fincharge,IFNULL(fcompname,'') AS fcompname,IFNULL(fhostname,'') AS fhostname,
IFNULL(e.flogname,'') AS flogname,
IFNULL(m.fmobileno,'') AS fmobileno,IFNULL(e.fverifystatus,'F') AS fverifystatus,
IFNULL(e.fverifyremarks,'') AS fverifyremarks,
IFNULL(e.fclientid,'') AS fclientid,IFNULL(e.fdbname,'') AS fdbname,
IFNULL(e.fcompname,'') AS fcompname,IFNULL(e.fremarks,'') AS fremarks
FROM logisys3_empty.masuniv m
LEFT JOIN logisys3_empty.daylog e ON m.funivcode = e.funivcode
AND fdate = DATE_FORMAT(STR_TO_DATE('{$date}','%d/%m/%Y'),'%Y-%m-%d')
WHERE m.fstatus = 'Active' AND m.fincharge <> '' AND m.funivcode = '{$univcode1}'
ORDER BY funivcode,fslno";
// $query = "select * from control";
// var_dump($query);
// die();
$result=$aobj_context->mobj_db->GetAll($query);
if($result){
echo $aobj_context->mobj_output->TOJSONEnvelope($result,0,"success");
}
else{
$arr['msg']="Failed..!";
echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
}
}
function updatestaturemarks($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$req = $aobj_context->req_body;
$save = $req['mcfviewdetailarray'];
$univcode = $aobj_context->mobj_data["univcode"];
$user = $aobj_context->mobj_data["user"];
// var_dump($save);
// die();
foreach ($save as $key => $value) {
$fslno = $value['fslno'];
$remarks = $value['fverifyremarks'];
$status = $value['fverifystatus'];
$date = $value['fdate'];
$univcode1 = $value['funivcode'];
$query = "update logisys3_empty.daylog set
fverifyremarks = '{$remarks}',
fverifystatus = '{$status}',
fverifyuser = '{$user}',
fverifydate = now()
where fslno = '{$fslno}' and funivcode = '{$univcode1}' AND fdate = DATE_FORMAT(STR_TO_DATE('{$date}','%d/%m/%Y'),'%Y-%m-%d')";
// var_dump($query);
// die();
$result=$aobj_context->pobj_db->Execute($query);
}
// var_dump($result);
// die();
if($result){
$arr['msg'] = 'Updated succesfully..!';
echo $aobj_context->mobj_output->TOJSONEnvelope($arr,0,"success");
}
else{
$arr['msg']="Failed..!";
echo $aobj_context->mobj_output->TOJSONEnvelope($arr,-1,"failed");
}
}
|