");
$last_id=0;
$rotation=0;
while($cnt!=0)
{
$userid=0;
$sql="select rotation,id 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, $rotation,$printer_id);
mysqli_stmt_fetch($stmt);
$last_id=$printer_id;
$used_by_user="";
echo("
$printer_id
");
$cnt--;
}
echo("
");
?>
Klassen
Klasse
Hinzufügen/Löschen
");
//form to add a color
echo("");
$last_id=0;
$color="";
$id=0;
$row=1;
while($cnt!=0)
{
$userid=0;
$sql="select id,name from class 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,$id, $name);
mysqli_stmt_fetch($stmt);
$last_id=$id;
$used_by_user="";
$row++;
echo("
");
$cnt--;
}
echo("
");
echo("
");
?>
Filamente
form => color
$cnt=0;
$url="";
$apikey="";
$sql="select count(*) from filament";
$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("
Filamente
Farbe
Hinzufügen/Löschen
");
//form to add a color
echo("");
$last_id=0;
$color="";
$id=0;
$row=1;
while($cnt!=0)
{
$userid=0;
$sql="select id,name,internal_id from filament 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,$id, $color,$printer_id);
mysqli_stmt_fetch($stmt);
$last_id=$id;
$used_by_user="";
$row++;
echo("
$printer_id
");
$cnt--;
}
echo("
");
echo("
");
?>
Server Stats
Genutztes Filament nach Nutzer
Nutzer mit mehr als 5 Meter nutzung anzeigen
close();
}
if(isset($_GET["high_usage"]))
$sql="select username, id, filament_usage from users where filament_usage > 5000 ORDER BY filament_usage DESC";
if(isset($_POST["username"])){
$username_search=htmlspecialchars($_POST["username"]);
$sql="select username, id, filament_usage from users where username='$username_search' ORDER BY filament_usage DESC";
}
if(isset($_GET["high_usage"]) or isset($_POST["username"])){
//list users
$usr_username="";
$usr_id="";
$usr_filament_usage="";
$stmt = mysqli_prepare($link, $sql);
mysqli_stmt_execute($stmt);
mysqli_stmt_store_result($stmt);
mysqli_stmt_bind_result($stmt, $usr_username, $usr_id,$usr_filament_usage);
echo "
User List
";
echo "
ID
Username
Filament nutzung
Nutzung zurücksetzen
";
if (mysqli_stmt_num_rows($stmt) > 0) {
while (mysqli_stmt_fetch($stmt)) {
$real_usage=($usr_filament_usage/1000);
echo "