@php use App\Http\Controllers\StudentController; use Carbon\Carbon; @endphp @extends('layouts.master') @section('title', 'Import Student') @section('style') @endsection @section('script') @endsection @section('content') @include('layouts.header') {{--

Import Student

--}} @include('layouts.title')
Import Student
{{-- Add --}}
{{ csrf_field() }}
File Import :
(.xlsx only)

@if (!empty($data)) @php $error_array = array() @endphp @foreach ($data as $key => $new_data) @if (StudentController::check_type(trim($new_data->student_typeofdebtor)) == 0) @php $error_array[] = 'Check the name of Type.' @endphp @endif @if (StudentController::check_curriculum(trim($new_data->student_curriculum)) == 0) @php $error_array[] = 'Check the name of curriculum.' @endphp @endif @if (StudentController::check_schools(trim($new_data->student_school)) == 0) @php $error_array[] = 'Check the name of School.' @endphp @endif @if (StudentController::check_nationality(trim($new_data->student_nationality)) == 0) @php $error_array[] = 'Check the name of Nationality.' @endphp @endif @if (StudentController::check_advisor(trim($new_data->student_advisor)) == 0) @php $error_array[] = 'Check the name of Advisor.' @endphp @endif @if (StudentController::check_academicstatus(trim($new_data->student_academic_status)) == 0) @php $error_array[] = 'Check the name of Academicstatus.' @endphp @endif @if (StudentController::check_start_year(trim($new_data->student_scholarshipstartdate)) == 0) @php $error_array[] = 'Check the Year.' @endphp @endif @if (StudentController::check_end_year(trim($new_data->student_scholarshipenddate)) == 0) @php $error_array[] = 'Check the Year.' @endphp @endif @if (StudentController::check_scholarshipprogram(trim($new_data->student_scholarshipprogram), $new_data->student_typeofdebtor) == 0) @php $error_array[] = 'Check the name of Scholarship Program.' @endphp @endif @if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $new_data->student_enddateofstudentstatussiit)) @php $error_array[] = 'Check the date of End Date of Student Status (Exec. SIIT).' @endphp @endif @if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $new_data->student_enddateofstudentstatus)) @php $error_array[] = 'Check the date of End Date of Student Status (TU).' @endphp @endif @if (!is_numeric($new_data->student_theoutstandingbalance)) @php $error_array[] = 'Outstanding Balance must be a number.' @endphp @endif @endforeach @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) @endforeach @endif
    No. Student ID Name Nationality Degree Curriculum School Scholarship Start Date Start Semester Scholarship End Date End Semester Advisor Academic Status End Date of Student Status (Exec. SIIT) End Date of Student Status (TU) Type of Debtor Scholarship Program Agreement No. Agreement Date Guarantor First Name Guarantor Last Name Guarantor E-mail Debt Status The Outstanding Balance (THB) Due Date of the Outstanding Balance Payment Remark
    {{ ++$key }} {{ $new_data->student_code }} {{ $new_data->student_firstname }} {{ $new_data->student_lastname }} @if (StudentController::check_nationality(trim($new_data->student_nationality)) == 0) {{ $new_data->student_nationality }} @else {{ $new_data->student_nationality }} @endif {{ $new_data->student_degree }} @if (StudentController::check_curriculum(trim($new_data->student_curriculum)) == 0) {{ $new_data->student_curriculum }} @else {{ $new_data->student_curriculum }} @endif @if (StudentController::check_schools(trim($new_data->student_school)) == 0) {{ $new_data->student_school }} @else {{ $new_data->student_school }} @endif @if (StudentController::check_start_year(trim($new_data->student_scholarshipstartdate)) == 0) {{ $new_data->student_scholarshipstartdate }} @else {{ $new_data->student_scholarshipstartdate }} @endif {{ $new_data->student_start_semester }} @if (StudentController::check_end_year(trim($new_data->student_scholarshipenddate)) == 0) {{ $new_data->student_scholarshipenddate }} @else {{ $new_data->student_scholarshipenddate }} @endif {{ $new_data->student_end_semester }} @if (StudentController::check_advisor(trim($new_data->student_advisor)) == 0) {{ trim($new_data->student_advisor) }} @else {{ trim($new_data->student_advisor) }} @endif @if (StudentController::check_academicstatus(trim($new_data->student_academic_status)) == 0) {{ $new_data->student_academic_status }} @else {{ $new_data->student_academic_status }} @endif {{ $new_data->student_enddateofstudentstatussiit }} {{ $new_data->student_enddateofstudentstatus }} @if (StudentController::check_type(trim($new_data->student_typeofdebtor)) == 0) {{ $new_data->student_typeofdebtor }} @else {{ $new_data->student_typeofdebtor }} @endif @if (trim($new_data->student_typeofdebtor) == 'Loan') @if (!empty($new_data->student_scholarshipprogram) || !empty($new_data->student_scholarshipstatus)) Invalid Scholarship Data for Loan Type @else - @endif @else @if (StudentController::check_scholarshipprogram(trim($new_data->student_scholarshipprogram), $new_data->student_typeofdebtor) == 0) {{ $new_data->student_scholarshipprogram }} @else {{ $new_data->student_scholarshipprogram }} @endif @endif {{ $new_data->student_agreementno }} {{ $new_data->student_agreementdate }} {{ $new_data->student_guarantor_firstname }} {{ $new_data->student_guarantor_lastname }} {{ $new_data->student_guarantor_email }} {{ $new_data->student_debtstatus }} student_theoutstandingbalance)) style="color: red" @endif> {{ is_numeric($new_data->student_theoutstandingbalance) ? number_format($new_data->student_theoutstandingbalance, 2) : $new_data->student_theoutstandingbalance }} {{ $new_data->student_duedate }} {{ $new_data->student_remark }}
    @endif
    @include('layouts.footer') @endsection