<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        @font-face {
            font-family: 'Vibes';
            src: url("https://fonts.googleapis.com/css?family=Great+Vibes") format('truetype');
            font-weight: normal;
            font-style: normal;
        }

        body {
            font-family: "Vibes";
        }

        .page-break {
            page-break-after: always;
        }
    </style>
</head>

<body>
    <img src="img/amea2.png" style="height:auto; width:150px; float: left !important">

    <div style="max-width: 100%;margin: auto;margin-bottom: -3%;font-size:20px;">
        <div style="border: 1.2px solid;height: 39px;margin-bottom: 2%;">
            <h4 style="text-align: center;margin-top: 1%;">Rapport d'expertise préliminaire
                {{ $dossier->typeexpertise->type ?? null }}</h4>
        </div>
        <span style="font-size: 74%; font-family: sans-serif; color:gray"> <strong
                style=" margin-left: 2%; font-family: sans-serif; color:gray">RAPPORT PRELIMINAIRE
                {{ $dossier->typeexpertise->type ?? null }}</strong> </span>
        <div style="margin-top: 6px;">
            <table border="1" style="width: 90%;border-collapse: collapse;    margin-left: 5%;" cellpadding="2"
                cellspacing="2" nobr="true">
                <tbody style="height: 109px;font-size: 81%;">
                    <tr>
                        <td style="width: 20%;"><strong> N/Réf </strong></td>
                        <td>{{ $dossier->ref }}</td>
                    </tr>
                    <tr>
                        <td style="width: 20%;"><strong> Sinistre du </strong></td>
                        <td>{{ $dossier->date_sinistre }}</td>
                    </tr>
                    <tr>
                        <td style="width: 20%;"><strong> Assurés </strong></td>
                        <td>{{ $dossier->insured->name }}</td>
                    </tr>
                </tbody>
            </table>
        </div>
        @if ($dossier->type_expertise_id != 3)

            <span style="font-size: 74%;  margin-left: 2%;">Entre les soussignés</span>
            <br>

            <p style="font-size: 74%;    margin-left: 2%;">
                Monsieur
                @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                    <strong>
                        KHANNIBA</strong>
                @else
                    .................
                @endif
                Expert désigné par la Compagnie
                @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                    <strong>

                        {{ $dossier->company->company }}</strong>
                @else
                    @if ($dossier->opponent)
                        @if ($dossier->opponent->company)
                            <strong>

                                {{ $dossier->opponent->company->company }}</strong>
                        @endif
                    @endif

                    .................
                @endif assureur du véhicule
                @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                    <strong>

                        {{ $dossier->insured->name ?? null }}</strong>
                @else
                    @if ($dossier->opponent)

                        @if ($dossier->opponent->name)
                            <strong>

                                {{ $dossier->opponent->name }}</strong>
                        @endif
                    @endif

                    .................
                @endif

                Immatriculé sous le N°
                @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                    <strong>

                        {{ $dossier->matricule ?? $dossier->new_matricule }}</strong>
                @else
                    @if ($dossier->opponent)

                        @if ($dossier->opponent->matricule)
                            <strong>

                                {{ $dossier->opponent->matricule }}</strong>
                        @endif

                    @endif

                    .................
                @endif par la police N°
                @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                    <strong>

                        {{ $dossier->numero_police ?? null }}</strong>
                @else
                    @if ($dossier->opponent)

                        @if ($dossier->opponent->numero_attestation)
                            <strong>

                                {{ $dossier->opponent->numero_attestation }}</strong>
                        @endif
                    @endif

                    .................
                @endif
            </p>
            <p style="font-size: 74%;    margin-left: 2%;">
                Et Monsieur <strong>
                    @if ($dossier->type_expertise_id != 4 && $dossier->type_expertise_id != 6)
                        KHANNIBA
                    @else
                        .................
                    @endif
                </strong>, Expert désigné par la Compagnie
                @if ($dossier->type_expertise_id != 4 && $dossier->type_expertise_id != 6)
                    {{ $dossier->company->company }}
                @else
                    @if ($dossier->opponent->company)
                        <strong>

                            {{ $dossier->opponent->company->company }}</strong>
                    @endif
                    .................
                @endif
                assureur du @if ($dossier->type_expertise_id != 4 && $dossier->type_expertise_id != 6)
                    {{ $dossier->insured->name ?? null }}
                @else
                    @if ($dossier->opponent->name)
                        <strong>

                            {{ $dossier->opponent->name }}</strong>
                    @endif
                    .................
                @endif par la police N°
                @if ($dossier->type_expertise_id != 4 && $dossier->type_expertise_id != 6)
                    {{ $dossier->numero_police }}
                @else
                    @if ($dossier->opponent->numero_attestation)
                        <strong>

                            {{ $dossier->opponent->numero_attestation }}</strong>
                    @endif
                    .................
                @endif
                l'effet de procéder à l'estimation contradictoire des dommages subis
                par ............................... dont les caractéristiques se présentent comme suit :
            </p>
            <span style="font-size: 74%; font-family: sans-serif;"> <strong
                    style="margin-left: 2%;font-family: sans-serif;">CARACTERISTIQUE TECHNIQUE DU VEHICULE</strong>
            </span>
        @endif
        <br>

        <div>
            <table border="1" style="width: 100%;border-collapse: collapse; font-size: 13px;" cellpadding="2"
                cellspacing="2" nobr="true">
                <tbody style="height: 109px;">
                    <tr>
                        <td style="width: 20%;">MARQUE</td>
                        <td style="width: 30%%;"><strong>{{ $dossier->vehiculemodel->brand->brand ?? null }}</strong>
                        </td>
                        <td style="width: 20%;">Chassis</td>

                        <td style="width: 30%;"><strong>{{ $dossier->numero_chassis ?? null }}</strong></td>
                    </tr>
                    <tr>
                        <td style="width: 20%;">Type</td>
                        <td style="width: 30%%;"><strong>{{ $dossier->typevehicule->type ?? null }}</strong></td>
                        <td style="width: 20%;">Puissance</td>
                        <td style="width: 30%;"><strong>{{ $dossier->puissance_fiscale ?? null }}</strong></td>
                    </tr>
                    <tr>
                        <td style="width: 20%;">DMC</td>
                        <td style="width: 30%%;"><strong>{{ $dossier->date_circulation ?? null }}</strong></td>
                        <td style="width: 20%;">Kilométrage</td>
                        <td style="width: 30%;"><strong>{{ $dossier->kilometrage ?? null }}</strong></td>
                    </tr>

                </tbody>
            </table>
        </div>
        <br>
        <div>
            <span style="font-size: 74%; font-family: sans-serif;"> <strong style="margin-left: 2%;">POSITION DU
                    @if ($dossier->type_expertise_id != 3)
                        1er EXPERT :
                    @else
                        Expert Arbitre
                    @endif


                </strong> </span>
            <br>
            <span style="font-size: 74%; margin-left:13%;font-family: sans-serif;color:gray"> <strong
                    style="margin-left: 7%;">ESTIMATION DES DOMMAGES :</strong> </span>
            <br>
            <span style="font-size: 74%; margin-left: 18%;font-family: sans-serif;"><strong
                    style="margin-left: 9%;">(*)Réparation :</strong> </span>
        </div>
        <br>
        <div>
            <table border="1" style="width: 100%;border-collapse: collapse; font-size: 13px;" cellpadding="2"
                cellspacing="2" nobr="true">
                <tbody style="height: 190px;">
                    <tr>
                        <th style="width: 78%;">Déstination et Descriptif</th>
                        <th>Valeur Estimée</th>
                    </tr>
                    <tr>
                        <td>
                            -Fourniture(piéce) <br>
                            -Main d'oeuvre <br>
                            -Main d'oeuvre peinture <br>
                            -Main d'oeuvre mécanique<br>
                            -Main d'oeuvre Électricité <br>
                            -Main d'oeuvre Contrôle <br>
                            -Ingrédients <br>
                        </td>
                        <td>
                            @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                                {{ number_format($montantpieces, 2, '.', ',') ?? 0 }}
                                {{ $dossier->currency->symbole ?? null }} <br>
                                {{ $main01 + $main02 + $main03 ?? 0 }} {{ $dossier->currency->symbole ?? null }} <br>
                                {{ $main04 ?? 0 }} {{ $dossier->currency->symbole ?? null }}<br>
                                {{ $main07 ?? 0 }} {{ $dossier->currency->symbole ?? null }}<br>
                                {{ $main05 ?? 0 }} {{ $dossier->currency->symbole ?? null }}<br>
                                {{ $main06 ?? 0 }} {{ $dossier->currency->symbole ?? null }}<br>
                                {{ $ingr ?? 0 }} {{ $dossier->currency->symbole ?? null }}
                            @endif

                        </td>
                    </tr>
                    <tr>
                        <td><strong>Total brut des dommages</strong></td>
                        <td><strong>
                                @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                                    {{ number_format($ttc, 2, '.', ',') ?? 0 }}
                                @endif {{ $dossier->currency->symbole ?? null }} TTC
                            </strong></td>
                    </tr>
                    <tr>
                        <td>A d'duire vétusté......</td>
                        <td>
                            @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                                {{ $vet ?? 0 }}
                            @endif {{ $dossier->currency->symbole ?? null }} TTC
                        </td>
                    </tr>
                    <tr>
                        <td><strong>Total net des dommages</strong></td>
                        <td><strong>
                                @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                                    {{ number_format($ttc - $vet, 2, '.', ',') ?? 0 }}
                                @endif {{ $dossier->currency->symbole ?? null }} TTC
                            </strong></td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div style="margin-top:1%;">

            <span style="font-size: 74%; margin-left: 0%;font-family: sans-serif;"><strong>Réforme Technique :</strong>
                @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                    @if ($dossier->mode_id == 3)
                        <span>X</span>
                    @else
                        <input name="" type="radio" name="" id="">
                    @endif
                @else
                    <input name="" type="radio" name="" id="">
                @endif
            </span>


            <span style="font-size: 74%; font-family: sans-serif;"><strong style="margin-left: 10%;">Réforme Economique
                    :
                </strong>
                @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                    @if ($dossier->mode_id == 2)
                        <span>X</span>
                    @else
                        <input name="" type="radio" name="" id="">
                    @endif
                @else
                    <input name="" type="radio" name="" id="">
                @endif
            </span>

        </div>
        <div style="margin-top:1%;">
            <table border="1" style="width: 100%;border-collapse: collapse; font-size: 13px;" cellpadding="2"
                cellspacing="2" nobr="true">
                <thead>
                    <tr>
                        <th>Valeur</th>
                        <th>HT</th>
                        <th>TTC</th>
                    </tr>
                </thead>
                <tbody style="height: 93px;">

                    <tr>
                        <td style="width: 50%;font-family: sans-serif;">Valeur Vénale</td>
                        <td>
                            @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                                {{ $dossier->valeurvenale ?? 0 }}
                                {{ $dossier->currency->symbole ?? null }}

                            @endif
                        </td>
                        <td>
                            @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                                {{ $dossier->valeurvenale_ttc ?? 0 }}
                                {{ $dossier->currency->symbole ?? null }}

                            @endif
                        </td>

                    </tr>
                    <tr>
                        <td style="width: 50%;font-family: sans-serif;">Valeur épave(Sous réserve de la maximalisation)
                        </td>
                        <td>
                            @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                                {{ $dossier->valeurepave ?? 0 }}
                                {{ $dossier->currency->symbole ?? null }}

                            @endif
                        </td>
                        <td>
                            @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                                {{ $dossier->valeurepave_ttc ?? 0 }}
                                {{ $dossier->currency->symbole ?? null }}

                            @endif
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 50%;font-family: sans-serif;"><strong>Différence des valeurs</strong></td>
                        <td>
                            @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                                {{ $dossier->valeuradire ?? 0 }}
                                {{ $dossier->currency->symbole ?? null }}
                            @endif

                        </td>
                        <td>
                            @if ($dossier->type_expertise_id != 5 && $dossier->type_expertise_id != 7)
                                {{ $dossier->valeuradire_ttc ?? 0 }}
                                {{ $dossier->currency->symbole ?? null }}
                            @endif

                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <br>
        <br>
        <br>
        <br>
        <br>
        @if ($dossier->type_expertise_id == 3)
            <br><br><br>
            <br><br>
        @endif
        <div>
            <p style="text-align: center;font-size:66%;">
                Parc Plaza Bd.Yaakoub Al Mansour lmm.G2 28800 -Mohammedia <br>
                Tél : 052330564-Fax : 0523305672 -E-mail :amea.maroc@gmail.com <br>
                RC:12583 -TP: 39570820-IF:14392431 -CNSS:4472213-ICE:001376800000001
            </p>
        </div>
        <img src="" alt="" srcset="">
        @if ($dossier->type_expertise_id != 3)

            <div class="page-break"></div>
            <br>

            <div>
                <span style="font-size: 74%; font-family: sans-serif;"> <strong style="margin-left: 2%;">POSITION DU
                        2eme
                        EXPERT :</strong> </span>
                <br>
                <span style="font-size: 74%; margin-left:13%;font-family: sans-serif;color:gray"> <strong
                        style="margin-left: 7%;">ESTIMATION DES DOMMAGES :</strong> </span>
                <br>
                <span style="font-size: 74%; margin-left: 18%;font-family: sans-serif;"><strong
                        style="margin-left: 9%;">(*)Réparation :</strong> </span>
            </div>
            <br>
            <div>
                <table border="1" style="width: 100%;border-collapse: collapse; font-size: 13px;" cellpadding="2"
                    cellspacing="2" nobr="true">
                    <tbody style="height: 190px;">
                        <tr>
                            <th style="width: 78%;">Déstination et Descriptif</th>
                            <th>Valeur Estimée</th>
                        </tr>
                        <tr>
                            <td>
                                -Fourniture(piéce) <br>
                                -Main d'oeuvre <br>
                                -Main d'oeuvre peinture <br>
                                -Main d'oeuvre mécanique<br>
                                -Main d'oeuvre Électricité <br>
                                -Main d'oeuvre Contrôle <br>
                                -Ingrédients <br>
                            </td>
                            <td>
                                @if ($dossier->type_expertise_id == 5 || $dossier->type_expertise_id == 7)
                                    {{ number_format($montantpieces, 2, '.', ',') ?? 0 }}
                                    {{ $dossier->currency->symbole ?? null }} <br>
                                    {{ $main01 + $main02 + $main03 ?? 0 }} {{ $dossier->currency->symbole ?? null }}
                                    <br>
                                    {{ $main04 ?? 0 }} {{ $dossier->currency->symbole ?? null }}<br>
                                    {{ $main07 ?? 0 }} {{ $dossier->currency->symbole ?? null }}<br>
                                    {{ $main05 ?? 0 }} {{ $dossier->currency->symbole ?? null }}<br>
                                    {{ $main06 ?? 0 }} {{ $dossier->currency->symbole ?? null }}<br>
                                    {{ $ingr ?? 0 }} {{ $dossier->currency->symbole ?? null }}
                                @else
                                    <br>
                                    <br>
                                    <br>
                                    <br>
                                @endif
                            </td>
                        </tr>
                        <tr>
                            <td><strong>Total brut des dommages</strong></td>
                            <td><strong>

                                    @if ($dossier->type_expertise_id == 5 || $dossier->type_expertise_id == 7)
                                        {{ number_format($ttc, 2, '.', ',') ?? 0 }}
                                    @endif {{ $dossier->currency->symbole ?? null }} TTC
                                </strong></td>
                        </tr>
                        <tr>
                            <td>A d'duire vétusté......</td>
                            <td>
                                @if ($dossier->type_expertise_id == 5 || $dossier->type_expertise_id == 7)
                                    {{ $vet ?? 0 }}
                                @endif {{ $dossier->currency->symbole ?? null }} TTC
                            </td>
                        </tr>
                        <tr>
                            <td><strong>Total net des dommages</strong></td>
                            <td><strong>
                                    @if ($dossier->type_expertise_id == 5 || $dossier->type_expertise_id == 7)
                                        {{ $ttc - $vet ?? 0 }}
                                    @endif {{ $dossier->currency->symbole ?? null }} TTC
                                </strong></td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div style="margin-top:1%;">
                <span style="font-size: 74%; margin-left: 0%;font-family: sans-serif;"><strong>Réforme Technique
                        :</strong>
                    @if ($dossier->type_expertise_id == 5 || $dossier->type_expertise_id == 7)
                        @if ($dossier->mode_id == 3)
                            <span>X</span>
                        @else
                            <input name="" type="radio" name="" id="">
                        @endif
                    @else
                        <input name="" type="radio" name="" id="">
                    @endif
                </span>


                <span style="font-size: 74%; font-family: sans-serif;"><strong style="margin-left: 10%;">Réforme
                        Economique :
                    </strong>
                    @if ($dossier->type_expertise_id == 5 || $dossier->type_expertise_id == 7)
                        @if ($dossier->mode_id == 2)
                            <span>X</span>
                        @else
                            <input name="" type="radio" name="" id="">
                        @endif
                    @else
                        <input name="" type="radio" name="" id="">
                    @endif
                </span>
            </div>
            <div style="margin-top:1%;">
                <table border="1" style="width: 100%;border-collapse: collapse; font-size: 13px;" cellpadding="2"
                    cellspacing="2" nobr="true">
                    <thead>
                        <tr>
                            <td>Valeurs</td>
                            <td>HT</td>
                            <td>TTC</td>
                        </tr>
                    </thead>
                    <tbody style="height: 93px;">
                        <tr>
                            <td style="width: 50%;font-family: sans-serif;">Valeur Vénale</td>
                            <td>
                                @if ($dossier->type_expertise_id == 5 || $dossier->type_expertise_id == 7)
                                    {{ $dossier->valeurvenale ?? 0 }} {{ $dossier->currency->symbole ?? null }}
                                @endif
                            </td>
                            <td>
                                @if ($dossier->type_expertise_id == 5 || $dossier->type_expertise_id == 7)
                                    {{ $dossier->valeurvenale_ttc ?? 0 }} {{ $dossier->currency->symbole ?? null }}
                                @endif
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%;font-family: sans-serif;">Valeur épave(Sous réserve de la
                                maximalisation)
                            </td>

                            <td>
                                @if ($dossier->type_expertise_id == 5 || $dossier->type_expertise_id == 7)
                                    {{ $dossier->valeurepave ?? 0 }} {{ $dossier->currency->symbole ?? null }}
                                @endif
                            </td>
                            <td>
                                @if ($dossier->type_expertise_id == 5 || $dossier->type_expertise_id == 7)
                                    {{ $dossier->valeurepave_ttc ?? 0 }} {{ $dossier->currency->symbole ?? null }}
                                @endif
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 50%;font-family: sans-serif;"><strong>Différence des valeurs</strong>
                            </td>
                            <td>
                                @if ($dossier->type_expertise_id == 5 || $dossier->type_expertise_id == 7)
                                    {{ $dossier->valeuradire }}
                                    {{ $dossier->currency->symbole ?? null }}
                                @endif

                            </td>
                            <td>
                                @if ($dossier->type_expertise_id == 5 || $dossier->type_expertise_id == 7)
                                    {{ $dossier->valeuradire_ttc }}
                                    {{ $dossier->currency->symbole ?? null }}
                                @endif

                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div>
                <span style="font-size: 74%; font-family: sans-serif;"> <strong style="margin-left: 2%;">OBSERVATION
                        OU
                        MOTIF DE DESCACCORD :</strong> </span>
                <span>....................................................................................................................................
                    <br>
                    <span>....................................................................................................................................
                        <br>
                        <span>....................................................................................................................................
                            <br>
                            <span>....................................................................................................................................
                                <br>
                                <span>....................................................................................................................................
                                    <br>
                                </span>
                                <p style="font-size: 74%; font-family: sans-serif;">En foi de quoi, la présente minute
                                    est
                                    établie pour servir et valoir ce que de droit.</p>
            </div>
            <div style="">
                <span><strong style="font-size: 74%; ">EXPERT DE LA COMPAGNIE</strong> <br>
                    <strong style="font-size: 74%;  margin-left:9%;">Cabinet .........</strong>
                </span>
            </div>

            <div style=" margin-top: -8%; margin-left: 66%;">
                <p style="text-align: center;font-size:66%; "> <strong> Fait à Mohammédia, le {{ now() }} <br>
                        EXPERT DE LA COMPAGNIE <br>
                        {{ $dossier->company->company ?? null }} <br> Cabinet KHANNIBA </strong></p>
                        <img src="img/sign.png"
                        style="  width:150px; float:right !important;  ">
            </div>
        @endif
       

    </div>
    <script type="text/php">
        if (isset($pdf)) {
            $pageText = "{PAGE_NUM} / {PAGE_COUNT}";
            $font = null;
            $size = 12;
            $color = array(0, 0, 0);
            $wordSpace = 0.0;
            $charSpace = 0.0;
            $angle = 0.0;
            $x = 280;
            $y = 800;
            $align = 'center';
            $font = $fontMetrics->get_font("Arial", "bold");
            $pdf->page_text($x, $y, $pageText, $font, $size, $color, $wordSpace, $charSpace, $angle);
        }
    </script>
</body>

</html>
