HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/ipsremont-demo/storage/framework/views/45f22212e1cd3120a2513360d216cf481c344006.php
<?php

/**
 * @var mixed $data
 * @var string $type
 */

use App\Models\Device;
use App\Models\Part;
use App\Models\PartsStorage;
use App\Models\Permission;
use App\Models\Schema;
use Illuminate\Support\Collection;

if ('schema' === $type) {
    /** @var Schema $data */
    $schema = $data;
} else {
    /** @var Device $data */
    $schema = $data->schema();
}

/** @var Collection $parts */
$parts = $schema->getParts();

?>
<table class="table table-hover parts-table">
    <?php echo e($type); ?>

    <tbody>
    <?php if(!$parts->isEmpty()): ?>
            <?php
            $partsIds = [];
            foreach ($parts as $part) {
                $partsIds[] = $part->id;
            }
            $counts = [];
            $partsStorage = PartsStorage::query()->whereIn('part_id', $partsIds)->get();
            foreach ($partsStorage as $row) {
                if (empty($counts[$row['part_id']])) {
                    $counts[$row['part_id']] = 0;
                }
                $counts[$row['part_id']] += $row->amount;
            }
            ?>
        <?php $__currentLoopData = $parts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $part): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php /** @var Part $part */ ?>
            <tr class="font-size-lg">
                <td class="d-flex align-items-center">
                    <!--begin::Symbol-->
                    <div class="symbol symbol-60 flex-shrink-0 mr-4 bg-light">
                        <div class="symbol-label" style="background-image: url('<?php echo e($part->getImage()); ?>')"></div>
                    </div>
                    <!--end::Symbol-->
                    <div class="d-flex flex-column flex-grow-1 my-lg-0 my-2 pr-3">
                        <span class="text-dark-75">
                            <?php echo e(($type == 'device') ? $part->device_parts->label() : $part->schema_parts()->where('schema_external_id', $schema->external_id)->first()->label()); ?>

                            <?php if(empty($counts[$part->id])): ?>
                                <span class="text-danger">(нет в наличии)</span>
                            <?php endif; ?>
                        </span>
                        <a href="<?php echo e(route('specifications.categories.device.part', $part->id)); ?>" class="text-primary font-weight-bolder text-hover-primary font-size-lg"><?php echo e($part->getName()); ?></a>
                        <span class="text-dark-75 font-weight-bold font-size-sm my-1"><?php echo e($part->external_id); ?></span>
                    </div>
                </td>
                <?php if(can([Permission::orders, Permission::actions])): ?>
                    <td class="text-right">
                        <?php echo e(($type == 'device') ? $part->device_parts->amount : $part->schema_parts->where('schema_external_id', $schema->external_id)->first()->amount); ?> <?php echo e($part->getItemName()); ?>

                    </td>
                <?php endif; ?>
                <td class="text-right align-middle font-weight-bolder font-size-h5">
                    <?php echo number_format($part->price, 2, ',', ' ') . ' &#8381;' ?>
                </td>
                <?php if(can([Permission::orders, Permission::actions])): ?>
                    <td class="js-go-to text-right align-middle">
                        <button id="add-to-cart" data-token="<?php echo e(csrf_token()); ?>" data-id="<?php echo e($part->id); ?>" type="submit" class="btn btn-warning text-uppercase font-weight-bold ml-3 add-to-cart">
                            <?php echo app('translator')->get('parts.toCart'); ?>
                        </button>
                    </td>
                <?php endif; ?>
            </tr>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    <?php else: ?>
        <tr>
            <td align="center"><?php echo app('translator')->get('parts.notFound'); ?></td>
        </tr>
    <?php endif; ?>
    </tbody>
</table>
<?php /**PATH /var/www/ipsremont-demo/resources/views/specifications/_table.blade.php ENDPATH**/ ?>