@extends('admin.layout')
@section('title','serveur')
@section('content')
<link href="library/bootstrap-5/bootstrap.min.css" rel="stylesheet" />
<script src="library/bootstrap-5/bootstrap.bundle.min.js"></script>
<script src="library/dselect.js"></script>

@if (session('status'))
<div class="alert alert-success">
    {{(session('status'))}}
</div>

@endif
<div class="container">

    <div class="col-12">


        <div class="card card-primary">
            <div class="card-header">
              <h3 class="card-title">Modifier serveur</h3>
            </div>
            <!-- /.card-header -->
            <!-- form start -->
            <form action="{{asset('update_serveur')}}" method="post">
                @csrf
                <input type="hidden" value="{{$serveur->id}}" name="id">
                <input type="hidden">
                <div class="card-body">
                <div class="form-group">
                    <label for="">Code agence</label>
                    <input type="text" class="form-control" name="code_agence" value="{{$serveur->code_agence}}">
                  </div>
                  <div class="form-group">
                    <label for="">Libelle agence</label>
                    <input type="text" class="form-control" name="libelle_agence" placeholder="Libelle agence" value="{{$serveur->libelle_agence}}">
                  </div>
                  <div class="form-group">
                    <label for="">Type agence</label>
                    <input type="text" class="form-control" name="type_agence" placeholder="Type agence" value="{{$serveur->type_agence}}">
                  </div>
                  <div class="form-group">
                    <label for="">IP agence</label>
                    <input type="text" class="form-control" name="ip_agence" placeholder="IP agence" value="{{$serveur->ip_agence}}">
                  </div>
                  <div class="form-group">
                    <label for="">Base de données agence</label>
                    <input type="text" class="form-control" name="bd_agence" placeholder="Base de données agence" value="{{$serveur->bd_agence}}">
                  </div>
                  <div class="form-group">
                    <label for="">Login SA</label>
                    <input type="text" class="form-control" name="login_sa" placeholder="Login SA" value="{{$serveur->login_sa}}">
                  </div>
                  <div class="form-group">
                    <label for="">Mot de passe</label>
                    <input type="password" class="form-control" name="password" placeholder="Mot de passe">
                  </div>
                  <div class="form-group">
                    <label for="">PORT</label>
                    <input type="text" class="form-control" name="port" placeholder="PORT" value="{{$serveur->port}}">
                  </div>
                  <div class="form-group">
                    <label for="">COMPTE LIAISON</label>
                    <input type="text" class="form-control" name="compte_liaison" value="{{$serveur->compte_liaison}}" placeholder="COMPTE LIAISON">
                  </div>
                  <div class="form-group">
                    <label for="">COMPTE TRANSFERT</label>
                    <input type="text" class="form-control" name="compte_transfert" value="{{$serveur->compte_transfert}}" placeholder="COMPTE TRANSFERT">
                  </div>
                  <div class="form-group">
                    <label for="">SERVEUR MERE</label>
                    <select class="form-control select2bs4" name="mere_id">
                        <option value="">*{{App\Models\Serveur::find($serveur->mere_id)->libelle_agence ?? "Selectionner un serveur mère"}}*</option>
                        @foreach($serveurs as $serveur)
                        <option value="{{$serveur->id}}">{{$serveur->libelle_agence}}</option>
                        @endforeach
                        <option value="0">Aucun serveur mère</option>
                        </select>
                  </div>

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

                <div class="card-footer">
                  <button type="submit" class="btn btn-primary">Modifier</button>
                </div>
              </form>
          </div>


</div>

@stop
