vernova/storage/framework/views/a03636601cf2476624659c1e63087b5d.php
2026-07-26 19:58:27 +03:30

251 lines
17 KiB
PHP

<?php $__env->startSection('content'); ?>
<div class="space-y-6">
<!-- Page Header -->
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
<div>
<h1 class="text-2xl font-bold text-gray-900"><?php echo e(__('dashboard.title')); ?></h1>
<p class="text-sm text-gray-500 mt-1"><?php echo e($todayDisplay); ?></p>
</div>
<div class="flex items-center gap-2">
<a href="<?php echo e(route('projects.create')); ?>" class="inline-flex items-center gap-2 px-4 py-2 bg-teal-600 text-white text-sm font-medium rounded-lg hover:bg-teal-700 transition-colors">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
<?php echo e(__('project.new')); ?>
</a>
</div>
</div>
<!-- KPI Cards -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
<!-- Active Projects -->
<div class="bg-white rounded-xl border border-gray-200 p-5 relative overflow-hidden">
<div class="absolute top-0 start-0 w-1 h-full bg-teal-500"></div>
<div class="flex items-center justify-between ms-2">
<div>
<p class="text-sm text-gray-500"><?php echo e(__('dashboard.active_projects')); ?></p>
<p class="text-2xl font-bold text-gray-900 mt-1">
<?php echo e(app()->getLocale() === 'fa' ? persian_num($activeProjectsCount) : $activeProjectsCount); ?>
</p>
</div>
<div class="w-12 h-12 bg-teal-50 rounded-lg flex items-center justify-center">
<svg class="w-6 h-6 text-teal-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"/>
</svg>
</div>
</div>
<?php if($projectTrend != 0): ?>
<p class="text-xs mt-2 ms-2 <?php echo e($projectTrend > 0 ? 'text-emerald-600' : 'text-red-600'); ?>">
<?php echo e($projectTrend > 0 ? '↑' : '↓'); ?> <?php echo e(abs($projectTrend)); ?>% <?php echo e(__('dashboard.vs_last_month')); ?>
</p>
<?php endif; ?>
</div>
<!-- Total Budget -->
<div class="bg-white rounded-xl border border-gray-200 p-5 relative overflow-hidden">
<div class="absolute top-0 start-0 w-1 h-full bg-emerald-500"></div>
<div class="flex items-center justify-between ms-2">
<div>
<p class="text-sm text-gray-500"><?php echo e(__('dashboard.total_budget')); ?></p>
<p class="text-2xl font-bold text-gray-900 mt-1"><?php echo e($totalBudgetFormatted); ?></p>
</div>
<div class="w-12 h-12 bg-emerald-50 rounded-lg flex items-center justify-center">
<svg class="w-6 h-6 text-emerald-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
</div>
</div>
</div>
<!-- Pending Tasks -->
<div class="bg-white rounded-xl border border-gray-200 p-5 relative overflow-hidden">
<div class="absolute top-0 start-0 w-1 h-full bg-amber-500"></div>
<div class="flex items-center justify-between ms-2">
<div>
<p class="text-sm text-gray-500"><?php echo e(__('dashboard.pending_tasks')); ?></p>
<p class="text-2xl font-bold text-gray-900 mt-1">
<?php echo e(app()->getLocale() === 'fa' ? persian_num($pendingTasksCount) : $pendingTasksCount); ?>
</p>
</div>
<div class="w-12 h-12 bg-amber-50 rounded-lg flex items-center justify-center">
<svg class="w-6 h-6 text-amber-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/>
</svg>
</div>
</div>
<?php if($taskTrend != 0): ?>
<p class="text-xs mt-2 ms-2 <?php echo e($taskTrend > 0 ? 'text-amber-600' : 'text-emerald-600'); ?>">
<?php echo e($taskTrend > 0 ? '↑' : '↓'); ?> <?php echo e(abs($taskTrend)); ?>% <?php echo e(__('dashboard.vs_last_month')); ?>
</p>
<?php endif; ?>
</div>
<!-- Active Employees -->
<div class="bg-white rounded-xl border border-gray-200 p-5 relative overflow-hidden">
<div class="absolute top-0 start-0 w-1 h-full bg-violet-500"></div>
<div class="flex items-center justify-between ms-2">
<div>
<p class="text-sm text-gray-500"><?php echo e(__('dashboard.active_employees')); ?></p>
<p class="text-2xl font-bold text-gray-900 mt-1">
<?php echo e(app()->getLocale() === 'fa' ? persian_num($activeEmployeesCount) : $activeEmployeesCount); ?>
</p>
</div>
<div class="w-12 h-12 bg-violet-50 rounded-lg flex items-center justify-center">
<svg class="w-6 h-6 text-violet-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"/>
</svg>
</div>
</div>
<?php if($employeeTrend != 0): ?>
<p class="text-xs mt-2 ms-2 <?php echo e($employeeTrend > 0 ? 'text-emerald-600' : 'text-red-600'); ?>">
<?php echo e($employeeTrend > 0 ? '↑' : '↓'); ?> <?php echo e(abs($employeeTrend)); ?>% <?php echo e(__('dashboard.vs_last_month')); ?>
</p>
<?php endif; ?>
</div>
</div>
<!-- Main Grid: Projects + Tasks/Activity -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- Projects Progress (2/3) -->
<div class="lg:col-span-2 bg-white rounded-xl border border-gray-200">
<div class="px-5 py-4 border-b border-gray-200 flex items-center justify-between">
<h2 class="text-base font-semibold text-gray-900"><?php echo e(__('dashboard.projects_progress')); ?></h2>
<a href="<?php echo e(route('projects.index')); ?>" class="text-sm text-teal-600 hover:text-teal-700 font-medium"><?php echo e(__('common.view_all')); ?></a>
</div>
<div class="p-5 space-y-4">
<?php $__empty_1 = true; $__currentLoopData = $projectsInProgress; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $project): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<div class="flex items-center gap-4">
<div class="flex-1 min-w-0">
<div class="flex items-center justify-between mb-1">
<a href="<?php echo e(route('projects.show', $project)); ?>" class="text-sm font-medium text-gray-900 hover:text-teal-600 truncate">
<?php echo e($project->name); ?>
</a>
<span class="text-xs font-medium <?php echo e($project->progress >= 75 ? 'text-emerald-600' : ($project->progress >= 50 ? 'text-amber-600' : 'text-red-600')); ?>">
<?php echo e(app()->getLocale() === 'fa' ? persian_num($project->progress) : $project->progress); ?>%
</span>
</div>
<div class="w-full bg-gray-100 rounded-full h-2">
<div class="h-2 rounded-full transition-all duration-500 <?php echo e($project->progress >= 75 ? 'bg-emerald-500' : ($project->progress >= 50 ? 'bg-amber-500' : 'bg-red-500')); ?>"
style="width: <?php echo e($project->progress); ?>%"></div>
</div>
<div class="flex items-center gap-3 mt-1.5 text-xs text-gray-500">
<span><?php echo e($project->code); ?></span>
<?php if($project->manager): ?>
<span><?php echo e($project->manager->name); ?></span>
<?php endif; ?>
</div>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<p class="text-sm text-gray-500 text-center py-4"><?php echo e(__('dashboard.no_projects')); ?></p>
<?php endif; ?>
</div>
</div>
<!-- My Tasks + Activity (1/3) -->
<div class="space-y-6">
<!-- My Tasks -->
<div class="bg-white rounded-xl border border-gray-200">
<div class="px-5 py-4 border-b border-gray-200 flex items-center justify-between">
<h2 class="text-base font-semibold text-gray-900"><?php echo e(__('dashboard.my_tasks')); ?></h2>
<a href="<?php echo e(route('tasks.index')); ?>" class="text-sm text-teal-600 hover:text-teal-700 font-medium"><?php echo e(__('common.view_all')); ?></a>
</div>
<div class="p-5 space-y-3 max-h-72 overflow-y-auto">
<?php $__empty_1 = true; $__currentLoopData = $myTasks; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $task): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<a href="<?php echo e(route('tasks.show', $task)); ?>" class="block p-3 rounded-lg hover:bg-gray-50 transition-colors border border-gray-100">
<div class="flex items-center justify-between mb-1">
<span class="text-sm font-medium text-gray-900 truncate"><?php echo e($task->title); ?></span>
<?php if($task->priority === 'urgent'): ?>
<span class="w-2 h-2 bg-rose-500 rounded-full flex-shrink-0"></span>
<?php endif; ?>
</div>
<div class="flex items-center gap-2 text-xs text-gray-500">
<span><?php echo e($task->project?->name); ?></span>
<?php if($task->due_date): ?>
<span>•</span>
<span><?php echo e(calendar_date($task->due_date)); ?></span>
<?php endif; ?>
</div>
</a>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<p class="text-sm text-gray-500 text-center py-4"><?php echo e(__('dashboard.no_tasks')); ?></p>
<?php endif; ?>
</div>
</div>
<!-- Recent Activity -->
<div class="bg-white rounded-xl border border-gray-200">
<div class="px-5 py-4 border-b border-gray-200">
<h2 class="text-base font-semibold text-gray-900"><?php echo e(__('dashboard.recent_activity')); ?></h2>
</div>
<div class="p-5 space-y-3 max-h-64 overflow-y-auto">
<?php $__empty_1 = true; $__currentLoopData = $recentActivities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $activity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<div class="flex items-start gap-3">
<div class="w-8 h-8 bg-gray-100 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5">
<span class="text-xs font-medium text-gray-600"><?php echo e(mb_strtoupper(mb_substr($activity->user?->name ?? '?', 0, 1))); ?></span>
</div>
<div class="min-w-0">
<p class="text-sm text-gray-700"><?php echo e($activity->user?->name); ?> — <?php echo e($activity->description); ?></p>
<p class="text-xs text-gray-400 mt-0.5"><?php echo e(calendar_date($activity->created_at)); ?></p>
</div>
</div>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<p class="text-sm text-gray-500 text-center py-4"><?php echo e(__('dashboard.no_activity')); ?></p>
<?php endif; ?>
</div>
</div>
</div>
</div>
<!-- i18n Showcase -->
<div class="bg-white rounded-xl border border-gray-200 p-5">
<h2 class="text-base font-semibold text-gray-900 mb-4"><?php echo e(__('dashboard.localization_info')); ?></h2>
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
<div class="p-4 bg-gray-50 rounded-lg">
<p class="text-xs text-gray-500 mb-1"><?php echo e(__('dashboard.calendar_system')); ?></p>
<p class="text-sm font-medium"><?php echo e($currentCalendar === 'jalali' ? __('calendar.jalali') : __('calendar.gregorian')); ?></p>
<p class="text-xs text-gray-400 mt-1"><?php echo e(__('dashboard.today')); ?>: <?php echo e($todayDisplay); ?></p>
</div>
<div class="p-4 bg-gray-50 rounded-lg">
<p class="text-xs text-gray-500 mb-1"><?php echo e(__('dashboard.number_format')); ?></p>
<p class="text-sm font-medium">
<?php echo e(app()->getLocale() === 'fa' ? persian_num(1234567.89) : number_format(1234567.89, 2)); ?>
</p>
</div>
<div class="p-4 bg-gray-50 rounded-lg">
<p class="text-xs text-gray-500 mb-1"><?php echo e(__('dashboard.currency_format')); ?></p>
<p class="text-sm font-medium"><?php echo e(format_currency(150000000, $currencyCode)); ?></p>
</div>
</div>
</div>
<!-- Quick Actions -->
<div class="grid grid-cols-2 sm:grid-cols-4 gap-3">
<a href="<?php echo e(route('projects.create')); ?>" class="flex flex-col items-center gap-2 p-4 bg-white rounded-xl border border-gray-200 hover:border-teal-300 hover:shadow-sm transition-all">
<svg class="w-6 h-6 text-teal-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
<span class="text-xs font-medium text-gray-700"><?php echo e(__('project.new')); ?></span>
</a>
<a href="<?php echo e(route('tasks.create')); ?>" class="flex flex-col items-center gap-2 p-4 bg-white rounded-xl border border-gray-200 hover:border-teal-300 hover:shadow-sm transition-all">
<svg class="w-6 h-6 text-amber-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/></svg>
<span class="text-xs font-medium text-gray-700"><?php echo e(__('task.new')); ?></span>
</a>
<a href="<?php echo e(route('expenses.create')); ?>" class="flex flex-col items-center gap-2 p-4 bg-white rounded-xl border border-gray-200 hover:border-teal-300 hover:shadow-sm transition-all">
<svg class="w-6 h-6 text-emerald-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8V7m0 1v8m0 0v1"/></svg>
<span class="text-xs font-medium text-gray-700"><?php echo e(__('expense.new')); ?></span>
</a>
<a href="<?php echo e(route('employees.create')); ?>" class="flex flex-col items-center gap-2 p-4 bg-white rounded-xl border border-gray-200 hover:border-teal-300 hover:shadow-sm transition-all">
<svg class="w-6 h-6 text-violet-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z"/></svg>
<span class="text-xs font-medium text-gray-700"><?php echo e(__('employee.new')); ?></span>
</a>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\projectra\resources\views/dashboard/index.blade.php ENDPATH**/ ?>