@extends('admin.index')
@section('content')

<section class="app-user-view-security">
      <div class="row" id="table-contextual">
        <!-- User Sidebar -->
          <div class="col-4">
            <!-- User Card -->
            <div class="card">
                <div class="card-body">
                    </br>
                    <h4 class="fw-bolder border-bottom pb-50 mb-1">
                       <i class="fas -duotone fa-address-card"></i>
                        {{trans('general.stduent_data')}}</h4>
                    <div class="info-container">
                        <ul class="list-unstyled">
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.name') }}:</span>
                                <span>{{$student->first_name. ' ' .$student->last_name}}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.gender') }}:</span>
                                <span>{{ trans('general.'.$student->gender) }}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.nationality') }}:</span>
                                @foreach($nationalities as $nationality)
                                @if(in_array($nationality->id, $studentNationalitiesIDs))
                                <span>{{ $nationality->title }}</span>,
                                @endif
                                @endforeach
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.birth_place') }}:</span>
                                <span>{{$student->birth_place}}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.birth_date') }}:</span>
                                <span>{{$student->birth_date}}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.religion') }}:</span>
                                <span>{{ $religion->name }}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.phone') }}:</span>
                                <span>{{$student->phone}}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.telephone') }}:</span>
                                <span>{{$student->telephone}}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{trans('general.stage')}}:</span>
                                <span>{{ $stage->title }}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{trans('general.level')}}:</span>
                                <span>{{ $level->title }}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{trans('general.division')}}:</span>
                                <span>{{ $division->title }}</span>
                            </li>

                        </ul>
                    </div></br> 
                    <h4 class="fw-bolder border-bottom pb-50 mb-1">
                  <i class="fas -thin fa-address-book"></i>
                        {{trans('general.student_parents_info')}}</h4>
                    <div class="info-container">
                        <ul class="list-unstyled">

                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.mother') }}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.name') }}:</span>
                                <span>{{ $mother->first_name .' '. $mother->last_name }}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.job') }}:</span>
                                <span>{{$mother->job}}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.phone') }}:</span>
                                <span>{{ $mother->phone }}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.father') }}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.name') }}:</span>
                                <span>{{ $father->first_name .' '. $father->last_name }}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.job') }}:</span>
                                <span>{{$father->job}}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.phone') }}:</span>
                                <span>{{ $father->phone }}</span>
                            </li>

                        </ul>
                    </div></br>
                    <h4 class="fw-bolder border-bottom pb-50 mb-1">
                      <i class="fas -duotone fa-map-pin"></i>
                        {{trans('general.student_address_transportation')}}</h4>
                    <div class="info-container">
                        <ul class="list-unstyled">

                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.transportation') }}:</span>
                                <span>{{ ($student->transportation != null)? trans("general.subscriber") : trans("general.non-subscriber")  }}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.address') }}:</span>
                                <span>{{$city->title .' \ '. $student->area .' \ '. $student->street}}</span>
                            </li>
                        </ul>
                    </div></br>
                    <h4 class="fw-bolder border-bottom pb-50 mb-1">
                 <i class="fas -thin fa-exclamation"></i>
                        {{trans('general.emergency')}}</h4>
                    <div class="info-container">
                        <ul class="list-unstyled">
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.phone') }}:</span>
                                <span>{{ $student->emergency_phone }}</span>
                            </li>
                            <li class="mb-75">
                                <span class="fw-bolder me-25">{{ trans('general.kinship') }}:</span>
                                <span>{{$student->emergency_kinship}}</span>
                            </li>
                        </ul>
             </div></div>     
         </div></div>
                    <div class="col-8">
                        <div class="row">
                        <div class="card">
                            <div class="card-header">
                                <h4 class="card-title"><i class="fas -thin fa-clipboard"></i>
                                <span class="fw-bolder me-25"> {{ trans('general.student_notes') }}:</span>
                                </h4>
                            </div>
                            <div class="table-responsive">
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th> </th>
                                            <th><span>{{trans('general.text')}}</span></th>
                                            <th><span>{{trans('general.code')}}</span></th>
                                            <th><span>{{trans('general.type')}}</span></th>
                                            <th><span>{{trans('general.created-at')}}</span></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                            @if (count($note) == 0)
                                            <tr>
                                                <td colspan="5" class="text-center">
                                                    No Data
                                                </td>
                                            </tr>
                                            @endif
                                            
                                            @foreach($note as $n)
                                             <tr> 
                                                <td> </td>
                                                <td>{{$n->text}}</td>
                                                <td>{{$n->code}}</td>
                                                <td>{{$n->type}}</td>
                                                <td>{{$n->created_at}}</td>
                                             </tr>
                                             @endforeach 
                                                 
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        </div>
                        </br></br>
                    <div class="row">
                        <div class="card">
                            <div class="card-header">
                                <h4 class="card-title" ><i class="fas -thin fa-clipboard-check"></i>
                                 <span class="fw-bolder me-25"> {{ trans('general.student_marks') }}:</span> </h4>
                             </div>
                           <div class="table-responsive">
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th> </th>
                                            <th><span>{{trans('general.grade')}}</span></th>
                                            <th><span>{{trans('general.description')}}</span></th>
                                            <th><span>{{trans('general.quiz_mark')}}</span></th>
                                            <th><span>{{trans('general.created-at')}}</span></th>
                                           
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @if (count($studentexamgrades) == 0)
                                        <tr>
                                            <td colspan="5" class="text-center">
                                                No Data
                                            </td>
                                        </tr>
                                        @endif
                                        
                                        @foreach($studentexamgrades as $s)
                                         <tr>
                                             <td> </td>
                                             <td>{{$s->grade}}</td>
                                             <td>{{$s->description}}</td>
                                             <td>{{$s->quiz_mark}}</td>
                                             <td>{{$s->created_at}}</td>
                                         </tr>
                                         @endforeach
                                         
                                      </tbody>
                                </table>
                                 </div>
                            </div>
                        </div>
                        </br></br>
                      <div class="row">
                         <div class="card">
                            <div class="card-header">
                                <h4 class="card-title">
                                   <i class="fas -thin fa-file-invoice-dollar"></i>
                               <span class="fw-bolder me-25"> {{ trans('general.student_transaction_record') }}:</span>  </h4>
                            </div>
                            <div class="table-responsive">
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th> </th>
                                       <th><span>{{trans('general.transaction_number')}}</span> </th>
                                       <th><span>{{trans('general.note')}}</span></th>
                                       <th><span>{{trans('general.amount')}}</span></th>
                                       <th><span>{{trans('general.date')}}</span></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @if (count($record) == 0)
                                            <tr>
                                                <td colspan="5" class="text-center">
                                                    No Data
                                                </td>
                                            </tr>
                                            @endif
                                            @foreach($record as $r)
                                             <tr>
                                             <td> </td>
                                             <td>{{$r->transaction_number}}</td>
                                             <td>{{$r->note}}</td>
                                             <td>{{$r->amount}}</td>
                                             <td>{{$r->transaction_date }}</td>
                                              </tr>
                                               @endforeach
                                         </tbody>
                                     </table>
                                 </div>
                            </div>
                        </div>
                        </br></br>
                   <div class="row">
                        <div class="card">
                            <div class="card-header">
                                <h4 class="card-title"><i class="fas -thin fa-file-medical"></i>
                                  <span class="fw-bolder me-25"> {{ trans('general.student_health_records') }}:</span></h4>
                             </div>
                            <div class="table-responsive">
                                <table class="table">
                                    <thead>
                                        <tr>
                                          <th> </th>
                                          <th><span>{{trans('general.title')}}</span></th>
                                          <th><span>{{trans('general.description')}}</span></th>
                                        </tr>
                                    </thead>
                                   <tbody> 
                                    @if (count($health) == 0)
                                            <tr>
                                                <td colspan="3" class="text-center">
                                                    No Data
                                                </td>
                                            </tr>@endif 
                                    @foreach($health as $h)
                                     <tr>
                                          <td> </td>
                                          <td>{{$h->title}}</td>
                                          <td>{{$h->description}}</td>
                                    </tr>
                                      @endforeach
                                           </tbody>
                                     </table>
                                 </div>
                             </div>
                          </div>
                        </br></br>
                                            
       </div>
       </section> 
   
@push('scripts')
<script src="{{ url('design') }}/app-assets/vendors/js/forms/repeater/jquery.repeater.min.js"></script>
<script src="{{ url('design') }}/app-assets/vendors/js/pickers/flatpickr/flatpickr.min.js"></script>
<script src="{{ url('design') }}/app-assets/vendors/js/forms/select/select2.full.min.js"></script>
<!-- BEGIN: Page Vendor JS-->
<!-- <script src="{{ url('design') }}/app-assets/vendors/js/forms/select/select2.full.min.js"></script> -->
<!-- END: Page Vendor JS-->

<!-- BEGIN: Page JS-->
<!-- <script src="{{ url('design') }}/app-assets/js/scripts/forms/form-select2.js"></script> -->
<!-- END: Page JS-->


<script>
    $(document).ready(function() {

        $(function() {
            'use strict';

            // form repeater jquery
            $('.school-sequence-repeater, .languages-repeater, .repeater-default, .health-problems-repeater').repeater({
                // initEmpty: true,
                show: function() {
                    $(this).slideDown();
                    // Feather Icons
                    if (feather) {
                        feather.replace({
                            width: 14,
                            height: 14
                        });
                    }
                },
                hide: function(deleteElement) {
                    if (confirm('{{trans("general.Are you sure you want to delete this element?")}}')) {
                        $(this).slideUp(deleteElement);
                    }
                },

            });
        });

    });
</script>
@endpush

@push('header')

<!-- BEGIN: Vendor CSS-->
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/vendors/css/vendors-rtl.min.css">
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/vendors/css/tables/datatable/dataTables.bootstrap5.min.css">
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/vendors/css/tables/datatable/responsive.bootstrap5.min.css">
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/vendors/css/pickers/flatpickr/flatpickr.min.css">
<!-- END: Vendor CSS-->

<!-- BEGIN: Theme CSS-->
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/css-rtl/bootstrap.css">
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/css-rtl/bootstrap-extended.css">
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/css-rtl/colors.css">
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/css-rtl/components.css">
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/css-rtl/themes/dark-layout.css">
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/css-rtl/themes/bordered-layout.css">
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/css-rtl/themes/semi-dark-layout.css">

<!-- BEGIN: Custom CSS-->
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/css-rtl/custom-rtl.css">
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/assets/css/style-rtl.css">
<!-- END: Custom CSS-->
<!-- <link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/vendors/css/forms/select/select2.min.css"> -->
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/vendors/css/pickers/flatpickr/flatpickr.min.css">
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/vendors/css/forms/select/select2.min.css">
<link rel="stylesheet" type="text/css" href="{{ url('design') }}/app-assets/css-rtl/pages/page-profile.css">
@endpush
@endsection