<div class="modal" id="modalAddPatient">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h5>Nuevo Paciente</h5>
            </div>
            <div class="modal-body">
                <form action="/pacientes/add" method="POST">
                    <div class="row">
                        <h5>Información General</h5>
                        <br>
                        <div class="col-md-6 form-group">
                            
                            <input type="text" class="form-control" placeholder="Nombre" name="nombre" maxlength="60" required>  
                        </div>
                        <div class="col-md-3 form-group">
                            
                            <input type="text" class="form-control" placeholder="Primer Apellido" name="primerApellido" maxlength="40" required>
                        </div>
                        <div class="col-md-3 form-group">
                            
                            <input type="text" class="form-control" placeholder="Segundo Apellido" name="segundoApellido" maxlength="40" >
                        </div>
                    </div>
                    <br>
                    <div class="row">
                        <div class="col-md-3">
                            <label class="col-form-label">Tipo</label>
                            <select class="form-select" name="patientType" <% if(tiposPaciente.length>0){ %> required <%}%>>
                                <option value="" selected disabled>Tipo Paciente</option>
                                <% tiposPaciente.forEach(tp =>{%> 
                                <option value="<%=tp.id%>" ><%= tp.nombre %></option>
                                <% }) %>
                            </select>
                        </div>
                        <div class="col-md-3">
                            <label class="col-form-label">Fecha de nacimiento</label>
                            <input type="date" class="form-control" name="fechaNacimiento" required>
                        </div>
                        
                        <div class="col-md-3">
                            <label class="col-form-label">DNI/NIE</label>
                            <input type="text" class="form-control" placeholder="DNI / NIE" name="DNI" maxlength="9" required>
                        </div>
                        <div class="col-md-3">
                            <label class="col-form-label">Género</label>
                            <select class="form-select" name="genero" required>
                                <option value="" selected disabled>Género</option>
                                <option value="1">Mujer</option>
                                <option value="2">Hombre</option>
                                <option value="3">Otro</option>
                            </select>
                        </div>

                    </div>
                    <br>
                    <div class="row">
                        <h5>Contacto principal</h5>
                        <br>
                        <div class="col-md-6">
                            <input type="text" class="form-control" placeholder="Teléfono" name="telefono" required>
                        </div>
                        
                        <div class="col-md-6">
                            <input type="text" class="form-control" placeholder="Email" name="email">
                        </div>
                        

                    </div>
                    
                    <br>
                    <div class="row">
                        <h5>Dirección</h5>
                        <div class="col-md-6 form-group">
                            <input type="text" class="form-control" placeholder="Calle, número, portal, piso" name="direccion" required>
                        </div>
                        <div class="col-md-3 form-group">
                            <input type="text" class="form-control" placeholder="Población" name="poblacion" required>
                        </div>
                        <div class="col-md-3 form-group">
                            <input type="text" class="form-control" placeholder="Código Postal" name="cp" required>
                        </div> 
                    </div>
                    <br>
                    
                    <div class="modal-footer">
                        <div id="botonesmodal from-group">
                            <button type="submit" class="btn btn-success btn-md" >Crear</button>
                            <button type="button" class="btn btn-danger btn-md" data-bs-dismiss="modal">Cancelar</button>
                        </div>
                    </div>
                </form>
                
            </div>
            
        </div>
    </div>    
</div>