This commit is contained in:
Ruan 2015-07-09 08:13:28 +02:00
parent 722d3536b7
commit 2def96da36
2 changed files with 10 additions and 5 deletions

View File

@ -42,6 +42,7 @@ if (isset($_POST['name'], $_POST['table'])) {
} else { } else {
echo('Banned permanently.'); echo('Banned permanently.');
} }
echo("<br>");
} }
} }
?> ?>

View File

@ -95,11 +95,15 @@ function print_table_headers($headers) {
} }
function print_check_form($table) { function print_check_form($table) {
// var table=document.URL.substring(document.URL.lastIndexOf("/")+1); table=table.substring(0,table.indexOf(".")); echo('
echo('<br>'); <div class="row">
echo('<form onsubmit="captureForm(event);" class="form-inline"><div class="form-group"><input type="text" class="form-control" id="user" placeholder="Player"></div><button type="submit" class="btn btn-default">Check</button></form>'); <div style="margin-left: 15px;">
echo('<script type="text/javascript">function captureForm(b){$.ajax({type:"POST",url:"check.php",data:{name:document.getElementById("user").value,table:"' . $table . '"}}).done(function(c){document.getElementById("output").innerHTML=c});b.preventDefault();return false};</script>'); <form onsubmit="captureForm(event);" class="form-inline"><div class="form-group"><input type="text" class="form-control" id="user" placeholder="Player"></div><button type="submit" class="btn btn-default" style="margin-left: 5px;">Check</button></form>
echo('<div id="output"></div>'); </div>
<script type="text/javascript">function captureForm(b){$("#output").removeClass("in");$.ajax({type:"POST",url:"check.php",data:{name:document.getElementById("user").value,table:"' . $table . '"}}).done(function(c){document.getElementById("output").innerHTML=c;$("#output").addClass("in")});b.preventDefault();return false};</script>
<div id="output" class="success fade" data-alert="alert" style="margin-left: 15px;"></div>
</div>
');
} }
?> ?>