<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <?php if (isset($component)) { $__componentOriginalf8d4ea307ab1e58d4e472a43c8548d8e = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalf8d4ea307ab1e58d4e472a43c8548d8e = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.page-header','data' => ['title' => 'Сервисна книга','subtitle' => $printer->manufacturer.' '.$printer->model]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('page-header'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['title' => 'Сервисна книга','subtitle' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($printer->manufacturer.' '.$printer->model)]); ?>
         <?php $__env->slot('actions', null, []); ?> 
            <a href="<?php echo e(route('readings.create', $printer)); ?>" class="btn btn-primary">
                <i class="bi bi-plus-lg me-1"></i>Ново читање
            </a>
            <a href="<?php echo e(route('printers.edit', $printer)); ?>" class="btn btn-light border">
                <i class="bi bi-pencil me-1"></i>Измени
            </a>
            <a href="<?php echo e(route('printers.qr', $printer)); ?>" class="btn btn-light border" target="_blank">
                <i class="bi bi-qr-code me-1"></i>Печати QR
            </a>
         <?php $__env->endSlot(); ?>
     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalf8d4ea307ab1e58d4e472a43c8548d8e)): ?>
<?php $attributes = $__attributesOriginalf8d4ea307ab1e58d4e472a43c8548d8e; ?>
<?php unset($__attributesOriginalf8d4ea307ab1e58d4e472a43c8548d8e); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalf8d4ea307ab1e58d4e472a43c8548d8e)): ?>
<?php $component = $__componentOriginalf8d4ea307ab1e58d4e472a43c8548d8e; ?>
<?php unset($__componentOriginalf8d4ea307ab1e58d4e472a43c8548d8e); ?>
<?php endif; ?>

    <?php if (isset($component)) { $__componentOriginal5168fdb0c14fd91c6598264bc4be63f2 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal5168fdb0c14fd91c6598264bc4be63f2 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.flash','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('flash'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal5168fdb0c14fd91c6598264bc4be63f2)): ?>
<?php $attributes = $__attributesOriginal5168fdb0c14fd91c6598264bc4be63f2; ?>
<?php unset($__attributesOriginal5168fdb0c14fd91c6598264bc4be63f2); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal5168fdb0c14fd91c6598264bc4be63f2)): ?>
<?php $component = $__componentOriginal5168fdb0c14fd91c6598264bc4be63f2; ?>
<?php unset($__componentOriginal5168fdb0c14fd91c6598264bc4be63f2); ?>
<?php endif; ?>

    <div class="row g-3 mb-3">
        <div class="col-12">
            <div class="card border-0 shadow-sm h-100">
                <div class="card-header bg-white fw-medium">Печатач</div>
                <div class="card-body">
                    <dl class="row mb-0 small">
                        <dt class="col-5 text-muted">Клиент</dt>
                        <dd class="col-7"><a href="<?php echo e(route('clients.show', $printer->client)); ?>"><?php echo e($printer->client->name); ?></a></dd>
                        <dt class="col-5 text-muted">Сериски број</dt><dd class="col-7"><?php echo e($printer->serial_number); ?></dd>
                        <dt class="col-5 text-muted">Инсталација</dt><dd class="col-7"><?php echo e(optional($printer->installation_date)->format('d.m.Y') ?: '—'); ?></dd>
                        <dt class="col-5 text-muted">Статус</dt><dd class="col-7"><?php echo e($printer->status->label()); ?></dd>
                    </dl>
                </div>
            </div>
        </div>
    </div>

    <div class="card border-0 shadow-sm">
        <div class="card-header bg-white fw-medium">Читања</div>
        <div class="table-responsive">
            <table class="table align-middle mb-0 small">
                <thead>
                    <tr>
                        <th>Датум</th>
                        <th class="text-end">Црно-бело</th>
                        <th class="text-end">Боја</th>
                        <th class="text-end">Скен</th>
                        <th>Тонер</th>
                        <th>Техничар</th>
                        <th>Опис</th>
                        <th class="text-end">Акции</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $log; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <?php ($r = $row['reading']); ?>
                        <tr>
                            <td><?php echo e($r->reading_date->format('d.m.Y')); ?></td>
                            <td class="text-end">
                                <?php echo e($r->bw_counter !== null ? number_format($r->bw_counter) : '—'); ?>

                                <?php if($row['bw_used'] !== null): ?><div class="text-muted">+<?php echo e(number_format($row['bw_used'])); ?></div><?php endif; ?>
                            </td>
                            <td class="text-end">
                                <?php echo e($r->color_counter !== null ? number_format($r->color_counter) : '—'); ?>

                                <?php if($row['color_used'] !== null): ?><div class="text-muted">+<?php echo e(number_format($row['color_used'])); ?></div><?php endif; ?>
                            </td>
                            <td class="text-end">
                                <?php echo e($r->scan_counter !== null ? number_format($r->scan_counter) : '—'); ?>

                                <?php if($row['scan_used'] !== null): ?><div class="text-muted">+<?php echo e(number_format($row['scan_used'])); ?></div><?php endif; ?>
                            </td>
                            <td class="text-nowrap">
                                <?php if($r->toner_black || $r->toner_cyan || $r->toner_magenta || $r->toner_yellow): ?>
                                    B<?php echo e($r->toner_black ?? '–'); ?> C<?php echo e($r->toner_cyan ?? '–'); ?> M<?php echo e($r->toner_magenta ?? '–'); ?> Y<?php echo e($r->toner_yellow ?? '–'); ?>

                                <?php else: ?> — <?php endif; ?>
                            </td>
                            <td><?php echo e($r->technician?->name ?? '—'); ?></td>
                            <td><?php echo e($r->description ?? '—'); ?></td>
                            <td class="text-end text-nowrap">
                                <a href="<?php echo e(route('readings.edit', $r)); ?>" class="btn btn-sm btn-light border">Измени</a>
                                <form method="POST" action="<?php echo e(route('readings.destroy', $r)); ?>" class="d-inline"
                                      onsubmit="return confirm('Избриши го читањето?');">
                                    <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                                    <button class="btn btn-sm btn-outline-danger">Избриши</button>
                                </form>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="8" class="text-center text-muted py-4">Сè уште нема читања</td></tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php /**PATH /Users/gego/Desktop/sterna/resources/views/printers/show.blade.php ENDPATH**/ ?>