@extends('layouts.demo10.base') @section('content') @can('view.import')
@php $sourceType = $activeSourceType ?? ($activeConnection->source_type ?? 'odk'); $isCsvImport = $sourceType === 'csv'; @endphp
{{ $isCsvImport ? 'CSV File' : 'ODKForm' }}
Generate Schema
Import

{{ $isCsvImport ? 'CSV Data Import' : 'ODK Data Import' }}

Project/{{ $currentProject->name ?? 'Projects' }}/Import

@can('process.import') @endcan
@csrf

{{ $isCsvImport ? 'Active CSV Connection' : 'Active ODK Connection' }}

@if($connections->count() > 0) @if($isCsvImport) {{ $connections->first()->file_name ?? basename($connections->first()->file_path ?? '') ?? 'CSV File' }} ({{ $connections->first()->project->name ?? 'N/A' }}) @else {{ $connections->first()->form_id }} ({{ $connections->first()->project->name ?? 'N/A' }}) @endif @else No active connection found @endif
@foreach($histories as $history) @endforeach
{{ $isCsvImport ? 'Source' : 'Form ID' }} Imported By Total Imports Schema File SQL File Imported At Status
@php $historyConnection = $history->odkConnection; $historySource = ($historyConnection?->source_type ?? 'odk') === 'csv' ? ($historyConnection?->file_name ?? 'CSV') : ($historyConnection?->form_id ?? 'Unknown'); @endphp {{ $historySource }} {{ $history->user?->name ?? 'N/A' }} {{ $history->total_imported }} {{ $history->schemaHistory ? basename($history->schemaHistory->schema_file) : 'N/A' }} @if($history->sql_file) Download SQL @else N/A @endif {{ $history->created_at->format('M d, Y') }} {{ ucfirst($history->status) }}
@else

Access Denied

You do not have permission to view this page.

@endcan

Importing Data

Please wait, we are importing data from ODK Central.

@endsection @section('scripts') @vite('resources/js/ImportDataset/import-dataset.js') @endsection