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.118.24.176
<?php
function getQPBoards($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$fdeggrp=trim($aobj_context->mobj_data["fdeggrp"]);
if($fdeggrp == '')
{
$arr='Invalid Params';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
$get_data="select distinct m.fboard as code, b.fboardname as value from masqp m
inner join masboard b on m.fboard = b.fboardcode
where fdeggrp = '{$fdeggrp}' and ifnull(fboard, '') <> ''";
$lobj_get_data = $aobj_context->mobj_db->GetAll($get_data);
if(!$lobj_get_data && gettype($lobj_get_data) == 'boolean')
{
$arr['msg'] = "Error while fetching holidays for year ".$fyear;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
$arr['board']=$lobj_get_data;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
function getDegreeGroupQP($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$get_data="select distinct m.fdeggrp as code, d.fdescpn as value from masqp m
inner join deggrp d on d.fdeggrp = m.fdeggrp";
$lobj_get_data = $aobj_context->mobj_db->GetAll($get_data);
if(!$lobj_get_data && gettype($lobj_get_data) == 'boolean')
{
$arr['msg'] = "Error while fetching degree groups";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
$arr['deggrp']=$lobj_get_data;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
function getQPSubjects($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$fdeggrp = trim($aobj_context->mobj_data["fdeggrp"]);
$fexamno = trim($aobj_context->mobj_data["fexamno"]);
$fboard = trim($aobj_context->mobj_data["fboard"]);
if($fdeggrp == '' || $fexamno == '' || $fboard == '')
{
$arr='Invalid Params';
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
if($fexamno == 'ODD')
$examno = "A', 'C', 'E";
else if($fexamno == 'EVEN')
$examno = "B', 'D', 'F";
else if($fexamno == 'ALL')
$examno = "A', 'B', 'C', 'D', 'E', 'F";
else
$examno = $fexamno;
$query = "select fexamno, fboard, fqpcode, fsubname, fdegreerange as fdegrees
from masqp where fboard = '{$fboard}' and fdeggrp = '{$fdeggrp}'
and fexamno in ('$examno') order by fexamno, fqpcode";
// var_dump($query);
$lobj_get_data = $aobj_context->mobj_db->GetAll($query);
if(!$lobj_get_data && gettype($lobj_get_data) == 'boolean')
{
$arr['msg'] = "Error while fetching qpcode for board";
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"Failure");
return;
}
$arr['qpdata'] = $lobj_get_data;
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
}
|