diff --git a/public/userarea/edit_template_xls.php b/public/userarea/edit_template_xls.php index 503cf0e..68a7658 100644 --- a/public/userarea/edit_template_xls.php +++ b/public/userarea/edit_template_xls.php @@ -20,17 +20,10 @@ if (!$template) { exit; } -// Debug del JSON -$clientSpecificFieldsJson = $template['client_specific_fields'] ?? '{}'; -error_log("Raw client_specific_fields JSON: " . $clientSpecificFieldsJson); - -$clientSpecificFields = json_decode($clientSpecificFieldsJson, true); -if (json_last_error() !== JSON_ERROR_NONE) { - error_log("JSON decode error: " . json_last_error_msg()); - $clientSpecificFields = []; -} else { - error_log("Decoded client_specific_fields: " . print_r($clientSpecificFields, true)); -} +// Recupera tutte le routine dal database +$stmt = $pdo->prepare("SELECT * FROM routine"); +$stmt->execute(); +$routines = $stmt->fetchAll(PDO::FETCH_ASSOC); ?> @@ -41,28 +34,9 @@ if (json_last_error() !== JSON_ERROR_NONE) { - + + + Edit Template <?= htmlspecialchars($titlewebsite, ENT_QUOTES, 'UTF-8'); ?> @@ -82,7 +56,7 @@ if (json_last_error() !== JSON_ERROR_NONE) { @@ -124,96 +98,43 @@ if (json_last_error() !== JSON_ERROR_NONE) { - +
- +
- +
- - - -
-
Field Name
-
Type
-
Possible Values
-
Required
-
Export Column Name
-
Default Value
-
Actions
+ + + - -
- $fieldData) { - if (is_array($fieldData)) { - $type = $fieldData['type'] ?? 'text'; - $possibleValues = implode(', ', $fieldData['possible_values'] ?? []); - $isRequired = isset($fieldData['is_required']) && $fieldData['is_required'] ? '1' : '0'; - $exportColumnName = $fieldData['export_column_name'] ?? ''; - $defaultValue = $fieldData['default_value'] ?? ''; - ?> -
-
-
- -
-
- -
- -
- -
-
- -
-
- -
-
- -
-
-
- -
- -
-
Cancel @@ -223,132 +144,78 @@ if (json_last_error() !== JSON_ERROR_NONE) {
- -
- - - - - - - - - - - - - - - - -