added photo functionality

This commit is contained in:
2025-03-28 08:40:59 +01:00
parent 8cad59e3d6
commit f8388bc81b
49 changed files with 2209 additions and 26 deletions
+5 -16
View File
@@ -51,9 +51,7 @@ error_log("Loaded template: " . print_r($template, true));
text-align: left;
border: 1px solid #dee2e6;
min-width: 100px;
/* Larghezza minima per tutte le colonne */
max-width: 200px;
/* Larghezza massima iniziale */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@@ -62,7 +60,6 @@ error_log("Loaded template: " . print_r($template, true));
.table th:first-child,
.table td:first-child {
min-width: 50px;
/* Colonna "Seleziona" più stretta */
max-width: 50px;
}
@@ -73,7 +70,6 @@ error_log("Loaded template: " . print_r($template, true));
user-select: none;
}
/* Handle di ridimensionamento */
.table th .resize-handle {
position: absolute;
top: 0;
@@ -199,16 +195,7 @@ error_log("Loaded template: " . print_r($template, true));
method: 'POST',
body: formData
})
.then(response => {
return response.text().then(text => {
console.log('Risposta grezza:', text);
try {
return JSON.parse(text);
} catch (e) {
throw new Error('Risposta non valida: ' + text);
}
});
})
.then(response => response.json())
.then(data => {
loader.style.display = 'none';
if (data.error) {
@@ -218,6 +205,9 @@ error_log("Loaded template: " . print_r($template, true));
let html = `
<form id="selectRowsForm" action="import_edit.php" method="POST">
<input type="hidden" name="template_id" value="${data.template_id}">
<input type="hidden" name="columns" value='${JSON.stringify(data.columns)}'>
<input type="hidden" name="rows" value='${JSON.stringify(data.rows)}'>
<input type="hidden" name="filename" value="${data.filename}">
<div class="search-container">
<input type="text" id="searchInput" class="form-control" placeholder="Cerca nelle righe...">
</div>
@@ -256,12 +246,11 @@ error_log("Loaded template: " . print_r($template, true));
const startWidth = th.offsetWidth;
const onMouseMove = (e) => {
const newWidth = Math.max(50, startWidth + (e.clientX - startX)); // Min 50px
const newWidth = Math.max(50, startWidth + (e.clientX - startX));
th.style.width = `${newWidth}px`;
th.style.minWidth = `${newWidth}px`;
th.style.maxWidth = `${newWidth}px`;
// Aggiorna anche le celle della colonna corrispondente
const cells = document.querySelectorAll(`.table td:nth-child(${index + 1})`);
cells.forEach(cell => {
cell.style.width = `${newWidth}px`;