<?php

namespace App\Form;

use App\Entity\TourClaimDetails;
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\TextType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;

class TourClaimDetailsType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder           
            ->add('category', ChoiceType::class, [                           
                'choices'  => [
                    'Traveling Expenses' => 'Traveling Expenses',
                    'Lodging Expenses' => 'Lodging Expenses', 
                    'Boarding Expenses' => 'Boarding Expenses',
                    'Misc Expenses' => 'Misc Expenses',
                    'Conveyance Expenses' => 'Conveyance Expenses',
                                                 
                ],
                'placeholder' => 'Select a Category...',
                'attr' => ['class' => 'form-control'], 
                'label' => false,                    
                // 'expanded' => true,
                // 'multiple' => false,                
                ])
            ->add('fromPlace',TextType::class, [       
                'attr' => ['class' => 'form-control'],
                'label' => false,
                ])
            ->add('startingDate', DateTimeType::class, [
                'attr' => ['class' => 'form-control',
                'style' => 'line-height:20px; width: 150px;'],
                'widget' => 'single_text',
                'empty_data' => null, 
                'label' => false,                                              
                ])
            ->add('toPlace',TextType::class, [       
                'attr' => ['class' => 'form-control'],
                'label' => false,
                ])
            ->add('endingDate', DateTimeType::class, [
                'attr' => ['class' => 'form-control',
                'style' => 'line-height:20px; width: 150px;'],
                'widget' => 'single_text',
                'empty_data' => null, 
                'label' => false,                                              
                ])
            ->add('travelMode', ChoiceType::class, [                           
                'choices'  => [
                    'Office Car' => 'Office Car',
                    'Air' => 'Air',
                    'Road' => 'Road', 
                    'Rail' => 'Rail', 
                    'Water' => 'Water',
                                
                ],
                'placeholder' => 'Select a Transportation Mode...',
                'attr' => ['class' => 'form-control'],  
                'label' => false,                         
                // 'expanded' => true,
                // 'multiple' => false,                
                ])  
            ->add('amountCurrency', ChoiceType::class, [                           
                'choices'  => [
                    'BDT' => 'BDT',
                    'USD' => 'USD', 
                                                    
                ],
                'placeholder' => 'Select a Currency...',
                'attr' => ['class' => 'form-control'], 
                'label' => false,                    
                // 'expanded' => true,
                // 'multiple' => false,                
                ])
            ->add('amount',NumberType::class, [       
                'attr' => ['class' => 'form-control'],
                'label' => false,     
                ])       
            
            ->add('remarks',TextType::class, [       
                'attr' => ['class' => 'form-control'],     
                'label' => false,          
                ])
           
        ;
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'data_class' => TourClaimDetails::class,
        ]);
    }
}
