src/Form/Registration/RegistrationStudentPreRegistrationType.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Form\Registration;
  3. use App\Entity\RegistrationStudent;
  4. use Symfony\Component\Form\AbstractType;
  5. use Symfony\Component\Form\FormBuilderInterface;
  6. use Vich\UploaderBundle\Form\Type\VichImageType;
  7. use App\Entity\RegistrationStudentPreRegistration;
  8. use Symfony\Component\OptionsResolver\OptionsResolver;
  9. use Symfony\Component\Form\Extension\Core\Type\DateType;
  10. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  11. use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
  12. class RegistrationStudentPreRegistrationType extends AbstractType
  13. {
  14.     public function buildForm(FormBuilderInterface $builder, array $options): void
  15.     {
  16.         $builder
  17.             ->add('last_school_attended')
  18.             ->add('last_school_attended_type'ChoiceType::class,[
  19.                 'choices' => RegistrationStudent::LAST_ETS_TYPE
  20.             ])
  21.             ->add('is_redoubling'ChoiceType::class,[
  22.                 'choices' => [
  23.                     'OUI' => true,
  24.                     'NON' => false
  25.                 ]
  26.             ])
  27.             
  28.             ->add('registration_number')
  29.             ->add('where_resides'ChoiceType::class,[
  30.                 'choices' => RegistrationStudent::WHER_RESIDE,
  31.                 'required' => true
  32.             ])
  33.             ->add('parent_status'ChoiceType::class,[
  34.                 'choices' => RegistrationStudent::PARENT_STATUS,
  35.                 'required' => true
  36.             ])
  37.             ->add('num_cmu')
  38.             ->add('last_name')
  39.             ->add('first_name')
  40.             ->add('location')
  41.             ->add('gender'ChoiceType::class,[
  42.                 'choices' => RegistrationStudent::GENDER
  43.             ])
  44.             ->add('birth_location')
  45.             ->add('nationality')
  46.             ->add('birthday'DateType::class, [
  47.                 'widget' => 'single_text',
  48.                 'html5' => true,
  49.                 'input' => 'datetime_immutable'
  50.             ])
  51.             ->add('birth_certificate_number')
  52.             ->add('imageFile'VichImageType::class, [
  53.                 'required' => false,
  54.                 'allow_delete' => true,
  55.                 'delete_label' => 'Supprimer',
  56.                 'download_label' => '',
  57.             ])
  58.             //La famille - Pere
  59.             ->add('is_parntal_authority_father'ChoiceType::class,[
  60.                 'choices' => [
  61.                     'OUI' => true,
  62.                     'NON' => false
  63.                 ]
  64.             ])
  65.             ->add('is_father_call_to_emergency')
  66.             ->add('father_last_name')
  67.             ->add('father_first_name')
  68.             ->add('father_address')
  69.             ->add('father_phone_number')
  70.             ->add('father_post')
  71.             ->add('father_location')
  72.             ->add('father_email')
  73.             //Mere
  74.             ->add('is_parntal_authority_mother'ChoiceType::class,[
  75.                 'choices' => [
  76.                     'OUI' => true,
  77.                     'NON' => false
  78.                 ]
  79.             ])
  80.             ->add('is_mother_call_to_emergency')
  81.             ->add('mother_last_name')
  82.             ->add('mother_first_name')
  83.             ->add('mother_address')
  84.             ->add('mother_phone_number')
  85.             ->add('mother_post')
  86.             ->add('mother_location')
  87.             ->add('mother_email')
  88.             ->add('responsible_of_schooling'ChoiceType::class,[
  89.                 'choices' => RegistrationStudent::RESPONSIBLE_OF_SCHOOLING,
  90.                 'required' => true
  91.             ])
  92.             ->add('responsible_of_schooling_last_name')
  93.             ->add('responsible_of_schooling_first_name')
  94.             ->add('responsible_of_schooling_address')
  95.             ->add('responsible_of_schooling_phone_number')
  96.             ->add('responsible_of_schooling_post')
  97.             ->add('responsible_of_schooling_location')
  98.             ->add('agree_parent_engagement'CheckboxType::class,[
  99.                 'mapped' => false,
  100.                 'required' => true
  101.             ])
  102.             ->add('agree_internal_rules'CheckboxType::class,[
  103.                 'mapped' => false,
  104.                 'required' => true
  105.             ])
  106.             ->add('is_need_canteen')
  107.             ->add('is_need_transport')
  108.             ->add('is_need_keep')
  109.             ->add('is_need_extrat_activity')
  110.             ->add('accompanying_person_name')
  111.             ->add('accompanying_person_phone_number')
  112.             ->add('accompanying_person_name_2')
  113.             ->add('accompanying_person_phone_number_2')
  114.             ->add('accompanying_person_name_3')
  115.             ->add('accompanying_person_phone_number_3')
  116.             ->add('notification_phone_number')
  117.             ->add('notification_name')
  118.             ->add('notification_watsapp_number')
  119.             ->add('observation')
  120.             //->add('last_previous_class')
  121.             /* ->add('art_or_musique', ChoiceType::class, [
  122.                 'choices' => RegistrationStudent::ART_MUSIQUE,
  123.                 'required' => false
  124.             ]) */
  125.             
  126.         ;
  127.     }
  128.     public function configureOptions(OptionsResolver $resolver): void
  129.     {
  130.         $resolver->setDefaults([
  131.             'data_class' => RegistrationStudentPreRegistration::class,
  132.         ]);
  133.     }
  134. }