update
This commit is contained in:
@@ -186,7 +186,7 @@
|
||||
}
|
||||
|
||||
// Create dissalowed_start table
|
||||
$sql = "CREATE TABLE IF NOT EXISTS disalowed_start (
|
||||
$sql = "CREATE TABLE IF NOT EXISTS disallowed_start (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
path VARCHAR(255) NOT NULL UNIQUE
|
||||
)";
|
||||
|
||||
@@ -140,7 +140,7 @@ load_settings();
|
||||
<a class="nav-link" href="client_settings.php?show=task" id="task_tab">Task Settings</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="client_settings.php?show=disalowed_start" id="disalowed_start_tab">Application Control</a>
|
||||
<a class="nav-link" href="client_settings.php?show=disallowed_start" id="disallowed_start_tab">Application Control</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -470,7 +470,7 @@ load_settings();
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="disalowed_start" style="display:none">
|
||||
<div id="disallowed_start" style="display:none">
|
||||
<h4>Application control</h4>
|
||||
<h7>AC: on/off</h7>
|
||||
<div class="form-check form-switch">
|
||||
@@ -494,12 +494,12 @@ load_settings();
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">000</th>
|
||||
<td><input type="text" id="disalowed_start" class="form-control" name="name"></td>
|
||||
<td><button type="button" class="btn btn-primary" onclick="add_item('disalowed_start','disalowed_start','path');">Add</button></td>
|
||||
<td><input type="text" id="disallowed_start" class="form-control" name="name"></td>
|
||||
<td><button type="button" class="btn btn-primary" onclick="add_item('disallowed_start','disallowed_start','path');">Add</button></td>
|
||||
</tr>
|
||||
<?php
|
||||
//load all the entrys from a db table
|
||||
$sql = "SELECT path,id FROM disalowed_start ORDER BY id";
|
||||
$sql = "SELECT path,id FROM disallowed_start ORDER BY id";
|
||||
$stmt = $conn->prepare($sql);
|
||||
// Execute the statement
|
||||
$stmt->execute();
|
||||
@@ -509,8 +509,8 @@ load_settings();
|
||||
//print out the items
|
||||
echo("<tr>");
|
||||
echo("<th scope=\"row\">".$row["id"]."</th>");
|
||||
echo("<td><input type=\"text\" id=\"disalowed_start".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$row["path"]."\" oninput=\"update_textfield('disalowed_start".$row["id"]."','disalowed_start','".$row["id"]."');\"></td>");
|
||||
echo("<td><button type=\"button\" class=\"btn btn-danger\" onclick=\"delete_item('disalowed_start',".$row["id"].");\">Delete</button></td>");
|
||||
echo("<td><input type=\"text\" id=\"disallowed_start".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$row["path"]."\" oninput=\"update_textfield('disallowed_start".$row["id"]."','disallowed_start','".$row["id"]."');\"></td>");
|
||||
echo("<td><button type=\"button\" class=\"btn btn-danger\" onclick=\"delete_item('disallowed_start',".$row["id"].");\">Delete</button></td>");
|
||||
echo("</tr>");
|
||||
}
|
||||
|
||||
|
||||
@@ -98,9 +98,9 @@ function safe_settings(){
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
}
|
||||
if($_GET["update"]=="disalowed_start"){
|
||||
if($_GET["update"]=="disallowed_start"){
|
||||
$id=htmlspecialchars($_GET["id"]);
|
||||
$stmt = $conn->prepare("UPDATE disalowed_start set path= ? WHERE id=?");
|
||||
$stmt = $conn->prepare("UPDATE disallowed_start set path= ? WHERE id=?");
|
||||
$stmt->bind_param("si",$value,$id);
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
|
||||
Reference in New Issue
Block a user