<tr>
                                    <th>Sl</th>
                                    <th>Subject</th>

                                    <th>Marks</th>
                                    <th>Letter Grade</th>
                                    <th>Grade Point</th>

                            </tr>
 
                            <?php 
        $inc = 0;
        $inc2 = 1;
        foreach ($v as $k2 => $v2) {
            $grade_id = $v2['grade_id'];
            $gradeInfo = grade_with_points($grade_id);
            $Obtained_GPA_v2 = $gradeInfo['Obtained_GPA_v2'];
            $Obtained_GPA = $gradeInfo['Obtained_GPA'];
            ?>
                            <tr>
                                <td><?php 
            echo $inc2;
            ?>
</td>
                                <td><?php 
            echo $v2['subject'];
            ?>
</td>
                                <td><?php 
            echo $v2['marks'];
            ?>
 function set_student_result_summary($info)
 {
     if ($info) {
         $inc = 0;
         $sGPA = 0;
         $marks = 0;
         foreach ($info as $inf) {
             $grade_id = $inf['grade_id'];
             $gradeInfo = grade_with_points($grade_id);
             $Obtained_GPA_v2 = $gradeInfo['Obtained_GPA_v2'];
             $Obtained_GPA = $gradeInfo['Obtained_GPA'];
             $sGPA = $sGPA + $Obtained_GPA_v2;
             $marks = $marks + $inf['marks'];
             $inc++;
         }
         $sGPA = $sGPA / $inc;
         $student_id = $info[0]['student_id'];
         $school_id = $info[0]['school_id'];
         $class_name_id = $info[0]['class_name_id'];
         $section_id = $info[0]['section_id'];
         $sql = "INSERT INTO scl_result_summary (`result_summary_id`, `student_id`, `cgpa`, `position`,`school_id`,`class_name_id`,`section_id`,`marks`) VALUES (NULL, '{$student_id}', '{$sGPA}', '0','{$school_id}','{$class_name_id}','{$section_id}','{$marks}')";
         $this->db->query($sql);
     }
 }