🎉 First commit
This commit is contained in:
91
resources/views/filament/pages/articles.blade.php
Normal file
91
resources/views/filament/pages/articles.blade.php
Normal file
@@ -0,0 +1,91 @@
|
||||
<x-filament-panels::page>
|
||||
@if ($errorMessage)
|
||||
<div class="rounded-lg bg-danger-50 p-4 text-sm text-danger-600 dark:bg-danger-400/10 dark:text-danger-400">
|
||||
{{ $errorMessage }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Formulaire de recherche --}}
|
||||
<div class="rounded-xl bg-white p-6 shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10">
|
||||
<h3 class="text-base font-semibold text-gray-950 dark:text-white">Rechercher des articles</h3>
|
||||
|
||||
<div class="mt-4 grid grid-cols-1 gap-4 sm:grid-cols-3">
|
||||
<div>
|
||||
<label for="search" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Recherche</label>
|
||||
<input wire:model="search" type="text" id="search" placeholder="Filtre de recherche..."
|
||||
class="mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:border-primary-500 focus:ring-primary-500 dark:border-white/10 dark:bg-white/5 dark:text-white sm:text-sm" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="select" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Colonnes (select)</label>
|
||||
<input wire:model="select" type="text" id="select" placeholder="artid,artname"
|
||||
class="mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:border-primary-500 focus:ring-primary-500 dark:border-white/10 dark:bg-white/5 dark:text-white sm:text-sm" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="results" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Nombre de resultats</label>
|
||||
<input wire:model="results" type="number" id="results" min="1" max="100"
|
||||
class="mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:border-primary-500 focus:ring-primary-500 dark:border-white/10 dark:bg-white/5 dark:text-white sm:text-sm" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<x-filament::button wire:click="searchArticles" icon="heroicon-o-magnifying-glass">
|
||||
Rechercher
|
||||
</x-filament::button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Resultats --}}
|
||||
@if (count($data) > 0)
|
||||
<div class="rounded-xl bg-white p-6 shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-base font-semibold text-gray-950 dark:text-white">Resultats</h3>
|
||||
@if ($metadata)
|
||||
<span class="text-sm text-gray-500">{{ $metadata['rowcount'] ?? 0 }} resultat(s)</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-4 overflow-x-auto">
|
||||
<table class="w-full text-left text-sm">
|
||||
<thead class="border-b border-gray-200 dark:border-white/10">
|
||||
<tr>
|
||||
@foreach (array_keys(is_array(reset($data)) ? reset($data) : $data) as $key)
|
||||
<th class="px-3 py-2 font-medium text-gray-500 dark:text-gray-400">{{ $key }}</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100 dark:divide-white/5">
|
||||
@foreach ($data as $row)
|
||||
<tr>
|
||||
@foreach ((is_array($row) ? $row : [$row]) as $value)
|
||||
<td class="px-3 py-2 text-gray-700 dark:text-gray-300">{{ is_array($value) ? json_encode($value) : $value }}</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- Stock d'un article --}}
|
||||
<div class="rounded-xl bg-white p-6 shadow-sm ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10">
|
||||
<h3 class="text-base font-semibold text-gray-950 dark:text-white">Verifier le stock d'un article</h3>
|
||||
|
||||
<div class="mt-4 flex items-end gap-4">
|
||||
<div class="flex-1">
|
||||
<label for="stockArticleId" class="block text-sm font-medium text-gray-700 dark:text-gray-300">Identifiant article (ARTID)</label>
|
||||
<input wire:model="stockArticleId" type="text" id="stockArticleId" placeholder="Ex: ART001"
|
||||
class="mt-1 block w-full rounded-lg border-gray-300 shadow-sm focus:border-primary-500 focus:ring-primary-500 dark:border-white/10 dark:bg-white/5 dark:text-white sm:text-sm" />
|
||||
</div>
|
||||
<x-filament::button wire:click="getStock" icon="heroicon-o-cube">
|
||||
Verifier le stock
|
||||
</x-filament::button>
|
||||
</div>
|
||||
|
||||
@if (count($stockData) > 0)
|
||||
<div class="mt-4 overflow-x-auto">
|
||||
<pre class="rounded-lg bg-gray-50 p-4 text-sm text-gray-700 dark:bg-gray-800 dark:text-gray-300">{{ json_encode($stockData, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}</pre>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</x-filament-panels::page>
|
||||
Reference in New Issue
Block a user