<th>Details</th>
                                
                            </thead>
                            <?php 
// var_dump($verified_exam_details);
?>
                            <?php 
foreach ($verified_exam_details as $offer) {
    ?>
                            <tr id="<?php 
    echo 'data' . $offer['id'];
    ?>
">
                                <td>
                                    <?php 
    echo humanize(student_name($offer['username'], $student_details));
    ?>
                                </td>
                                 <td>
                                    <?php 
    echo humanize($offer['company']);
    ?>
                                </td>
                                <td>
                                    <?php 
    echo humanize($offer['year_pass']);
    ?>
                                </td>
                                <td>
                                    <?php 
    echo $offer['details'];
    $data["Class Average"] = $avg;
    foreach ($list as $student_regno) {
        $found = FALSE;
        foreach ($marks_details as $mark) {
            // std
            //echo "etf";
            if ($mark["sem"] == $sem && $mark["regno"] == $student_regno) {
                $data[student_name($student_regno, $student_name_regno)] = round($mark["percent"], 2);
                //echo "found perc of".student_name($student_regno,$student_name_regno)."in ".$sem." as ".round($mark["percent"],2)."\n";
                $found = TRUE;
                break;
            }
        }
        if ($found == FALSE) {
            if ($sem == 2) {
                $data[student_name($student_regno, $student_name_regno)] = $avg;
            }
            //echo "found perc of".student_name($student_regno,$student_name_regno)."in ".$sem." as 0\n";
        }
    }
    $data["Semester"] = semname($sem);
    array_push($final, $data);
    $per = 0;
    $count = 0;
    $avg = 0;
    $found = false;
}
echo json_encode($final);
function student_name($regno, $details)
{
    foreach ($details as $std) {