Add fade-out

This commit is contained in:
Ruan 2015-07-09 08:30:16 +02:00
parent 2def96da36
commit 928594e9b9
2 changed files with 4 additions and 5 deletions

View File

@ -18,7 +18,7 @@ if (isset($_POST['name'], $_POST['table'])) {
} }
if (!isset($uuid)) { if (!isset($uuid)) {
$name = htmlspecialchars($name, ENT_QUOTES, 'UTF-8'); $name = htmlspecialchars($name, ENT_QUOTES, 'UTF-8');
echo($name . ' has not joined before.'); echo($name . ' has not joined before.<br>');
return; return;
} }
$table = $table_bans; $table = $table_bans;
@ -26,7 +26,7 @@ if (isset($_POST['name'], $_POST['table'])) {
$stmt = $conn->prepare("SELECT * FROM " . $table . " WHERE (uuid=? AND active=1) LIMIT 1"); $stmt = $conn->prepare("SELECT * FROM " . $table . " WHERE (uuid=? AND active=1) LIMIT 1");
if ($stmt->execute(array($uuid))) { if ($stmt->execute(array($uuid))) {
if (!($row = $stmt->fetch())) { if (!($row = $stmt->fetch())) {
echo($name . ' is not banned.'); echo($name . ' is not banned.<br>');
return; return;
} }
$banner = get_banner_name($row); $banner = get_banner_name($row);
@ -40,9 +40,8 @@ if (isset($_POST['name'], $_POST['table'])) {
if ($row['until'] > 0) { if ($row['until'] > 0) {
echo('Banned until: ' . $until . '<br>'); echo('Banned until: ' . $until . '<br>');
} else { } else {
echo('Banned permanently.'); echo('Banned permanently.<br>');
} }
echo("<br>");
} }
} }
?> ?>

View File

@ -100,7 +100,7 @@ function print_check_form($table) {
<div style="margin-left: 15px;"> <div style="margin-left: 15px;">
<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> <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>
</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> <script type="text/javascript">function captureForm(b){o=$("#output");o.removeClass("in");x=setTimeout(function(){o.html("<br>")}, 150);$.ajax({type:"POST",url:"check.php",data:{name:$("#user").val(),table:"' . $table . '"}}).done(function(c){clearTimeout(x);o.html(c);o.addClass("in")});b.preventDefault();return false};</script>
<div id="output" class="success fade" data-alert="alert" style="margin-left: 15px;"></div> <div id="output" class="success fade" data-alert="alert" style="margin-left: 15px;"></div>
</div> </div>
'); ');