@extends('Templates/templateAdmin')

@section('Main-content')

    @if (session('success'))
        <div class="alert alert-success" role="alert" id="alert-message-success" style="transition: opacity 1s;">
            {{ session('success') }}
        </div>
        <script>
            setTimeout(function() {
                $('#alert-message-success').fadeOut('slow', function() {
                    $(this).remove();
                });
            }, 5000); // A mensagem desaparecerá após 5 segundos
        </script>
    @endif

    @if (session('danger'))
        <div class="alert alert-danger" role="alert" id="alert-message-danger" style="transition: opacity 1s;">
            {{ session('danger') }}
        </div>
        <script>
            setTimeout(function() {
                $('#alert-message-danger').fadeOut('slow', function() {
                    $(this).remove();
                });
            }, 5000); // A mensagem desaparecerá após 5 segundos
        </script>
    @endif

    <section class="content-header">
        <div class="container-fluid">
            <!-- Progressbar -->

            <ul id="progressbar" class="nav nav-pills d-flex flex-sm-row justify-content-center">
                <li class="@if ($step == 2) active @endif "></li>
                {{-- Project details --}}
                <li class="@if ($step == 2) active @endif "></li>
                {{-- Articulated --}}
                <li class="@if ($step == 3) active @endif "></li>
                {{-- Workstation --}}
            </ul>

        </div>
    </section>
    {{-- ./content-header --}}

    <fieldset class="content">
        <div class="container-fluid">

            <div class="card card-primary">
                <div class="card-header">
                    <h3 class="card-title">Articulado</h3>
                </div>
                <!-- ./Card-header -->

                <div class="card-body">
                    <div class="card card-success collapsed-card">
                        <div class="card-header">
                            <h3 class="card-title">Criar Equipamentos Manualmente</h3>

                            <div class="card-tools">
                                <button type="button" class="btn btn-tool" data-card-widget="collapse"><i
                                        class="fas fa-plus"></i>
                                </button>
                            </div>
                            <!-- /.card-tools -->
                        </div>
                        <!-- /.card-header -->
                        <div class="card-body">
                            <form action="{{ route('test2CreateEquipment') }}" method="POST">
                                @csrf
                                {{-- Vai receber o valor do ID da obra e passar diretamente para o controller, esta em hidden pois nao e necessario mostrar seu campo ao utilizador --}}
                                <input type="hidden" name="numberProject" value="{{ $numberProject }}">

                                <div class="row">
                                    <!-- select -->
                                    <div class="form-group col-sm-6">
                                        <label>Fabrica</label>
                                        <select class="form-control" name="unit_id" id="unit_select" required>
                                            <option value='' hidden>Selecione Fabrica...</option>
                                            <option value="new">Criar Fabrica...</option>
                                            @foreach ($checkUnits as $checkUnit)
                                                <option value="{{ $checkUnit->unit_id }}">
                                                    {{ $checkUnit->unit_name }}
                                                </option>
                                            @endforeach
                                        </select>
                                    </div>

                                    <div class="form-group col-sm-6" id="new_unit_div">
                                        <label>Nova Fabrica :</label>
                                        <input type="text" id="new_unit_name" class="form-control" name="new_unit_name"
                                            placeholder="Digite o nome da nova empresa" required>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label>Tipo de equipamento</label>
                                    <select class="form-control" name="equipmentTypeId" {{-- equipmentType_id --}}
                                        id="equipmentType_id_list" required>
                                        <option value='' hidden>Selecionar Tipo de equipamento...</option>
                                        @foreach ($typeEquipments as $typeEquipment)
                                            <option value="{{ $typeEquipment->equipment_type_id }}">
                                                {{ $typeEquipment->equipment_type_name }}</option>
                                        @endforeach
                                    </select>
                                </div>

                                <!-- PSV-card -->
                                <div id="psv_card" class="card card-secondary">
                                    <div class="card-header">
                                        <h3 class="card-title">PSV</h3>
                                    </div>
                                    <!-- /.card-header -->
                                    <div class="card-body">

                                        <div class="row">
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-tagEquipment">
                                                        <i class="fa-sharp fa-solid fa-tag" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="tag"
                                                            class="form-control card_inputs" id="equipmentTag"
                                                            placeholder="Tag..." aria-label="Tag Equipment"
                                                            aria-describedby="form-tagEquipment" required>
                                                        <label>Tag <span class="required">*</span></label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-equipmentDescription">
                                                        {{-- <i class="fa fa-id-badge"></i> --}}
                                                        <i class="fa-sharp fa-regular fa-newspaper"
                                                            style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="equipmentDescription"
                                                            class="form-control card_inputs" id="equipmentDescription"
                                                            placeholder="Descricao Equipamento..."
                                                            aria-label="Tag Equipment"
                                                            aria-describedby="form-equipmentDescription" required>
                                                        <label>Descricao Equipamento <span class="required">*</span></label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        {{-- 3 inputs per line :equipmentSerialNumber, equipmentBrand, equipmentModel  --}}
                                        <div class="row">
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-serialNumberEquipment">
                                                        <i class="fa-solid fa-barcode" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="serialNumberEquipment"
                                                            class="form-control card_inputs" id="equipmentSerialNumber"
                                                            placeholder="Número de série"
                                                            aria-label="Serial Number Equipment"
                                                            aria-describedby="form-serialNumberEquipment">
                                                        <label>Número de série </label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-equipmentBrand">
                                                        <i class="fa-solid fa-object-group" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="equipmentBrand"
                                                            class="form-control card_inputs" id="equipmentBrand"
                                                            placeholder="Marca" aria-label="Serial Number Equipment"
                                                            aria-describedby="form-equipmentBrand">
                                                        <label>Marca</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-equipmentModel">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="equipmentModel"
                                                            class="form-control card_inputs" id="equipmentModel"
                                                            placeholder="Modelo" aria-label="Serial Number Equipment"
                                                            aria-describedby="form-equipmentModel">
                                                        <label>Modelo</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 3 inputs per line :equipmentDimension, equipmentRating, equipmentDimcerta  --}}
                                        <div class="row">
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-dimension">
                                                        <i class="fa-solid fa-ruler " style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="dimension"
                                                            class="form-control card_inputs" id="dimension"
                                                            placeholder="Dimensão" aria-label="Serial Number Equipment"
                                                            aria-describedby="form-dimension">
                                                        <label>Dimensão</label>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-rating">
                                                        <i class="fa-solid fa-ranking-star" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="rating"
                                                            class="form-control card_inputs" id="rating"
                                                            placeholder="Rating..." aria-label="Serial Number Equipment"
                                                            aria-describedby="form-rating">
                                                        <label>Rating</label>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-dim_certa">
                                                        <i class="fa-sharp fa-regular fa-square-poll-vertical"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="dim_certa"
                                                            class="form-control card_inputs" id="dim_certa"
                                                            placeholder="Dim certa..."
                                                            aria-label="Serial Number Equipment"
                                                            aria-describedby="form-dim_certa">
                                                        <label>Dim certa</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 3 inputs per line : main_equipment, p&id, sap_number --}}
                                        <div class="row">
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-main_equipment">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="main_equipment"
                                                            class="form-control card_inputs" id="main_equipment"
                                                            placeholder="Main Equipment" aria-label="Main Equipment"
                                                            aria-describedby="form-main_equipment">
                                                        <label>Main Equipment</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-p&id">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="p&id"
                                                            class="form-control card_inputs" id="p&id"
                                                            placeholder="P&ID" aria-label="P & id"
                                                            aria-describedby="form-p&id">
                                                        <label>P&ID</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-sap_number">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="sap_number"
                                                            class="form-control card_inputs" id="sap_number"
                                                            placeholder="Nº SAP" aria-label="Numero Sap"
                                                            aria-describedby="form-sap_number">
                                                        <label>Nº SAP</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 3 inputs per line :SP_(Bar)_Cold, Back_Presure_(Bar), material  --}}
                                        <div class="row">
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-SP_(Bar)_Cold">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="SP_(Bar)_Cold"
                                                            class="form-control card_inputs" id="SP_(Bar)_Cold"
                                                            placeholder="SP (Bar) Cold" aria-label="SP (Bar) Cold"
                                                            aria-describedby="form-SP_(Bar)_Cold">
                                                        <label>SP (Bar) Cold</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-Back_Presure_(Bar)">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="Back_Presure_(Bar)"
                                                            class="form-control card_inputs" id="Back_Presure_(Bar)"
                                                            placeholder="Back Presure (Bar)"
                                                            aria-label="Back Presure (Bar)"
                                                            aria-describedby="form-Back_Presure_(Bar)">
                                                        <label>Back Presure (Bar)</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-material">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="material"
                                                            class="form-control card_inputs" id="material"
                                                            placeholder="Material" aria-label="Material"
                                                            aria-describedby="form-material">
                                                        <label>Material</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 2 inputs per line :  --}}
                                        <div class="row">
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-manufacturer">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="manufacturer"
                                                            class="form-control card_inputs" id="manufacturer"
                                                            placeholder="Fabricante" aria-label="Fabricante"
                                                            aria-describedby="form-manufacturer">
                                                        <label>Fabricante</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-isolation">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="isolation"
                                                            class="form-control card_inputs" id="isolation"
                                                            placeholder="Isolamento" aria-label="Isolamento"
                                                            aria-describedby="form-isolation">
                                                        <label>Isolamento</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 2 Selects per line :psv_scaffold, psv_crane --}}
                                        <div class="row">
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <select class="form-control card_inputs" name="scaffold">
                                                            <option value="Sim">Sim</option>
                                                            <option value="Nao" selected>Nao</option>
                                                        </select>
                                                        <label>Andaime?</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <select class="form-control card_inputs" name="crane">
                                                            <option value="Sim">Sim</option>
                                                            <option value="Nao" selected>Nao</option>
                                                        </select>
                                                        <label>Grua?</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}
                                    </div>
                                    <!-- /.card-body -->
                                </div>
                                {{-- ./psv_card --}}

                                <!-- ISV-card -->
                                <div id="isv_card" class="card card-primary">
                                    <div class="card-header">
                                        <h3 class="card-title">ISV</h3>
                                    </div>
                                    <!-- /.card-header -->
                                    <div class="card-body">
                                        {{-- 2 inputs per line :equipmentTag ,equipmentDescription --}}
                                        <div class="row">
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-tagEquipment">
                                                        <i class="fa-sharp fa-solid fa-tag" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="tag"
                                                            class="form-control card_inputs" id="equipmentTag"
                                                            placeholder="Tag..." aria-label="Tag Equipment"
                                                            aria-describedby="form-tagEquipment" required>
                                                        <label>Tag <span class="required">*</span></label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-equipmentDescription">
                                                        <i class="fa-sharp fa-regular fa-newspaper"
                                                            style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="equipmentDescription"
                                                            class="form-control card_inputs" id="equipmentDescription"
                                                            placeholder="Descricao Equipamento..."
                                                            aria-label="Tag Equipment"
                                                            aria-describedby="form-equipmentDescription" required>
                                                        <label>Descricao Equipamento <span
                                                                class="required">*</span></label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 3 inputs per line :serialNumberEquipment, equipmentBrand, equipmentModel  --}}
                                        <div class="row">
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-serialNumberEquipment">
                                                        <i class="fa-solid fa-barcode" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="serialNumberEquipment"
                                                            class="form-control card_inputs" id="equipmentSerialNumber"
                                                            placeholder="Número de série"
                                                            aria-label="Serial Number Equipment"
                                                            aria-describedby="form-serialNumberEquipment">
                                                        <label>Número de série </label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-equipmentBrand">
                                                        <i class="fa-solid fa-object-group" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="equipmentBrand"
                                                            class="form-control card_inputs" id="equipmentBrand"
                                                            placeholder="Marca" aria-label="Marca Equipamento"
                                                            aria-describedby="form-equipmentBrand">
                                                        <label>Marca</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-equipmentModel">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="equipmentModel"
                                                            class="form-control card_inputs" id="equipmentModel"
                                                            placeholder="Modelo" aria-label="Modelo Equipamento"
                                                            aria-describedby="form-equipmentModel">
                                                        <label>Modelo</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 3 inputs per line :equipmentDimension, equipmentRating, equipmentDimcerta  --}}
                                        <div class="row">
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-dimension">
                                                        <i class="fa-solid fa-ruler " style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="dimension"
                                                            class="form-control card_inputs" id="dimension"
                                                            placeholder="Dimensão" aria-label="Dimensao Equipamento"
                                                            aria-describedby="form-dimension">
                                                        <label>Dimensão</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-rating">
                                                        <i class="fa-solid fa-ranking-star" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="rating"
                                                            class="form-control card_inputs" id="rating"
                                                            placeholder="Rating..." aria-label="Rating Equipamento"
                                                            aria-describedby="form-rating">
                                                        <label>Rating</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-dim_certa">
                                                        <i class="fa-sharp fa-regular fa-square-poll-vertical"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="dim_certa"
                                                            class="form-control card_inputs" id="dim_certa"
                                                            placeholder="Dim certa..." aria-label="Dim certa Equipamento"
                                                            aria-describedby="form-dim_certa">
                                                        <label>Dim certa</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 3 Inputs per line :main_equipment ,p&id ,sap_number --}}
                                        <div class="row">
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-main_equipment">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="main_equipment"
                                                            class="form-control card_inputs" id="main_equipment"
                                                            placeholder="Main Equipment" aria-label="Main Equipment"
                                                            aria-describedby="form-main_equipment">
                                                        <label>Main Equipment</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-P_IidEquipment">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="p&id"
                                                            class="form-control card_inputs" id="P_idEquipment"
                                                            placeholder="P&ID" aria-label="P&ID"
                                                            aria-describedby="form-P_IidEquipment">
                                                        <label>P&ID</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-NumberSapEquipment">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="sap_number"
                                                            class="form-control card_inputs" id="NumberSapEquipment"
                                                            placeholder="Nº SAP" aria-label="Numero SAP Equipamento"
                                                            aria-describedby="form-NumberSapEquipment">
                                                        <label>Nº SAP</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 3 Inputs per line :material ,manufacturerEquipment ,isolationEquipment    --}}
                                        <div class="row">
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-materialEquipment">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="material"
                                                            class="form-control card_inputs" id="materialEquipment"
                                                            placeholder="Material" aria-label="Material Equipamento"
                                                            aria-describedby="form-materialEquipment">
                                                        <label>Material</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-manufacturerEquipment">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="manufacturer"
                                                            class="form-control card_inputs" id="manufacturerEquipment"
                                                            placeholder="Fabricante" aria-label="Fabricante Equipamento"
                                                            aria-describedby="form-manufacturerEquipment">
                                                        <label>Fabricante</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-isolationEquipment">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="isolation"
                                                            class="form-control card_inputs" id="isolationEquipment"
                                                            placeholder="Isolamento" aria-label="Isolamento Equipamento"
                                                            aria-describedby="form-isolationEquipment">
                                                        <label>Isolamento</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 2 Selects per line :psv_scaffold, psv_crane --}}
                                        <div class="row">
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <select class="form-control card_inputs" name="scaffold">
                                                            <option value="Sim">Sim</option>
                                                            <option value="Nao" selected>Nao</option>
                                                        </select>
                                                        <label>Andaime?</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <select class="form-control card_inputs" name="crane">
                                                            <option value="Sim">Sim</option>
                                                            <option value="Nao" selected>Nao</option>
                                                        </select>
                                                        <label>Grua?</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}
                                    </div>
                                    <!-- /.card-body -->
                                </div>
                                <!-- ./ISV-card -->


                                <!-- CV-card -->
                                <div id="cv_card" class="card card-info">

                                    <div class="card-header">
                                        <h3 class="card-title">CV</h3>
                                    </div>
                                    <!-- /.card-header -->
                                    <div class="card-body">
                                        {{-- 2 inputs per line :equipmentTag ,equipmentDescription --}}
                                        <div class="row">
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-tagEquipment">
                                                        <i class="fa-sharp fa-solid fa-tag" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="tag"
                                                            class="form-control card_inputs" id="equipmentTag"
                                                            placeholder="Tag..." aria-label="Tag Equipment"
                                                            aria-describedby="form-tagEquipment" required>
                                                        <label>Tag <span class="required">*</span></label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-equipmentDescription">
                                                        <i class="fa-sharp fa-regular fa-newspaper"
                                                            style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="equipmentDescription"
                                                            class="form-control card_inputs" id="equipmentDescription"
                                                            placeholder="Descricao Equipamento..."
                                                            aria-label="equipmentDescription"
                                                            aria-describedby="form-equipmentDescription" required>
                                                        <label>Descricao Equipamento <span
                                                                class="required">*</span></label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 3 inputs per line :serialNumberEquipment, equipmentBrand, equipmentModel  --}}
                                        <div class="row">
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-serialNumberEquipment">
                                                        <i class="fa-solid fa-barcode" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="serialNumberEquipment"
                                                            class="form-control card_inputs" id="equipmentSerialNumber"
                                                            placeholder="Número de série"
                                                            aria-label="Serial Number Equipment"
                                                            aria-describedby="form-serialNumberEquipment">
                                                        <label>Número de série </label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-equipmentBrand">
                                                        <i class="fa-solid fa-object-group" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="equipmentBrand"
                                                            class="form-control card_inputs" id="equipmentBrand"
                                                            placeholder="Modelo" aria-label="Marca Equipamento"
                                                            aria-describedby="form-equipmentBrand">
                                                        <label>Marca</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-equipmentModel">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="equipmentModel"
                                                            class="form-control card_inputs" id="equipmentModel"
                                                            placeholder="Modelo" aria-label="Modelo Equipamento"
                                                            aria-describedby="form-equipmentModel">
                                                        <label>Modelo</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 3 inputs per line :equipmentDimension, equipmentRating, equipmentDimcerta  --}}
                                        <div class="row">
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-dimension">
                                                        <i class="fa-solid fa-ruler " style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="dimension"
                                                            class="form-control card_inputs" id="dimension"
                                                            placeholder="Dimensão" aria-label="Dimensao Equipamento"
                                                            aria-describedby="form-dimension">
                                                        <label>Dimensão</label>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-rating">
                                                        <i class="fa-solid fa-ranking-star" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="rating"
                                                            class="form-control card_inputs" id="rating"
                                                            placeholder="Rating..." aria-label="Rating Equipamento"
                                                            aria-describedby="form-rating">
                                                        <label>Rating</label>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-dim_certa">
                                                        <i class="fa-sharp fa-regular fa-square-poll-vertical"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="dim_certa"
                                                            class="form-control card_inputs" id="dim_certa"
                                                            placeholder="Dim certa..." aria-label="Dim certa Equipamento"
                                                            aria-describedby="form-dim_certa">
                                                        <label>Dim certa</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 3 Inputs per line :main_equipment ,P_idEquipment ,NumberSapEquipment --}}
                                        <div class="row">
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-main_equipment">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="main_equipment"
                                                            class="form-control card_inputs" id="main_equipment"
                                                            placeholder="Main Equipment" aria-label="Main Equipment"
                                                            aria-describedby="form-main_equipment">
                                                        <label>Main Equipment</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-P_IidEquipment">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="p&id"
                                                            class="form-control card_inputs" id="p&id"
                                                            placeholder="P&ID" aria-label="P&ID"
                                                            aria-describedby="form-P_IidEquipment">
                                                        <label>P&ID</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-NumberSapEquipment">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="sap_number"
                                                            class="form-control card_inputs" id="sap_number"
                                                            placeholder="Nº SAP" aria-label="Numero SAP Equipamento"
                                                            aria-describedby="form-NumberSapEquipment">
                                                        <label>Nº SAP</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 3 Inputs per line :materialEquipment ,manufacturerEquipment ,isolationEquipment    --}}
                                        <div class="row">
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-materialEquipment">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="material"
                                                            class="form-control card_inputs" id="material"
                                                            placeholder="Material" aria-label="Material Equipamento"
                                                            aria-describedby="form-materialEquipment">
                                                        <label>Material</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-manufacturerEquipment">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="manufacturer"
                                                            class="form-control card_inputs" id="manufacturerEquipment"
                                                            placeholder="Fabricante" aria-label="Fabricante Equipamento"
                                                            aria-describedby="form-manufacturerEquipment">
                                                        <label>Fabricante</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-isolationEquipment">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="isolation"
                                                            class="form-control card_inputs" id="isolation"
                                                            placeholder="Isolamento" aria-label="Isolamento Equipamento"
                                                            aria-describedby="form-isolationEquipment">
                                                        <label>Isolamento</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 3 Inputs per line : actuatorManufacturer,   --}}
                                        <div class="row">
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-actuatorManufacturer">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="actuatorManufacturer"
                                                            class="form-control card_inputs" id="actuatorManufacturer"
                                                            placeholder="Fabricante do atuador"
                                                            aria-label="Fabricante do Atuador"
                                                            aria-describedby="form-actuatorManufacturer">
                                                        <label>Fabricante do atuador</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-ActuatorModel">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="ActuatorModel"
                                                            class="form-control card_inputs" id="ActuatorModel"
                                                            placeholder="Modelo do atuador" aria-label="Modelo do atuador"
                                                            aria-describedby="form-ActuatorModel">
                                                        <label>Modelo do atuador</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-4">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-actuatorSerialNumber">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="actuatorSerialNumber"
                                                            class="form-control card_inputs" id="actuatorSerialNumber"
                                                            placeholder="N.º de série do atuador"
                                                            aria-label="Numero de série do atuado"
                                                            aria-describedby="form-actuatorSerialNumber">
                                                        <label>N.º de série do atuador</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./Row --}}

                                        {{-- 2 Inputs per line : actuatorManufacturer,   --}}
                                        <div class="row">
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-PositionerManufacturer">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="PositionerManufacturer"
                                                            class="form-control card_inputs" id="PositionerManufacturer"
                                                            placeholder="Fabricante do posicionador"
                                                            aria-label="Fabricante do posicionador"
                                                            aria-describedby="form-PositionerManufacturer">
                                                        <label>Fabricante do posicionador</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text" id="form-PositionerSerialNumber">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <input type="text" name="PositionerSerialNumber"
                                                            class="form-control card_inputs" id="PositionerSerialNumber"
                                                            placeholder="N.º de série do posicionador"
                                                            aria-label="Numero de série do posicionador"
                                                            aria-describedby="form-PositionerSerialNumber">
                                                        <label>N.º de série do posicionador</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}

                                        {{-- 2 Selects per line :psv_scaffold, psv_crane --}}
                                        <div class="row">
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <select class="form-control card_inputs" name="scaffold">
                                                            <option value="Sim">Sim</option>
                                                            <option value="Nao" selected>Nao</option>
                                                        </select>
                                                        <label>Andaime?</label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="form-group col-sm-6">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text">
                                                        <i class="fa-solid fa-cubes" style="color: #00B0EA;"></i>
                                                    </span>
                                                    <div class="has-float-label">
                                                        <select class="form-control card_inputs" name="crane">
                                                            <option value="Sim">Sim</option>
                                                            <option value="Nao" selected>Nao</option>
                                                        </select>
                                                        <label>Grua?</label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        {{-- ./row --}}
                                    </div>
                                    <!-- /.card-body -->
                                </div>
                                <!-- ./CV-card -->

                                <div class="form-group">
                                    <label>Ambitos</label>
                                    <select class="form-control" name="EquipmentAmbit" id="AmbitsEquipments_list"
                                        required>
                                        <option value='' hidden>Selecionar Ambito...</option>
                                    </select>
                                </div>


                                <div class="form-group col-sm-4">
                                    <button type="submit" class="btn btn-primary">Guardar</button>
                                </div>
                            </form>
                        </div>

                    </div>

                    <div class="card card-primary collapsed-card">
                        <div class="card-header">
                            <h3 class="card-title">Selecionar Equipamentos</h3>

                            <div class="card-tools">
                                <button type="button" class="btn btn-tool" data-card-widget="collapse"><i
                                        class="fas fa-plus"></i>
                                </button>
                            </div>
                            <!-- /.card-tools -->
                        </div>
                        <div class="card-body">

                            <div class="table-responsive">
                                <div class="row text-center">

                                    <div class="form-group col-sm-4">
                                        <label>Fabrica</label>
                                        <select class="form-control" name="unit_id" id="unit_select2">
                                            {{-- Antes era : 'unit_select' (caso de algum erro) --}}
                                            <option value='#' hidden>Selecione Fabrica...</option>
                                            @foreach ($checkUnits as $checkUnit)
                                                <option value="{{ $checkUnit->unit_id }}">
                                                    {{ $checkUnit->unit_name }}
                                                </option>
                                            @endforeach
                                        </select>
                                    </div>

                                    <div class="form-group col-sm-4">
                                        <label>Tipo de equipamento</label>
                                        <select class="form-control" name="equipmentType_id" id="equipmentType_id_list">
                                            <option value='#' hidden>Selecionar Tipo de equipamento...
                                            </option>

                                            @foreach ($typeEquipments as $typeEquipment)
                                                <option value="{{ $typeEquipment->equipment_type_id }}">
                                                    {{ $typeEquipment->equipment_type_name }}</option>
                                            @endforeach
                                        </select>
                                    </div>

                                    <div class="form-group col-sm-4">
                                        <label for="">Pesquisa</label>
                                        <input class="form-control" type="text">
                                    </div>

                                </div>

                                {{-- <table class="table table-bordered table-striped"> --}}
                                <table id="tableSelectEquipements" class="table table-bordered table-striped">

                                    <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>Fabrica</th>
                                            <th>Tipo de Equipamento</th>
                                            <th>Tag</th>
                                            <th>Descricao Equipamento</th>
                                            <th>Numero de Serie</th>
                                            <th>Marca</th>
                                            <th>Selecionar Equipamentos</th>
                                            <th>Editar</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {{-- @if (Session::has('listValves'))
                                                        @foreach (Session::get('listValves') as $valve) --}}
                                        @foreach ($listEquipmentsProjects as $listEquipmentsProject)
                                            <tr>
                                                <td>{{ $listEquipmentsProject->equipment_id }}</td>
                                                <td>{{ $listEquipmentsProject->unit->unit_name ?? 'Sem Fabrica Associada!!!' }}
                                                </td>
                                                <td>{{ $listEquipmentsProject->equipmentType->equipment_type_name ?? 'Sem tipo de Equipamento Associado!!!' }}
                                                </td>
                                                <td>{{ $listEquipmentsProject->equipment_tag }}</td>
                                                <td>{{ $listEquipmentsProject->equipment_description }}</td>
                                                <td>{{ $listEquipmentsProject->equipment_serial_number }}</td>
                                                <td>{{ $listEquipmentsProject->equipment_brand }}</td>
                                                {{-- <td>{{ $vallistEquipmentsProjectve->equipment_model }}</td> --}}

                                                <td class="text-center d-flex justify-content-around">
                                                    <div class="form-check">
                                                        <input class="form-check-input" type="checkbox"
                                                            value="uniqueValue" id="uniqueId">
                                                        <label class="form-check-label" for="uniqueId">
                                                            Recebe algo
                                                        </label>
                                                    </div>
                                                </td>
                                            </tr>
                                        @endforeach
                                    </tbody>
                                    <tfoot>
                                        <tr>
                                            <th>Selecionar tudo :</th>
                                        </tr>
                                    </tfoot>
                                </table>
                            </div>
                            {{-- ./table-responsive --}}
                        </div>
                    </div>

                    <form action="{{ route('processStep2') }}" method="post" enctype="multipart/form-data">

                        @csrf
                        <input type="hidden" name="numberProject" value="{{ $numberProject }}">
                        <div class="row">
                            <div class="col-sm-4 d-flex justify-content-center">
                                <a id="btn-download-template" href="{{ route('download') }}" class="btn btn-info">Baixar
                                    Template</a>
                            </div>
                            <div class="form-group col-sm-4">
                                <div class="input-group">
                                    <span class="input-group-text border rounded-left" id=""
                                        style="border-right: none;">
                                        <i class="fa-solid fa-file-arrow-up" style="color: #00B0EA;"></i>
                                    </span>
                                    <div class="custom-file border rounded-right" style="border-left: none;">
                                        <input type="file" class="custom-file-input" id="exampleInputFile"
                                            name="documento" accept=".xlsx, .xls">
                                        <label class="custom-file-label" for="exampleInputFile">Importar
                                            Articulado</label>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-4 d-flex justify-content-end">
                                <button type="submit" class="btn btn-primary">Enviar</button>
                            </div>
                        </div>

                        {{-- ./row --}}
                    </form>

                    <div class="row">
                        <div class="form-group col-sm-4">
                            <a href='#' data-toggle='modal' data-target='#modal-pedingEquipments'>
                                <button class="btn btn-danger">
                                    Pendentes :
                                    @if (isset($pendingEquipments))
                                        ({{ count($pendingEquipments) }})
                                    @endif
                                </button>
                            </a>
                        </div>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-bordered table-striped" id="ProjectEquipmentTable">
                            <thead>
                                <tr>
                                    <th>Fabrica</th>
                                    <th>Tipo de Equipamento</th>
                                    <th>Tag</th>
                                    <th>Descricao Equipamento</th>
                                    <th>Ambito</th>
                                    <th>Detalhes</th>
                                </tr>
                            </thead>
                            <tbody>

                                @foreach ($listEquipmentsProjects as $listEquipmentsProject)
                                    <tr>
                                        <td>{{ $listEquipmentsProject->unit->unit_name ?? 'Sem Fabrica Associada!!!' }}
                                        </td>
                                        <td>{{ $listEquipmentsProject->equipmentType->equipment_type_name ?? 'Sem tipo de Equipamento Associado!!!' }}
                                        </td>
                                        <td>{{ $listEquipmentsProject->equipment_tag }}</td>
                                        <td>{{ $listEquipmentsProject->equipment_description }}</td>
                                        <td>{{ $listEquipmentsProject->equipmentAssociationAmbit->ambitsEquipment->ambits_description ?? 'Sem Descrição Ambit Associada!!!' }}
                                        </td>
                                        <td class="text-center d-flex justify-content-around">
                                            <a href="#" class="open-modal"
                                                data-equipment-id="{{ $listEquipmentsProject->equipment_id }}"
                                                data-toggle="modal"
                                                data-target="#modal-showEquipment-{{ $listEquipmentsProject->equipment_id }}">
                                                <i class="fa-solid fa-eye text-secondary"></i>
                                            </a>
                                            <a href="#" data-toggle="modal"
                                                data-target="#modal-removeProjectEquipment-{{ $listEquipmentsProject->equipment_id }}">
                                                <i class="fa-solid fa-trash-alt text-danger"></i>
                                            </a>
                                        </td>
                                    </tr>
                                @endforeach
                            </tbody>
                        </table>
                    </div>
                    {{-- ./table-responsive --}}

                    @foreach ($listEquipmentsProjects as $listEquipmentsProject)
                        <div class="modal fade" id="modal-showEquipment-{{ $listEquipmentsProject->equipment_id }}">
                            <div class="modal-dialog modal-xl">
                                <div class="modal-content">
                                    <div class="modal-header bg-light">
                                        <h4 class="modal-title">Equipamento:</h4>
                                        <h3>{{ $listEquipmentsProject->equipment_tag }}</h3>
                                    </div>

                                    <div class="modal-body ">
                                        <form action="{{ route('EditEquipmentsProjects') }}" method="post">
                                            @csrf
                                            <input type="hidden" name="equipmentId"
                                                value="{{ $listEquipmentsProject->equipment_id }}">
                                            <input type="hidden" name="numberProject" value="{{ $numberProject }}">

                                            @if ($listEquipmentsProject->equipment_type_id == 3)
                                                <!-- PSV-card -->
                                                <div id="psv_card" class="card card-secondary specificAttributes-div">
                                                    <div class="card-header">
                                                        <h3 class="card-title">PSV</h3>
                                                    </div>
                                                    <!-- /.card-header -->
                                                    <div class="card-body">

                                                        <div class="row">
                                                            <div class="form-group col-sm-6">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text" id="form-tagEquipment">
                                                                        <i class="fa-sharp fa-solid fa-tag"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="tag"
                                                                            value="{{ $listEquipmentsProject->equipment_tag }}"
                                                                            class="form-control card_inputs"
                                                                            id="equipmentTag" placeholder="Tag..."
                                                                            aria-label="Tag Equipment"
                                                                            aria-describedby="form-tagEquipment">
                                                                        <label>Tag </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-6">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-equipmentDescription">
                                                                        {{-- <i class="fa fa-id-badge"></i> --}}
                                                                        <i class="fa-sharp fa-regular fa-newspaper"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="equipmentDescription"
                                                                            value="{{ $listEquipmentsProject->equipment_description }}"
                                                                            class="form-control card_inputs"
                                                                            id="equipmentDescription"
                                                                            placeholder="Descricao Equipamento..."
                                                                            aria-label="Tag Equipment"
                                                                            aria-describedby="form-equipmentDescription">
                                                                        <label>Descricao Equipamento </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>

                                                        {{-- 3 inputs per line :equipmentSerialNumber, equipmentBrand, equipmentModel  --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-serialNumberEquipment">
                                                                        <i class="fa-solid fa-barcode"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="serialNumberEquipment"
                                                                            value="{{ $listEquipmentsProject->equipment_serial_number }}"
                                                                            class="form-control card_inputs"
                                                                            id="equipmentSerialNumber"
                                                                            placeholder="Número de série"
                                                                            aria-label="Serial Number Equipment"
                                                                            aria-describedby="form-serialNumberEquipment">
                                                                        <label>Número de série </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-equipmentBrand">
                                                                        <i class="fa-solid fa-object-group"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="equipmentBrand"
                                                                            value="{{ $listEquipmentsProject->equipment_brand }}"
                                                                            class="form-control card_inputs"
                                                                            id="equipmentBrand" placeholder="Marca"
                                                                            aria-label="Serial Number Equipment"
                                                                            aria-describedby="form-equipmentBrand">
                                                                        <label>Marca</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-equipmentModel">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="equipmentModel"
                                                                            value="{{ $listEquipmentsProject->equipment_model }}"
                                                                            class="form-control card_inputs"
                                                                            id="equipmentModel" placeholder="Modelo"
                                                                            aria-label="Serial Number Equipment"
                                                                            aria-describedby="form-equipmentModel">
                                                                        <label>Modelo</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}

                                                        {{-- 3 inputs per line :equipmentDimension, equipmentRating, equipmentDimcerta  --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text" id="form-dimension">
                                                                        <i class="fa-solid fa-ruler "
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[8]"
                                                                            class="form-control card_inputs"
                                                                            id="dimension" placeholder="Dimensão"
                                                                            aria-label="Serial Number Equipment"
                                                                            aria-describedby="form-dimension">
                                                                        <label>Dimensão</label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text" id="form-rating">
                                                                        <i class="fa-solid fa-ranking-star"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[17]"
                                                                            class="form-control card_inputs"
                                                                            id="rating" placeholder="Rating..."
                                                                            aria-label="Serial Number Equipment"
                                                                            aria-describedby="form-rating">
                                                                        <label>Rating</label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text" id="form-dim_certa">
                                                                        <i
                                                                            class="fa-sharp fa-regular fa-square-poll-vertical"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[10]"
                                                                            class="form-control card_inputs"
                                                                            id="dim_certa" placeholder="Dim certa..."
                                                                            aria-label="Serial Number Equipment"
                                                                            aria-describedby="form-dim_certa">
                                                                        <label>Dim certa</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}

                                                        {{-- 3 inputs per line : main_equipment, p&id, sap_number --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-main_equipment">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[18]"
                                                                            class="form-control card_inputs"
                                                                            id="main_equipment"
                                                                            placeholder="Main Equipment"
                                                                            aria-label="Main Equipment"
                                                                            aria-describedby="form-main_equipment">
                                                                        <label>Main Equipment</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text" id="form-p&id">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[11]"
                                                                            class="form-control card_inputs"
                                                                            id="p&id" placeholder="P&ID"
                                                                            aria-label="P & id"
                                                                            aria-describedby="form-p&id">
                                                                        <label>P&ID</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text" id="form-sap_number">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[12]"
                                                                            class="form-control card_inputs"
                                                                            id="sap_number" placeholder="Nº SAP"
                                                                            aria-label="Numero Sap"
                                                                            aria-describedby="form-sap_number">
                                                                        <label>Nº SAP</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}

                                                        {{-- 3 inputs per line :SP_(Bar)_Cold, Back_Presure_(Bar), material  --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-SP_(Bar)_Cold">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[19]"
                                                                            class="form-control card_inputs"
                                                                            id="SP_(Bar)_Cold"
                                                                            placeholder="SP (Bar) Cold"
                                                                            aria-label="SP (Bar) Cold"
                                                                            aria-describedby="form-SP_(Bar)_Cold">
                                                                        <label>SP (Bar) Cold</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-Back_Presure_(Bar)">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[20]"
                                                                            class="form-control card_inputs"
                                                                            id="Back_Presure_(Bar)"
                                                                            placeholder="Back Presure (Bar)"
                                                                            aria-label="Back Presure (Bar)"
                                                                            aria-describedby="form-Back_Presure_(Bar)">
                                                                        <label>Back Presure (Bar)</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-attributes[21]text"
                                                                        id="form-material">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name=""
                                                                            class="form-control card_inputs"
                                                                            id="material" placeholder="Material"
                                                                            aria-label="Material"
                                                                            aria-describedby="form-material">
                                                                        <label>Material</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}

                                                        {{-- 2 inputs per line :  --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-6">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-manufacturer">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[22]"
                                                                            class="form-control card_inputs"
                                                                            id="manufacturer" placeholder="Fabricante"
                                                                            aria-label="Fabricante"
                                                                            aria-describedby="form-manufacturer">
                                                                        <label>Fabricante</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-6">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text" id="form-isolation">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[13]"
                                                                            class="form-control card_inputs"
                                                                            id="isolation" placeholder="Isolamento"
                                                                            aria-label="Isolamento"
                                                                            aria-describedby="form-isolation">
                                                                        <label>Isolamento</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}

                                                        {{-- 2 Selects per line :psv_scaffold, psv_crane --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-6">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <select class="form-control card_inputs"
                                                                            name="23">
                                                                            <option value="Sim">Sim</option>
                                                                            <option value="Nao" selected>Nao</option>
                                                                        </select>
                                                                        <label>Andaime?</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-6">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <select class="form-control card_inputs"
                                                                            name="24">
                                                                            <option value="Sim">Sim</option>
                                                                            <option value="Nao" selected>Nao</option>
                                                                        </select>
                                                                        <label>Grua?</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}

                                                    </div>
                                                    <!-- /.card-body -->



                                                </div>
                                                {{-- ./PSV-card --}}

                                                {{-- Ambito-PSV --}}
                                                <div class="card card-secondary collapsed-card">
                                                    <div class="card-header">
                                                        <h3 class="card-title">Ambito :
                                                            {{ $listEquipmentsProject->equipmentAssociationAmbit->ambitsEquipment->ambits_description }}
                                                        </h3>
                                                        <div class="card-tools">
                                                            <button type="button" class="btn btn-tool"
                                                                data-card-widget="collapse"><i class="fas fa-plus"></i>
                                                            </button>
                                                        </div>
                                                    </div>
                                                    {{-- ./card-header --}}
                                                    <div class="card-body">
                                                        <div class="card ordemTasks-div">
                                                            <div class="card-header">
                                                                <h3 class="card-title">Lista de Tarefas Elementares :
                                                                    {{ $listEquipmentsProject->equipmentAssociationAmbit->first()->ambitsEquipment->ambits_description }}
                                                                </h3>
                                                            </div>
                                                            <!-- /.card-header -->
                                                            <div class="card-body p-0">
                                                                <table class="table table-sm ">
                                                                    <thead>
                                                                        <tr>
                                                                            <th style="width: 10px">#</th>
                                                                            <th>Tarefas Elementares</th>
                                                                            <th class="text-center">Selecionar Tarefa</th>
                                                                            <th style="width: 40px">Inspecionar</th>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody>
                                                                        <tr>
                                                                            <td>TE1</td>
                                                                            <td>Desmontar da linha</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[1]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[1]" value="on"
                                                                                    {{ old('ordemTasks[1]') == 'on' ? 'checked' : '' }}>
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE2</td>
                                                                            <td>Descontaminar</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[2]" value="off">
                                                                                    <input type="checkbox"
                                                                                    name="ordemTasks[2]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE3</td>
                                                                            <td>Pŕe-Teste</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[3]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[3]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE4</td>
                                                                            <td>Abertura da válvula, análise e controle dos
                                                                                componentes</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[5]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[5]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE5</td>
                                                                            <td>Limpeza e lavagem dos componentes</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[8]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[8]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE6</td>
                                                                            <td>Retificação e lapidação</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[9]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[9]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE7</td>
                                                                            <td>Fecho da válvula e substituição de
                                                                                componentes </td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[10]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[10]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE8</td>
                                                                            <td>Calibrar e certificar</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[13]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[13]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE9</td>
                                                                            <td>Pintura</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[14]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[14]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE10</td>
                                                                            <td>Montagem na linha</td>
                                                                            {{-- Apenas para ver se recebe um on ou off, o hidden serve para devolver valor se o checkbox nao estiver a 'checked' --}}
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[15]"
                                                                                    value="off">
                                                                                    <input type="checkbox"
                                                                                    name="ordemTasks[15]" value="on"
                                                                                    {{ old('ordemTasks[15]') == 'on' ? 'checked' : '' }}>
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE11</td>
                                                                            <td>Inspeção Final</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[17]"
                                                                                    value="off">
                                                                                    <input type="checkbox"
                                                                                    name="ordemTasks[17]" value="on"
                                                                                    {{ old('ordemTasks[17]') == 'on' ? 'checked' : '' }}>
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </div>
                                                            <!-- /.card-body -->

                                                            <div class="card-footer">
                                                                <!--Tarefa Complementar -->
                                                                <div class="icheck-primary d-inline">
                                                                    <input type="checkbox" id="checkboxAddicionalTask"
                                                                        unchecked>
                                                                    <label for="checkboxAddicionalTask">
                                                                        Tarefa Complementares
                                                                    </label>
                                                                </div>
                                                            </div>

                                                        </div>
                                                        <!-- general form elements disabled -->
                                                        <div id="descriptionAdditionalTask">
                                                            <div class="form-group">
                                                                <div class="card">
                                                                    <div class="card-body">
                                                                        <div class="text-center">
                                                                            <p><b>Fluxo da Tarefa</b></p>
                                                                            <p id="ValuesTableElementsTasks"></p>
                                                                        </div>
                                                                        <div class="row">
                                                                            <div class="col-sm-6">
                                                                                <p>Indique a tarefa :</p>
                                                                                <input type="text"
                                                                                    class="form-control">
                                                                            </div>
                                                                            <div class="col-sm-6">
                                                                                <p>Selecione Após qual tarefa :</p>
                                                                                <select id="ArrayListElementsTasks"
                                                                                    class="form-control">
                                                                                    <option value="InitTask">Tarefa
                                                                                        Inicial
                                                                                    </option>
                                                                                </select>
                                                                            </div>
                                                                        </div>
                                                                        <br>
                                                                        <div class="row">
                                                                            <div class="col-sm-6"></div>
                                                                            <div class="col-sm-6 text-right">
                                                                                <a type="button"
                                                                                    id="AddComplementTasks"
                                                                                    class="btn btn-outline-success ">Adicionar</a>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./description --}}
                                                    </div>
                                                    {{-- ./card-body --}}
                                                </div>
                                                {{-- ./Ambito-PSV --}}
                                            @endif

                                            @if ($listEquipmentsProject->equipment_type_id == 2)
                                                <!-- ISV-card -->
                                                <div id="isv_card" class="card card-primary specificAttributes-div">
                                                    <div class="card-header">
                                                        <h3 class="card-title">ISV</h3>
                                                    </div>
                                                    <!-- /.card-header -->
                                                    <div class="card-body">

                                                        {{-- 2 inputs per line :equipmentTag ,equipmentDescription --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-6">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-tagEquipment">
                                                                        <i class="fa-sharp fa-solid fa-tag"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="tag"
                                                                            value="{{ $listEquipmentsProject->equipment_tag }}"
                                                                            class="form-control card_inputs"
                                                                            id="equipmentTag" placeholder="Tag..."
                                                                            aria-label="Tag Equipment"
                                                                            aria-describedby="form-tagEquipment">
                                                                        <label>Tag </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-6">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-equipmentDescription">
                                                                        <i class="fa-sharp fa-regular fa-newspaper"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text"
                                                                            name="equipmentDescription"
                                                                            value="{{ $listEquipmentsProject->equipment_description }}"
                                                                            class="form-control card_inputs"
                                                                            id="equipmentDescription"
                                                                            placeholder="Descricao Equipamento..."
                                                                            aria-label="Tag Equipment"
                                                                            aria-describedby="form-equipmentDescription">
                                                                        <label>Descricao Equipamento </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}

                                                        {{-- 3 inputs per line :serialNumberEquipment, equipmentBrand, equipmentModel  --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-serialNumberEquipment">
                                                                        <i class="fa-solid fa-barcode"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text"
                                                                            name="serialNumberEquipment"
                                                                            value="{{ $listEquipmentsProject->equipment_serial_number }}"
                                                                            class="form-control card_inputs"
                                                                            id="equipmentSerialNumber"
                                                                            placeholder="Número de série"
                                                                            aria-label="Serial Number Equipment"
                                                                            aria-describedby="form-serialNumberEquipment">
                                                                        <label>Número de série </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-equipmentBrand">
                                                                        <i class="fa-solid fa-object-group"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="equipmentBrand"
                                                                            class="form-control card_inputs"
                                                                            value="{{ $listEquipmentsProject->equipment_brand }}"
                                                                            id="equipmentBrand" placeholder="Marca"
                                                                            aria-label="Marca Equipamento"
                                                                            aria-describedby="form-equipmentBrand">
                                                                        <label>Marca</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-equipmentModel">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="equipmentModel"
                                                                            class="form-control card_inputs"
                                                                            value="{{ $listEquipmentsProject->equipment_model }}"
                                                                            id="equipmentModel" placeholder="Modelo"
                                                                            aria-label="Modelo Equipamento"
                                                                            aria-describedby="form-equipmentModel">
                                                                        <label>Modelo</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}

                                                        {{-- 3 inputs per line :equipmentDimension, equipmentRating, equipmentDimcerta  --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text" id="form-dimension">
                                                                        <i class="fa-solid fa-ruler "
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[8]"
                                                                            class="form-control card_inputs"
                                                                            id="dimension" placeholder="Dimensão"
                                                                            aria-label="Dimensao Equipamento"
                                                                            aria-describedby="form-dimension">
                                                                        <label>Dimensão</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text" id="form-rating">
                                                                        <i class="fa-solid fa-ranking-star"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[17]"
                                                                            class="form-control card_inputs"
                                                                            id="rating" placeholder="Rating..."
                                                                            aria-label="Rating Equipamento"
                                                                            aria-describedby="form-rating">
                                                                        <label>Rating</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text" id="form-dim_certa">
                                                                        <i
                                                                            class="fa-sharp fa-regular fa-square-poll-vertical"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[10]"
                                                                            class="form-control card_inputs"
                                                                            id="dim_certa" placeholder="Dim certa..."
                                                                            aria-label="Dim certa Equipamento"
                                                                            aria-describedby="form-dim_certa">
                                                                        <label>Dim certa</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}

                                                        {{-- 3 Inputs per line :main_equipment ,p&id ,sap_number --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-main_equipment">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[18]"
                                                                            class="form-control card_inputs"
                                                                            id="main_equipment"
                                                                            placeholder="Main Equipment"
                                                                            aria-label="Main Equipment"
                                                                            aria-describedby="form-main_equipment">
                                                                        <label>Main Equipment</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-P_IidEquipment">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[11]"
                                                                            class="form-control card_inputs"
                                                                            id="P_idEquipment" placeholder="P&ID"
                                                                            aria-label="P&ID"
                                                                            aria-describedby="form-P_IidEquipment">
                                                                        <label>P&ID</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-NumberSapEquipment">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[12]"
                                                                            class="form-control card_inputs"
                                                                            id="NumberSapEquipment" placeholder="Nº SAP"
                                                                            aria-label="Numero SAP Equipamento"
                                                                            aria-describedby="form-NumberSapEquipment">
                                                                        <label>Nº SAP</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}

                                                        {{-- 3 Inputs per line :material ,manufacturerEquipment ,isolationEquipment    --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-materialEquipment">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[21]"
                                                                            class="form-control card_inputs"
                                                                            id="materialEquipment"
                                                                            placeholder="Material"
                                                                            aria-label="Material Equipamento"
                                                                            aria-describedby="form-materialEquipment">
                                                                        <label>Material</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-manufacturerEquipment">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[22]"
                                                                            class="form-control card_inputs"
                                                                            id="manufacturerEquipment"
                                                                            placeholder="Fabricante"
                                                                            aria-label="Fabricante Equipamento"
                                                                            aria-describedby="form-manufacturerEquipment">
                                                                        <label>Fabricante</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-isolationEquipment">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[13]"
                                                                            class="form-control card_inputs"
                                                                            id="isolationEquipment"
                                                                            placeholder="Isolamento"
                                                                            aria-label="Isolamento Equipamento"
                                                                            aria-describedby="form-isolationEquipment">
                                                                        <label>Isolamento</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}

                                                        {{-- 2 Selects per line :psv_scaffold, psv_crane --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-6">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <select class="form-control card_inputs"
                                                                            name="scaffold">
                                                                            <option value="Sim">Sim</option>
                                                                            <option value="Nao" selected>Nao</option>
                                                                        </select>
                                                                        <label>Andaime?</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-6">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <select class="form-control card_inputs"
                                                                            name="crane">
                                                                            <option value="Sim">Sim</option>
                                                                            <option value="Nao" selected>Nao</option>
                                                                        </select>
                                                                        <label>Grua?</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}
                                                    </div>
                                                    <!-- /.card-body -->
                                                </div>
                                                <!-- /.card-body -->

                                                {{-- Ambito-ISV  --}}
                                                <div class="card card-primary collapsed-card">
                                                    <div class="card-header">
                                                        <h3 class="card-title">Ambito :
                                                            {{-- {{ $listEquipmentsProject->equipmentAssociationAmbit->first()->ambitsEquipment->ambits_description }} --}}
                                                        </h3>
                                                        <div class="card-tools">
                                                            <button type="button" class="btn btn-tool"
                                                                data-card-widget="collapse"><i class="fas fa-plus"></i>
                                                            </button>
                                                        </div>
                                                    </div>
                                                    {{-- ./card-header --}}
                                                    <div class="card-body">
                                                        <div class="card ordemTasks-div">
                                                            <div class="card-header">
                                                                <h3 class="card-title">Lista de Tarefas Elementares :
                                                                    {{-- {{ $listEquipmentsProject->equipmentAssociationAmbit->first()->ambitsEquipment->ambits_description }} --}}
                                                                </h3>
                                                            </div>
                                                            <!-- /.card-header -->
                                                            <div class="card-body p-0">
                                                                <table class="table table-sm ">
                                                                    <thead>
                                                                        <tr>
                                                                            <th style="width: 10px">#</th>
                                                                            <th>Tarefas Elementares</th>
                                                                            <th class="text-center">Selecionar Tarefa
                                                                            </th>
                                                                            <th style="width: 40px">Inspecionar</th>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody>
                                                                        <tr>
                                                                            <td>TE1</td>
                                                                            <td>Desmontar da linha</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[1]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[1]" value="on"
                                                                                    {{ old('ordemTasks[1]') == 'on' ? 'checked' : '' }}>
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE2</td>
                                                                            <td>Descontaminar</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[2]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[2]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE3</td>
                                                                            <td>Pŕe-Teste</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[3]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[3]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE4</td>
                                                                            <td>Abertura da válvula, análise e controle
                                                                                dos
                                                                                componentes</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[5]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[5]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE5</td>
                                                                            <td>Limpeza e lavagem dos componentes</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[8]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[8]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE6</td>
                                                                            <td>Retificação e lapidação</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[6]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[6]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE7</td>
                                                                            <td>Fecho da válvula e substituição de
                                                                                componentes </td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[7]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[7]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE8</td>
                                                                            <td>Calibrar e certificar</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[8]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[8]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE9</td>
                                                                            <td>Pintura</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[9]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[9]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE10</td>
                                                                            <td>Montagem na linha</td>
                                                                            {{-- Apenas para ver se recebe um on ou off, o hidden serve para devolver valor se o checkbox nao estiver a 'checked' --}}
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[10]"
                                                                                    value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[10]"
                                                                                    value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE11</td>
                                                                            <td>Inspeção Final</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[11]"
                                                                                    value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[11]"
                                                                                    value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </div>
                                                            <!-- /.card-body -->

                                                            <div class="card-footer">
                                                                {{-- @foreach ($taskExecutionOrders as $taskExecutionOrder)
                                                              <p> {}
                                                              </p>
                                                          @endforeach --}}
                                                                <!--Tarefa Complementar -->
                                                                <div class="icheck-primary d-inline">
                                                                    <input type="checkbox" id="checkboxAddicionalTask"
                                                                        unchecked>
                                                                    <label for="checkboxAddicionalTask">
                                                                        Tarefa Complementares
                                                                    </label>
                                                                </div>
                                                            </div>

                                                        </div>
                                                        <!-- general form elements disabled -->
                                                        <div id="descriptionAdditionalTask">
                                                            <div class="form-group">
                                                                <div class="card">
                                                                    <div class="card-body">
                                                                        <div class="text-center">
                                                                            <p><b>Fluxo da Tarefa</b></p>
                                                                            <p id="ValuesTableElementsTasks"></p>
                                                                        </div>
                                                                        <div class="row">
                                                                            <div class="col-sm-6">
                                                                                <p>Indique a tarefa :</p>
                                                                                <input type="text"
                                                                                    class="form-control">
                                                                            </div>
                                                                            <div class="col-sm-6">
                                                                                <p>Selecione Após qual tarefa :</p>
                                                                                <select id="ArrayListElementsTasks"
                                                                                    class="form-control">
                                                                                    <option value="InitTask">Tarefa
                                                                                        Inicial
                                                                                    </option>
                                                                                </select>
                                                                            </div>
                                                                        </div>
                                                                        <br>
                                                                        <div class="row">
                                                                            <div class="col-sm-6"></div>
                                                                            <div class="col-sm-6 text-right">
                                                                                <a type="button"
                                                                                    id="AddComplementTasks"
                                                                                    class="btn btn-outline-success ">Adicionar</a>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./description --}}
                                                    </div>
                                                    {{-- ./card-body --}}
                                                </div>
                                                {{-- ./Ambito-ISV --}}
                                            @endif

                                            @if ($listEquipmentsProject->equipment_type_id == 1)
                                                <!-- CV-card -->
                                                <div id="cv_card" class="card card-info specificAttributes-div">
                                                    <div class="card-header">
                                                        <h3 class="card-title">CV</h3>
                                                    </div>
                                                    <div class="card-body">
                                                        {{-- 2 inputs per line :equipmentTag ,equipmentDescription --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-6">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-tagEquipment">
                                                                        <i class="fa-sharp fa-solid fa-tag"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="tag"
                                                                            value="{{ $listEquipmentsProject->equipment_tag }}"
                                                                            class="form-control card_inputs"
                                                                            id="equipmentTag" placeholder="Tag..."
                                                                            aria-label="Tag Equipment"
                                                                            aria-describedby="form-tagEquipment">
                                                                        <label>Tag </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-6">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-equipmentDescription">
                                                                        <i class="fa-sharp fa-regular fa-newspaper"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text"
                                                                            name="equipmentDescription"
                                                                            value="{{ $listEquipmentsProject->equipment_description }}"
                                                                            class="form-control card_inputs"
                                                                            id="equipmentDescription"
                                                                            placeholder="Descricao Equipamento..."
                                                                            aria-label="equipmentDescription"
                                                                            aria-describedby="form-equipmentDescription">
                                                                        <label>Descricao Equipamento </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}
                                                        {{-- 3 inputs per line :serialNumberEquipment, equipmentBrand, equipmentModel  --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-serialNumberEquipment">
                                                                        <i class="fa-solid fa-barcode"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text"
                                                                            name="serialNumberEquipment"
                                                                            value="{{ $listEquipmentsProject->equipment_serial_number }}"
                                                                            class="form-control card_inputs"
                                                                            id="equipmentSerialNumber"
                                                                            placeholder="Número de série"
                                                                            aria-label="Serial Number Equipment"
                                                                            aria-describedby="form-serialNumberEquipment">
                                                                        <label>Número de série </label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-equipmentBrand">
                                                                        <i class="fa-solid fa-object-group"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="equipmentBrand"
                                                                            class="form-control card_inputs"
                                                                            value="{{ $listEquipmentsProject->equipment_brand }}"
                                                                            id="equipmentBrand" placeholder="Modelo"
                                                                            aria-label="Marca Equipamento"
                                                                            aria-describedby="form-equipmentBrand">
                                                                        <label>Marca</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-equipmentModel">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="equipmentModel"
                                                                            class="form-control card_inputs"
                                                                            value="{{ $listEquipmentsProject->equipment_model }}"
                                                                            id="equipmentModel" placeholder="Modelo"
                                                                            aria-label="Modelo Equipamento"
                                                                            aria-describedby="form-equipmentModel">
                                                                        <label>Modelo</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}
                                                        {{-- 3 inputs per line :equipmentDimension, equipmentRating, equipmentDimcerta  --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text" id="form-dimension">
                                                                        <i class="fa-solid fa-ruler "
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[8]"
                                                                            class="form-control card_inputs"
                                                                            id="dimension" placeholder="Dimensão"
                                                                            aria-label="Dimensao Equipamento"
                                                                            aria-describedby="form-dimension">
                                                                        <label>Dimensão</label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text" id="form-rating">
                                                                        <i class="fa-solid fa-ranking-star"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[17]"
                                                                            class="form-control card_inputs"
                                                                            id="rating" placeholder="Rating..."
                                                                            aria-label="Rating Equipamento"
                                                                            aria-describedby="form-rating">
                                                                        <label>Rating</label>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text" id="form-dim_certa">
                                                                        <i
                                                                            class="fa-sharp fa-regular fa-square-poll-vertical"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[10]"
                                                                            class="form-control card_inputs"
                                                                            id="dim_certa" placeholder="Dim certa..."
                                                                            aria-label="Dim certa Equipamento"
                                                                            aria-describedby="form-dim_certa">
                                                                        <label>Dim certa</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}
                                                        {{-- 3 Inputs per line :main_equipment ,P_idEquipment ,NumberSapEquipment --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-main_equipment">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[18]"
                                                                            class="form-control card_inputs"
                                                                            id="main_equipment"
                                                                            placeholder="Main Equipment"
                                                                            aria-label="Main Equipment"
                                                                            aria-describedby="form-main_equipment">
                                                                        <label>Main Equipment</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-P_IidEquipment">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[11]"
                                                                            class="form-control card_inputs"
                                                                            id="p&id" placeholder="P&ID"
                                                                            aria-label="P&ID"
                                                                            aria-describedby="form-P_IidEquipment">
                                                                        <label>P&ID</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-NumberSapEquipment">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[12]"
                                                                            class="form-control card_inputs"
                                                                            id="sap_number" placeholder="Nº SAP"
                                                                            aria-label="Numero SAP Equipamento"
                                                                            aria-describedby="form-NumberSapEquipment">
                                                                        <label>Nº SAP</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}
                                                        {{-- 3 Inputs per line :materialEquipment ,manufacturerEquipment ,isolationEquipment    --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-materialEquipment">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[21]"
                                                                            class="form-control card_inputs"
                                                                            id="material" placeholder="Material"
                                                                            aria-label="Material Equipamento"
                                                                            aria-describedby="form-materialEquipment">
                                                                        <label>Material</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-manufacturerEquipment">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[22]"
                                                                            class="form-control card_inputs"
                                                                            id="manufacturerEquipment"
                                                                            placeholder="Fabricante"
                                                                            aria-label="Fabricante Equipamento"
                                                                            aria-describedby="form-manufacturerEquipment">
                                                                        <label>Fabricante</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-isolationEquipment">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[13]"
                                                                            class="form-control card_inputs"
                                                                            id="isolation" placeholder="Isolamento"
                                                                            aria-label="Isolamento Equipamento"
                                                                            aria-describedby="form-isolationEquipment">
                                                                        <label>Isolamento</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}
                                                        {{-- 3 Inputs per line : actuatorManufacturer,   --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-actuatorManufacturer">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[25]"
                                                                            class="form-control card_inputs"
                                                                            id="actuatorManufacturer"
                                                                            placeholder="Fabricante do atuador"
                                                                            aria-label="Fabricante do Atuador"
                                                                            aria-describedby="form-actuatorManufacturer">
                                                                        <label>Fabricante do atuador</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-ActuatorModel">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[26]"
                                                                            class="form-control card_inputs"
                                                                            id="ActuatorModel"
                                                                            placeholder="Modelo do atuador"
                                                                            aria-label="Modelo do atuador"
                                                                            aria-describedby="form-ActuatorModel">
                                                                        <label>Modelo do atuador</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-4">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-actuatorSerialNumber">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[27]"
                                                                            class="form-control card_inputs"
                                                                            id="actuatorSerialNumber"
                                                                            placeholder="N.º de série do atuador"
                                                                            aria-label="Numero de série do atuado"
                                                                            aria-describedby="form-actuatorSerialNumber">
                                                                        <label>N.º de série do atuador</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./Row --}}
                                                        {{-- 2 Inputs per line : actuatorManufacturer,   --}}
                                                        <div class="row">
                                                            <div class="form-group col-sm-6">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-PositionerManufacturer">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[28]"
                                                                            class="form-control card_inputs"
                                                                            id="PositionerManufacturer"
                                                                            placeholder="Fabricante do posicionador"
                                                                            aria-label="Fabricante do posicionador"
                                                                            aria-describedby="form-PositionerManufacturer">
                                                                        <label>Fabricante do posicionador</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                            <div class="form-group col-sm-6">
                                                                <div class="input-group-prepend">
                                                                    <span class="input-group-text"
                                                                        id="form-PositionerSerialNumber">
                                                                        <i class="fa-solid fa-cubes"
                                                                            style="color: #00B0EA;"></i>
                                                                    </span>
                                                                    <div class="has-float-label">
                                                                        <input type="text" name="attributes[29]"
                                                                            class="form-control card_inputs"
                                                                            id="PositionerSerialNumber"
                                                                            placeholder="N.º de série do posicionador"
                                                                            aria-label="Numero de série do posicionador"
                                                                            aria-describedby="form-PositionerSerialNumber">
                                                                        <label>N.º de série do posicionador</label>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./row --}}
                                                    </div>
                                                </div>
                                                <!-- ./CV-card -->

                                                {{-- Ambito-CV  --}}
                                                <div class="card card-info collapsed-card">
                                                    <div class="card-header">
                                                        <h3 class="card-title">Ambito :
                                                            {{ $listEquipmentsProject->equipmentAssociationAmbit->first()->ambitsEquipment->ambits_description }}
                                                        </h3>
                                                        <div class="card-tools">
                                                            <button type="button" class="btn btn-tool"
                                                                data-card-widget="collapse"><i class="fas fa-plus"></i>
                                                            </button>
                                                        </div>
                                                    </div>
                                                    {{-- ./card-header --}}
                                                    <div class="card-body">
                                                        <div class="card ordemTasks-div">
                                                            <div class="card-header">
                                                                <h3 class="card-title">Lista de Tarefas Elementares :
                                                                    {{ $listEquipmentsProject->equipmentAssociationAmbit->first()->ambitsEquipment->ambits_description }}
                                                                </h3>
                                                            </div>
                                                            <!-- /.card-header -->
                                                            <div class="card-body p-0">
                                                                <table class="table table-sm ">
                                                                    <thead>
                                                                        <tr>
                                                                            <th style="width: 10px">#</th>
                                                                            <th>Tarefas Elementares</th>
                                                                            <th class="text-center">Selecionar Tarefa
                                                                            </th>
                                                                            <th style="width: 40px">Inspecionar</th>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody>
                                                                        <tr>
                                                                            <td>TE1</td>
                                                                            <td>Desmontar da linha</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[1]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[1]" value="on"
                                                                                    {{ old('ordemTasks[1]') == 'on' ? 'checked' : '' }}>
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE2</td>
                                                                            <td>Descontaminar</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[2]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[2]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE3</td>
                                                                            <td>Pŕe-Teste</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[3]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[3]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE4</td>
                                                                            <td>Abertura da válvula, análise e controle
                                                                                dos
                                                                                componentes</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[4]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[4]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE5</td>
                                                                            <td>Limpeza e lavagem dos componentes</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[5]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[5]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE6</td>
                                                                            <td>Retificação e lapidação</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[6]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[6]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE7</td>
                                                                            <td>Fecho da válvula e substituição de
                                                                                componentes </td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[7]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[7]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE8</td>
                                                                            <td>Calibrar e certificar</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[8]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[8]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE9</td>
                                                                            <td>Pintura</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[9]" value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[9]" value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE10</td>
                                                                            <td>Montagem na linha</td>
                                                                            {{-- Apenas para ver se recebe um on ou off, o hidden serve para devolver valor se o checkbox nao estiver a 'checked' --}}
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[10]"
                                                                                    value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[10]"
                                                                                    value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td>TE11</td>
                                                                            <td>Inspeção Final</td>
                                                                            <td class="text-center">
                                                                                <input type="hidden"
                                                                                    name="ordemTasks[11]"
                                                                                    value="off">
                                                                                <input type="checkbox"
                                                                                    name="ordemTasks[11]"
                                                                                    value="on">
                                                                            </td>
                                                                            <td class="text-center">
                                                                                <input type="checkbox" name="">
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </div>
                                                            <!-- /.card-body -->

                                                            <div class="card-footer">
                                                                {{-- @foreach ($taskExecutionOrders as $taskExecutionOrder)
                                                              <p> {}
                                                              </p>
                                                          @endforeach --}}
                                                                <!--Tarefa Complementar -->
                                                                <div class="icheck-primary d-inline">
                                                                    <input type="checkbox" id="checkboxAddicionalTask"
                                                                        unchecked>
                                                                    <label for="checkboxAddicionalTask">
                                                                        Tarefa Complementares
                                                                    </label>
                                                                </div>
                                                            </div>

                                                        </div>
                                                        <!-- general form elements disabled -->
                                                        <div id="descriptionAdditionalTask">
                                                            <div class="form-group">
                                                                <div class="card">
                                                                    <div class="card-body">
                                                                        <div class="text-center">
                                                                            <p><b>Fluxo da Tarefa</b></p>
                                                                            <p id="ValuesTableElementsTasks"></p>
                                                                        </div>
                                                                        <div class="row">
                                                                            <div class="col-sm-6">
                                                                                <p>Indique a tarefa :</p>
                                                                                <input type="text"
                                                                                    class="form-control">
                                                                            </div>
                                                                            <div class="col-sm-6">
                                                                                <p>Selecione Após qual tarefa :</p>
                                                                                <select id="ArrayListElementsTasks"
                                                                                    class="form-control">
                                                                                    <option value="InitTask">Tarefa
                                                                                        Inicial
                                                                                    </option>
                                                                                </select>
                                                                            </div>
                                                                        </div>
                                                                        <br>
                                                                        <div class="row">
                                                                            <div class="col-sm-6"></div>
                                                                            <div class="col-sm-6 text-right">
                                                                                <a type="button"
                                                                                    id="AddComplementTasks"
                                                                                    class="btn btn-outline-success ">Adicionar</a>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        {{-- ./description --}}
                                                    </div>
                                                    {{-- ./card-body --}}
                                                </div>
                                                {{-- ./Ambito-CV --}}
                                            @endif

                                            <!-- adicione mais campos de input conforme necessário -->
                                            <input class="btn btn-primary" type="submit" value="Guardar">
                                        </form>
                                    </div>
                                    {{-- ./modal-body --}}
                                </div>
                            </div>
                        </div>
                        {{-- ./modal-showEquipment --}}

                        <div class="modal fade"
                            id="modal-removeProjectEquipment-{{ $listEquipmentsProject->equipment_id }}">
                            <div class="modal-dialog">
                                <div class="modal-content">
                                    <div class="modal-header bg-primary">
                                        <h4 class="modal-title">Remover {{ $listEquipmentsProject->equipment_tag }}</h4>
                                        <button type="button" class="close" data-dismiss="modal"
                                            aria-label="Close">
                                            <span aria-hidden="true">x</span>
                                        </button>
                                    </div>
                                    <div class="modal-body">
                                        <form action="{{ route('removeProjectEquipment') }}" method="GET">
                                            <p>Deseja remover o Equipamento da obra ou Excluir por completo ?</p>
                                            <div class="row align-items-center">

                                                <input type="hidden" name="EquipmentID"
                                                    value="{{ $listEquipmentsProject->equipment_id }}">

                                                <div class="col">
                                                    <div class="form-check">
                                                        <input class="form-check-input" type="radio"
                                                            name="removalType" id="total" value="total" checked>
                                                        <label class="form-check-label" for="total">Por
                                                            Completo</label>
                                                    </div>
                                                </div>
                                                <div class="col">
                                                    <div class="form-check">
                                                        <input class="form-check-input" type="radio"
                                                            name="removalType" id="obra" value="obra">
                                                        <label class="form-check-label" for="obra">Apenas da
                                                            Obra</label>
                                                    </div>
                                                </div>
                                            </div>

                                            <input class="btn btn-danger mt-3" type="submit" value="Excluir">
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                        {{-- ./modal-removeProjectEquipment" --}}
                    @endforeach

                    <div class="card-footer">
                        <div class="float-right">
                            {{-- <button type="submit" class="btn btn-primary">Guardar</button> --}}
                        </div>
                    </div>

                </div>
                <!-- /.card-body -->

            </div>
            <!-- ./Card card-Primary  -->
            <a href="{{ route('test1', ['id' => $numberProject]) }}" class="btn btn-primary  float-left">Anterior</a>
            <a href="{{ route('test3', ['id' => $numberProject]) }}" class="btn btn-primary  float-right">Seguinte</a>

        </div>
        {{-- ./container-fluid --}}

    </fieldset>
    {{-- ./content --}}

    {{-- modal-pedingEquipments --}}
    <div class="modal fade" id="modal-pedingEquipments">
        <div class="modal-dialog modal-xl">
            <div class="modal-content">

                <div class="table-responsive">
                    <table class="table table-bordered table-striped">
                        <thead>
                            <tr>
                                <th>Fabrica</th>
                                <th>Tipo de Equipamento</th>
                                <th>Tag</th>
                                <th>Descricao Equipamento</th>
                                <th>Numero de Serie</th>
                                <th>Marca</th>
                                <th>Modelo</th>
                                <th>Acoes</th>
                            </tr>
                        </thead>
                        <tbody>
                            @isset($pendingEquipments)
                                @foreach ($pendingEquipments as $pendingEquipment)
                                    <tr id="row-{{ $pendingEquipment->pending_equipment_id }}">
                                        <td>{{ $pendingEquipment->unit->unit_name ?? 'Sem Fabrica Associada!!!' }}</td>
                                        <td>{{ $pendingEquipment->equipmentType->equipment_type_name ?? 'Sem tipo de Equipamento Associado!!!' }}
                                        </td>
                                        <td>{{ $pendingEquipment->pending_equipment_tag }}</td>
                                        <td>{{ $pendingEquipment->pending_equipment_description }}</td>
                                        <td>{{ $pendingEquipment->pending_equipment_serial_number }}</td>
                                        <td>{{ $pendingEquipment->pending_equipment_brand }}</td>
                                        <td>{{ $pendingEquipment->pending_equipment_model }}</td>
                                        <td class="text-center d-flex justify-content-around">
                                            <a href="#" data-toggle="modal"
                                                data-target="#modal-PendingEquipmentCreate-{{ $pendingEquipment->pending_equipment_id }}">
                                                <i class="fa-solid fa-eye text-secondary"></i>
                                            </a>
                                            <a href="#" data-toggle="modal"
                                                data-target="#modal-PendingEquipmentRemove-{{ $pendingEquipment->pending_equipment_id }}">
                                                <i class="fa-solid fa-trash-alt text-danger"></i>
                                            </a>
                                        </td>
                                    </tr>

                                    <tr id="card-{{ $pendingEquipment->pending_equipment_id }}" style="display: none;">
                                        <td colspan="9">
                                            <div class="card">
                                                <div class="card-body">
                                                    <h5 class="card-title">
                                                        {{ $pendingEquipment->pending_equipment_description }}</h5>
                                                    <p class="card-text">Informações adicionais sobre o equipamento
                                                        aqui.
                                                    </p>
                                                    <!-- Aqui você pode adicionar a informação correspondente de listValves, se disponível -->
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                @endforeach
                            @else
                                <tr>
                                    <td colspan="9" class="text-center">Sem dados existentes !!!</td>
                                </tr>
                            @endisset
                        </tbody>
                    </table>
                </div>
                {{-- ./table-responsive --}}

            </div>
            {{-- ./modal-content --}}
        </div>
    </div>
    {{-- ./modal-pedingEquipments --}}

    @if (isset($pendingEquipments))
        @foreach ($pendingEquipments as $pendingEquipment)
            {{-- modal-PendingEquipmentCreate --}}
            <div class="modal fade" id="modal-PendingEquipmentCreate-{{ $pendingEquipment->pending_equipment_id }}">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header bg-primary">
                            <h4 class="modal-title">Criar Equipamento</h4>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">x</span>
                            </button>
                        </div>
                        <form action="{{ route('CreateNewEquipmentFromPendingEquipment', $pendingEquipment->pending_equipment_id) }}"
                            method="POST">
                            
                            @csrf
                            <div class="modal-body">
                                <p>Criar equipamento ?</p>
                                <h4>{{ $pendingEquipment->pending_equipment_tag }} <strong>(Numero da
                                        copia)</strong> </h4>
                                <h4>{{ $pendingEquipment->pending_equipment_description }} <strong>(Numero da
                                        copia)</strong></h4>
                                <h4>{{ $pendingEquipment->pending_equipment_type_id }}</h4>

                                <select class="form-control" name="EquipmentAmbit"
                                    id="AmbitsEquipments_list-{{ $pendingEquipment->pending_equipment_id }}" required>
                                    <option value='' hidden>Selecionar Ambito...</option>
                                </select>
                            </div>
                            <div class="modal-footer justify-content-between">
                                <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
                                <button type="submit" class="btn btn-success">Criar</button>
                            </div>
                        </form>
                    </div>
                    <!-- /.modal-content -->
                </div>
            </div>
            {{-- ./modal-PendingEquipmentCreate --}}

            {{-- modal-PendingEquipmentRemove --}}
            <div class="modal fade" id="modal-PendingEquipmentRemove-{{ $pendingEquipment->pending_equipment_id }}">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header bg-primary">
                            <h4 class="modal-title">Remover</h4>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">x</span>
                            </button>
                        </div>
                        <div class="modal-body">
                            <p>Deseja realmente remover o equipamento ?</p>
                            <h4>{{ $pendingEquipment->pending_equipment_tag }}</h4>
                            <h4>{{ $pendingEquipment->pending_equipment_description }}</h4>
                        </div>
                        <div class="modal-footer justify-content-between">
                            <form action="{{ route('removeEquipment', $pendingEquipment->pending_equipment_id) }}"
                                method="POST">
                                @csrf
                                @method('DELETE')
                                <div class="modal-footer justify-content-between">
                                    <button type="button" class="btn btn-default"
                                        data-dismiss="modal">Fechar</button>
                                    <button type="submit" class="btn btn-danger">Remover</button>
                                </div>
                            </form>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>
            {{-- ./modal-PendingEquipmentRemove --}}
        @endforeach
    @endif

    {{-- <script>
    $(document).ready(function() {
        $('#equipmentType_id_list').on('change', function() {
            var equipmentTypeID = $(this).val();
            if (equipmentTypeID) {
                $.ajax({
                    url: '/api/ambits/' + equipmentTypeID,
                    type: 'GET',
                    success: function(data) {
                        $('#AmbitsEquipments_list').empty(); // Limpar o select de ambits
                        $.each(data, function(key, value) {
                            $('#AmbitsEquipments_list').append(
                                '<option value="#" hidden>Selecionar Tipo de Ambito...</option>',
                                '<option value="' + value.ambits_id + '">' +
                                value.ambits_description + '</option>');
                        });
                    }
                });
            } else {
                $('#AmbitsEquipments_list')
                    .empty(); // Limpar o select de ambits se não há tipo de equipamento selecionado
            }
        });
    });
</script> --}}

    <script>
        $(document).ready(function() {
            $('#equipmentType_id_list').on('change', function() {
                var equipmentTypeID = $(this).val();
                if (equipmentTypeID) {
                    $.ajax({
                        url: '/api/ambits/' + equipmentTypeID,
                        type: 'GET',
                        success: function(data) {
                            $('#AmbitsEquipments_list').empty(); // Limpar o select de ambits
                            $('#AmbitsEquipments_list').append(
                                '<option value="" hidden>Selecionar Tipo de Ambito...</option>'
                            );
                            $.each(data, function(key, value) {
                                $('#AmbitsEquipments_list').append('<option value="' +
                                    value.ambits_id + '">' + value
                                    .ambits_description + '</option>');
                            });
                        }
                    });
                } else {
                    $('#AmbitsEquipments_list')
                        .empty(); // Limpar o select de ambits se não há tipo de equipamento selecionado
                    $('#AmbitsEquipments_list').append(
                        '<option value="" hidden>Selecionar Tipo de Ambito...</option>');
                }
            });
        });
    </script>

    <script>
        $(function() {
            $('#new_unit_div').hide(); // inicialmente ocultamos a div
            $('#new_unit_name').prop('required', false); // inicialmente removemos o requisito

            $('#unit_select').change(function() { // evento quando o valor do select muda
                if ($(this).val() == 'new') { // se a opção selecionada é "new"
                    $('#new_unit_div').show(); // mostramos a div
                    $('#new_unit_name').prop('required', true); // adicionamos o requisito
                } else {
                    $('#new_unit_div').hide(); // senão, ocultamos a div
                    $('#new_unit_name').prop('required', false); // removemos o requisito
                }
            });
        });
    </script>

    <script>
        $(function() {
            $('#psv_card').hide();
            $('#isv_card').hide();
            $('#cv_card').hide();

            $('#equipmentType_id_list').change(function() {
                // esconde todos os cards
                $('#psv_card').hide();
                $('#isv_card').hide();
                $('#cv_card').hide();

                // desabilita todos os inputs
                $('.card_inputs').prop('disabled', true);


                switch ($(this).val()) {
                    case '1':
                        $('#cv_card').show();
                        $('#cv_card .card_inputs').prop('disabled', false);
                        break;
                    case '2':
                        $('#isv_card').show();
                        $('#isv_card .card_inputs').prop('disabled', false);
                        break;
                    case '3':
                        $('#psv_card').show();
                        $('#psv_card .card_inputs').prop('disabled', false);
                        break;
                }
            });
        });
    </script>

    <script>
        $(document).ready(function() {
            $('.fa-eye').parent().click(function(event) {
                event.preventDefault(); // Isso impede que o link seja seguido
                var id = $(this).data('id');
                $('#card-' + id).toggle(); // Isso mostra ou oculta o cartão correspondente
            });
        });
    </script>

    <script>
        $(document).ready(function() {
            $('.show-card').click(function(e) {
                e.preventDefault(); // Para evitar que o link execute a ação padrão

                var id = $(this).data('id'); // Obtém o id do elemento clicado

                // Alterna a visibilidade do cartão correspondente
                $('#card-' + id).toggle();
            });
        });
    </script>

    <script>
        $(document).ready(function() {
            $('#modal-remover').on('show.bs.modal', function(event) {
                var button = $(event.relatedTarget);
                console.log(button); // Log do objeto button para verificar se é o correto
                var id = button.attr('data-id'); // 
                console.log(id);
                var form = $(this).find('form');
                var action = form.attr('action');
                form.attr('action', action.replace(':ID', id));
                $('#equipament_id').val(id);
            });
        });
    </script>



@endsection

@section('scriptsTemplateAdmin')
    {{-- <script>
        $(document).ready(function() {
            $('.open-modal').click(function(e) {
                e.preventDefault();
                var equipmentId = $(this).data('equipment-id');

                $.ajax({
                    url: '/api/equipment/' + equipmentId,
                    method: 'GET',
                    success: function(data) {
                        console.log(data);
                        data.attributes.forEach(function(item) {
                            // Procura o input com name igual a general_attributes_equipment_id e preenche com specific_attributes_value
                            $('input[name="attributes[' + item
                                .general_attributes_equipment_id + ']"]').val(item
                                .specific_attributes_value);
                        });
                        data.OrdemTasks.forEach(function(item) {
                            console.log(data.OrdemTasks);
                            // Procura o checkbox com name igual a elemental_tasks_id e marca como checked
                            $('input[name="ordemTasks[' + item.elemental_tasks_id +
                                ']"]').prop('checked', true);
                        });

                        // Abre a modal
                        $('#modal-showEquipment').modal('show');
                    }
                });
            });
        });
    </script> --}}
    {{-- <script>
        $(document).ready(function() {
            $('.open-modal').click(function(e) {
                e.preventDefault();
                var equipmentId = $(this).data('equipment-id');

                $.ajax({
                    url: '/api/equipment/' + equipmentId,
                    method: 'GET',
                    success: function(data) {
                        data.attributes.forEach(function(item) {
                            // Procura o input com name igual a general_attributes_equipment_id e preenche com specific_attributes_value
                            $('input[name="attributes[' + item
                                .general_attributes_equipment_id + ']"]').val(item
                                .specific_attributes_value);
                        });
                        data.OrdemTasks.forEach(function(item) {
                            // console.log(data.OrdemTasks);
                            // Procura o checkbox com name igual a elemental_tasks_id e marca como checked
                            var checkbox = $('input[name="ordemTasks[' + item
                                .elemental_tasks_id + ']"]');
                            checkbox.prop('checked', true);

                            // Adiciona a opção ao dropdown
                            var option = new Option('TE' + item.elemental_tasks_id,
                                'TE' + item.elemental_tasks_id);
                            console.log(option);
                            $('#ArrayListElementsTasks').append($(option));
                        });

                        // Abre a modal
                        $('#modal-showEquipment').modal('show');
                    }
                });
            });
        });
    </script> --}}


    <script>
        $(document).ready(function() {
            var selectedTasks = []; // Esta variável armazena todas as tarefas selecionadas

            $('.open-modal').click(function(e) {
                e.preventDefault();
                var equipmentId = $(this).data('equipment-id');

                $.ajax({
                    url: '/api/equipment/' + equipmentId,
                    method: 'GET',
                    success: function(data) {
                        data.attributes.forEach(function(item) {
                            // Procura o input com name igual a general_attributes_equipment_id e preenche com specific_attributes_value
                            $('input[name="attributes[' + item
                                .general_attributes_equipment_id + ']"]').val(item
                                .specific_attributes_value);
                        });

                        // Limpa o array de tarefas selecionadas
                        selectedTasks = [];

                        data.OrdemTasks.forEach(function(item) {
                            // Procura o checkbox com name igual a elemental_tasks_id e marca como checked
                            var checkbox = $('input[name="ordemTasks[' + item
                                .elemental_tasks_id + ']"]');
                            checkbox.prop('checked', true);

                            // Adiciona a tarefa ao array de tarefas selecionadas
                            selectedTasks.push('TE' + item.elemental_tasks_id);
                        });

                        console.log(selectedTasks);

                        // Ordena o array de tarefas selecionadas
                        selectedTasks.sort();

                        // Limpa o select
                        $('#ArrayListElementsTasks').empty();

                        // Adiciona as opções ao select na ordem correta
                        $.each(selectedTasks, function(index, value) {
                            $('#ArrayListElementsTasks').append(new Option(value,
                                value));
                        });

                        // Abre a modal
                        $('#modal-showEquipment').modal('show');
                    }
                });
            });

            // Monitora mudanças em todos os checkboxes
            $('input[name^="ordemTasks"]').change(function() {
                var taskNumberMatch = this.name.match(/\d+$/);
                if (taskNumberMatch !== null) {
                    var taskName = 'TE' + taskNumberMatch[0];

                    if (this.checked) {
                        // Adiciona a tarefa no array e ordena
                        selectedTasks.push(taskName);
                        selectedTasks.sort();
                    } else {
                        // Remove a tarefa do array
                        var index = selectedTasks.indexOf(taskName);
                        if (index > -1) {
                            selectedTasks.splice(index, 1);
                        }
                    }

                    // Limpa o select
                    $('#ArrayListElementsTasks').empty();

                    // Adiciona as opções ao select na ordem correta
                    $.each(selectedTasks, function(index, value) {
                        $('#ArrayListElementsTasks').append(new Option(value, value));
                    });
                }
            });
        });
    </script>




    <script>
        $(document).ready(function() {
            // Detecta quando qualquer checkbox é selecionado ou desmarcado
            $('input[name^="ordemTasks"]').change(function() {
                // Obtém o valor do checkbox (TE1, TE2, etc.)
                var taskValue = $(this).parent().prev().prev().text();

                if (this.checked) {
                    // Adiciona uma nova opção ao select
                    $('#ArrayListElementsTasks').append($('<option>', {
                        value: taskValue,
                        text: taskValue
                    }));
                } else {
                    // Remove a opção do select
                    $("#ArrayListElementsTasks option[value='" + taskValue + "']").remove();
                }
            });

            // Adiciona as opções que já estão marcadas ao carregar a página
            $('input[name^="ordemTasks"]:checked').each(function() {
                var taskValue = $(this).parent().prev().prev().text();

                // Adiciona uma nova opção ao select
                $('#ArrayListElementsTasks').append($('<option>', {
                    value: taskValue,
                    text: taskValue
                }));
            });
        });
    </script>


    <script>
        $(function() {
            $('#descriptionAdditionalTask').hide();

            $('#checkboxAddicionalTask').change(function() {
                if ($('#checkboxAddicionalTask').is(':checked')) {
                    $('#descriptionAdditionalTask').fadeIn();
                } else {
                    $('#descriptionAdditionalTask').hide();
                }
            });
        })
    </script>


    {{-- <script>
        $(document).ready(function() {
            $('.open-modal').click(function(e) {
                e.preventDefault();
                var equipmentId = $(this).data('equipment-id');
                $.ajax({
                    url: '/equipment/' +
                    equipmentId, // Ajuste a URL conforme a rota que você definiu
                    method: 'GET',
                    success: function(data) {
                        // Aqui você preenche a modal com os dados retornados
                        $('.modal-title').text('Equipamento : ' + data.equipment_tag);
                        // Remova o conteúdo anterior da modal
                        $('.modal-body').empty();
                        // Adicione os novos dados na modal
                        data.specificAttributes.forEach(function(attribute) {
                            $('.modal-body').append('<p>' + attribute
                                .general_attributes_equipment_description + '</p>');
                            $('.modal-body').append('<p>' + attribute
                                .specific_attributes_value + '</p>');
                        });
                        // Abre a modal
                        $('#modal-showEquipment').modal('show');
                    },
                    error: function(error) {
                        console.log(error);
                    }
                });
            });
        });
    </script> --}}







    <script>
        $(function() {
            $("#ProjectEquipmentTable").DataTable({
                "responsive": true,
                "lengthChange": false,
                "autoWidth": false,
                "buttons": ["copy", "csv", "excel", "pdf", "print", "colvis"]
            }).buttons().container().appendTo('#ProjectEquipmentTable_wrapper .col-md-6:eq(0)');
        });
    </script>

    <script>
        $(document).ready(function() {
            $('#tableSelectEquipements').DataTable();
        });
    </script>


    <script>
        $(document).ready(function() {
            $('#exampleInputFile').on('change', function() {
                // Obtendo o nome do arquivo
                var fileName = $(this).val().split('\\').pop();

                // Substituindo o texto do rótulo
                $(this).next('.custom-file-label').html(fileName);
            })
        });
    </script>


    <script>
        $(document).ready(function() {
            $('[id^="modal-PendingEquipmentCreate-"]').on('show.bs.modal', function(e) {
                // Pega o id do equipamento pendente do id da modal
                var pendingEquipmentID = e.target.id.split('-').pop();

                // Pega o valor do tipo de equipamento do elemento h4
                var equipmentTypeID = $(this).find('h4').last().text();

                // Realiza a chamada AJAX
                if (equipmentTypeID) {
                    $.ajax({
                        url: '/api/ambits/' + equipmentTypeID,
                        type: 'GET',
                        success: function(data) {
                            $('#AmbitsEquipments_list-' + pendingEquipmentID).empty();
                            $('#AmbitsEquipments_list-' + pendingEquipmentID).append(
                                '<option value="" hidden>Selecionar Tipo de Ambito...</option>'
                            );
                            $.each(data, function(key, value) {
                                $('#AmbitsEquipments_list-' + pendingEquipmentID)
                                    .append('<option value="' +

                                        value.ambits_id + '">' + value
                                        .ambits_description + '</option>');
                            });
                        }
                    });
                } else {
                    $('#AmbitsEquipments_list-' + pendingEquipmentID).empty();
                    $('#AmbitsEquipments_list-' + pendingEquipmentID).append(
                        '<option value="" hidden>Selecionar Tipo de Ambito...</option>');
                }
            });
        });
    </script>



    <script>
        $(document).ready(function() {
            $('#mytable').DataTable();
        });
    </script>
@endsection
