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 : 13.58.232.94
<?php
function getQpSummaryNew($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$data = json_decode($aobj_context->mobj_data["data"], true);
$split = explode("*", $data['exam']);
$deggrp = $split[0];
$splitYearAndMode = explode("-", $split[1]);
$year = $splitYearAndMode[0];
$type = $splitYearAndMode[1];
$semCond = $data['sem'] === "All" ? "": "and d.fexamno='{$data['sem']}'";
$degCond = $data['degree'] === "All" ? "": "and d.fdegree='{$data['degree']}'";
$qpCond = $data['qpcode'] === "All" ? "": "and q.fqpcode='{$data['qpcode']}'";
$boardCond = $data['board'] === "All" ? "": "and s.fboard='{$data['board']}'";
if($data['teachStatus'] === "All"){
$teachCond="";
}else if($data['teachStatus'] === "uploaded"){
$teachCond="and ifnull(q.fqpfilepath, '') <> ''";
}else if($data['teachStatus'] === "not_uploaded"){
$teachCond="and ifnull(q.fqpfilepath, '') = ''";
}
if($data['modStatus'] === "All"){
$modCond="";
}else if($data['teachStatus'] === "uploaded"){
$modCond="and ifnull(q.fmodqpupd, '') <> ''";
}else if($data['teachStatus'] === "not_uploaded"){
$modCond="and ifnull(q.fmodqpupd, '') = ''";
}
$query = "select q.fqpcode, concat(s.fsubname, ' - ', s.fsubshort) as fsubname,
d.fdegree, d.fexamno,
count(q.fset)as fset, q.fteachcode,
sum(if(ifnull(q.fqpfilepath, '') <> '', 1, 0))as teach_uploaded,
sum(if(ifnull(q.fmodqpupd, '') <> '', 1, 0))as mod_uploaded
from qpseterdet1 q
inner join subject s on s.fqpcode = q.fqpcode
inner join degree d on d.fdegree = s.fdegree and s.fexamno = d.fexamno
inner join deggrp dg on dg.fdeggrp = d.fdeggrp and dg.fyear = q.fyear
and dg.fexamtype = q.fexamtype
where dg.fdeggrp='{$deggrp}' and q.fyear='{$year}' and q.fexamtype='{$type}'
{$qpCond} {$degCond} {$semCond} {$boardCond} {$teachCond} {$modCond}
group by q.fqpcode";
$result = $aobj_context->pobj_db->GetAll($query);
if($result){
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}else{
$arr['msg'] = 'No data Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
function getDetaileQpSummary($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data["univcode"];
$stateData = json_decode($aobj_context->mobj_data["stateData"], true);
$data = json_decode($aobj_context->mobj_data["data"], true);
$split = explode("*", $stateData['exam']);
$deggrp = $split[0];
$splitYearAndMode = explode("-", $split[1]);
$year = $splitYearAndMode[0];
$type = $splitYearAndMode[1];
$query="select q.fqpcode, concat(s.fsubname, ' - ', s.fsubshort) as fsubname,
d.fdegree, d.fexamno, q.fqpcodeno, ifnull(q.fstatus, '')as fstatus,
ifnull(fset, '')as fset, ifnull(q.fteachcode, '')as fteachcode,
ifnull(m.fteachname, '')as fteachname,
if(ifnull(q.fqpfilepath, '') <> '', 'uploaded', 'not uploaded')as teach_uploaded,
if(ifnull(q.fmodqpupd, '') <> '', 'uploaded', 'not uploaded')as mod_uploaded,
ifnull(q.fqpfilepath, '') as fqppath,
ifnull(q.fmodqpupd, '') as fmodpath
from qpseterdet1 q
inner join subject s on s.fqpcode = q.fqpcode
inner join degree d on d.fdegree = s.fdegree and s.fexamno = d.fexamno
inner join deggrp dg on dg.fdeggrp = d.fdeggrp and dg.fyear = q.fyear
left join masteach m on m.fteachcode = q.fteachcode
and dg.fexamtype = q.fexamtype
where dg.fdeggrp='{$deggrp}' and q.fyear='{$year}' and q.fexamtype='{$type}'
and q.fqpcode='{$data['fqpcode']}'
group by fset, fqpcodeno";
$result = $aobj_context->pobj_db->GetAll($query);
if($result){
echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success");
}else{
$arr['msg'] = 'No data Found';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure");
return;
}
}
?>
|