@extends('layouts.app')
@section('title','Barcode Labels')
@section('styles')<style>.label-sheet{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.barcode-label{height:38mm;border:1px dashed #aaa;padding:6px;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center}.barcode-label svg{max-width:100%;height:55px}@media print{.label-sheet{grid-template-columns:repeat(3,1fr)}.barcode-label{break-inside:avoid}.erp-main{padding:0}}</style>@endsection
@section('content')<div class="page-head no-print"><div><h1>Barcode labels</h1><p>CODE128 / EAN-compatible product labels.</p></div><button class="btn btn-dark" onclick="print()">Print labels</button></div><form class="card-erp no-print"><div class="card-erp-body d-flex gap-2"><select name="product_id" class="form-select">@foreach($products as $p)<option value="{{ $p->id }}" @selected($product?->id===$p->id)>{{ $p->product_code }} · {{ $p->name_en }}</option>@endforeach</select><button class="btn btn-primary">Generate</button></div></form>@if($product&&$barcodeSvg)<div class="label-sheet">@for($i=0;$i<24;$i++)<div class="barcode-label"><b>{{ $product->name_en }}</b><small dir="rtl">{{ $product->name_ar }}</small>{!! $barcodeSvg !!}<span>{{ $product->barcode }}</span></div>@endfor</div>@endif@endsection
