<?php
    $equipment = !empty($equipment) ? $equipment : '';
    $serviceID = !empty($attribution) ? (int) $attribution->service_id : 0;
    $attr_date = !empty($attribution) ? $attribution->attr_date : '';
    $equipmentID = !empty($equipment) ? (int) $equipment->id : 0;
    $modelID = !empty($equipment) ? (int) $equipment->modele_id : '';
    $brandID = !empty($equipment) ? (int) $equipment->brand_id : '';
    $processorID = !empty($equipment) ? (int) $equipment->processor_id : '';
    $systemID = !empty($equipment) ? (int) $equipment->system_id : '';
    $storagetypeID = !empty($equipment) ? (int) $equipment->storagetype_id : '';
    $hard_disk = !empty($equipment) ? $equipment->hard_disk : '';
    $ram = !empty($equipment) ? $equipment->ram : '';
    $serial_number = !empty($equipment) ? $equipment->serial_number : '';
?>

<form class="form" action="<?php echo e(route('set.laptop')); ?>" method="post">

    <div>
        <?php echo csrf_field(); ?>
        <input type="hidden" value="<?php echo e($equipmentSelected->id); ?>" id="equipmenttypeID">
        <input type="hidden" value="<?php echo e($equipmentID); ?>" id="rowID" name="rowID">

        <!--begin::Input group-->
        <div class="fv-row mb-7 fv-plugins-icon-container row">
            <div class="col-md-4">
                <!--begin::Label-->
                <label class="required fs-6 fw-semibold mb-2">Marque & modèle</label>
                <!--end::Label-->

                <!--begin::Select2-->
                <select class="form-select" data-control="select2" data-placeholder="Selectionnez une option"
                    name="modele_id">
                    <option></option>
                    <?php $__empty_1 = true; $__currentLoopData = $modelesByType; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <?php
                            $selected = $item->id == $modelID ? 'selected' : '';
                        ?>
                        <option value="<?php echo e($item->id); ?>" <?php echo e($selected); ?>><?php echo e(ucfirst($item->concat)); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <?php endif; ?>
                </select>
                <!--end::Select2-->
                <?php if($errors->has('modele_id')): ?>
                    <div class="text-danger"><?php echo e($errors->first('modele_id')); ?></div>
                <?php endif; ?>
            </div>

            <div class="col-md-4">
                <!--begin::Label-->
                <label class="fs-6 fw-semibold mb-2">Type de stockage</label>
                <!--end::Label-->

                <!--begin::Select2-->
                <select class="form-select" data-control="select2" data-placeholder="Selectionnez une option"
                    name="storagetype_id">
                    <option></option>
                    <?php $__empty_1 = true; $__currentLoopData = $storagetypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $storagetype): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <?php
                            $selected = $storagetype->id == $storagetypeID ? 'selected' : '';
                        ?>
                        <option value="<?php echo e($storagetype->id); ?>" <?php echo e($selected); ?>>
                            <?php echo e(mb_strtoupper($storagetype->name)); ?></option>

                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <?php endif; ?>
                </select>
                <!--end::Select2-->
                <?php if($errors->has('storagetype_id')): ?>
                    <div class="text-danger"><?php echo e($errors->first('storagetype_id')); ?></div>
                <?php endif; ?>
            </div>

            <div class="col-md-4">
                <!--begin::Label-->
                <label class="fs-6 fw-semibold mb-2">Système d'exploitation</label>
                <!--end::Label-->

                <!--begin::Select2-->
                <select class="form-select" data-control="select2" data-placeholder="Selectionnez une option"
                    name="operatingsystem_id">
                    <option></option>
                    <?php $__empty_1 = true; $__currentLoopData = $systems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $system): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <?php
                            $selected = $system->id == $systemID ? 'selected' : '';
                        ?>
                        <option value="<?php echo e($system->id); ?>" <?php echo e($selected); ?>><?php echo e(ucfirst($system->name)); ?></option>

                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <?php endif; ?>
                </select>
                <!--end::Select2-->
                <?php if($errors->has('operatingsystem_id')): ?>
                    <div class="text-danger"><?php echo e($errors->first('operatingsystem_id')); ?></div>
                <?php endif; ?>
            </div>
        </div>
        <!--end::Input group-->


        <!--begin::Input group-->
        <div class="fv-row mb-7 fv-plugins-icon-container row">
            <div class="col-md-3">
                <!--begin::Label-->
                <label class="fs-6 fw-semibold mb-2">Processeur</label>
                <!--end::Label-->

                <!--begin::Select2-->
                <select class="form-select" data-control="select2" data-placeholder="Selectionnez une option"
                    name="processor_id">
                    <option></option>
                    <?php $__empty_1 = true; $__currentLoopData = $processors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $processor): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <?php
                            $selected = $processor->id == $processorID ? 'selected' : '';
                        ?>
                        <option value="<?php echo e($processor->id); ?>" <?php echo e($selected); ?>><?php echo e(ucfirst($processor->name)); ?>

                        </option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <?php endif; ?>
                </select>
                <!--end::Select2-->
                <?php if($errors->has('processor_id')): ?>
                    <div class="text-danger"><?php echo e($errors->first('processor_id')); ?></div>
                <?php endif; ?>
            </div>
            <div class="col-md-3">
                <!--begin::Label-->
                <label class="required fs-6 fw-semibold mb-2">Numéro de série</label>
                <!--end::Label-->

                <!--begin::input-->
                <input type="text" class="form-control form-control-lg form-control-solid" name="serial_number"
                    value="<?php echo e($serial_number); ?>">
                <!--end::input-->

                <?php if($errors->has('serial_number')): ?>
                    <div class="text-danger"><?php echo e($errors->first('serial_number')); ?></div>
                <?php endif; ?>
            </div>

            <div class="col-md-3">
                <!--begin::Label-->
                <label class="fs-6 fw-semibold mb-2">Mémoire RAM</label>
                <!--end::Label-->

                <!--begin::input-->
                <input type="number" class="form-control form-control-lg form-control-solid" name="ram"
                    value="<?php echo e($ram); ?>">
                <!--end::input-->
                <?php if($errors->has('ram')): ?>
                    <div class="text-danger"><?php echo e($errors->first('ram')); ?></div>
                <?php endif; ?>
            </div>

            <div class="col-md-3">
                <!--begin::Label-->
                <label class="fs-6 fw-semibold mb-2">Disque dur</label>
                <!--end::Label-->

                <!--begin::input-->
                <input type="number" class="form-control form-control-lg form-control-solid" name="hard_disk"
                    value="<?php echo e($hard_disk); ?>">
                <!--end::input-->
                <?php if($errors->has('hard_disk')): ?>
                    <div class="text-danger"><?php echo e($errors->first('hard_disk')); ?></div>
                <?php endif; ?>
            </div>
        </div>
        <!--end::Input group-->

        <!--begin::Input group-->
        <div class="fv-row mb-7 fv-plugins-icon-container row">
            <div class="col-md-8">
                <!--begin::Label-->
                <label class="required fs-6 fw-semibold mb-2">Service</label>
                <!--end::Label-->

                <!--begin::Select2-->
                <select class="form-select" data-control="select2" data-placeholder="Selectionnez une option"
                    name="service_id">
                    <option></option>
                    <?php $__empty_1 = true; $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $service): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <?php
                            $selected = $service->id == $serviceID ? 'selected' : '';
                        ?>
                        <option value="<?php echo e($service->id); ?>" <?php echo e($selected); ?>><?php echo e(ucfirst($service->name)); ?>

                        </option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <?php endif; ?>
                </select>
                <!--end::Select2-->
                <?php if($errors->has('service_id')): ?>
                    <div class="text-danger"><?php echo e($errors->first('service_id')); ?></div>
                <?php endif; ?>
            </div>

            <div class="col-md-4">
                <!--begin::Label-->
                <label class="fs-6 fw-semibold mb-2">Date d'attribution</label>
                <!--end::Label-->

                <!--begin::input-->
                <input type="text" class="form-control form-control-lg form-control-solid" name="attr_date"
                    id="attr_date" placeholder="Choisir la date d'attribution" value="<?php echo e($attr_date); ?>">
                <!--end::input-->
                <?php if($errors->has('attr_date')): ?>
                    <div class="text-danger"><?php echo e($errors->first('attr_date')); ?></div>
                <?php endif; ?>
            </div>
        </div>
        <!--end::Input group-->

    </div>
    <!--begin::Modal footer-->
    <div class="modal-footer flex-center">
        <!--begin::Button-->
        <button type="submit" class="btn btn-primary w-100">
            <span class="indicator-label">
                Attribuer l'équipement
            </span>
        </button>
        <!--end::Button-->
    </div>
    <!--end::Modal footer-->
</form>
<?php /**PATH C:\laragon\www\helpdesk\resources\views/backoffice/attributions/attribution/forms/laptop.blade.php ENDPATH**/ ?>