{% extends 'base.html.twig' %}

{% block stylesheets %}
    {{ parent() }}
    <!-- <link rel="stylesheet" href="{{ asset('choosen/docsupport/style.css') }}"> -->
    <link rel="stylesheet" href="{{ asset('choosen/docsupport/prism.css') }}">
    <link rel="stylesheet" href="{{ asset('choosen/chosen.css') }}">
{% endblock %}

{% block body %}

    <div class="row">
        <div class="col-lg-12">
            <div class="main-card mb-3 card">
                <div class="card-body">
                    <h5 class="card-title mb-2">
                        rechercher 
                    </h5>
                    <div class="table-responsive-sm">
                        {{ form_start(form) }}

                            <div class="position-relative row form-group">
                                {{ form_errors(form.nom) }}
                                <div class="col-sm-7">
                                    {{ form_widget(form.nom, {'attr': {'class': 'form-control', 'placeholder':'Mot cle a rechercher' }}) }}
                                </div>
                                <div class="col-sm-2">
                                    <input type="submit" value="Filtrer" class="btn btn-outline-primary">
                                </div>
                            </div>
                        {{ form_end(form) }}
                        
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
            <div class="col-lg-12">
                <div class="main-card mb-3 card">
                    <div class="card-body">
                        <h5 class="card-title mb-2">
                            Repertoire des patients ( <span class="alert-info" style="text-transform: lowercase;"> Cliquez sur le nom pour modifier les informations d'un patient  </span> )
                        </h5>
                        <div class="table-responsive-sm">

                            <table class="table">
                                <thead>
                                <tr>
                                    <th> Nom </th>
                                    <th> Pr&eacute;nom (s) </th>
                                    <th> Date Naiss. </th>
                                    <th> Lieu Naiss. </th>
                                    <th> Sexe </th>
                                    <th> Groupe Sanguin </th>
                                    <th> Num. Pi&egrave;ce </th>
                                    <th> Type Pi&egrave;ce </th>
                                    <th> Profession </th>
                                    <th> &nbsp; </th>
                                </tr>
                                </thead>
                                <tbody>
                                    {% for patient in patients %}
                                        <tr>
                                            <td>  <a href="{{ path('patient_edit', {'id':patient.id }) }}"> {{ patient.nom  }}  </a>   </td>
                                            <td>  {{ patient.prenoms  }}  </td>
                                            <td>  {{ patient.dnaiss|date('d/m/Y')  }}  </td>
                                            <td>  {{ patient.lnaiss  }}  </td>
                                            <td>  {{ patient.genre  }}  </td>
                                            <td>  {{ patient.gsanguin  }}  </td>
                                            <td>  {{ patient.cni  }}  </td>
                                            <td>  {{ patient.typePiece  }}  </td>
                                            <td>  {{ patient.profession  }}  </td>
                                            <td> 
                                                <a target="_blank" href="{{ path('patient_show', {'id':patient.id}) }}">
                                                    <i class="pe-7s-print"> </i>                        
                                                </a> 

                                                <a target="_blank" href="{{ path('patient_invoice', {'id':patient.id}) }}">
                                                    <i class="pe-7s-note2"> </i>                        
                                                </a> 
                                                
                                            </td>
                                        </tr>
                                    {% endfor %}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>

{% endblock %}

{% block javascripts %}

{{ parent() }}

<script src="{{ asset('choosen/docsupport/jquery-3.2.1.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('choosen/chosen.jquery.js') }}" type="text/javascript"></script>
<script src="{{ asset('choosen/docsupport/prism.js') }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ asset('choosen/docsupport/init.js') }}" type="text/javascript" charset="utf-8"></script>


{% endblock %}