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.188.249.160
<?php
function valuatordet($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$teachfrom = $aobj_context->mobj_data["techfrom"];
$teachto = $aobj_context->mobj_data["teachto"];
$collfrom = $aobj_context->mobj_data["collfrom"];
$collto = $aobj_context->mobj_data["collto"];
$type = $aobj_context->mobj_data["type"];
$user = $aobj_context->mobj_data["user"];
$user = json_decode($user,true);
if($user['fcurtype'] == '400')
{
$cnd = "and ms.fboard = '{$user['fdegree']}'";
$cnd3 = "and s.fboard = '{$user['fdegree']}'";
}else
{
$cnd = "";
$cnd3 = "";
}
$cnd2="";
if($type == 'All')
{
$cnd2 = "";
}else if($type == 'nval')
{
$cnd2 = "and ifnull(v.fvalcode,'') = ''";
}else if($type == 'val')
{
$cnd2 = "and ifnull(v.fvalcode,'') <> ''";
}
$query1 = "select m.fcollcode, concat(c.fcollname,', ', c.ftown) as fcollname, m.fteachcode, m.fteachname,
if(ifnull(v.fvalcode,'') = '','F','T') as fvalstatus
from masteach m inner join college c on m.fcollcode = c.fcollcode
inner join teachsub ts on ts.fteachcode = m.fteachcode
inner join masqp s on ts.fqpcode = s.fqpcode
left join
(select distinct m.fvalcode from mastabu m
inner join masqp ms on m.fqpcode = ms.fqpcode {$cnd}
union
select distinct m.frevcode from mastabu m
inner join masqp ms on m.fqpcode = ms.fqpcode {$cnd}
) v on v.fvalcode = m.fteachcode
where m.fcollcode between '{$collfrom}' and '{$collto}'
and m.fteachcode between '{$teachfrom}' and '{$teachto}'
{$cnd2} {$cnd3}
group by m.fteachcode
order by m.fcollcode,fvalstatus desc";
//var_dump($query1);
$result1 = $aobj_context->pobj_db->GetAll($query1);
if ($result1) {
$res['valuatordet'] = $result1;
echo $aobj_context->mobj_output->ToJSONEnvelope($res, 0, "success");
return;
} else {
$arr['msg'] = 'No Deatils found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr, -1, "failure");
return;
}
}
?>
|