added time field

This commit is contained in:
Claudio 2026-02-18 09:34:26 +01:00
parent cd3bccd183
commit 74c9a1d02a
4 changed files with 35 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -26,6 +26,14 @@ $stmt = $pdo->prepare("SELECT id, excel_column, data_type, is_required, manual_d
$stmt->execute([$template_id]);
$allMappings = $stmt->fetchAll(PDO::FETCH_ASSOC);
$timeLabels = [
'Sample Arrival Time:',
'Sample Unlock Time:',
'Login Time:',
'Presa in carico, Orario:',
];
if (empty($allMappings)) {
header("Location: import_xls.php?id=$template_id&status=error&message=" . urlencode("Nessun mapping trovato per il template"));
exit;
@ -155,6 +163,12 @@ function fixedDefaultValue(array $f): string
background-color: #f8d7da;
}
input.required-input,
select.required-input {
background-color: #f8d7da;
border-color: transparent;
}
input,
select,
textarea {
@ -738,6 +752,8 @@ function fixedDefaultValue(array $f): string
echo "<input type='text' class='custom-field date-picker $inputClass' data-column='manual_$manualIndex' value='" . htmlspecialchars($fieldValue) . "' " . ($mapping['is_required'] ? 'required' : '') . ">";
} elseif ($mapping['data_type'] === 'INT') {
echo "<input type='number' class='custom-field $inputClass' data-column='manual_$manualIndex' value='" . htmlspecialchars($fieldValue) . "' " . ($mapping['is_required'] ? 'required' : '') . ">";
} elseif (in_array($mapping['field_label'], $timeLabels)) {
echo "<input type='time' class='custom-field $inputClass' data-column='manual_$manualIndex' value='" . htmlspecialchars($fieldValue) . "' " . ($mapping['is_required'] ? 'required' : '') . ">";
} else {
echo "<input type='text' class='custom-field $inputClass' data-column='manual_$manualIndex' value='" . htmlspecialchars($fieldValue) . "' " . ($mapping['is_required'] ? 'required' : '') . ">";
}
@ -964,6 +980,8 @@ function fixedDefaultValue(array $f): string
echo "<input type='text' name='rows[$index][details][{$mapping['id']}][field_value]' value='" . htmlspecialchars($fieldValue) . "' class='cell-input date-picker $inputClass' " . ($mapping['is_required'] ? 'required' : '') . ">";
} elseif ($mapping['data_type'] === 'INT') {
echo "<input type='number' name='rows[$index][details][{$mapping['id']}][field_value]' value='" . htmlspecialchars($fieldValue) . "' class='cell-input $inputClass' " . ($mapping['is_required'] ? 'required' : '') . ">";
} elseif (in_array($mapping['field_label'], $timeLabels)) {
echo "<input type='time' name='rows[$index][details][{$mapping['id']}][field_value]' value='" . htmlspecialchars($fieldValue) . "' class='cell-input $inputClass' " . ($mapping['is_required'] ? 'required' : '') . ">";
} else {
echo "<input type='text' name='rows[$index][details][{$mapping['id']}][field_value]' value='" . htmlspecialchars($fieldValue) . "' class='cell-input $inputClass' " . ($mapping['is_required'] ? 'required' : '') . ">";
}
@ -993,6 +1011,8 @@ function fixedDefaultValue(array $f): string
echo "<input type='text' name='rows[$index][details][{$mapping['id']}][field_value]' value='" . htmlspecialchars($fieldValue) . "' class='cell-input date-picker $inputClass' " . ($mapping['is_required'] ? 'required' : '') . ">";
} elseif ($mapping['data_type'] === 'INT') {
echo "<input type='number' name='rows[$index][details][{$mapping['id']}][field_value]' value='" . htmlspecialchars($fieldValue) . "' class='cell-input $inputClass' " . ($mapping['is_required'] ? 'required' : '') . ">";
} elseif (in_array($mapping['field_label'], $timeLabels)) {
echo "<input type='time' name='rows[$index][details][{$mapping['id']}][field_value]' value='" . htmlspecialchars($fieldValue) . "' class='cell-input $inputClass' " . ($mapping['is_required'] ? 'required' : '') . ">";
} else {
echo "<input type='text' name='rows[$index][details][{$mapping['id']}][field_value]' value='" . htmlspecialchars($fieldValue) . "' class='cell-input $inputClass' " . ($mapping['is_required'] ? 'required' : '') . ">";
}
@ -1153,6 +1173,13 @@ function fixedDefaultValue(array $f): string
instance.input.dispatchEvent(event);
}
});
flatpickr(".time-picker", {
enableTime: true,
noCalendar: true,
dateFormat: "H:i",
time_24hr: true,
allowInput: true
});
});
$(document).on("click", ".export-lims-btn", function() {

File diff suppressed because one or more lines are too long

View File

@ -870,6 +870,12 @@
"ConteggioClienti": 0,
"Nome": "CARHARTT ( provvisiorio in revisione)",
"Descrizione": "Schema per tutti i campioni CARHARTT provvissorio\r\n\r\n"
},
{
"IdSchemaCustomFields": 201,
"ConteggioClienti": 0,
"Nome": "ROSSIMODA",
"Descrizione": "Per tutti i campioni di ROSSIMODA\r\n\r\n"
}
]
}