130 lines
8.2 KiB
PHP
130 lines
8.2 KiB
PHP
<?php $__env->startSection('content'); ?>
|
|
<div class="max-w-4xl mx-auto space-y-6">
|
|
<!-- Page Header -->
|
|
<div class="flex items-center gap-4">
|
|
<a href="<?php echo e(route('employees.index')); ?>" class="p-2 text-gray-500 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/></svg>
|
|
</a>
|
|
<div class="flex-1">
|
|
<h1 class="text-2xl font-bold text-gray-900"><?php echo e($employee->full_name); ?></h1>
|
|
<p class="text-sm text-gray-500"><?php echo e($employee->job_title ?? '-'); ?></p>
|
|
</div>
|
|
<div class="flex gap-2">
|
|
<a href="<?php echo e(route('employees.work-logs', $employee)); ?>" class="px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors">
|
|
<?php echo e(__('employee.workLogs')); ?>
|
|
|
|
</a>
|
|
<a href="<?php echo e(route('employees.financials', $employee)); ?>" class="px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors">
|
|
<?php echo e(__('employee.financials')); ?>
|
|
|
|
</a>
|
|
<a href="<?php echo e(route('employees.edit', $employee)); ?>" class="px-4 py-2 text-sm font-medium text-white bg-teal-600 rounded-lg hover:bg-teal-700 transition-colors">
|
|
<?php echo e(__('common.edit')); ?>
|
|
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Employee Info Card -->
|
|
<div class="bg-white rounded-xl border border-gray-200 p-6">
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-5">
|
|
<div>
|
|
<p class="text-xs font-medium text-gray-500 mb-1"><?php echo e(__('employee.firstName')); ?></p>
|
|
<p class="text-sm text-gray-900"><?php echo e($employee->first_name); ?></p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs font-medium text-gray-500 mb-1"><?php echo e(__('employee.lastName')); ?></p>
|
|
<p class="text-sm text-gray-900"><?php echo e($employee->last_name); ?></p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs font-medium text-gray-500 mb-1"><?php echo e(__('employee.jobTitle')); ?></p>
|
|
<p class="text-sm text-gray-900"><?php echo e($employee->job_title ?? '-'); ?></p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs font-medium text-gray-500 mb-1"><?php echo e(__('employee.contractType')); ?></p>
|
|
<p class="text-sm text-gray-900"><?php echo e(__('employee.' . $employee->contract_type) ?? $employee->contract_type ?? '-'); ?></p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs font-medium text-gray-500 mb-1"><?php echo e(__('employee.phone')); ?></p>
|
|
<p class="text-sm text-gray-900" dir="ltr"><?php echo e($employee->phone ?? '-'); ?></p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs font-medium text-gray-500 mb-1"><?php echo e(__('employee.nationalCode')); ?></p>
|
|
<p class="text-sm text-gray-900" dir="ltr"><?php echo e($employee->national_code ?? '-'); ?></p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs font-medium text-gray-500 mb-1"><?php echo e(__('employee.hireDate')); ?></p>
|
|
<p class="text-sm text-gray-900"><?php echo e($employee->hire_date ? calendar_date($employee->hire_date) : '-'); ?></p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs font-medium text-gray-500 mb-1"><?php echo e(__('employee.project')); ?></p>
|
|
<p class="text-sm text-gray-900"><?php echo e($employee->project?->name ?? '-'); ?></p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs font-medium text-gray-500 mb-1"><?php echo e(__('employee.baseSalary')); ?></p>
|
|
<p class="text-sm font-bold text-gray-900"><?php echo e($employee->base_salary ? format_currency((float)$employee->base_salary, $employee->currency?->code) : '-'); ?></p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs font-medium text-gray-500 mb-1"><?php echo e(__('employee.bankAccount')); ?></p>
|
|
<p class="text-sm text-gray-900" dir="ltr"><?php echo e($employee->bank_account ?? '-'); ?></p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs font-medium text-gray-500 mb-1"><?php echo e(__('employee.status')); ?></p>
|
|
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium
|
|
<?php echo e($employee->status === 'active' ? 'bg-emerald-50 text-emerald-700' :
|
|
($employee->status === 'terminated' ? 'bg-red-50 text-red-700' : 'bg-amber-50 text-amber-700')); ?>">
|
|
<?php echo e(__('employee.' . $employee->status) ?? $employee->status); ?>
|
|
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Recent Work Logs -->
|
|
<?php if($employee->workLogs->count() > 0): ?>
|
|
<div class="bg-white rounded-xl border border-gray-200 overflow-hidden">
|
|
<div class="px-5 py-4 border-b border-gray-200 flex items-center justify-between">
|
|
<h3 class="text-sm font-bold text-gray-900"><?php echo e(__('employee.workLogs')); ?></h3>
|
|
<a href="<?php echo e(route('employees.work-logs', $employee)); ?>" class="text-xs text-teal-600 hover:text-teal-700"><?php echo e(__('common.all')); ?> ←</a>
|
|
</div>
|
|
<div class="divide-y divide-gray-100">
|
|
<?php $__currentLoopData = $employee->workLogs->take(5); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $log): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<div class="flex items-center justify-between px-5 py-3">
|
|
<div>
|
|
<p class="text-sm text-gray-900"><?php echo e(calendar_date($log->date)); ?></p>
|
|
<p class="text-xs text-gray-500"><?php echo e($log->project?->name ?? '-'); ?></p>
|
|
</div>
|
|
<span class="text-sm font-medium text-gray-900"><?php echo e(persian_num(number_format($log->hours_worked, 1))); ?> <?php echo e(__('employee.hoursWorked')); ?></span>
|
|
</div>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<!-- Recent Financials -->
|
|
<?php if($employee->financials->count() > 0): ?>
|
|
<div class="bg-white rounded-xl border border-gray-200 overflow-hidden">
|
|
<div class="px-5 py-4 border-b border-gray-200 flex items-center justify-between">
|
|
<h3 class="text-sm font-bold text-gray-900"><?php echo e(__('employee.financials')); ?></h3>
|
|
<a href="<?php echo e(route('employees.financials', $employee)); ?>" class="text-xs text-teal-600 hover:text-teal-700"><?php echo e(__('common.all')); ?> ←</a>
|
|
</div>
|
|
<div class="divide-y divide-gray-100">
|
|
<?php $__currentLoopData = $employee->financials->take(5); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $fin): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<div class="flex items-center justify-between px-5 py-3">
|
|
<div>
|
|
<p class="text-sm text-gray-900"><?php echo e(__('employee.' . $fin->type)); ?></p>
|
|
<p class="text-xs text-gray-500"><?php echo e($fin->effective_date ? calendar_date($fin->effective_date) : '-'); ?></p>
|
|
</div>
|
|
<span class="text-sm font-medium <?php echo e(in_array($fin->type, ['deduction', 'advance']) ? 'text-red-600' : 'text-emerald-600'); ?>">
|
|
<?php echo e(format_currency((float)$fin->amount, $fin->currency?->code)); ?>
|
|
|
|
</span>
|
|
</div>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
</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/employees/show.blade.php ENDPATH**/ ?>
|