|
|
- <!DOCTYPE html>
- <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
-
- <title>Upload New CSV</title>
-
- <!-- Fonts -->
- <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap" rel="stylesheet">
-
- <link rel="stylesheet" type="text/css" href="{{ asset('css/csv-upload.css') }}">
-
- <script>
- document.addEventListener('DOMContentLoaded', function() {
- document.getElementById('file-input').onchange = function () {
- document.getElementById('file-input-label').textContent = document.getElementById('file-input').files[0].name;
- }
- }, false);
- </script>
-
- </head>
- <body class="antialiased">
- <div id="demo">
- <h1>Upload New CSV</h1>
- <h2>CSV parser</h2>
-
- <form action="{{route('fileUpload')}}" method="post" enctype="multipart/form-data">
- @csrf
- @if (count($errors) > 0)
- <div>
- <ul>
- @foreach ($errors->all() as $error)
- <li>{{ $error }}</li>
- @endforeach
- </ul>
- </div>
- @endif
-
-
- <div class="file-uploader">
- <label id="file-input-label" for="file-input">Select your file</label>
- <input id="file-input" type="file" name="file"/>
- </div>
- <button type="submit" name="submit">Upload Files</button>
- </form>
-
- @if ($results = Session::get('results'))
- <h2>Bank Transactions from CSV</h2>
- <div class="table-responsive-vertical shadow-z-1">
-
- <table id="table" class="table table-hover table-mc-light-blue">
- @foreach ($results as $index => $row)
- <tr>
- @foreach ($row as $column)
- @if ($index === 0)
- <th>{{ $column }}</th>
- @break
- @endif
-
- <td>{{ $column }}</td>
-
- @endforeach
- </tr>
- @endforeach
- <table>
- </div>
- @endif
- </div>
- </body>
- </html>
|