Esempio n. 1
0
function show_page($err, $msg)
{
    if ($err) {
        alert($err, -1);
    }
    if ($msg) {
        alert($msg, 1);
    }
    lmt_page_header('Score Entry');
    ?>
      <h1>Theme Round Score Entry</h1>
      <form id="lmtIndivScore" method="post" action="<?php 
    echo $_SERVER['REQUEST_URI'];
    ?>
"><div class="text-centered">
        Name:
        <input type="text" id="autocomplete" name="name" size="35" class="focus" />
        &nbsp;&nbsp;&nbsp;&nbsp;
        Score:
        <input type="text" name="score" size="5" />
        &nbsp;
        <input type="hidden" name="xsrf_token" value="<?php 
    echo $_SESSION['xsrf_token'];
    ?>
" />
        <input type="submit" name="do_enter_theme_score" value="Enter" />
      </div></form>
<?php 
    echo autocomplete_js("#autocomplete", lmt_indiv_data());
    die;
}
Esempio n. 2
0
function show_page()
{
    // Check that the provided ID exists
    $row = DB::queryFirstRow('SELECT test_id, name, total_points FROM tests WHERE test_id=%i LIMIT 1', $_REQUEST['ID']);
    if (is_null($row)) {
        trigger_error('Show_Page: Invalid Test ID', E_USER_ERROR);
    }
    $test_id = $row['test_id'];
    $test_name = $row['name'];
    $total_points = $row['total_points'];
    page_title('Enter Scores');
    echo autocomplete_js("#userAutocomplete", autocomplete_users_data());
    ?>
      <h1>Enter Scores</h1>
      
      <h3><?php 
    echo $test_name;
    ?>
</h3>
      Total Points: <b><?php 
    echo $total_points;
    ?>
</b>
      <br />
      <br />
      <br />
      <form id="enterScore" method="post" action="Enter_Scores" autocomplete="off">
      <table class="spacious">
        <tr>
          <td>Name:</td>
          <td><input type="text" id="userAutocomplete" name="user" class="focus" size="25"/></td>
        </tr><tr>
          <td>Score:&nbsp;</td>
          <td><input type="text" name="score" size="3"/></td>
        </tr><tr>
          <td></td>
          <td>
			<input type="hidden" name="ID" value="<?php 
    echo $test_id;
    ?>
"/>
            <input type="hidden" name="xsrf_token" value="<?php 
    echo $_SESSION['xsrf_token'];
    ?>
"/>
            <input type="submit" name="do_add_score" value="Enter"/>
            &nbsp;&nbsp;<a href="Tests">Back</a>
          </td>
        </tr>
      </table>
      </form>
<?php 
}
Esempio n. 3
0
function show_search_page()
{
    $previous_query = htmlentities(@$_REQUEST['query']);
    echo autocomplete_js('#search', autocomplete_users_data()) . <<<HEREDOC
      <h1>Search Members</h1>
\t  
      <br />
      <form id="memberSearch" method="get"><div>
        <input type="text" id="search" name="query" value="{$previous_query}" size="35" class="focus"/>
        <input type="submit" id="" value="Search"/>
      </div></form>
HEREDOC;
}
Esempio n. 4
0
function show_combine_page($err)
{
    $row = DB::queryFirstRow('SELECT id, name FROM users WHERE id=%i', $_GET['ID']);
    if (is_null($row)) {
        trigger_error('Show_Combine: Invalid User ID', E_USER_ERROR);
    }
    $id = $row['id'];
    $name = $row['name'];
    // Add some javascript for the jQuery Autocomplete
    echo autocomplete_js('#userAutocomplete', autocomplete_users_data());
    // If an error message is given, put it inside this div
    if ($err != '') {
        alert($err, -1);
    }
    page_header('Temporary Users');
    echo <<<HEREDOC
      <h1>Temporary Users</h1>
      
      {$err}
      <span class="b">Temporary User {$name}'s Test Scores</span><br /><br />

HEREDOC;
    echo create_score_table($id);
    global $duplicate_with_id;
    if ($duplicate_with_id != '') {
        echo <<<HEREDOC
      
      <br /><br />
      <span class="b">Actual Account's Test Scores</span><br /><br />

HEREDOC;
        echo create_score_table($duplicate_with_id);
        $htmlentities_duplicate_with_id = htmlentities($duplicate_with_id);
        $request_url = htmlentities($_SERVER['REQUEST_URI']);
        echo <<<HEREDOC
      <br /><br /><br />
      <form method="post" action="{$request_uri}"><div>
        <input type="hidden" name="xsrf_token" value="{$_SESSION['xsrf_token']}"/>
        <input type="hidden" name="combine_with_id" value="{$htmlentities_duplicate_with_id}"/>
        <input type="submit" name="do_combine_duplicate" value="Combine Anyway"/>&nbsp;&nbsp;
        <a href="Temporary_Users">Cancel</a>
      </div></form>
HEREDOC;
    } else {
        echo <<<HEREDOC
      <br /><br /><br />
      <form method="post" action="{$request_uri}"><div>
        Combine with:
        <input type="text" id="userAutocomplete" name="actual_user" size="25"/><br /><br />{$duplicate_input}
        <input type="hidden" name="xsrf_token" value="{$_SESSION['xsrf_token']}"/>
        <input type="submit" name="do_combine" value="Combine"/>&nbsp;&nbsp;
        <a href="Temporary_Users">Cancel</a>
      </div></form>
HEREDOC;
    }
}
Esempio n. 5
0
<?php

require_once '../.lib/functions.php';
restrict_access('A');
page_title('Search Users');
echo autocomplete_js('#searchbox', autocomplete_users_data());
?>
<input type="text" id="searchbox" class="focus"/>