Update client_settings.php

This commit is contained in:
jakani24
2024-02-11 20:12:29 +01:00
parent 3cdfc6a239
commit 86984bc44d

View File

@@ -281,263 +281,269 @@ function load_settings(){
<a class="nav-link" href="client_settings.php?show=general" id="general_tab">General Settings</a> <a class="nav-link" href="client_settings.php?show=general" id="general_tab">General Settings</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="#">Link</a> <a class="nav-link" href="client_settings.php?show=rtp" id="rtp_tab">RTP Settings</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="#">Link</a> <a class="nav-link" href="client_settings.php?show=task" id="task_tab">Task Settings</a>
</li> </li>
</ul> </ul>
<h4>General</h4> <div id="general" style="display:none">
<!-- Dropdown for virus controll action --> <h4>General</h4>
<h7>What should be done, if the scanner finds a virus?</h7> <!-- Dropdown for virus controll action -->
<div class="dropdown"> <h7>What should be done, if the scanner finds a virus?</h7>
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false"> <div class="dropdown">
<?php echo($setting_virus_ctrl_virus_found_action) ?> <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
</button> <?php echo($setting_virus_ctrl_virus_found_action) ?>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1"> </button>
<li><a class="dropdown-item" href="#" onclick="update_setting('dropdownMenuButton1','setting_virus_ctrl_virus_found_action','remove')">remove</a></li> <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item" href="#" onclick="update_setting('dropdownMenuButton1','setting_virus_ctrl_virus_found_action','quarantine')">quarantine</a></li> <li><a class="dropdown-item" href="#" onclick="update_setting('dropdownMenuButton1','setting_virus_ctrl_virus_found_action','remove')">remove</a></li>
<li><a class="dropdown-item" href="#" onclick="update_setting('dropdownMenuButton1','setting_virus_ctrl_virus_found_action','ignore')">ignore</a></li> <li><a class="dropdown-item" href="#" onclick="update_setting('dropdownMenuButton1','setting_virus_ctrl_virus_found_action','quarantine')">quarantine</a></li>
<li><a class="dropdown-item" href="#" onclick="update_setting('dropdownMenuButton1','setting_virus_ctrl_virus_found_action','call_srv')">call_srv</a></li> <li><a class="dropdown-item" href="#" onclick="update_setting('dropdownMenuButton1','setting_virus_ctrl_virus_found_action','ignore')">ignore</a></li>
</ul> <li><a class="dropdown-item" href="#" onclick="update_setting('dropdownMenuButton1','setting_virus_ctrl_virus_found_action','call_srv')">call_srv</a></li>
</ul>
</div>
<br>
<h7>What is the URL of this server? (url or ip address where the clients connect to)</h7>
<input type="text" id="server_url_input" class="form-control" name="name" value="<?php echo($setting_server_server_url); ?>" oninput="update_textfield('server_url_input','setting_server_server_url','0')">
<br>
</div> </div>
<br> <div id="rtp" style="display:none">
<h7>What is the URL of this server? (url or ip address where the clients connect to)</h7> <h4>RTP</h4>
<input type="text" id="server_url_input" class="form-control" name="name" value="<?php echo($setting_server_server_url); ?>" oninput="update_textfield('server_url_input','setting_server_server_url','0')"> <h7>RTP: folderscanner on/off</h7>
<br> <div class="form-check form-switch">
<h4>RTP</h4> <?php if($setting_rtp_folder_scan_status=="true")
<h7>RTP: folderscanner on/off</h7> echo ("<input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"flexSwitchCheckDefault\" onclick=\"update_switch('flexSwitchCheckDefault','setting_rtp_folder_scan_status')\" checked>");
<div class="form-check form-switch"> else
<?php if($setting_rtp_folder_scan_status=="true") echo ("<input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"flexSwitchCheckDefault\" onclick=\"update_switch('flexSwitchCheckDefault','setting_rtp_folder_scan_status')\">");
echo ("<input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"flexSwitchCheckDefault\" onclick=\"update_switch('flexSwitchCheckDefault','setting_rtp_folder_scan_status')\" checked>"); ?>
else <label class="form-check-label" for="flexSwitchCheckDefault">Check file modifications</label>
echo ("<input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"flexSwitchCheckDefault\" onclick=\"update_switch('flexSwitchCheckDefault','setting_rtp_folder_scan_status')\">"); </div>
<div class="form-check form-switch">
<?php if($setting_rtp_process_scan_status=="true")
echo ("<input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"flexSwitchCheckDefault1\" onclick=\"update_switch('flexSwitchCheckDefault1','setting_rtp_process_scan_status')\" checked>");
else
echo ("<input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"flexSwitchCheckDefault1\" onclick=\"update_switch('flexSwitchCheckDefault1','setting_rtp_process_scan_status')\">");
?>
<label class="form-check-label" for="flexSwitchCheckDefault1">Check Processes</label>
</div>
<br>
<h7>Included folders for RTP folderscanner</h7>
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Path</th>
<th scope="col">Add / Delete</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">000</th>
<td><input type="text" id="rtp_included" class="form-control" name="name"></td>
<td><button type="button" class="btn btn-primary" onclick="add_item('rtp_included','rtp_included','path');">Add</button></td>
</tr>
<?php
//load all the entrys from a db table
$sql = "SELECT path,id FROM rtp_included ORDER BY id";
$stmt = $conn->prepare($sql);
// Execute the statement
$stmt->execute();
// Get the result
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()){
//print out the items
echo("<tr>");
echo("<th scope=\"row\">".$row["id"]."</th>");
echo("<td><input type=\"text\" id=\"rtp_included".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$row["path"]."\" oninput=\"update_textfield('rtp_included".$row["id"]."','rtp_included','".$row["id"]."');\"></td>");
echo("<td><button type=\"button\" class=\"btn btn-danger\" onclick=\"delete_item('rtp_included',".$row["id"].");\">Delete</button></td>");
echo("</tr>");
}
$stmt -> close();
?> ?>
<label class="form-check-label" for="flexSwitchCheckDefault">Check file modifications</label> </tbody>
</div> </table>
<div class="form-check form-switch"> <h7>Excluded folders for RTP folderscanner</h7>
<?php if($setting_rtp_process_scan_status=="true") <table class="table">
echo ("<input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"flexSwitchCheckDefault1\" onclick=\"update_switch('flexSwitchCheckDefault1','setting_rtp_process_scan_status')\" checked>"); <thead>
else <tr>
echo ("<input class=\"form-check-input\" type=\"checkbox\" role=\"switch\" id=\"flexSwitchCheckDefault1\" onclick=\"update_switch('flexSwitchCheckDefault1','setting_rtp_process_scan_status')\">"); <th scope="col">#</th>
<th scope="col">Path</th>
<th scope="col">Add / Delete</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">000</th>
<td><input type="text" id="rtp_excluded" class="form-control" name="name"></td>
<td><button type="button" class="btn btn-primary" onclick="add_item('rtp_excluded','rtp_excluded','path');">Add</button></td>
</tr>
<?php
//load all the entrys from a db table
$sql = "SELECT path,id FROM rtp_excluded ORDER BY id";
$stmt = $conn->prepare($sql);
// Execute the statement
$stmt->execute();
// Get the result
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()){
//print out the items
echo("<tr>");
echo("<th scope=\"row\">".$row["id"]."</th>");
echo("<td><input type=\"text\" id=\"rtp_excluded".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$row["path"]."\" oninput=\"update_textfield('rtp_excluded".$row["id"]."','rtp_excluded','".$row["id"]."');\"></td>");
echo("<td><button type=\"button\" class=\"btn btn-danger\" onclick=\"delete_item('rtp_excluded',".$row["id"].");\">Delete</button></td>");
echo("</tr>");
}
$stmt -> close();
?> ?>
<label class="form-check-label" for="flexSwitchCheckDefault1">Check Processes</label> </tbody>
</table>
<br>
</div> </div>
<br> <div id="task" style="display:none">
<h7>Included folders for RTP folderscanner</h7> <h4>User Tasks</h4>
<table class="table"> <table class="table">
<thead> <thead>
<tr>
<th scope="col">#</th>
<th scope="col">Path</th>
<th scope="col">Add / Delete</th>
</tr>
</thead>
<tbody>
<tr> <tr>
<th scope="row">000</th> <th scope="col">#</th>
<td><input type="text" id="rtp_included" class="form-control" name="name"></td> <th scope="col">Time</th>
<td><button type="button" class="btn btn-primary" onclick="add_item('rtp_included','rtp_included','path');">Add</button></td> <th scope="col">Action</th>
<th scope="col">Argument</th>
<th scope="col">Name</th>
<th scope="col">Add / Delete</th>
</tr> </tr>
<?php </thead>
//load all the entrys from a db table <tbody>
$sql = "SELECT path,id FROM rtp_included ORDER BY id"; <tr>
$stmt = $conn->prepare($sql); <th scope="row">000</th>
// Execute the statement <td><input type="text" id="task_time" class="form-control" name="task_time"></td>
$stmt->execute(); <td>
// Get the result <select class="form-select" data-live-search="true" id="task_action">
$result = $stmt->get_result(); <option value="choose_action">Choose an action</option>
while ($row = $result->fetch_assoc()){ <option value="scanfile">scanfile</option>
//print out the items <option value="scanfolder">scanfolder</option>
echo("<tr>"); </select>
echo("<th scope=\"row\">".$row["id"]."</th>"); </td>
echo("<td><input type=\"text\" id=\"rtp_included".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$row["path"]."\" oninput=\"update_textfield('rtp_included".$row["id"]."','rtp_included','".$row["id"]."');\"></td>"); <td><input type="text" id="task_argument" class="form-control" name="task_argument"></td>
echo("<td><button type=\"button\" class=\"btn btn-danger\" onclick=\"delete_item('rtp_included',".$row["id"].");\">Delete</button></td>"); <td><input type="text" id="task_name" class="form-control" name="task_name"></td>
echo("</tr>"); <td><button type="button" class="btn btn-primary" onclick="add_task('user_tasks','task','task_time','task_action','task_argument','task_name');">Add</button></td>
} </tr>
<?php
$stmt -> close(); //load all the entrys from a db table
?> $sql = "SELECT task,id FROM user_tasks ORDER BY id";
</tbody> $stmt = $conn->prepare($sql);
</table> // Execute the statement
<h7>Excluded folders for RTP folderscanner</h7> $stmt->execute();
<table class="table"> // Get the result
<thead> $result = $stmt->get_result();
<tr> while ($row = $result->fetch_assoc()){
<th scope="col">#</th> $buf=explode(";",$row["task"]);
<th scope="col">Path</th> $time=$buf[0];
<th scope="col">Add / Delete</th> $action=$buf[1];
</tr> $argument=$buf[2];
</thead> $name=$buf[3];
<tbody> //print out the items
echo("<tr>");
echo("<th scope=\"row\">".$row["id"]."</th>");
echo("<td><input type=\"text\" id=\"task_time".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$time."\" oninput=\"update_task('user_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
//echo("<td><input type=\"text\" id=\"task_action".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$action."\" oninput=\"update_task('user_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
echo("<td>");
echo('<select class="form-select" data-live-search="true" id="task_action'.$row["id"].'" onchange="update_task(\'user_tasks\','.$row["id"].',\'task_time'.$row["id"].'\',\'task_action'.$row["id"].'\',\'task_argument'.$row["id"].'\',\'task_name'.$row["id"].'\');">');
echo('<option value="choose_action">Choose an action</option>');
if($action=="scanfile")
echo('<option value="scanfile" selected >scanfile</option>');
else
echo('<option value="scanfile" >scanfile</option>');
if($action=="scanfolder")
echo('<option value="scanfolder" selected>scanfolder</option>');
else
echo('<option value="scanfolder">scanfolder</option>');
echo('</select>');
echo('</td>');
echo("<td><input type=\"text\" id=\"task_argument".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$argument."\" oninput=\"update_task('user_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
echo("<td><input type=\"text\" id=\"task_name".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$name."\" oninput=\"update_task('user_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
echo("<td><button type=\"button\" class=\"btn btn-danger\" onclick=\"delete_item('user_tasks',".$row["id"].");\">Delete</button></td>");
echo("</tr>");
}
$stmt -> close();
?>
</tbody>
</table>
<h4>System Tasks (Warning: Changes may impact security)</h4>
<table class="table">
<thead>
<tr> <tr>
<th scope="row">000</th> <th scope="col">#</th>
<td><input type="text" id="rtp_excluded" class="form-control" name="name"></td> <th scope="col">Time</th>
<td><button type="button" class="btn btn-primary" onclick="add_item('rtp_excluded','rtp_excluded','path');">Add</button></td> <th scope="col">Action</th>
<th scope="col">Argument</th>
<th scope="col">Name</th>
<th scope="col">Add / Delete</th>
</tr> </tr>
<?php </thead>
//load all the entrys from a db table <tbody>
$sql = "SELECT path,id FROM rtp_excluded ORDER BY id"; <tr>
$stmt = $conn->prepare($sql); <th scope="row">000</th>
// Execute the statement <td><input type="text" id="task_time" class="form-control" name="task_time"></td>
$stmt->execute(); <td>
// Get the result <select class="form-select" data-live-search="true" id="task_action">
$result = $stmt->get_result(); <option value="choose_action">Choose an action</option>
while ($row = $result->fetch_assoc()){ <option value="scanfile">scanfile</option>
//print out the items <option value="scanfolder">scanfolder</option>
echo("<tr>"); </select>
echo("<th scope=\"row\">".$row["id"]."</th>"); </td>
echo("<td><input type=\"text\" id=\"rtp_excluded".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$row["path"]."\" oninput=\"update_textfield('rtp_excluded".$row["id"]."','rtp_excluded','".$row["id"]."');\"></td>"); <td><input type="text" id="task_argument" class="form-control" name="task_argument"></td>
echo("<td><button type=\"button\" class=\"btn btn-danger\" onclick=\"delete_item('rtp_excluded',".$row["id"].");\">Delete</button></td>"); <td><input type="text" id="task_name" class="form-control" name="task_name"></td>
echo("</tr>"); <td><button type="button" class="btn btn-primary" onclick="add_task('system_tasks','task','task_time','task_action','task_argument','task_name');">Add</button></td>
} </tr>
<?php
$stmt -> close(); //load all the entrys from a db table
?> $sql = "SELECT task,id FROM system_tasks ORDER BY id";
</tbody> $stmt = $conn->prepare($sql);
</table> // Execute the statement
<br> $stmt->execute();
<h4>User Tasks</h4> // Get the result
<table class="table"> $result = $stmt->get_result();
<thead> while ($row = $result->fetch_assoc()){
<tr> $buf=explode(";",$row["task"]);
<th scope="col">#</th> $time=$buf[0];
<th scope="col">Time</th> $action=$buf[1];
<th scope="col">Action</th> $argument=$buf[2];
<th scope="col">Argument</th> $name=$buf[3];
<th scope="col">Name</th> //print out the items
<th scope="col">Add / Delete</th> echo("<tr>");
</tr> echo("<th scope=\"row\">".$row["id"]."</th>");
</thead> echo("<td><input type=\"text\" id=\"task_time".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$time."\" oninput=\"update_task('system_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
<tbody> //echo("<td><input type=\"text\" id=\"task_action".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$action."\" oninput=\"update_task('user_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
<tr> echo("<td>");
<th scope="row">000</th> echo('<select class="form-select" data-live-search="true" id="task_action'.$row["id"].'" onchange="update_task(\'system_tasks\','.$row["id"].',\'task_time'.$row["id"].'\',\'task_action'.$row["id"].'\',\'task_argument'.$row["id"].'\',\'task_name'.$row["id"].'\');">');
<td><input type="text" id="task_time" class="form-control" name="task_time"></td> echo('<option value="choose_action">Choose an action</option>');
<td> if($action=="scanfile")
<select class="form-select" data-live-search="true" id="task_action"> echo('<option value="scanfile" selected >scanfile</option>');
<option value="choose_action">Choose an action</option> else
<option value="scanfile">scanfile</option> echo('<option value="scanfile" >scanfile</option>');
<option value="scanfolder">scanfolder</option> if($action=="scanfolder")
</select> echo('<option value="scanfolder" selected>scanfolder</option>');
</td> else
<td><input type="text" id="task_argument" class="form-control" name="task_argument"></td> echo('<option value="scanfolder">scanfolder</option>');
<td><input type="text" id="task_name" class="form-control" name="task_name"></td> echo('</select>');
<td><button type="button" class="btn btn-primary" onclick="add_task('user_tasks','task','task_time','task_action','task_argument','task_name');">Add</button></td> echo('</td>');
</tr>
<?php echo("<td><input type=\"text\" id=\"task_argument".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$argument."\" oninput=\"update_task('system_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
//load all the entrys from a db table echo("<td><input type=\"text\" id=\"task_name".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$name."\" oninput=\"update_task('system_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
$sql = "SELECT task,id FROM user_tasks ORDER BY id"; echo("<td><button type=\"button\" class=\"btn btn-danger\" onclick=\"delete_item('system_tasks',".$row["id"].");\">Delete</button></td>");
$stmt = $conn->prepare($sql); echo("</tr>");
// Execute the statement }
$stmt->execute();
// Get the result $stmt -> close();
$result = $stmt->get_result(); ?>
while ($row = $result->fetch_assoc()){ </tbody>
$buf=explode(";",$row["task"]); </table>
$time=$buf[0]; </div>
$action=$buf[1];
$argument=$buf[2];
$name=$buf[3];
//print out the items
echo("<tr>");
echo("<th scope=\"row\">".$row["id"]."</th>");
echo("<td><input type=\"text\" id=\"task_time".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$time."\" oninput=\"update_task('user_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
//echo("<td><input type=\"text\" id=\"task_action".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$action."\" oninput=\"update_task('user_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
echo("<td>");
echo('<select class="form-select" data-live-search="true" id="task_action'.$row["id"].'" onchange="update_task(\'user_tasks\','.$row["id"].',\'task_time'.$row["id"].'\',\'task_action'.$row["id"].'\',\'task_argument'.$row["id"].'\',\'task_name'.$row["id"].'\');">');
echo('<option value="choose_action">Choose an action</option>');
if($action=="scanfile")
echo('<option value="scanfile" selected >scanfile</option>');
else
echo('<option value="scanfile" >scanfile</option>');
if($action=="scanfolder")
echo('<option value="scanfolder" selected>scanfolder</option>');
else
echo('<option value="scanfolder">scanfolder</option>');
echo('</select>');
echo('</td>');
echo("<td><input type=\"text\" id=\"task_argument".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$argument."\" oninput=\"update_task('user_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
echo("<td><input type=\"text\" id=\"task_name".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$name."\" oninput=\"update_task('user_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
echo("<td><button type=\"button\" class=\"btn btn-danger\" onclick=\"delete_item('user_tasks',".$row["id"].");\">Delete</button></td>");
echo("</tr>");
}
$stmt -> close();
?>
</tbody>
</table>
<h4>System Tasks (Warning: Changes may impact security)</h4>
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Time</th>
<th scope="col">Action</th>
<th scope="col">Argument</th>
<th scope="col">Name</th>
<th scope="col">Add / Delete</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">000</th>
<td><input type="text" id="task_time" class="form-control" name="task_time"></td>
<td>
<select class="form-select" data-live-search="true" id="task_action">
<option value="choose_action">Choose an action</option>
<option value="scanfile">scanfile</option>
<option value="scanfolder">scanfolder</option>
</select>
</td>
<td><input type="text" id="task_argument" class="form-control" name="task_argument"></td>
<td><input type="text" id="task_name" class="form-control" name="task_name"></td>
<td><button type="button" class="btn btn-primary" onclick="add_task('system_tasks','task','task_time','task_action','task_argument','task_name');">Add</button></td>
</tr>
<?php
//load all the entrys from a db table
$sql = "SELECT task,id FROM system_tasks ORDER BY id";
$stmt = $conn->prepare($sql);
// Execute the statement
$stmt->execute();
// Get the result
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()){
$buf=explode(";",$row["task"]);
$time=$buf[0];
$action=$buf[1];
$argument=$buf[2];
$name=$buf[3];
//print out the items
echo("<tr>");
echo("<th scope=\"row\">".$row["id"]."</th>");
echo("<td><input type=\"text\" id=\"task_time".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$time."\" oninput=\"update_task('system_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
//echo("<td><input type=\"text\" id=\"task_action".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$action."\" oninput=\"update_task('user_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
echo("<td>");
echo('<select class="form-select" data-live-search="true" id="task_action'.$row["id"].'" onchange="update_task(\'system_tasks\','.$row["id"].',\'task_time'.$row["id"].'\',\'task_action'.$row["id"].'\',\'task_argument'.$row["id"].'\',\'task_name'.$row["id"].'\');">');
echo('<option value="choose_action">Choose an action</option>');
if($action=="scanfile")
echo('<option value="scanfile" selected >scanfile</option>');
else
echo('<option value="scanfile" >scanfile</option>');
if($action=="scanfolder")
echo('<option value="scanfolder" selected>scanfolder</option>');
else
echo('<option value="scanfolder">scanfolder</option>');
echo('</select>');
echo('</td>');
echo("<td><input type=\"text\" id=\"task_argument".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$argument."\" oninput=\"update_task('system_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
echo("<td><input type=\"text\" id=\"task_name".$row["id"]."\" class=\"form-control\" name=\"name\" value=\"".$name."\" oninput=\"update_task('system_tasks',".$row["id"].",'task_time".$row["id"]."','task_action".$row["id"]."','task_argument".$row["id"]."','task_name".$row["id"]."');\"></td>");
echo("<td><button type=\"button\" class=\"btn btn-danger\" onclick=\"delete_item('system_tasks',".$row["id"].");\">Delete</button></td>");
echo("</tr>");
}
$stmt -> close();
?>
</tbody>
</table>
</div> </div>
</div> </div>
</div> </div>
@@ -552,7 +558,7 @@ function load_settings(){
// Get the value of the "show" parameter // Get the value of the "show" parameter
const show_div = document.getElementById(urlParams.get('show')); const show_div = document.getElementById(urlParams.get('show'));
const nav_tab = document.getElementById(urlParams.get('show')+"_tab"); const nav_tab = document.getElementById(urlParams.get('show')+"_tab");
//show_div.style.display="block"; show_div.style.display="block";
nav_tab.setAttribute('class', 'nav-link active'); nav_tab.setAttribute('class', 'nav-link active');
</script> </script>
</body> </body>