<?php
namespace App\Form\Registration;
use App\Entity\RegistrationStudent;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Vich\UploaderBundle\Form\Type\VichImageType;
use App\Entity\RegistrationStudentPreRegistration;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
class RegistrationStudentPreRegistrationType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('last_school_attended')
->add('last_school_attended_type', ChoiceType::class,[
'choices' => RegistrationStudent::LAST_ETS_TYPE
])
->add('is_redoubling', ChoiceType::class,[
'choices' => [
'OUI' => true,
'NON' => false
]
])
->add('registration_number')
->add('where_resides', ChoiceType::class,[
'choices' => RegistrationStudent::WHER_RESIDE,
'required' => true
])
->add('parent_status', ChoiceType::class,[
'choices' => RegistrationStudent::PARENT_STATUS,
'required' => true
])
->add('num_cmu')
->add('last_name')
->add('first_name')
->add('location')
->add('gender', ChoiceType::class,[
'choices' => RegistrationStudent::GENDER
])
->add('birth_location')
->add('nationality')
->add('birthday', DateType::class, [
'widget' => 'single_text',
'html5' => true,
'input' => 'datetime_immutable'
])
->add('birth_certificate_number')
->add('imageFile', VichImageType::class, [
'required' => false,
'allow_delete' => true,
'delete_label' => 'Supprimer',
'download_label' => '',
])
//La famille - Pere
->add('is_parntal_authority_father', ChoiceType::class,[
'choices' => [
'OUI' => true,
'NON' => false
]
])
->add('is_father_call_to_emergency')
->add('father_last_name')
->add('father_first_name')
->add('father_address')
->add('father_phone_number')
->add('father_post')
->add('father_location')
->add('father_email')
//Mere
->add('is_parntal_authority_mother', ChoiceType::class,[
'choices' => [
'OUI' => true,
'NON' => false
]
])
->add('is_mother_call_to_emergency')
->add('mother_last_name')
->add('mother_first_name')
->add('mother_address')
->add('mother_phone_number')
->add('mother_post')
->add('mother_location')
->add('mother_email')
->add('responsible_of_schooling', ChoiceType::class,[
'choices' => RegistrationStudent::RESPONSIBLE_OF_SCHOOLING,
'required' => true
])
->add('responsible_of_schooling_last_name')
->add('responsible_of_schooling_first_name')
->add('responsible_of_schooling_address')
->add('responsible_of_schooling_phone_number')
->add('responsible_of_schooling_post')
->add('responsible_of_schooling_location')
->add('agree_parent_engagement', CheckboxType::class,[
'mapped' => false,
'required' => true
])
->add('agree_internal_rules', CheckboxType::class,[
'mapped' => false,
'required' => true
])
->add('is_need_canteen')
->add('is_need_transport')
->add('is_need_keep')
->add('is_need_extrat_activity')
->add('accompanying_person_name')
->add('accompanying_person_phone_number')
->add('accompanying_person_name_2')
->add('accompanying_person_phone_number_2')
->add('accompanying_person_name_3')
->add('accompanying_person_phone_number_3')
->add('notification_phone_number')
->add('notification_name')
->add('notification_watsapp_number')
->add('observation')
//->add('last_previous_class')
/* ->add('art_or_musique', ChoiceType::class, [
'choices' => RegistrationStudent::ART_MUSIQUE,
'required' => false
]) */
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => RegistrationStudentPreRegistration::class,
]);
}
}