Skip to content

Commit

Permalink
Absent problem in export csv fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
harshvladha committed May 14, 2015
1 parent 4c39f69 commit 609145f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion classes/Marks.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,19 @@ public function exportCSV($course_code, $course_dep, $type, $category){
if($type==="all"){
while ($row = $result->fetch_array(MYSQL_NUM)) {
$pointer = $row[7];
$row[7]=$row[4]+$row[5]+$row[6];
$row[1] = ($row[1]==-200?'AB':$row[1]);
$row[2] = ($row[2]==-200?'AB':$row[2]);
$row[3] = ($row[3]==-200?'AB':$row[3]);
$row[5] = ($row[5]==-200?'AB':$row[5]);
$row[6] =($row[6]==-200?'AB':$row[6]);
$row[7]=$row[4]+($row[5]=='AB'?0:$row[5])+($row[6]=='AB'?0:$row[6]);
$row[8]=$this->getGradeFromPointer($pointer);
fputcsv($fp, array_values($row));
}
}
else{
while ($row = $result->fetch_array(MYSQL_NUM)) {
$row[1]=($row[1]==-200?'AB':$row[1]);
fputcsv($fp, array_values($row));
}
}
Expand Down

0 comments on commit 609145f

Please sign in to comment.