<?php
namespace App\Form;
use App\Entity\Applicant;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Validator\Constraints\File;
class ApplicantType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('Division', ChoiceType::class, [
'choices' => [
'Body Imaging'=> 'Body',
'Musculoskeletal Imaging' => 'MSK',
'Breast Imaging' => 'Breast',
'Magnetic Resonance Imaging' => 'MRI',
'Women Imaging' => 'Women',
'Cardiothoracic Imaging' => 'Chest',
],
])
->add('Name')
->add('Email')
->add('Address')
->add('Degree')
->add('CurrentPosition')
->add('Phone')
->add('appForm', FileType::class, [
'label' => 'Application Form (PDF file)',
// unmapped means that this field is not associated to any entity property
'mapped' => false,
// make it optional so you don't have to re-upload the PDF file
// every time you edit the Product details
'required' => false,
// unmapped fields can't define their validation using annotations
// in the associated entity, so you can use the PHP constraint classes
'constraints' => [
new File([
'maxSize' => '6072k',
'mimeTypes' => [
'application/pdf',
'application/x-pdf',
],
'mimeTypesMessage' => 'Please upload a valid PDF document',
])
],
])
->add('PersonalStat', FileType::class, [
'label' => 'Personal Statment (PDF file)',
// unmapped means that this field is not associated to any entity property
'mapped' => false,
// make it optional so you don't have to re-upload the PDF file
// every time you edit the Product details
'required' => false,
// unmapped fields can't define their validation using annotations
// in the associated entity, so you can use the PHP constraint classes
'constraints' => [
new File([
'maxSize' => '6072k',
'mimeTypes' => [
'application/pdf',
'application/x-pdf',
],
'mimeTypesMessage' => 'Please upload a valid PDF document',
])
],
])
->add('CVLink', FileType::class, [
'label' => 'CV (PDF file)',
// unmapped means that this field is not associated to any entity property
'mapped' => false,
// make it optional so you don't have to re-upload the PDF file
// every time you edit the Product details
'required' => false,
// unmapped fields can't define their validation using annotations
// in the associated entity, so you can use the PHP constraint classes
'constraints' => [
new File([
'maxSize' => '6072k',
'mimeTypes' => [
'application/pdf',
'application/x-pdf',
],
'mimeTypesMessage' => 'Please upload a valid PDF document',
])
],
])
->add('usfile', FileType::class, [
'label' => 'USMLE (PDF file)',
// unmapped means that this field is not associated to any entity property
'mapped' => false,
// make it optional so you don't have to re-upload the PDF file
// every time you edit the Product details
'required' => false,
// unmapped fields can't define their validation using annotations
// in the associated entity, so you can use the PHP constraint classes
'constraints' => [
new File([
'maxSize' => '6072k',
'mimeTypes' => [
'application/pdf',
'application/x-pdf',
],
'mimeTypesMessage' => 'Please upload a valid PDF document',
])
],
])
->add('dlFile', FileType::class, [
'label' => 'Dean Letter (PDF file), *See Note Below',
// unmapped means that this field is not associated to any entity property
'mapped' => false,
// make it optional so you don't have to re-upload the PDF file
// every time you edit the Product details
'required' => false,
// unmapped fields can't define their validation using annotations
// in the associated entity, so you can use the PHP constraint classes
'constraints' => [
new File([
'maxSize' => '7072k',
'mimeTypes' => [
'application/pdf',
'application/x-pdf',
],
'mimeTypesMessage' => 'Please upload a valid PDF document',
])
],
])
->add('mdFile', FileType::class, [
'label' => 'Medical School Diploma (PDF file)',
// unmapped means that this field is not associated to any entity property
'mapped' => false,
// make it optional so you don't have to re-upload the PDF file
// every time you edit the Product details
'required' => false,
// unmapped fields can't define their validation using annotations
// in the associated entity, so you can use the PHP constraint classes
'constraints' => [
new File([
'maxSize' => '6072k',
'mimeTypes' => [
'application/pdf',
'application/x-pdf',
],
'mimeTypesMessage' => 'Please upload a valid PDF document',
])
],
])
->add('Ref1Name',TextType::class, ['label'=>'Reference #1 Name' ])
->add('Ref1Email',TextType::class, ['label'=>'Reference #1 Email' ])
->add('Ref1Letter',TextType::class, ['label'=>'Reference #1 Job Title' ])
->add('Ref2Name',TextType::class, ['label'=>'Reference #2 Name' ])
->add('Ref2Email',TextType::class, ['label'=>'Reference #2 Email' ])
->add('Ref2Letter',TextType::class, ['label'=>'Reference #2 Job Title' ])
->add('Ref3Name',TextType::class, ['label'=>'Reference #3 Name' ])
->add('Ref3Email',TextType::class, ['label'=>'Reference #3 Email' ])
->add('Ref3Letter',TextType::class, ['label'=>'Reference #3 Job Title' ])
->add('Status',ChoiceType::class, ['label'=>'Status for OFFICE Use Only',
'required' => false,
'choices' => [
'For OFFICE Use Only'=> 'Office',
'Withdrew' => 'Withdrew',
'Under Consideration'=>'Under Consideration',
'Withdrew Before Interview' =>'Withdrew Before Interview',
'Interviewed'=>'Interviewed',
'Withdrew After Interview'=>'Withdrew After Interview',
'Offer Extended'=>'Offer Extended',
'Declined Offer'=>'Declined Offer',
'Offer Accepted'=>'Offer Accepted',
],
])
->add('Notes',TextareaType::class, ['label'=>'Notes for OFFICE Use Only', 'required' => false,
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Applicant::class,
]);
}
}