<?php
namespace App\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ClientType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('nome', null, [
'required' => true,
'attr' => ['placeholder' => 'Nome']
])
->add('cpf', null, [
'required' => false,
'label' => 'CPF',
'attr' => ['class' => 'cpf', 'data-small' => 'Importante: O CPF será utilizado para dar acesso ao proprietário do imóvel.']
])
->add('email', EmailType::class, [
'attr' => ['placeholder' => 'E-mail'],
'label' => 'E-mail',
'required' => true,
])
->add('codStays', null, [
'required' => true,
'label' => 'Código (Stays)',
'attr' => ['placeholder' => 'Código na Stays']
])
->add('celular', null, [
'required' => true,
'label' => 'Telefone',
'attr' => ['placeholder' => 'Telefone', 'class' => 'phone']
])
->add('cidade', ChoiceType::class, [
'label' => 'Local',
'choices' => $this->locais(),
'placeholder' => 'Selecione um local',
'attr' => [
'class' => 'local'
],
'required' => true,
])
->add('plano', NumberType::class, [
'label' => 'Porcentagem',
'required' => true,
])
// ->add('plano', ChoiceType::class, [
// 'label' => 'Plano',
// 'choices' => [
// 'Partnership (10%)' => 10,
// 'Essential (15%)' => 15,
// 'Standard (20%)' => 20,
// 'Prime (25%)' => 25,
// 'Platinum (28%)' => 28,
// ],
// 'required' => true,
// ])
->add('endereco', null, [
'required' => true,
'label' => 'Endereço',
'attr' => ['placeholder' => 'Endereço']
])
->add('contrato', null,[
'required' => false,
'attr' => ['style'=>'display:none']
])
->add('objectID', HiddenType::class,[
'required' => false,
])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
// Configure your form options here
]);
}
public function locais(){
return [
"Barra do Una" => "Barra do Una",
"Campos do Jordão" => "Campos do Jordão",
"Ceará" => "Ceará",
"Guaruja" => "Guaruja",
"Ilhabela" => "Ilhabela",
"Juquehy" => "Juquehy",
"Riviera de São Lourenço" => "Riviera de São Lourenço",
"Santo Antônio do Pinhal" => "Santo Antônio do Pinhal",
"São Paulo" => "São Paulo",
"Trancoso" => "Trancoso",
];
}
}