<commit_before><?php
    ini_set('display_errors', 1);
    echo 'You have successfully logged into the admin page';
    include( '../php/rds.php' );
    include("../php/signal.class.php");
    include("../php/auth.php");
    session_start();
    if(!isset($_COOKIE['alumdbauth'])){
        header("location: /auth/");
        exit;
    } else {
        $resp = auth::check_auth($_COOKIE['alumdbauth']);
        if($resp->isError()){
            header("location: /auth/");
            exit;
        }
          
    }
    include ('../php/rds.php');
    $conn = new mysqli($dbhost, $username, $password, $dbname);
            if ($conn->connect_error) {
                die("Connection failed: " . $conn->connect_error);
            }

            $query = "SELECT username,firstname,lastname,graduationyear FROM `setupusers`";
            $result = $conn->query($query);           
            $num_rows_full = $result->num_rows;
            $max_pages = ceil($num_rows_full/100);
            $page = 1;
            if(isset($_GET["page"])){
                $page = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT);
            }
            $page = max(array(min(array($page, $max_pages)), 1));
            $start = $page * 100 - 100;
            if($start < 0){
                $start = 0;
            }
            $query = $query .  " ORDER BY graduationyear LIMIT {$start}, 100";
            $result = $conn->query($query);           
            $tablecode = "";
            $num_rows = $result->num_rows;
            if ($num_rows > 0) {
                // output data of each row
                $tablecode = "<table class=\"table\" id=\"table\" style=\"width:100%\" border=\"1\"><thead><tr><th>Firstname</th><th>Lastname</th><th>Graduation Year</th></tr></thead><tbody>";
                while($row = $result->fetch_assoc()) {
                    $tablecode = $tablecode . '<tr><td><a href="https://alumdb.mamaroneckschoolsfoundation.org/profile/individualalumni.php?alumniid=' . $row["username"]. '">' . $row["firstname"]. '</a></td><td>' . $row["lastname"]. "</td><td>" . $row["graduationyear"]. "</td></tr>";
                }
                $tablecode = $tablecode . "</tbody></table>";
            }
            echo $tablecode;
            $res_str = "<div class=\"t_footer\"><br>{$num_rows_full} Result";
            if($result->num_rows != 1){
                $res_str = $res_str . "s";
            }

            $res_str = $res_str . ", {$num_rows} shown (page {$page} of " . $max_pages . ")<br>"; <commit_msg>changes to table and link<commit_after><?php
    ini_set('display_errors', 1);
    echo 'You have successfully logged into the admin page';
    include( '../php/rds.php' );
    include("../php/signal.class.php");
    include("../php/auth.php");
    session_start();
    if(!isset($_COOKIE['alumdbauth'])){
        header("location: /auth/");
        exit;
    } else {
        $resp = auth::check_auth($_COOKIE['alumdbauth']);
        if($resp->isError()){
            header("location: /auth/");
            exit;
        }
          
    }
    include ('../php/rds.php');
    $conn = new mysqli($dbhost, $username, $password, $dbname);
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    }

            $query = "SELECT username,firstname,lastname,graduationyear FROM `setupusers`";
            $result = $conn->query($query);           
            $num_rows_full = $result->num_rows;
            $max_pages = ceil($num_rows_full/100);
            $page = 1;
            if(isset($_GET["page"])){
                $page = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT);
            }
            $page = max(array(min(array($page, $max_pages)), 1));
            $start = $page * 100 - 100;
            if($start < 0){
                $start = 0;
            }
            $query = $query .  " ORDER BY graduationyear LIMIT {$start}, 100";
            $result = $conn->query($query);           
            $tablecode = "";
            $num_rows = $result->num_rows;
            if ($num_rows > 0) {
                // output data of each row
                $tablecode = "<table class=\"table\" id=\"table\" style=\"width:100%\" border=\"1\"><thead><tr><th>Firstname</th><th>Lastname</th><th>Graduation Year</th></tr></thead><tbody>";
                while($row = $result->fetch_assoc()) {
                    $tablecode = $tablecode . '<tr><td><a href="https://alumdb.mamaroneckschoolsfoundation.org/profile/individualalumni.php?username=' . $row["username"]. '">' . $row["username"]. '</a></td><td>' . $row["firstname"]. "</td><td>" . $row["lastname"]. "</td><td>" . $row["graduationyear"]. "</td></tr>";
                }
                $tablecode = $tablecode . "</tbody></table>";
            }
            echo $tablecode;
            $res_str = "<div class=\"t_footer\"><br>{$num_rows_full} Result";
            if($result->num_rows != 1){
                $res_str = $res_str . "s";
            }

            $res_str = $res_str . ", {$num_rows} shown (page {$page} of " . $max_pages . ")<br>"; 
{'fraction_non_alphanumeric': 0.1925343811394892, 'fraction_numerical': 0.009037328094302554, 'mean_word_length': 1.934293948126801, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 79, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '178243', 'n_tokens_mistral': 1619, 'n_tokens_neox': 1536, 'n_words': 276}