@extends('layouts.app2')

<!DOCTYPE html>
<html lang="ar" >
<head>
    <meta charset="UTF-8">
    <title>Dashboard</title>
    <link rel="stylesheet" href="{{ asset('style.css') }}">
    <!--script src="https://jsdelivr.net"></script-->
    <link rel="stylesheet" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js"></script>


<script>
    $(document).ready(function(){
        $('.datepicker').datepicker({
            format: 'yyyy-mm-dd',
            autoclose: true,
            todayHighlight: true
        });
    });

</script>
</head>
<body>
   
    <div class="dashboard-container">
        <!-- Sidebar -->
        <aside class="sidebar">
            <div class="logo">
                
                <span>
                    وزارة الصحة الإتحادية
                </span>
                <img src="{{ asset('build/assets/logo-fmoh2.png') }}" alt="شعار الوزارة" 
                style="height:70px;border-radius: 40px;margin-top: -40px;" class="me-2" align="left">
                <div style="margin-top: 45px;">
                     منصة التعاون الدولي الصحي
                </div>
             

          

                </div>
            <hr style="margin-top: 20px;">
              @include('layouts.navigationUser')
               
             <form method="POST" action="{{ route('logout') }}">
                            @csrf

                            <x-dropdown-link :href="route('logout')"
                                    onclick="event.preventDefault();
                                                this.closest('form').submit();" style="color: red;">
                                {{ __('Log Out') }}
                            </x-dropdown-link>
                        </form>
        </aside>

        <!-- Main Content -->
      @include('layouts.readingUser')
            
                    @if (session()->has('success'))
                        <div class="alert alert-success">
                            <span class="text-green font-bold">{{ session('success') }}</span>
                        </div>
                    @endif
            <!-- Charts Row -->
         

            <section class="charts-grid" style="margin-top: 40px;">
              @if ($errors->any())
                    <div class="alert alert-danger" style="width: 440px;">
                        <ul>
                            @foreach ($errors->all() as $error)
                                <li>{{ $error }}</li>
                            @endforeach
                        </ul>
                    </div>
                @endif
                <div class="form-container" style="width: 675px"> 
        <h3 class="mb-4"  >  تسجيل هبة جديدة  </h3>
        <form action="{{ route('donations.store') }}" method="POST">
                @csrf

        <div class="mb-3">
            <label class="form-label">اسم الهبة</label>
            <input type="hidden" value="{{ Auth::user()->referencesUser }}" name="organization_id" class="form-control" required>
            <input type="hidden" value="{{ Auth::user()->id }}" name="user_id" class="form-control" required>
            <input type="text" name="donation_title" class="form-control" required>
        </div>

         <div class="mb-3">
            <label class="form-label"> القطاع </label>
            <select name="sector_id" class="form-control" required>
                 <option value="0" selected>-------القطاع-----</option>
                 @foreach ($sectors as $sector)
                    <option @selected($sector->id == @$Patient_Data->StateID) value="{{$sector->id}}" >{{$sector->sectorName}}</option>
                 @endforeach
            </select>
        </div>

        <div class="mb-3">
            
            <input type="hidden" name="donation_type" value="مالية" class="form-control datepicker">
        </div>

        <div class="mb-3">
            <label class="form-label">  تاريخ الهبة   </label>
            <input type="text" name="donation_date" class="form-control datepicker">
        </div>

        <div class="mb-3">
            <label class="form-label">  العدد   </label>
            <input type="text" name="quantity" class="form-control datepicker">
        </div>


        <div class="mb-3">
            <label class="form-label"> التكلفة </label>
            <input type="text" name="donation_amount" class="arabicNumbers form-control">
        </div>

         <div class="mb-3">
            <label class="form-label"> العملة </label>
            <select name="currency" class="form-control" required>
                <option value="USD">دولار أمريكي</option>
                <option value="EUR">يورو</option>
                <option value="SDG">جنيه سوداني</option>
                <option value="SAR">ريال سعودي</option>
            </select>
        </div>

        <button type="submit" class="btn btn-success">حفظ</button>
    </form>
</div>

                </div>
               
            </section>
        </main>
    </div>
</body>

</html>
