<?php
namespace App\Form;
use App\Entity\VisaApplicant;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
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\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
class VisaApplicantType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('surname', TextType::class, [
'label' => 'Surname'
])
->add('firstName', TextType::class, [
'label' => 'First Name'
])
->add('previousName', TextType::class, [
'label' => 'Previous/Other Name if any',
'required' => false
])
->add('sex', ChoiceType::class, [
'label' => 'Sex',
'choices' => [
'Male' => 'male',
'Female' => 'female',
'Other' => 'other'
],
'expanded' => true,
'multiple' => false
])
->add('maritalStatus', TextType::class, [
'label' => 'Marital Status'
])
->add('dateOfBirth', DateType::class, [
'label' => 'Date of Birth',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd'
])
->add('religion', TextType::class, [
'label' => 'Religion'
])
->add('placeOfBirth', TextType::class, [
'label' => 'Place of Birth'
])
->add('townCity', TextType::class, [
'label' => 'Town/City'
])
->add('countryOfBirth', TextType::class, [
'label' => 'Country of Birth'
])
->add('citizenshipNationalIdNo', TextType::class, [
'label' => 'Citizenship/National ID No'
])
->add('educationalQualification', TextType::class, [
'label' => 'Educational Qualification'
])
->add('currentNationality', TextType::class, [
'label' => 'Current Nationality'
])
->add('nationalityByBirthOrNaturalization', TextType::class, [
'label' => 'Nationality by Birth/Naturalization'
])
->add('previousNationality', TextType::class, [
'label' => 'Any Other Previous/Past Nationality',
'required' => false
])
->add('passportNumber', TextType::class, [
'label' => 'Passport No.'
])
->add('passportDateOfIssue', DateType::class, [
'label' => 'Date of Issue',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd'
])
->add('passportPlaceOfIssue', TextType::class, [
'label' => 'Place of Issue'
])
->add('passportDateOfExpiry', DateType::class, [
'label' => 'Date of Expiry',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd'
])
->add('hasOtherPassportOrIC', ChoiceType::class, [
'label' => 'Any other Passport/Identity Certificate held',
'choices' => [
'Yes' => true,
'No' => false
],
'expanded' => true,
'multiple' => false
])
->add('otherPassportCountryOfIssue', TextType::class, [
'label' => 'Country of Issue',
'required' => false
])
->add('otherPassportPlaceOfIssue', TextType::class, [
'label' => 'Place of Issue',
'required' => false
])
->add('otherPassportNumber', TextType::class, [
'label' => 'Passport/IC No',
'required' => false
])
->add('otherPassportDateOfIssue', DateType::class, [
'label' => 'Date of Issue',
'widget' => 'single_text',
'format' => 'yyyy-MM-dd',
'required' => false
])
->add('otherPassportNationality', TextType::class, [
'label' => 'Nationality/Status',
'required' => false
])
->add('phoneNumber', TextType::class, [
'label' => 'Phone No'
])
->add('mobileNumber', TextType::class, [
'label' => 'Mobile/Cell No'
])
->add('presentAddress', TextareaType::class, [
'label' => 'Present Address'
])
->add('emailAddress', EmailType::class, [
'label' => 'Email Address'
])
->add('permanentAddress', TextareaType::class, [
'label' => 'Permanent Address'
])
->add('presentOccupation', TextType::class, [
'label' => 'Present Occupation'
])
->add('designation', TextType::class, [
'label' => 'Designation/Rank'
])
->add('employerName', TextType::class, [
'label' => 'Employer Name/Business'
])
->add('employerAddress', TextareaType::class, [
'label' => 'Employer Address'
])
->add('employerPhoneNumber', TextType::class, [
'label' => 'Employer Phone Number'
])
->add('pastOccupation', TextType::class, [
'label' => 'Past Occupation (if any)',
'required' => false
])
->add('workedWithForces', ChoiceType::class, [
'label' => 'Have you worked with Armed forces/Police/Para Military forces?',
'choices' => [
'Yes' => true,
'No' => false
],
'expanded' => true,
'multiple' => false
])
->add('securityOrganization', TextType::class, [
'label' => 'Organization',
'required' => false
])
->add('securityDesignation', TextType::class, [
'label' => 'Designation',
'required' => false
])
->add('securityPlaceOfPosting', TextType::class, [
'label' => 'Place of Posting',
'required' => false
])
->add('securityRank', TextType::class, [
'label' => 'Rank',
'required' => false
])
->add('declarationStatus', CheckboxType::class,[
'label'=>false,
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => VisaApplicant::class,
]);
}
}