Пример #1
0
    ?>
</th>
                <td><?php 
    echo $row['course'];
    ?>
</td>
                <td><?php 
    echo DecodeGrade($row['grade']);
    ?>
</td>
                <td><?php 
    echo $row['credit'];
    ?>
</td>
                <td><?php 
    echo DecodeSemester($row['semester']);
    ?>
</td>
                <td>
                  <form action="/grade/edit/?id=<?php 
    echo $row['grade_id'];
    ?>
" method= "post" id="delete_course">
                    <a href="/grade/edit/edit.php?id=<?php 
    echo $row['grade_id'];
    ?>
" class="btn btn-success btn-xs">edit</a>
                    <button type="submit" name="delete" class="btn btn-warning btn-xs">delete</button>
                  </form>
                </td>
              </tr>
Пример #2
0
?>
<br/>
            <li>Lowest grade earned: <?php 
echo $row[1] . ' or ' . DecodeGrade($row[1]);
?>
</ul>
           </font>
        </div>
<?php 
$query = "SELECT DISTINCT semester FROM GRADES ORDER BY semester ASC";
$result = query($query);
while ($row = mysqli_fetch_array($result)) {
    $sem = $row['semester'];
    ?>
        <h4 align="center"><?php 
    echo DecodeSemester($sem);
    ?>
</h4>
<?php 
    $query = "SELECT SUM(credit), SUM(credit*grade) FROM GRADES WHERE semester= {$sem} ";
    $query .= "AND user_id={$USERID} GROUP BY semester";
    $res = query($query);
    $per_semester = mysqli_fetch_array($res);
    $per_credit = $per_semester[0];
    $tgpa = $per_semester[1] / $per_semester[0];
    ?>
          <p align="center"><?php 
    echo "TGPA: <b>{$tgpa}</b> Total credit: <b>{$per_credit}</b>";
    ?>
</p><hr/>
        <table class="table table-striped">