@extends('layouts.app')
@section('title', 'Nouveau partenaire')
@section('content')
<h3 class="mb-4">Creer un partenaire (golden customer / laboratoire / clinique)</h3>

<div class="card p-4" style="max-width:700px;">
    <form method="POST" action="{{ route('admin.partners.store') }}">
        @csrf
        <div class="row g-3">
            <div class="col-md-8">
                <label class="form-label">Nom du partenaire</label>
                <input type="text" name="name" class="form-control" value="{{ old('name') }}" required>
            </div>
            <div class="col-md-4">
                <label class="form-label">Type</label>
                <select name="type" class="form-select" required>
                    <option value="clinique">Clinique</option>
                    <option value="laboratoire">Laboratoire</option>
                </select>
            </div>
            <div class="col-12">
                <label class="form-label">Adresse</label>
                <input type="text" name="address" class="form-control" value="{{ old('address') }}">
            </div>
            <div class="col-md-6">
                <label class="form-label">Personne de contact</label>
                <input type="text" name="contact_person" class="form-control" value="{{ old('contact_person') }}">
            </div>
            <div class="col-md-6">
                <label class="form-label">Telephone</label>
                <input type="text" name="phone" class="form-control" value="{{ old('phone') }}">
            </div>
            <hr class="mt-4">
            <p class="text-muted small mb-0">Ces identifiants seront utilises par le partenaire pour se connecter a la plateforme.</p>
            <div class="col-md-6">
                <label class="form-label">Email (identifiant de connexion)</label>
                <input type="email" name="email" class="form-control" value="{{ old('email') }}" required>
            </div>
            <div class="col-md-6">
                <label class="form-label">Mot de passe initial</label>
                <input type="text" name="password" class="form-control" required minlength="8">
            </div>
        </div>
        <div class="mt-4">
            <button class="btn btn-primary">Creer le partenaire</button>
            <a href="{{ route('admin.partners.index') }}" class="btn btn-link">Annuler</a>
        </div>
    </form>
</div>
@endsection
