<?php

    // session_start();

    include "../db.php";

    $srun = mysqli_query($con, "SELECT uref, uname FROM users WHERE uref = '$_GET[tref]'");

    $srow = mysqli_fetch_assoc($srun);



    $u_run = mysqli_query($con, "SELECT n.uploadedby, n.n_subject, n.n_class, n.notes, u.uname, u.uref FROM notes  AS n INNER JOIN users AS u ON n.uploadedby = u.uref WHERE n.uploadedby = '$_GET[tref]'");



    if ( mysqli_num_rows($u_run) > 0 ) {

        echo '

            <div class="row">

                <div class="col-12">

                <h5 class="badge badge-success" style="font-size: 15px">'.$srow["uname"].'</h5>

                    <table class="table table-striped table-hover table-bordered w-100" id="thisismytable">

                        <thead class="thead-inverse text-center">

                            <tr>

                                <th>Notes</th>

                                <th>Subject</th>

                                <th>Class</th>

                            </tr>

                        </thead>

                        <tbody class="text-center">

                            ';

                            // $u_run = mysqli_query($con, "SELECT f.sid, f.amount, f.fmonth, f.fdate, u.uname, u.uid FROM fees  AS f INNER JOIN users AS u ON f.sid = u.uid WHERE f.sid = '$_GET[stuid]'");

                            $a = 1;

                            // $totalfees = 0;

                            while ($u_row = mysqli_fetch_assoc($u_run)) {

                                // $totalfees += $u_row["amount"];

                                echo '

                                    <tr>

                                        <td><img src='.$u_row["notes"].' alt="image" height="25" data-toggle="modal" data-target="#modal1"></td>

                                        <td>'.$u_row["n_subject"].'</td>

                                        <td>'.$u_row["n_class"].'</td>

                                    </tr>

                                ';

                                $a++;

                            }

                            // $fees=$fees+$fees;

                        echo '

                           

                        </tbody>

                    </table>

                </div>

            </div>

        ';

    } else {

        echo '

        No fees yet

        ';

    }

    

    

?>

