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.19.247
<?php
function getsublisting($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$univcode = $aobj_context->mobj_data['univcode'];
$degree = $aobj_context->mobj_data['degree'];
$range = $aobj_context->mobj_data['range'];
$sub = $aobj_context->mobj_data['sub'];
// var_dump($sub);
// die();
//string(5) "A,B,C"
$mystring =$range;
$result_string = "'" . str_replace(",", "','", $mystring) . "'";
if($range=="All")
{
$cond1="AND IFNULL(subject.fexamno,'')<>''";
}
else{
$cond1=" AND (subject.FEXAMNO) in ({$result_string}) " ;
}
if($sub == 'main'){
$qry="SELECT IF(FMANDATORY='T',CONCAT('* ',FSUBCODE),CONCAT(' ',FSUBCODE)) AS FSUBCODE,
subject.FEXAMNO, subject.FSUBNAME , subject.FSUBSHORT,FQPCODE";
$cond = "";
}else if($sub == 'subject'){
$qry="SELECT IF(FMANDATORY='T',CONCAT('* ',FCSUBCODE),CONCAT(' ',FCSUBCODE)) AS FCSUBCODE , subject.FEXAMNO,
CONCAT(FSUBNAME, CONCAT(SPACE(3),FSSUBNAME,'(',IF(FTHEORY='T','TH','PA'),')')) AS SSubName,
LEFT(FCSUBCODE,LENGTH(FCSUBCODE)-1) AS Fsubc,FSHORTNAME, FSMAXMARKS,FQPCODE,CONCAT(IF(FTHEORY='T','Theory','Practical'),
CONCAT(SPACE(2),IF(FINTASS='T' ,'I A' ,''))) AS Remarks";
$cond = "";
}else{
$qry="SELECT IF(FMANDATORY='T',CONCAT('* ',FCSUBCODE),CONCAT(' ',FCSUBCODE)) AS FCSUBCODE , subject.FEXAMNO,
CONCAT(FSUBNAME, CONCAT(SPACE(3),FSSUBNAME,'(',IF(FTHEORY='T','TH',''),')')) AS SSubName,
LEFT(FCSUBCODE,LENGTH(FCSUBCODE)-1) AS Fsubc, FSHORTNAME, FSMAXMARKS,FQPCODE,CONCAT(IF(FTHEORY='T','Theory','Practical'),
CONCAT(SPACE(2),IF(FINTASS='T' ,'I A' ,''))) AS Remarks";
$cond = "AND IFNULL(FTHEORY,'F') = 'T' AND IFNULL(FINTASS,'F') <> 'T'";
}
$query = "{$qry} ,degree.FEXAMNAME,degree.FEXAMNO from subject JOIN degree ON subject.fexamno=degree.fexamno WHERE subject.FDEGREE='{$degree}' {$cond1} AND IFNULL(subject.FDELETED,'F')='F' {$cond} GROUP BY subject.FSUBCODE,degree.fexamno;";
$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");
}
}
?>
|