Files
vokspace/print.php
2026-01-02 21:00:45 +01:00

122 lines
2.7 KiB
PHP

<?php session_start();
$sitename = 'print';
?>
<!DOCTYPE html>
<html>
<head>
<title>Ordner drucken | Vokabelbox</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<?php
require "files/ezine_db.inc.php";
include "files/loginscript.inc.php";
include "files/errorcodesscript.inc.php";
if($LoggedIn == 'true') {
$folderID = $_SESSION["folderID"];
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE `Nutzername` = '$Benutzername' AND `ID` = '$folderID' AND `Sprache1` = ''";
$result_articles = $conn->query($sql);
while ($articleDb = mysqli_fetch_object($result_articles)) {
$folderTEXT = $articleDb->Ordner;
}
$sql = "SELECT * FROM `VokabelBoxVokabeln` WHERE `Nutzername` = '$Benutzername' AND `ID` = '$folderID' AND `Sprache1` != ''";
$result_articles = $conn->query($sql);
if(!mysqli_num_rows($result_articles))
{
print("Fehler");
}
else {
$gesamt_anzahl = mysqli_num_rows($result_articles);
print(
" <h2><b>$folderTEXT</b></h2><p></p>
<table>
<tr>
<td><b>Sprache 1</b></td>
<td><b>Sprache 2</b></td>
</tr>
");
while ($articleDb = mysqli_fetch_object($result_articles)) {
print(
" <tr>
<td>$articleDb->Sprache1</td>
<td>$articleDb->Sprache2</td>
</tr>
");
}
}
print(
" </table>
<span>Dr&uuml;cke STRG + P oder w&auml;hle 'Drucken' in den Optionen deines Browsers (Chrome: Drei Punkte oben rechts, Firefox: Button ganz oben rechts).</span>
");
}
?>
</body>
</html>
<style>
@import url('https://fonts.googleapis.com/css?family=Fredoka+One');
* {
font-family: Arial;
}
table {
width: 100%;
height: 100%;
border-collapse: separate;
border-spacing: 0px;
border-radius: 20px;
border: 3px solid #424242;
overflow: hidden;
}
table td {
border: 1px solid #424242;
padding: 3px;
}
table tr td:last-child {
border-right: 0px solid #fff;
}
tr td:first-child {
border-left: 0px solid #fff;
}
tr:last-child td {
border-bottom: 0px solid #fff;
}
tr:first-child td {
border-top: 0px solid #fff;
}
p {
-webkit-print-color-adjust: exact;
position: absolute;
top: 0px;
right: 0px;
font-size: 20px;
padding: 10px;
font-family: 'Fredoka One', cursive;
}
p::before {
content: "Vokabel";
}
p::after {
content: "Box";
background-color: #424242 !important;
color: #fff;
border-radius: 10px;
padding: 5px;
margin-left: 5px;
}
@media print {
span {
display: none;
}
}
</style>