<commit_before><?php
    session_start();

    if (!isset($_SESSION['user_id']) || strcmp($_SESSION['type'], 'admin') != 0 )
    {
        // redirect unauthorized user at once to homepage
        header('Location: http://localhost/qa/index.php');
        die();
    }

    $header_tag_extras = "";
    $header_section_styles = "";
    $header_section_metas = "";
    $header_section_scripts = "";
    $header_section_extras = "";
    $body_tag_extras = "";

    $body_section_styles = "";
    $body_section_scripts = "";

    require('../database/selectQuires.php');
    // TODO: fill admin content when database is ready
    $result = getAllPendingUsers();
    $body_section_content = '<div><h1>List of pending users</h1><div>Usernames:<select name="pendingDropDownList">';
    foreach ($result as $val) {
        $body_section_content .=  "<option value=" . $val['ID'] . ">" . $val['name'] . "</option>";
    }
    $body_section_content .= '</select></div></div>' ;
    $select_pending_option = $_POST['pendingDropDownList'];
    $body_section_content .= '<a href="user.php?page_user_id="' . $select_pending_option . '""'

    $navbar_content = array(
        array("../index.php", "Home"),
        array("../about.php", "About us."),
        array("../contact.php", "contact us."),
        array("../logout.php", "Sign out.")
    );


    include ("../templates/base.php");
?><commit_msg>Admin view<commit_after><?php
    session_start();

    if (!isset($_SESSION['user_id']) || strcmp($_SESSION['type'], 'admin') != 0 )
    {
        // redirect unauthorized user at once to homepage
        header('Location: http://localhost/qa/index.php');
        die();
    }

    $header_tag_extras = "";
    $header_section_styles = "";
    $header_section_metas = "";
    $header_section_scripts = "";
    $header_section_extras = "";
    $body_tag_extras = "";

    $body_section_styles = "";
    $body_section_scripts = "";

    require('../database/selectQuires.php');
    // TODO: fill admin content when database is ready
    $result_pending = getAllPendingUsers();
    $body_section_content = '<h1>List of pending users</h1>';
    $body_section_content .= '<ol>';
    foreach ($result_pending as $val) {
        $body_section_content .=  '<li><a href="user.php?page_user_id=' . $val['ID'] . '">' . $val['name'] . "</a></li>";
    }
    $body_section_content .= '</ol>' ;
    // Selected value in pending drop down

    $result_allusers = getAllUsers();
    $body_section_content = '<h1>List of all users</h1>';
    $body_section_content .= '<ol>';
    foreach ($result_allusers as $val) {
        $body_section_content .=  '<li><a href="user.php?page_user_id=' . $val['ID'] . '">' . $val['name'] . "</a></li>";
    }
    $body_section_content .= '</ol>' ;
    
    $navbar_content = array(
        array("../index.php", "Home"),
        array("../about.php", "About us."),
        array("../contact.php", "contact us."),
        array("../logout.php", "Sign out.")
    );


    include ("../templates/base.php");
?>
{'fraction_non_alphanumeric': 0.19980119284294234, 'fraction_numerical': 0.0026507620941020544, 'mean_word_length': 2.9776021080368906, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 31, 'https://': 0, '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': '455529', 'n_tokens_mistral': 974, 'n_tokens_neox': 955, 'n_words': 173}