diff --git a/sys0-code/app/debug.php b/sys0-code/app/debug.php
index 37f742f..db9e05a 100644
--- a/sys0-code/app/debug.php
+++ b/sys0-code/app/debug.php
@@ -88,32 +88,37 @@ function delete_input(input,action,id,row){
$stmt = mysqli_prepare($link, $sql);
mysqli_stmt_execute($stmt);
}
+ if($_GET["update_status"]){
+ $status=$_GET["status"];
+ $printer=$_GET["update_status"];
+ $sql="UPDATE printer SET system_status=$status WHERE id = $printer";
+ $stmt = mysqli_prepare($link, $sql);
+ mysqli_stmt_execute($stmt);
+ }
$cnt=0;
$url="";
$apikey="";
- $sql="select count(*) from printer where free=0";
+ $sql="select count(*) from printer";
$stmt = mysqli_prepare($link, $sql);
mysqli_stmt_execute($stmt);
mysqli_stmt_store_result($stmt);
mysqli_stmt_bind_result($stmt, $cnt);
mysqli_stmt_fetch($stmt);
//echo($cnt);
- echo("
| Druckerid | Freigeben |
");
+ echo("| Druckerid | Freigeben | Druckerstatus ändern |
");
$last_id=0;
+ $system_status=0;
while($cnt!=0)
{
$userid=0;
- $sql="select id,printer_url,apikey,cancel,used_by_userid from printer where free=0 and id>$last_id ORDER BY id";
+ $sql="select id,printer_url,apikey,cancel,used_by_userid, system_status from printer where id>$last_id ORDER BY id";
$cancel=0;
$stmt = mysqli_prepare($link, $sql);
mysqli_stmt_execute($stmt);
mysqli_stmt_store_result($stmt);
- mysqli_stmt_bind_result($stmt, $printer_id,$url,$apikey,$cancel,$userid);
+ mysqli_stmt_bind_result($stmt, $printer_id,$url,$apikey,$cancel,$userid,$system_status);
mysqli_stmt_fetch($stmt);
-
-
$last_id=$printer_id;
-
$used_by_user="";
$sql="select username from users where id=$userid";
$stmt = mysqli_prepare($link, $sql);
@@ -122,9 +127,10 @@ function delete_input(input,action,id,row){
mysqli_stmt_bind_result($stmt, $used_by_user);
mysqli_stmt_fetch($stmt);
-
- echo("| $printer_id | |
");
-
+ if($system_status==0)
+ echo("| $printer_id | Status auf kaputt setzen |
");
+ else
+ echo("| $printer_id | Status auf bereit setzen |
");
$cnt--;
}
echo("
");
diff --git a/sys0-code/app/overview.php b/sys0-code/app/overview.php
index 78a07cc..7d8d85f 100644
--- a/sys0-code/app/overview.php
+++ b/sys0-code/app/overview.php
@@ -359,8 +359,6 @@ function load_user()
echo("");
echo("");
echo("| Status | Problem / nicht Betriebsbereit |
");
- if(!empty($filament_color) && $filament_color!=NULL)
- echo("| Filamentfarbe | $filament_color |
");
echo("");
echo("
");
echo("");
diff --git a/sys0-code/app/print.php b/sys0-code/app/print.php
index 5faea48..2c4d25b 100644
--- a/sys0-code/app/print.php
+++ b/sys0-code/app/print.php
@@ -454,7 +454,7 @@ function is_time_between($startTime, $endTime, $checkTime) {
while($num_of_printers!=0)
{
$id=0;
- $sql="Select id,color from printer where id>$last_id order by id";
+ $sql="Select id,color from printer where id>$last_id and system_status=0 order by id";
//echo $sql;
$color="";
$stmt = mysqli_prepare($link, $sql);