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.217.26.8
<?php
function printMarkListDetailsWisenew_CIE($aobj_context){
ini_set('memory_limit','300M');
ini_set('max_execution_time',3300);
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$FUNIVCODE = $_SESSION['FUNIVCODE'];
$degree_ = $aobj_context->mobj_data['degree'];
$deg = explode(' - ', $degree_);
$degree = $deg[0];
$dept = $deg[1];
$sem_ = $aobj_context->mobj_data['sem'];
$seme = explode(' - ', $sem_);
$sem = $seme[0];
$semester = $seme[1];
$query="select s.fdegree,s.fexamno, m.fregno, s.fname,group_concat(distinct m.fsubcode,'=>',ifnull(fmarks,'x'),'=>',sub.fsubshort order by sub.fsubcode SEPARATOR '*') as marks
from marks m inner join student s on s.fdegree = m.fdegree
inner join subject sub on m.fdegree = sub.fdegree and m.fexamno = sub.fexamno
and m.fsubcode = sub.fcsubcode
where m.fdegree ='{$degree}' and s.fexamno = '{$semester}'
and ifnull(s.fdeleted,'') <> 'T'
group by m.fdegree,m.fregno
order by m.fregno,m.fdegree,sub.fcsubcode";
$result = $aobj_context->mobj_db->GetAll($query);
$header = [];
foreach($result as $val){
$split = explode("*",$val['marks']);
foreach($split as $v){
$split_sub = explode("=>",$v);
$obj['sub'] = $split_sub[0];
$obj['marks'] = $split_sub[1];
$obj['subshort'] = $split_sub[2];
array_push($header, $split_sub[2]);
}
}
$sub_header = array_unique($header);
if($subject === "All"){
$condSub = "";
$tableHead="-1";
}else{
$condSub = "AND LEFT(FCSUBCODE, 4) = '{$subject}'";
$tableHead=" ";
}
$e_data = "";
$n=count($sub_header);
if(!empty($result)){
$e_data.="<div style='width:100%; height:500px;'><table cellspacing='0' cellpadding='1' border='1'>";
$e_data.="<thead style='position:sticky; top:0;'>";
$e_data.="<th align='center' >Sl. No.</th>";
$e_data.="<th align='center' >USN</th>";
$e_data.="<th align='center' >Name</th>";
for($i=0; $i<$n; $i++){
$e_data.="<th align='center' {$colspan}>{$sub_header[$i]}</th>";
}
$e_data.="</thead>";
$j=1;
foreach($result as $val){
$e_data.="<tr>";
$e_data.="<td align='center' style='height:40px;'>{$j}</td>";
$e_data.="<td align='center' style='height:40px;'>{$val['fregno']}</td>";
$e_data.="<td align='left' style='height:40px;'>{$val['fname']}</td>";
// $e_data.="<td align='center'>{$val['marks']}</td>";
$split = explode("*", $val['marks']);
foreach($split as $value){
$split = explode("=>", $value);
$split_marks[1] = $split[1];
//$split_marks = explode("|", $split[1]);
if($split_marks[1] == 'x'){
$mark1 = '';
}else{
if($split_marks[1] == "-2"){
$mark1 = "AB";
}else{
$mark1 = $split_marks[1];
}
}
$e_data.="<td align='center' style='height:40px;'>{$mark1}</td>";
}
$e_data.="</tr>";
$j++;
}
$e_data.="</table></div>";
}
header("Content-Type:application/xls");
header("Content-Disposition: attachment; filename=Progress_report.xls");
echo $e_data;
}
?>
|