-
Notifications
You must be signed in to change notification settings - Fork 0
/
PresaInCaricoProdotti.html
309 lines (276 loc) · 16.8 KB
/
PresaInCaricoProdotti.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style-index.css">
<title>Sezione Presa in Carico</title>
</head>
<body>
<header>
<img src="assistenza-tecnica-riparazioni-cellulare.jpg">
</header>
<!-- Navbar -->
<div class="container">
<div class="nav">
<div class="navbar">
<a id="homeNav" href="index.html">Home</a>
<a href="#" class="it" style="color: black;">Stato Dispositivi</a>
<a href="#" class="en" style="color: black;">Devices Status</a>
<a id="info-device-it" class="it" href="gestioneriparazione.html">Info Dispositivo</a>
<a id="info-device-en" class="en" href="gestioneriparazione.html">Info Device</a>
</div>
</div>
</div>
<div class="lang-btn">
<button id="italianButton" onclick="changeLanguage('it')" class="active">Italiano</button>
<button id="englishButton" onclick="changeLanguage('en')">English</button>
</div>
<div class="dashboard">
<h1 class="it">Dispositivi in attesa di riparazione</h1>
<h1 class="en">Devices waiting to be repaired</h1>
<input type="text" id="searchInput" placeholder="Cerca per numero di serie o nome cliente">
<select id="statusFilter">
<option value="">Scegli uno stato</option>
<option value="tutti">Tutti gli stati</option>
<option value="in_attesa">In attesa di diagnosi</option>
<option value="in_riparazione">In riparazione</option>
<option value="pronto">Pronto per il ritiro</option>
</select>
<div id="productList">
<!-- Qui verranno visualizzati dinamicamente i prodotti -->
</div>
</div>
<script>
var italian = true;
// Esempio di dati dei prodotti (sostituire con i dati dal backend)
const products = [
{ serialNumber: 'XYZ', customerName: 'Mario Rossi', status: 'in_attesa', statusEn: 'waiting' },
{ serialNumber: 'ZYX', customerName: 'Luca Bianchi', status: 'in_riparazione', statusEn: 'under_repair' },
{ serialNumber: 'YXZ', customerName: 'Anna Verdi', status: 'pronto', statusEn: 'ready' },
];
// Funzione per visualizzare i prodotti nella pagina
function displayProducts(products) {
var productList = document.getElementById('productList');
productList.innerHTML = '';
products.forEach(product => {
var productElement = document.createElement('div');
productElement.classList.add('product');
if (italian) {
productElement.innerHTML = `<p id="srlNum" style="margin:-5px 0px;"><strong >Numero di Serie:</strong>${product.serialNumber}</p><br>
<p id="custName" style="margin:-5px 0px;"><strong>Nome Cliente:</strong>${product.customerName}</p><br>
<p id="prdStatus" style="margin:-5px 0px;"><strong>Stato:</strong>${product.status}</p>
`;
} else {
productElement.innerHTML = `<p style="margin:-5px 0px;"><strong>Serial Number:</strong>${product.serialNumber}</p><br>
<p style="margin:-5px 0px;"><strong>Customer Name:</strong>${product.customerName}</p><br>
<p style="margin:-5px 0px;"><strong>Status:</strong>${product.statusEn}</p><br>
`;
}
productList.appendChild(productElement);
});
}
// Mostra tutti i prodotti inizialmente
//displayProducts(products);
// Aggiungi event listener per la ricerca e il filtraggio
document.getElementById('searchInput').addEventListener('input', function () {
var searchKeyword = this.value.toLowerCase();
var filteredProducts = products.filter(product =>
product.serialNumber.toLowerCase().includes(searchKeyword) ||
product.customerName.toLowerCase().includes(searchKeyword)
);
displayProducts(filteredProducts);
});
document.getElementById('statusFilter').addEventListener('change', function () {
var selectedStatus = this.value;
if (selectedStatus === 'tutti') {
displayProducts(products);
} else {
var filteredProducts = products.filter(product => product.status === selectedStatus);
displayProducts(filteredProducts);
}
});
function changeLanguage(lang) {
var elementsEn = document.querySelectorAll(".en");
var elementsIt = document.querySelectorAll(".it");
var buttonsEn = document.querySelectorAll(".en-btn");
var buttonsIt = document.querySelectorAll(".it-btn");
var selector = document.getElementById("statusFilter");
if (lang === 'en') {
italian = false;
elementsEn.forEach(function (el) {
el.style.display = "block";
});
elementsIt.forEach(function (el) {
el.style.display = "none";
});
buttonsEn.forEach(function (el) {
el.style.display = "inline-block";
});
buttonsIt.forEach(function (el) {
el.style.display = "none";
});
document.getElementById('italianButton').classList.remove('active');
document.getElementById('englishButton').classList.add('active');
document.getElementById("searchInput").placeholder = "Look for serial number or customer name:";
selector.options[0].text = "Choose a status";
selector.options[1].text = "All statuses";
selector.options[2].text = "Waiting for diagnosis";
selector.options[3].text = "Under repair";
selector.options[4].text = "Ready to be collected";
//document.getElementById("srlNum").innerHTML = "Serial Number";
displayProducts(products);
selector.selectedIndex = 0;
var productList = document.getElementById('productList');
productList.innerHTML = '';
} else {
italian = true;
elementsEn.forEach(function (el) {
el.style.display = "none";
});
elementsIt.forEach(function (el) {
el.style.display = "block";
});
buttonsEn.forEach(function (el) {
el.style.display = "none";
});
buttonsIt.forEach(function (el) {
el.style.display = "inline-block";
});
document.getElementById('italianButton').classList.add('active');
document.getElementById('englishButton').classList.remove('active');
document.getElementById("searchInput").placeholder = "Cerca per numero di serie o nome cliente";
selector.options[0].text = "Scegli uno stato";
selector.options[1].text = "Tutti gli stati";
selector.options[2].text = "In attesa di diagnosi";
selector.options[3].text = "In riparazione";
selector.options[4].text = "Pronto per il ritiro";
displayProducts(products);
selector.selectedIndex = 0;
var productList = document.getElementById('productList');
productList.innerHTML = '';
}
}
function navigateToPage(page) {
const codedSelectedLang = encodeURIComponent(italian ? 'it' : 'en');
const urlDestination = page + "?testo=" + codedSelectedLang;
window.location.href = urlDestination;
}
document.getElementById('homeNav').addEventListener('click', function () {
navigateToPage("index.html");
event.preventDefault();
});
document.getElementById('info-device-it').addEventListener('click', function () {
navigateToPage("gestioneriparazione.html");
event.preventDefault();
});
document.getElementById('info-device-en').addEventListener('click', function () {
navigateToPage("gestioneriparazione.html");
event.preventDefault();
});
//receiving the preferred language from another page and decodifying it, then adapting the language buttons so that the button corresponding to the preferred language will appear active
// Function to retrieve language parameter from the URL
function getLanguageFromURL() {
const params = new URLSearchParams(window.location.search);
return params.get("testo");
}
// Function to set the active state for language buttons
function setActiveLanguage() {
const language = getLanguageFromURL();
if (language === 'en') {
document.getElementById('italianButton').classList.remove('active');
document.getElementById('englishButton').classList.add('active');
italian = false;
changeLanguage('en');
} else {
document.getElementById('italianButton').classList.add('active');
document.getElementById('englishButton').classList.remove('active');
italian = true;
changeLanguage('it');
}
}
// Call the function when the page loads
document.addEventListener('DOMContentLoaded', function () {
setActiveLanguage();
});
</script>
<footer>
<div class="footers-container">
<div class="footers">
<div class="svg-icon">
<svg style="color: white" xmlns="http://www.w3.org/2000/svg" width="26" height="26"
fill="currentColor" class="bi bi-facebook" viewBox="0 0 16 16">
<path
d="M16 8.049c0-4.446-3.582-8.05-8-8.05C3.58 0-.002 3.603-.002 8.05c0 4.017 2.926 7.347 6.75 7.951v-5.625h-2.03V8.05H6.75V6.275c0-2.017 1.195-3.131 3.022-3.131.876 0 1.791.157 1.791.157v1.98h-1.009c-.993 0-1.303.621-1.303 1.258v1.51h2.218l-.354 2.326H9.25V16c3.824-.604 6.75-3.934 6.75-7.951z"
fill="white"></path>
</svg>
</div>
<div class="icons-text">
<a href="#">facebook</a>
<p>CellTechLab</p>
</div>
</div>
<div class="footers">
<div class="svg-icon">
<svg style="color: white" xmlns="http://www.w3.org/2000/svg" width="24" height="24"
fill="currentColor" class="bi bi-instagram" viewBox="0 0 16 16">
<path
d="M8 0C5.829 0 5.556.01 4.703.048 3.85.088 3.269.222 2.76.42a3.917 3.917 0 0 0-1.417.923A3.927 3.927 0 0 0 .42 2.76C.222 3.268.087 3.85.048 4.7.01 5.555 0 5.827 0 8.001c0 2.172.01 2.444.048 3.297.04.852.174 1.433.372 1.942.205.526.478.972.923 1.417.444.445.89.719 1.416.923.51.198 1.09.333 1.942.372C5.555 15.99 5.827 16 8 16s2.444-.01 3.298-.048c.851-.04 1.434-.174 1.943-.372a3.916 3.916 0 0 0 1.416-.923c.445-.445.718-.891.923-1.417.197-.509.332-1.09.372-1.942C15.99 10.445 16 10.173 16 8s-.01-2.445-.048-3.299c-.04-.851-.175-1.433-.372-1.941a3.926 3.926 0 0 0-.923-1.417A3.911 3.911 0 0 0 13.24.42c-.51-.198-1.092-.333-1.943-.372C10.443.01 10.172 0 7.998 0h.003zm-.717 1.442h.718c2.136 0 2.389.007 3.232.046.78.035 1.204.166 1.486.275.373.145.64.319.92.599.28.28.453.546.598.92.11.281.24.705.275 1.485.039.843.047 1.096.047 3.231s-.008 2.389-.047 3.232c-.035.78-.166 1.203-.275 1.485a2.47 2.47 0 0 1-.599.919c-.28.28-.546.453-.92.598-.28.11-.704.24-1.485.276-.843.038-1.096.047-3.232.047s-2.39-.009-3.233-.047c-.78-.036-1.203-.166-1.485-.276a2.478 2.478 0 0 1-.92-.598 2.48 2.48 0 0 1-.6-.92c-.109-.281-.24-.705-.275-1.485-.038-.843-.046-1.096-.046-3.233 0-2.136.008-2.388.046-3.231.036-.78.166-1.204.276-1.486.145-.373.319-.64.599-.92.28-.28.546-.453.92-.598.282-.11.705-.24 1.485-.276.738-.034 1.024-.044 2.515-.045v.002zm4.988 1.328a.96.96 0 1 0 0 1.92.96.96 0 0 0 0-1.92zm-4.27 1.122a4.109 4.109 0 1 0 0 8.217 4.109 4.109 0 0 0 0-8.217zm0 1.441a2.667 2.667 0 1 1 0 5.334 2.667 2.667 0 0 1 0-5.334z"
fill="white"></path>
</svg>
</div>
<div class="icons-text">
<a href="#">Instagram</a>
<p>Cell_Tech_Lab</p>
</div>
</div>
<div class="footers">
<div class="svg-icon">
<svg style="color: white" xmlns="http://www.w3.org/2000/svg" width="24" height="24"
fill="currentColor" class="bi bi-whatsapp" viewBox="0 0 16 16">
<path
d="M13.601 2.326A7.854 7.854 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.933 7.933 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.898 7.898 0 0 0 13.6 2.326zM7.994 14.521a6.573 6.573 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.557 6.557 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592zm3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.729.729 0 0 0-.529.247c-.182.198-.691.677-.691 1.654 0 .977.71 1.916.81 2.049.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232z"
fill="white"></path>
</svg>
</div>
<div class="icons-text">
<a href="#">WhatsApp</a>
<p>333 444555</p>
</div>
</div>
<div class="footers">
<div class="svg-icon">
<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" fill="white" stroke="white"
viewBox="0 0 512 512">
<!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.-->
<path
d="M64 112c-8.8 0-16 7.2-16 16v22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1V128c0-8.8-7.2-16-16-16H64zM48 212.2V384c0 8.8 7.2 16 16 16H448c8.8 0 16-7.2 16-16V212.2L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64H448c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z" />
</svg>
</div>
<div class="icons-text">
<a href="#">Email</a>
<p>info@celltechlab.com</p>
</div>
</div>
<div class="footers">
<div class="svg-icon">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="feather feather-map-pin">
<path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path>
<circle cx="12" cy="10" r="3"></circle>
</svg>
</div>
<div class="icons-text">
<a href="#">Address</a>
<p>Città Bella, Via degli </p>
<p style="margin-top: -6px;">Sviluppatori, N°1</p>
</div>
</div>
</div>
</footer>
<div class="lastPart">
<p>Cell Tech Lab Copyright 2023 All Rights Reserved - Privacy Policy </p>
</div>
</body>
</html>