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 : 52.14.201.216
<?php
function uGetDetailResult($aobj_context)
{
$regno = $aobj_context->mobj_data['regno'];
$fexamno = $aobj_context->mobj_data['examno'];
$univcode = $aobj_context->mobj_data['univcode'];
$get_data = "select s.FSUBNAME, rm.fsubcode, rm.fssubname, rm.fmarks, rm.fyear, rm.fexamtype
from resmarksdet rm left join subject s on s.FDEGREE = rm.fdegree
and s.FEXAMNO = rm.fexamno and s.FCSUBCODE = rm.fsubcode
where fregno = '{$regno}' and rm.fexamno = '{$fexamno}'
order by s.fsubcode, s.fssubcode";
$app_data=$aobj_context->pobj_db->GetAll($get_data);
if(sizeof($app_data)==0) {
$errmsg="No data found!";
echo $aobj_context->mobj_output->ToJSONEnvelope($errmsg,-1,"failure");
return;
}
$final_arr=array();
$sl_no=1;
foreach($app_data as $k=>$v)
{
$FSUBNAME=$v['FSUBNAME'];
$fssubname=$v['fssubname'];
$fmarks=$v['fmarks'];
$fsubcode=$v['fsubcode'];
$final_arr[$FSUBNAME][$fsubcode]['s']=$fssubname;
$final_arr[$FSUBNAME][$fsubcode]['m']=$fmarks;
}
$sl_no=1;
$table_data = array();
foreach($final_arr as $ak=>$av)
{
$arr=GetSubjectData($av);
$send_arr['sl_no'] = $sl_no;
$send_arr['Subject_Name'] = $ak;
$send_arr['Component_Name'] = $arr['sub_html'];
$send_arr['Marks'] = $arr['marks_html'];
// $arr['sub_name'] = $ak;
// $arr['sl_no'] = $sl_no;
array_push($table_data,$send_arr);
$sl_no++;
}
$tableHeaders =[
"Sl. No.",
"Subject Name",
"Component Name",
"Marks",
];
$send_data->error_code=0;
$send_data->status ="success";
$send_data->tableHeaders=$tableHeaders;
$send_data->tableData = $table_data;
echo json_encode($send_data);
}
function GetSubjectData($arr)
{
$sub_html="";
$marks_html="";
foreach($arr as $akk=>$avv)
{
$sub_html.=$avv['s'] . "\n";
$marks_html.=$avv['m'] . "\n";
}
$fin_arr['sub_html']=$sub_html;
$fin_arr['marks_html']=$marks_html;
return $fin_arr;
}
?>
|