added time field
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -26,6 +26,14 @@ $stmt = $pdo->prepare("SELECT id, excel_column, data_type, is_required, manual_d
|
|||||||
$stmt->execute([$template_id]);
|
$stmt->execute([$template_id]);
|
||||||
$allMappings = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$allMappings = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
$timeLabels = [
|
||||||
|
'Sample Arrival Time:',
|
||||||
|
'Sample Unlock Time:',
|
||||||
|
'Login Time:',
|
||||||
|
'Presa in carico, Orario:',
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
if (empty($allMappings)) {
|
if (empty($allMappings)) {
|
||||||
header("Location: import_xls.php?id=$template_id&status=error&message=" . urlencode("Nessun mapping trovato per il template"));
|
header("Location: import_xls.php?id=$template_id&status=error&message=" . urlencode("Nessun mapping trovato per il template"));
|
||||||
exit;
|
exit;
|
||||||
@@ -155,6 +163,12 @@ function fixedDefaultValue(array $f): string
|
|||||||
background-color: #f8d7da;
|
background-color: #f8d7da;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input.required-input,
|
||||||
|
select.required-input {
|
||||||
|
background-color: #f8d7da;
|
||||||
|
border-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
input,
|
input,
|
||||||
select,
|
select,
|
||||||
textarea {
|
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' : '') . ">";
|
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') {
|
} elseif ($mapping['data_type'] === 'INT') {
|
||||||
echo "<input type='number' class='custom-field $inputClass' data-column='manual_$manualIndex' value='" . htmlspecialchars($fieldValue) . "' " . ($mapping['is_required'] ? 'required' : '') . ">";
|
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 {
|
} else {
|
||||||
echo "<input type='text' class='custom-field $inputClass' data-column='manual_$manualIndex' value='" . htmlspecialchars($fieldValue) . "' " . ($mapping['is_required'] ? 'required' : '') . ">";
|
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' : '') . ">";
|
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') {
|
} 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' : '') . ">";
|
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 {
|
} else {
|
||||||
echo "<input type='text' name='rows[$index][details][{$mapping['id']}][field_value]' value='" . htmlspecialchars($fieldValue) . "' class='cell-input $inputClass' " . ($mapping['is_required'] ? 'required' : '') . ">";
|
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' : '') . ">";
|
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') {
|
} 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' : '') . ">";
|
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 {
|
} else {
|
||||||
echo "<input type='text' name='rows[$index][details][{$mapping['id']}][field_value]' value='" . htmlspecialchars($fieldValue) . "' class='cell-input $inputClass' " . ($mapping['is_required'] ? 'required' : '') . ">";
|
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);
|
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() {
|
$(document).on("click", ".export-lims-btn", function() {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -870,6 +870,12 @@
|
|||||||
"ConteggioClienti": 0,
|
"ConteggioClienti": 0,
|
||||||
"Nome": "CARHARTT ( provvisiorio in revisione)",
|
"Nome": "CARHARTT ( provvisiorio in revisione)",
|
||||||
"Descrizione": "Schema per tutti i campioni CARHARTT provvissorio\r\n\r\n"
|
"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"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user