Improves the date picker for the internet page
This commit is contained in:
@@ -10,7 +10,11 @@ if ($developer) {
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
// Checks if the user is a mobile user
|
||||
$ua = strtolower($_SERVER["HTTP_USER_AGENT"]);
|
||||
if (array_key_exists("HTTP_USER_AGENT", $_SERVER)) {
|
||||
$ua = strtolower($_SERVER["HTTP_USER_AGENT"]);
|
||||
} else {
|
||||
$ua = "";
|
||||
}
|
||||
$MOBILE = is_numeric(strpos($ua, "mobile"));
|
||||
|
||||
require_once("ip.php");
|
||||
|
||||
@@ -33,7 +33,7 @@ function save(id) {
|
||||
}
|
||||
ajax.open("POST", "/api/internet.php");
|
||||
ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
ajax.send(`edit='${id}'&startHour='${document.getElementById(id + '.startHour').value}'&startMinute='${document.getElementById(id + '.startMinute').value}'&endHour='${document.getElementById(id + '.endHour').value}'&endMinute='${document.getElementById(id + '.endMinute').value}'&expire='${document.getElementById(id + '.expire').value}'&key='${getCookie('user')}'`);
|
||||
ajax.send(`edit='${id}'&startHour='${document.getElementById(id + '.startHour').value}'&startMinute='${document.getElementById(id + '.startMinute').value}'&endHour='${document.getElementById(id + '.endHour').value}'&endMinute='${document.getElementById(id + '.endMinute').value}'&expire='${Date.parse(document.getElementById(id + '.expire').value)/1000}'&key='${getCookie('user')}'`);
|
||||
}
|
||||
function addRow() {
|
||||
topPriority ++;
|
||||
@@ -48,6 +48,6 @@ function addRow() {
|
||||
priority.innerHTML = topPriority;
|
||||
startTime.innerHTML = `<input type='number' id='${topPriority}.startHour' value='0'>:<input type='number' id='${topPriority}.startMinute' value='0'>`;
|
||||
endTime.innerHTML = `<input type='number' id='${topPriority}.endHour' value='0'>:<input type='number' id='${topPriority}.endMinute' value='0'>`;
|
||||
expiration.innerHTML = `<input style='width: 120px' type='number' id='${topPriority}.expire' value='0'>`;
|
||||
expiration.innerHTML = `<input step="1" type='datetime-local' id='${topPriority}.expire'>`;
|
||||
buttons.innerHTML = `<button type='button' onClick='save("${topPriority}")'>✓</button><div class='red'><button type='button' onClick='remove("${topPriority}")'>✗</button>`;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
$endTimeText = "$endHour:$endMinute";
|
||||
}
|
||||
if($PRIVILEGE["internet"]) {
|
||||
$expireText = "<input style='width: 120px' type='number' id='$priority.expire' value='$expire'>";
|
||||
$expireText = "<input step='1' type='datetime-local' id='$priority.expire'><script>date = new Date($expire*1000); document.getElementById('$priority.expire').value = date.toISOString().split('.')[0];</script>";
|
||||
} else {
|
||||
$expireText = "$expire";
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
</table>
|
||||
<h3>Create Session or api key below here:</h3>
|
||||
<div>
|
||||
<label for="expire">Expiration: </label><input type='datetime-local' id="expire"><br>
|
||||
<label for="expire">Expiration: </label><input step="1" type='datetime-local' id="expire"><br>
|
||||
<button id='create'>Create</button>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user