mirror of
https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
synced 2024-11-23 12:48:39 -05:00
Fix #33 - finishing touches
This commit is contained in:
parent
55f669b5d8
commit
b2e6954ac9
@ -121,9 +121,9 @@ class Constellation
|
|||||||
$timestamp = time();
|
$timestamp = time();
|
||||||
}
|
}
|
||||||
|
|
||||||
$c = ($future)?">=":"<=";
|
$operator = ($future)?">=":"<=";
|
||||||
$limit++;
|
$limit++;
|
||||||
$sql = $mysqli->prepare("SELECT *, status.id as status_id FROM status INNER JOIN users ON user_id=users.id WHERE `time` $c ? AND `end_time` $c ? OR (`time`<=? AND `end_time` $c ? ) ORDER BY `time` DESC LIMIT ? OFFSET ?");
|
$sql = $mysqli->prepare("SELECT *, status.id as status_id FROM status INNER JOIN users ON user_id=users.id WHERE `time` $operator ? AND `end_time` $operator ? OR (`time`<=? AND `end_time` $operator ? ) ORDER BY `time` DESC LIMIT ? OFFSET ?");
|
||||||
$sql->bind_param("iiiiii",$timestamp, $timestamp, $timestamp, $timestamp, $limit, $offset);
|
$sql->bind_param("iiiiii",$timestamp, $timestamp, $timestamp, $timestamp, $limit, $offset);
|
||||||
$sql->execute();
|
$sql->execute();
|
||||||
$query = $sql->get_result();
|
$query = $sql->get_result();
|
||||||
|
@ -69,6 +69,6 @@ class Token
|
|||||||
$stmt = $mysqli->prepare("DELETE FROM tokens WHERE token = ? OR expire<?");
|
$stmt = $mysqli->prepare("DELETE FROM tokens WHERE token = ? OR expire<?");
|
||||||
$stmt->bind_param("sd", $token,$time);
|
$stmt->bind_param("sd", $token,$time);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$query = $stmt->get_result();
|
$stmt->get_result();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -549,7 +549,7 @@ class User
|
|||||||
$stmt = $mysqli->prepare("UPDATE users SET email = ? WHERE id=?");
|
$stmt = $mysqli->prepare("UPDATE users SET email = ? WHERE id=?");
|
||||||
$stmt->bind_param("sd", $email, $id);
|
$stmt->bind_param("sd", $email, $id);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$query = $stmt->get_result();
|
$stmt->get_result();
|
||||||
Token::delete($token);
|
Token::delete($token);
|
||||||
header("Location: ".WEB_URL."/admin/");
|
header("Location: ".WEB_URL."/admin/");
|
||||||
}
|
}
|
||||||
|
@ -341,8 +341,8 @@ body a h1{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 991px) {
|
@media (max-width: 991px) {
|
||||||
#footerwrap .col-md-8, #footerwrap .col-md-4 {
|
body #footerwrap .col-md-8, #footerwrap .col-md-4 {
|
||||||
text-align: center !important;
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
js/admin.js
10
js/admin.js
@ -11,7 +11,7 @@
|
|||||||
var icons = ["fa fa-times", "fa fa-exclamation", "fa fa-info", "fa fa-check"];
|
var icons = ["fa fa-times", "fa fa-exclamation", "fa fa-info", "fa fa-check"];
|
||||||
|
|
||||||
$("body").on("change","#new-incident select", function(){
|
$("body").on("change","#new-incident select", function(){
|
||||||
var val = $(this).val();
|
var val = parseInt($(this).val()); //this should make exploitation harder
|
||||||
|
|
||||||
$("#new-incident .panel.new .panel-heading i").get(0).className = icons[val];
|
$("#new-incident .panel.new .panel-heading i").get(0).className = icons[val];
|
||||||
$("#new-incident .panel.new").get(0).className = classes[val] + " new";
|
$("#new-incident .panel.new").get(0).className = classes[val] + " new";
|
||||||
@ -22,9 +22,9 @@
|
|||||||
$("body").on("submit","#new-incident",function(){
|
$("body").on("submit","#new-incident",function(){
|
||||||
var time = Date.parse($('#time_input').val());
|
var time = Date.parse($('#time_input').val());
|
||||||
var end_time = Date.parse($('#end_time').val());
|
var end_time = Date.parse($('#end_time').val());
|
||||||
var type = $("#type").val();
|
var type = $("#type").val() || 0;
|
||||||
|
|
||||||
if (type == 2 &&(isNaN(time) || isNaN(end_time)))
|
if (type === 2 &&(isNaN(time) || isNaN(end_time)))
|
||||||
{
|
{
|
||||||
if (isNaN(end_time))
|
if (isNaN(end_time))
|
||||||
{
|
{
|
||||||
@ -39,7 +39,7 @@
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (type == 2 && time >= end_time)
|
else if (type === 2 && time >= end_time)
|
||||||
{
|
{
|
||||||
$.growl.error({ message: "End time is either the same or earlier than start time!" });
|
$.growl.error({ message: "End time is either the same or earlier than start time!" });
|
||||||
$('#time').addClass("error");
|
$('#time').addClass("error");
|
||||||
@ -47,7 +47,7 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($('#status-container :checkbox:checked').length == 0)
|
if($('#status-container :checkbox:checked').length === 0)
|
||||||
{
|
{
|
||||||
$.growl.error({ message: "Please check at least one service!" });
|
$.growl.error({ message: "Please check at least one service!" });
|
||||||
$('#status-container').addClass("error");
|
$('#status-container').addClass("error");
|
||||||
|
Loading…
Reference in New Issue
Block a user