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.145.16.251
<?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 subject m
// inner join masboard b on m.fboard = b.fboardcode
// where fdeggrp = '{$fdeggrp}' and ifnull(fboard, '') <> ''";
$get_data= "select distinct m.fboard as code, b.fboardname as value from subject m
inner join masboard b on m.fboard = b.fboardcode
where ifnull(fboard, '') <> ''
and m.fdegree in(select distinct fdegree from degree where fdeggrp = '{$fdeggrp}')";
//var_dump($get_data);
$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;
}
if(count($lobj_get_data) == 0)
{
$get_data= "select distinct 'All' as code, 'All' as value";
$lobj_get_data = $aobj_context->mobj_db->GetAll($get_data);
}
$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 fdeggrp as code, fdescpn as value from deggrp";
var_dump($get_data);
die();
$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"]);
$db = trim($aobj_context->mobj_data["db"]);
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;
if($db == 'vskub')
{
$query = "select fexamno, fboard, fqpcode, fsubname, '' as fdegrees
from subject where fboard = '{$fdeggrp}'
and fexamno in ('$examno')
and ifnull(fqpcode,'') <> ''";
}else if($db == 'srun' || $db == 'dypatil')
{
$query = "select s.fexamno, ifnull(s.fboard,'') as fboard, s.fqpcode, s.fsubname, group_concat(distinct s.fdegree SEPARATOR ', ') as fdegrees
from subject s inner join degree d on s.fdegree = d.fdegree
and s.fexamno = d.fexamno
where d.fdeggrp = '{$fdeggrp}'
and d.fexamno in ('$examno')
and ifnull(s.fqpcode,'') <>''
and s.fexamno in ('$examno')
group by s.fexamno, s.fqpcode
order by s.fexamno, s.fqpcode";
}
else
{
$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");
}
|