<!DOCTYPE html>
<html lang="ar" >
<head>
    <meta charset="UTF-8">
    <title>Dashboard</title>
    <link rel="stylesheet" href="<?php echo e(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="<?php echo e(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;">
              <?php echo $__env->make('layouts.navigationUser', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
               
             <form method="POST" action="<?php echo e(route('logout')); ?>">
                            <?php echo csrf_field(); ?>

                            <?php if (isset($component)) { $__componentOriginal68cb1971a2b92c9735f83359058f7108 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal68cb1971a2b92c9735f83359058f7108 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dropdown-link','data' => ['href' => route('logout'),'onclick' => 'event.preventDefault();
                                                this.closest(\'form\').submit();','style' => 'color: red;']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dropdown-link'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('logout')),'onclick' => 'event.preventDefault();
                                                this.closest(\'form\').submit();','style' => 'color: red;']); ?>
                                <?php echo e(__('Log Out')); ?>

                             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal68cb1971a2b92c9735f83359058f7108)): ?>
<?php $attributes = $__attributesOriginal68cb1971a2b92c9735f83359058f7108; ?>
<?php unset($__attributesOriginal68cb1971a2b92c9735f83359058f7108); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal68cb1971a2b92c9735f83359058f7108)): ?>
<?php $component = $__componentOriginal68cb1971a2b92c9735f83359058f7108; ?>
<?php unset($__componentOriginal68cb1971a2b92c9735f83359058f7108); ?>
<?php endif; ?>
                        </form>
        </aside>

        <!-- Main Content -->
        <main class="main-content">
           <div style="margin: 10px;">
       <i class="fa fa-user"></i>    👋    مرحباً : 
        <div><?php echo e(Auth::user()->name); ?></div> 
                </div>

            <!-- Stats Row -->
            <div class="" style="display: flex;gap: 20px;">
                <div class="stat-card"><i class="fa fas fa-briefcase" style="font-size:48px;"></i> <h3>132</h3> <p style="margin-top: 10px;">المشاريع</p></div>
                <div class="stat-card"><i class="fa fa-shopping-cart" style="font-size:48px;"></i> <h3>4.2M</h3> <p style="margin-top: 10px;">الهبات</p></div>
                <div class="stat-card"><i class="fa fa-money" style="font-size:48px;"></i><h3>18.5M</h3><p style="margin-top: 10px;">المنح</p></div>
            </div>
            
                    <?php if(session()->has('success')): ?>
                        <div class="alert alert-success">
                            <span class="text-green font-bold"><?php echo e(session('success')); ?></span>
                        </div>
                    <?php endif; ?>
            <!-- Charts Row -->
            <section class="charts-grid" style="margin-top: 40px;">
                <div class="chart-container">
                   
 <div class="card shadow-sm" style="width: 325px;">
        <div class="card-body">
            <h3 class="card-title text-success mb-3">📌 <?php echo e($activities->title); ?></h3>

            <p><strong>الوصف:</strong> <?php echo e($activities->activity_title); ?></p>
            <p><strong>تاريخ البداية:</strong> 📅 <?php echo e($activities->start_date); ?></p>
            <p><strong>تاريخ النهاية:</strong> 📅 <?php echo e($activities->end_date); ?></p>
            <p><strong>التكلفة:</strong> 💰 <?php echo e($activities->TotalCost); ?> <?php echo e($activities->currency); ?></p>
            <p><strong>الموقع:</strong> 🏢 <?php echo e($activities->StatesName); ?> </p>
           
            <a href="<?php echo e(route('activity.index')); ?>" class="btn btn-secondary mt-3">⬅️ رجوع للقائمة</a>
        </div>
 </div>

 
                </div>
                <div class="chart-container">

 <section class="charts-grid" style="margin-top: 40px;">
          
                <div class="form-container" style=""> 
                    <div style="direction: ltr;">
                      
                        <button class="btn btn-success" data-bs-toggle="modal" data-bs-target="#TaskModal" > 
                                 إضافة مهمة
                          </button>
                    </div>
                     <h3 class="mb-4"  >  قائمة المهام :     </h3>
               <table id="Task-table" class="display" style="width: 787px;">
                        <thead>
                            <tr>
                                <th>الرقم</th>
                                <th>إسم المهمة</th>
                                <th> العدد </th>
                                <th> التكلفة </th>
                                <th> العملة </th>
                                 <th> المستند </th>
                             
                                <th> -- </th>
                              
                            </tr>
                        </thead>
                     </table>
                </div>

                </div>
               
            </section>

                </div>
               
            </section>

            <section class="charts-grid" style="margin-top: 40px;">
              <?php if($errors->any()): ?>
                    <div class="alert alert-danger" style="width: 440px;">
                        <ul>
                            <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <li><?php echo e($error); ?></li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </ul>
                    </div>
                <?php endif; ?>
                <div class="form-container" style="width: 675px"> 
        
</div>

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




<!-- sector -->
<div class="modal fade" id="projectModal" tabindex="-1" aria-labelledby="projectModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered"> <!-- هنا نضيف modal-dialog-centered -->
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="projectModalLabel"> تحديد قطاع المشروع </h5>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="إغلاق"></button>
      </div>
      <div class="modal-body">
        <p><strong>اسم المشروع:</strong> مشروع تجريبي</p>
        <p><strong>الوصف:</strong> هذا مثال لمودال في المنتصف.</p>
        <p><strong>التكلفة:</strong> 💰 5000 USD</p>
        <p><strong>الموقع:</strong> <i class="bi bi-geo-alt-fill text-primary"></i> الخرطوم</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">إغلاق</button>
        <button type="button" class="btn btn-success">حفظ</button>
      </div>
    </div>
  </div>
</div>


<!----Tasks----->
<div class="modal fade" id="TaskModal" tabindex="-1" aria-labelledby="TaskModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered"> <!-- هنا نضيف modal-dialog-centered -->
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="TaskModalLabel">  إضافة مهمة  </h5>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="إغلاق"></button>
      </div>
      <div class="modal-body">
        
           <form action="<?php echo e(route('activity.Tasks-store')); ?>" method="POST"  enctype="multipart/form-data">
                <?php echo csrf_field(); ?>

        <div class="mb-3">
            <label class="form-label">اسم المهمة</label>
            <input type="hidden" value="<?php echo e(Auth::user()->id); ?>" name="user_id" class="form-control" required>
            <input type="hidden" value="<?php echo e($activities->project_id); ?>" name="project_id" class="form-control" required>
             <input type="hidden" value="<?php echo e($activities->id); ?>" name="activity_id" class="form-control" required>
            <input type="text" name="task_title" class="form-control" required>
        </div>

        
       

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

       
        <div class="mb-3">
            <label class="form-label"> التكلفة </label>
            <input type="text" name="TaskCost" 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>

        <div class="mb-3">
            <label class="form-label">  المستند   </label>
            <input type="file" name="task_Document" class="form-control datepicker">
        </div>

        <button type="submit" class="btn btn-success">حفظ</button>
    </form>
       
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">إغلاق</button>
       
      </div>
    </div>
  </div>
</div>






<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
    <script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
    <script>
        $(function() {
            $('#Task-table').DataTable({
                processing: true,
                serverSide: true,
                ajax: '<?php echo e(route('activity.Taskdata')); ?>',
                columns: [
                    { data: 'id', name: 'id' },
                    { data: 'task_title', name: 'task_title' },
                    { data: 'taskNumber', name: 'taskNumber' },
                    { data: 'TaskCost', name: 'TaskCost' },
                    { data: 'currency', name: 'currency' },
                    { data: 'action2', name: 'action2', orderable: false, searchable: false },
                    { data: 'action', name: 'action', orderable: false, searchable: false },
                   
                ]
            });
        });
    </script>

</html>

<?php echo $__env->make('layouts.app2', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/moh-portal/resources/views/activity/showTasks.blade.php ENDPATH**/ ?>