<?php
namespace App\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
class TimesheetSearchType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('nom_client', TextType::class, [
'label' => 'Nom du conducteur',
'required' => false,
'attr' => [
'class' => 'form-control',
'placeholder' => 'Rechercher un conducteur...',
'autocomplete' => 'off',
]
])
->add('immatriculation', TextType::class, [
'label' => 'Immatriculation',
'required' => false,
'attr' => [
'class' => 'form-control',
'placeholder' => 'Rechercher une immatriculation...',
'autocomplete' => 'off',
]
])
->add('agence', TextType::class, [
'label' => 'Agence',
'required' => false,
'attr' => [
'class' => 'form-control',
'placeholder' => 'Rechercher une agence...',
'autocomplete' => 'off',
]
])
->add('date_debut', DateType::class, [
'label' => 'Date début',
'widget' => 'single_text',
'required' => false,
'attr' => ['class' => 'form-control']
])
->add('date_fin', DateType::class, [
'label' => 'Date fin',
'widget' => 'single_text',
'required' => false,
'attr' => ['class' => 'form-control']
])
->add('rechercher', SubmitType::class, [
'label' => 'Rechercher',
'attr' => ['class' => 'btn btn-primary']
])
// ->add('exporter', SubmitType::class, [
// 'label' => 'Exporter Excel',
// 'attr' => [
// 'class' => 'btn btn-success',
// 'formnovalidate' => true,
// ]
// ])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'method' => 'POST',
'csrf_protection' => false,
]);
}
}