@extends('admin.layout_admin.main') @section('css') @endsection @section('content') @php $filters = []; if (request()->filled('q')) { $filters[] = 'Từ khóa: ' . e(request('q')) . ''; } if (request()->filled('status')) { $statuses = ['0' => 'Tạm ngưng', '1' => 'Hoạt động']; $filters[] = 'Trạng thái: ' . ($statuses[request('status')] ?? 'Không rõ') . ''; } @endphp
@if (count($filters)) Tìm kiếm thuốc @else Danh sách thuốc @endif
@can('them-thuoc') @endcan
@if (count($filters))

Kết quả tìm kiếm: {!! implode(', ', $filters) !!}

@endif @if ($medicines->count() > 0)
@can(['chinh-sua-thuoc', 'xoa-thuoc']) @endcan @foreach ($medicines as $key => $medicine) @endforeach
STT Mã thuốc Tên thuốc Loại thuốc Đơn vị chính Đóng gói Đơn vị cơ sở Giá bán lẻ(VNĐ) Trạng tháiXử lý
{{ $medicines->firstItem() + $key }} {{ $medicine->medicine_code }} {{ $medicine->name }} @if ($medicine->medicineCategories->count() > 0) @foreach ($medicine->medicineCategories as $category) {{ $category->name }} @endforeach @else Chưa có loại thuốc @endif {{ $medicine->unit }} {{ $medicine->packaging }} {{ $medicine->base_unit }} {{ number_format($medicine->sale_price, 0, ',', '.') }} {!! $medicine->status == 1 ? 'Hoạt động' : 'Tạm ngưng' !!}
@can('chinh-sua-thuoc') @endcan @can('xoa-thuoc')
@method('DELETE') @csrf
@endcan
@else

Chưa có thuốc nào!

@endif
{{ $medicines->links() }}
@endsection @section('js') @endsection