{% extends "base.html" %} {% block title %}Admin Panel - Delphi Database{% endblock %} {% block content %}

Admin Panel

{% if error %} {% endif %} {% if show_upload_results %} {% endif %} {% if show_import_results %} {% endif %}
File Upload
Supported formats: ROLODEX, PHONE, FILES, LEDGER, PAYMENTS, DEPOSITS, QDROS, PENSIONS, PLANINFO, TRNSTYPE, TRNSLKUP, FOOTERS, FILESTAT, EMPLOYEE, GRUPLKUP, FILETYPE, and all related tables (*.csv)
{% if upload_results %}
Upload Results
{% for result in upload_results %} {% endfor %}
Original Filename Stored Filename Import Type Size Status
{{ result.filename }}
Original name
{{ result.stored_filename }}
Stored as
{{ result.import_type }} {{ result.size }} bytes Uploaded
Ready for Import

Files have been uploaded and validated. Use the import section below to process the data.

{% endif %} {% if upload_errors %}
Upload Errors
    {% for error in upload_errors %}
  • {{ error }}
  • {% endfor %}
{% endif %} {% if table_counts %}
Database Status - Imported Data

View record counts for all tables to track import progress:

Reference Tables
{% for table_name, count in table_counts.reference.items() %} {% endfor %}
Table Records
{{ table_name }} {% if count > 0 %} {% endif %} {{ "{:,}".format(count) }}
Core Data Tables
{% for table_name, count in table_counts.core.items() %} {% endfor %}
Table Records
{{ table_name }} {% if count > 0 %} {% endif %} {{ "{:,}".format(count) }}
Specialized Tables
{% for table_name, count in table_counts.specialized.items() %} {% endfor %}
Table Records
{{ table_name }} {% if count > 0 %} {% endif %} {{ "{:,}".format(count) }}
Modern Models
{% for table_name, count in table_counts.modern.items() %} {% endfor %}
Table Records
{{ table_name }} {% if count > 0 %} {% endif %} {{ "{:,}".format(count) }}
Legend: Green = Has data imported | Gray = No data yet | = Table populated
{% endif %}
Import Order Guide

For best results, import tables in this recommended order:

Reference Tables (Import First)
  • TRNSTYPE
  • TRNSLKUP
  • FOOTERS
  • FILESTAT
  • EMPLOYEE
  • GRUPLKUP
  • FILETYPE
  • FVARLKUP, RVARLKUP
Core Data Tables
  • ROLODEX
  • PHONE, ROLEX_V
  • FILES (+ FILES_R, FILES_V, FILENOTS)
  • LEDGER
  • DEPOSITS, PAYMENTS
  • PLANINFO
  • QDROS, PENSIONS (+ related tables)
Important: Reference tables must be imported before core data to avoid foreign key errors.
Sync to Modern Models

After importing legacy CSV data, sync it to the simplified modern application models (Client, Phone, Case, Transaction, Payment, Document).

{% if show_sync_results and sync_results %}
Sync Results

{{ total_synced or 0 }}

Records Synced

{{ total_skipped or 0 }}

Records Skipped

{{ total_sync_errors or 0 }}

Errors
Detailed Results by Table:
{% for table_name, result in sync_results.items() %} {% if result.errors %} {% endif %} {% endfor %}
Modern Table Synced Skipped Errors
{{ table_name.title() }} {{ result.success }} {{ result.skipped }} {{ result.errors|length }}
View Errors ({{ result.errors|length }})
    {% for error in result.errors[:10] %}
  • {{ error }}
  • {% endfor %} {% if result.errors|length > 10 %}
  • ... and {{ result.errors|length - 10 }} more errors
  • {% endif %}
{% endif %}
Data Import
{% if files_by_type %}
{% for import_type, files in files_by_type.items() %}
{{ import_type.title() }} Data {{ files|length }}
{% if import_type == 'unknown' and valid_import_types %}
{% endif %}
{% for file in files %} {% endfor %}
{% endfor %}
{% else %}
No CSV files available for import. Upload files first.
{% endif %}
{% if import_results %}
Import Results

{{ total_success }}

Successful

{{ total_errors }}

Errors

{{ import_results|length }}

Files

{{ total_success + total_errors }}

Total Records
{% for result in import_results %} {% endfor %}
Filename Status Total Rows Success Errors Details
{{ result.filename }} {% if result.status == 'success' %} Success {% else %} Error {% endif %} {{ result.total_rows }} {{ result.success_count }} {{ result.error_count }} {% if result.errors %}
    {% for error in result.errors %}
  • {{ error }}
  • {% endfor %}
{% else %} No errors {% endif %}
{% endif %} {% if recent_imports %}
Recent Import History
{% for import_log in recent_imports %} {% endfor %}
Date/Time Type File Status Records Success Errors
{{ import_log.created_at.strftime('%Y-%m-%d %H:%M') }} {{ import_log.import_type }} {{ import_log.file_name }} {% if import_log.status == 'completed' %} Completed {% elif import_log.status == 'failed' %} Failed {% elif import_log.status == 'running' %} Running {% else %} {{ import_log.status }} {% endif %} {{ import_log.total_rows }} {{ import_log.success_count }} {{ import_log.error_count }}
{% endif %}
{% endblock %}