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.133.113.24
Current Path : /var/www/oasis/src_old/ |
| Current File : /var/www/oasis/src_old/subjectList_display.php |
<?php
function displaySubjectDetails($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$college_code = $_SESSION['collcode'];
$degree_code = $aobj_context->mobj_data["degree_code"];
$exam_code_start = $aobj_context->mobj_data["exam_code_start"];
$exam_code_end = $aobj_context->mobj_data["exam_code_end"];
$subjType = $aobj_context->mobj_data["subjType"];
$main_src_obj=(explode("/",$_SERVER["REQUEST_URI"]));
$main_src=$main_src_obj[1];
if($subjType == 'SUBJECT_GENERAL')
{
$get_subject_data= " select if(FMANDATORY='T',concat('* ',FCSUBCODE),concat(' ',FCSUBCODE)) as FCSUBCODE , 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
from subject
where FDEGREE='{$degree_code}' and
FEXAMNO>='{$exam_code_start}' and FEXAMNO<='{$exam_code_end}' and
IFNULL(FDELETED,'F') ='F'
group by FCSUBCODE;
";
$lobj_get_subject_data = $aobj_context->mobj_db->GetAll($get_subject_data);
if(!empty($lobj_get_subject_data))
{
$e_data.="<table align = 'center' width='100%' cellspacing='0' cellpadding='1' border='0' >";
$e_data.="<th align='left' colspan='6' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper' style='font-size:12px; padding-left:6px; height:24px;'>Subject List</th>";
$e_data.="<tr class='ui-state-default ui-jqgrid-hdiv'>";
$e_data.="<td align='center' style='width:30px; font-size:12px; border-left:1px solid #C5DBEC;border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Sl.<br> No.</td>";
$e_data.="<td align='center' style='width:65px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;text-align:center;'>subject<br>Code</td>";
$e_data.="<td align='center' style='width:65px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>QP.<br> Code</td>";
$e_data.="<td align='center' style='width:305px; font-size:12px; padding:5px 5px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;text-align:left;'>Description</td>";
$e_data.="<td align='center' style='width:55px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Max. <br> Marks</td>";
$e_data.="<td align='center' style='width:105px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Remarks</td>";
$e_data.="</tr>";
$counter_subj = 0;
$k=0;
foreach($lobj_get_subject_data as $key=>$value)
{
$e_data.="<tr class='ui-widget-content jqgrow'>";
if($value['Fsubc'] != $prevSubCode)
{
$counter_subj++;
$e_data.="<td class='tbl_row_new' rowspan='1' style='border-bottom:0px;border-top:1px solid #C5DBEC;border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;' >{$counter_subj}</td>";
}
else
{
$e_data.="<td class='tbl_row_new' rowspan='1' style='border-bottom:0px;border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;' ></td>";
}
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;' >{$value[FCSUBCODE]}</td>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;' >{$value[FQPCODE]}</td>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:left;' >{$value[SSubName]}</td>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:right;' >{$value[FSMAXMARKS]}</td>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:left;' >{$value[Remarks]}</td>";
$e_data.="</tr>";
$k++;
$id++;
$m++;
$prevSubCode =$value['Fsubc'];
}
$e_data.="</table>";
$arr['total_count']= $m;
$arr['html']=$e_data;
$arr['error']=0;
}
}
if($subjType == 'SUBJECT_ADCL')
{
$get_subject_data= " select if(FMANDATORY='T',concat('* ',FSUBCODE),concat(' ',FSUBCODE)) as FSUBCODE,
FEXAMNO, FSUBNAME , FSUBSHORT,FQPCODE
from subject where FDEGREE='{$degree_code}' and
FEXAMNO>='{$exam_code_start}' and FEXAMNO<='{$exam_code_end}'
and ifnull(FDELETED,'F')='F' group by FSUBCODE ;
";
$lobj_get_subject_data = $aobj_context->mobj_db->GetAll($get_subject_data);
if(!empty($lobj_get_subject_data))
{
$e_data.="<table align = 'center' width='100%' cellspacing='0' cellpadding='1' border='0' >";
$e_data.="<th align='left' colspan='6' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper' style='font-size:12px; padding-left:6px; height:24px;'>Subject List</th>";
$e_data.="<tr class='ui-state-default ui-jqgrid-hdiv'>";
$e_data.="<td align='center' style='width:30px; font-size:12px; border-left:1px solid #C5DBEC;border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Sl.<br> No.</td>";
$e_data.="<td align='center' style='width:65px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>subject <br> Code</td>";
//$e_data.="<td align='center' style='width:65px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>QP Code</td>";
$e_data.="<td align='center' style='width:305px; font-size:12px; padding:5px 5px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;text-align:left;'>Description</td>";
$e_data.="<td align='center' style='width:65px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Short Name</td>";
$e_data.="</tr>";
$counter_subj = 1;
$k=0;
foreach($lobj_get_subject_data as $key=>$value)
{
$e_data.="<tr class='ui-widget-content jqgrow'>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;' >{$counter_subj}</td>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;' >{$value[FSUBCODE]}</td>";
//$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;' >{$value[FQPCODE]}</td>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:left;' >{$value[FSUBNAME]}</td>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:left;' >{$value[FSUBSHORT]}</td>";
$e_data.="</tr>";
$k++;
$id++;
$m++;
$counter_subj++;
}
$e_data.="</table>";
$arr['total_count']= $m;
$arr['html']=$e_data;
$arr['error']=0;
}
}
if($subjType == 'SUBJECT_THEORY')
{
$get_subject_data= " select if(FMANDATORY='T',concat('* ',FCSUBCODE),concat(' ',FCSUBCODE)) as FCSUBCODE , 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
from subject
where FDEGREE='{$degree_code}' and
FEXAMNO>='{$exam_code_start}' and FEXAMNO<='{$exam_code_end}' and
IFNULL(FDELETED,'F') ='F' and IFNULL(FTHEORY,'F') = 'T' AND IFNULL(FINTASS,'F') <> 'T'
group by FCSUBCODE;
";
$lobj_get_subject_data = $aobj_context->mobj_db->GetAll($get_subject_data);
if(!empty($lobj_get_subject_data))
{
$e_data.="<table align = 'center' width='100%' cellspacing='0' cellpadding='1' border='0' >";
$e_data.="<th align='left' colspan='6' class='ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper' style='font-size:12px; padding-left:6px; height:24px;'>Subject List</th>";
$e_data.="<tr class='ui-state-default ui-jqgrid-hdiv'>";
$e_data.="<td align='center' style='width:30px; font-size:12px; border-left:1px solid #C5DBEC;border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Sl.<br> No.</td>";
$e_data.="<td align='center' style='width:65px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>subject <br>Code</td>";
$e_data.="<td align='center' style='width:65px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>QP.<br>Code</td>";
$e_data.="<td align='center' style='width:305px; font-size:12px; padding:5px 5px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;text-align:left;'>Description</td>";
$e_data.="<td align='center' style='width:55px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Max.<br> Marks</td>";
$e_data.="<td align='center' style='width:105px; font-size:12px; border-right:1px solid #C5DBEC; border-bottom:1px solid #C5DBEC;'>Remarks</td>";
$e_data.="</tr>";
$counter_subj = 1;
$k=0;
foreach($lobj_get_subject_data as $key=>$value)
{
$e_data.="<tr class='ui-widget-content jqgrow'>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;' >{$counter_subj}</td>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;' >{$value[FCSUBCODE]}</td>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:center;' >{$value[FQPCODE]}</td>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:left;' >{$value[SSubName]}</td>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:right;' >{$value[FSMAXMARKS]}</td>";
$e_data.="<td class='tbl_row_new' style='border-left:1px solid #C5DBEC; border-right:1px solid #C5DBEC; padding:2px; font-size:12px;text-align:left;' >{$value[Remarks]}</td>";
$e_data.="</tr>";
$counter_subj++;
$k++;
$id++;
$m++;
}
$e_data.="</table>";
$arr['total_count']= $m;
$arr['html']=$e_data;
$arr['error']=0;
}
}
if($arr['error']==0)
echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
else
{
$error_msg = "Invalid Subject Code..!";
echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"success");
}
return;
}
?>
|