-
Notifications
You must be signed in to change notification settings - Fork 0
/
printnavneskilt.html
107 lines (86 loc) · 3.21 KB
/
printnavneskilt.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<html>
<head>
<title>Mosterihaven Kolding</title>
<style>
div.template {
border-style: dashed;
border-width: 1px 1px 1px 1px;
border-color: black;
display: flex;
align-items: center;
justify-content: center;
font-family: Arial, Helvetica, sans-serif;
text-align: center;
}
p.template {
width: 100%;
height: 100%;
display: flex;
text-align: center;
justify-content: center;
font-family: Arial, Helvetica, sans-serif;
font-size: 12pt;
font-weight: bold;
}
</style>
<meta charset="UTF-8">
<script>
function UpdateTemplate(names, apartment) {
apartment = apartment.toUpperCase();
names = names.toUpperCase();
document.getElementById("door_tenant").innerHTML = names;
document.getElementById("mailbox").innerHTML = apartment + ' - ' + names;
document.getElementById("entryphone_tenant").innerHTML = names;
document.getElementById("entryphone_apartment").innerHTML = apartment;
document.getElementById("name_sign_updater").value = names;
document.getElementById("apartment_sign_updater").value = apartment;
document.title = apartment + ' - ' + names;
}
</script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
function Print() {
var divContents = $("#templateContainer").html();
var printWindow = window.open('', '', 'height=400,width=800');
printWindow.document.write('<html>');
printWindow.document.write(document.head.innerHTML);
printWindow.document.write('<body>');
printWindow.document.write(divContents);
printWindow.document.write('</body></html>');
printWindow.print();
printWindow.document.close();
}
</script>
</head>
<body>
<h1>Mosterihaven</h1>
<div id="templateContainer">
<div id="door_tenant" class="template" style="width: 210mm; height: 36mm; font-size: 24pt; font-weight: bold;">
Navne
</div>
<br />
<div id="mailbox" class="template" style="width: 235mm; height: 15mm; font-size: 22pt;">
Lejlighed
</div>
<br />
<div class="template" style="width: 65mm; height: 20mm; display: grid;">
<p id="entryphone_tenant" class="template" style="align-items: flex-end; margin-bottom: 6pt; margin-top: 6pt;">
Navne
</p>
<p id="entryphone_apartment" class="template" style="align-items: flex-start; margin-top: 12pt; ">
Lejlighed
</p>
<br />
</div>
</div>
<br />
<form>
<label for="name_sign_updater">Navne:</label>
<input type="text" id="name_sign_updater"><br><br>
<label for="apartment_sign_updater">Lejlighed:</label>
<input type="text" id="apartment_sign_updater">
</form>
<button type="button" onclick="UpdateTemplate(document.getElementById('name_sign_updater').value, document.getElementById('apartment_sign_updater').value)">Opdater skilt</button>
<button type="button" onclick="Print()">Print</button>
</body>
</html>