@extends('layouts.idara.panel')


@section('content')

@include('backend.partials.import')

@include('backend.partials.features')



    <div class="card mt-4">
        <div class="card-header">
        Vous pouvez ajouter une image ou la modifie
        </div>
        <div class="card-body">
            

            <div class="container">
                @if(session('success'))
                <div class="alert alert-success">
                    {{ session('success') }}
                </div>
                @endif
                @if (count($errors) > 0)
                <div class="alert alert-danger">
                    <strong>Whoops!</strong> Some problems with your input.<br><br>
                    <ul>
                        @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
                @endif

                <form action="{{url('contacts/'.$contact->id)}}" method="post">
                    <input type="hidden" name="_method" value="PUT">
                    @csrf
        
        
                    <div class="form-group Coordonnee mt-4" id="Coordonnee">
        
        
                        <label class="" for="exampleFormControlInput1"><strong>Type de coordonnées :</strong></label>
                        <br>
        
        
                        <input value="{{ $contact->coorType->type}}" class="form-control" disabled>
        
        
        
                    </div>
        
        
                    <div class="form-group  t_val mt-4">
        
                        <label class="" for="exampleFormControlInput1"><strong>Coordonnée :</strong></label>
                        <br>
        
                        @if($contact->coorType_id == 1)
                        <input type='tel' class="form-control" name="coordonnees" placeholder="0550505050" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}" value="{{$contact->coordonnees}}" required>
        
                        @elseif($contact->coorType_id == 2)
                        <input type='tel' class="form-control" name="coordonnees" placeholder="021 ..." pattern="" value="{{$contact->coordonnees}}" required>
        


                        @elseif($contact->coorType_id == 3)
        
        
                        <input type='email' class="form-control" name="coordonnees" placeholder="email" value="{{$contact->coordonnees}}" required>
        
        
                        @elseif($contact->coorType_id == 5)
        
        
        
                        <input type='url' class="form-control" name="coordonnees" placeholder="Ex:https://goo.gl/maps/RpEVLKrSv549xcxb" value="{{$contact->coordonnees}}" required>
        
        
        
                        <div style="margin-top:10px">
                            <a type="submit" class="btn" target="blank" href="https://www.google.com/maps/search/gg+maps+alger/@36.6968581,2.9521356,11z/data=!3m1!4b1" id="hiddenDiv" style=" background:yellow; border:1px; visibility:hidden;" required>
        
        
                                Clickez Ici <i class="fa-solid fa-map-location-dot"></i> </a></div>
        
        
                        @elseif($contact->coorType_id == 7 || 6 || 8 || 9)
        
        
        
                        <input type='url' class="form-control" name="coordonnees" placeholder="Ex: https://www.xxxxxx.net/" value="{{$contact->coordonnees}}" required>
        
        
        
                        @endif
        
                    </div>
        
        
                    <div class="form-group add mt-4">
                        <button type="submit" class="btn btn-primary" value="Ajouter">Modifier</button>
        
                    </div>
        
                </form>
            </div>
        </div>
    </div>

</div>

@endsection

