Configure Template:
Client: | Schema: | Header Row: | Start Column:
Schema Fields Configuration
| Title | ID | Type | Mapping | Default Value | Action |
|---|---|---|---|---|---|
getConnection(); $stmt = $pdo->prepare("SELECT name, header_row, start_column, target_table, sample_xlsx, idclient, clientname, idschema, schemaname, schemajson FROM excel_templates WHERE id = ?"); $stmt->execute([$id]); $template = $stmt->fetch(PDO::FETCH_ASSOC); if (!$template) { die("Template not found"); } $clientName = $template['clientname'] ?: ''; $schemaName = $template['schemaname'] ?: ''; $schemajson = $template['schemajson'] ? json_decode($template['schemajson'], true) : []; $isSchemajsonEmpty = empty(trim($template['schemajson'])); // Recupera i campi dalla tabella template_mapping $stmt = $pdo->prepare("SELECT id, field_id, excel_column, is_manual, manual_default, data_type, is_required, default_value, has_list, length, decimals, min_value, max_value, default_curr_date, tablename, field_label FROM template_mapping WHERE template_id = ?"); $stmt->execute([$id]); $mappings = $stmt->fetchAll(PDO::FETCH_ASSOC); ?>