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.117.232.108
<?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"];
$fboard = $aobj_context->mobj_data["board"];
$type = $aobj_context->mobj_data["type"];
$user = $aobj_context->mobj_data["user"];
$college = $aobj_context->mobj_data["coll"];
$user = json_decode($user,true);
foreach ($college as $key => $value) {
$col.= "'".$value."',";
}
$col_ar=substr_replace($col ,"",-1);
if($fboard == 'All'){
$cnd4 = "";
}else{
$cnd4 = "AND m.fboard = '{$fboard}'";
}
if($col_ar == "'all'"){
$collcond = "";
}else{
$collcond = "and m.fcollcode IN ($col_ar)";
}
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);
$query1 = "SELECT m.fcollcode, m.fboard,mb.fboardname, m.fteachcode, m.fteachname,m.fgender,m.fscale,m.fmobile,m.femail, CONCAT(c.fcollname,', ', c.ftown) AS fcollname,
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
INNER JOIN masboard mb ON mb.fboardcode = m.fboard
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.fteachcode BETWEEN '{$teachfrom}' and '{$teachto}' $collcond
{$cnd2} {$cnd3}
{$cnd4}
GROUP BY m.fteachcode
ORDER BY m.fcollcode,fvalstatus DESC";
$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;
}
}
?>
|