@php use App\Http\Controllers\FacultyController; @endphp @extends('layouts.master') @section('title', 'Import Faculty Member') @section('style') @endsection @section('script') @endsection @section('content') @include('layouts.header') @include('layouts.title')
Import Faculty Member
{{-- Add --}}
{{ csrf_field() }}
File Import :
(.xlsx only)

@if(!empty($data)) @php $error_array = []; @endphp {{-- ========================================== --}} {{-- ตรวจ Error ของแต่ละแถวจาก excel_faculty --}} {{-- ========================================== --}} @foreach($data as $new_data) @if(!empty($new_data->errors)) @foreach($new_data->errors as $error) @php $error_array[] = $error; @endphp @endforeach @endif @endforeach {{-- ========================================== --}} {{-- ถ้าไม่มี Error แสดงปุ่ม Import --}} {{-- ========================================== --}} @if(count($error_array) == 0) @else

@php $error_array = array_unique($error_array); @endphp @foreach($error_array as $error)
  • {{ $error }}
  • @endforeach @endif @endif

    @if (isset($show))
    @if (!empty($data)) @foreach($data as $key => $new_data) {{-- ========================================== --}} {{-- School --}} {{-- ========================================== --}} {{-- ========================================== --}} {{-- Program --}} {{-- ========================================== --}} {{-- ========================================== --}} {{-- Position --}} {{-- ========================================== --}} @endforeach @endif
    No. Staff ID Title First Name Last Name E-mail School Program Position (Optional)
    {{ $key + 1 }} {{ $new_data->faculty_code }} {{ $new_data->faculty_title }} {{ $new_data->faculty_firstname }} {{ $new_data->faculty_lastname }} {{ $new_data->faculty_email }} @if(isset($new_data->errors['school'])) {{ $new_data->faculty_school }} @else {{ $new_data->faculty_school }} @endif @if(isset($new_data->errors['program'])) {{ $new_data->faculty_program }} @else @if(!empty($new_data->faculty_program_names)) @foreach($new_data->faculty_program_names as $programName) {{ $programName }} @endforeach @else - @endif @endif @if(isset($new_data->errors['position'])) {{ $new_data->faculty_position }} @else {{ $new_data->faculty_position ?: '-' }} @endif
    @endif
    @include('layouts.footer') @endsection