<?php

/*

 * Developer : John D'Alto (jdalto@yahoo.com)

 * Date : 9/1/2012

 * All code (c)2012 JLS Consulting, all rights reserved

 */



namespace Dorcas\TabithaBundle\Form\Type;



use Symfony\Component\Form\AbstractType;

use Symfony\Component\Form\FormBuilder;

use Doctrine\ORM\EntityRepository;

use Symfony\Component\OptionsResolver\OptionsResolverInterface;



class AssistanceType extends AbstractType

{

    public function buildForm(FormBuilder $builder, array $options)

    {

        $builder->add('checks_issued_date', 'date', array('label' => 'Date:*',

            'input'  => 'datetime',

            'widget' => 'single_text',

            'format' => 'MM/dd/yyyy',

            'error_bubbling' => 'true', 

            'invalid_message' => 'Please re-enter, Check Issued Date was invalid.'));

        $builder->add('checks_issued_payee', 'text', array('label' => 'Payee*:',

            'error_bubbling' => 'true'));

        $builder->add('checkpurpose');

        $builder->add('check_dorcas', 'money', array('label' => 'Dorcas', 'currency' => 'USD'));

        $builder->add('check_oasis', 'money', array('label' => 'OASIS'));

        $builder->add('check_sfumc', 'money', array('label' => 'SFUMC'));

        $builder->add('check_other', 'money', array('label' => 'Other'));

        $builder->add('food_given', 'checkbox', array('label' => 'Food Given:', 'required'  => false,));

        $builder->add('food_given_date', 'date', array('label' => 'Date Food Given:',

            'input'  => 'datetime',

            'widget' => 'single_text',

            'format' => 'MM/dd/yyyy',

            ));

        

        

        $builder->add('special_program_date', 'date', array('label' => 'Date:',

            'input'  => 'datetime',

            'widget' => 'single_text',

            'format' => 'MM/dd/yyyy',

            'error_bubbling' => 'true', 

            'invalid_message' => 'Please re-enter, Check Issued Date was invalid.'));

        $builder->add('special_program');

        $builder->add('special_program_check', 'money', array('label' => 'Amount*', 'currency' => 'USD'));

        $builder->add('special_program_recipient_name', 'text', array('label' => "Recipient's Name:",

            'error_bubbling' => 'true'));

        $builder->add('special_program_parent_name', 'text', array('label' => "Parent's Name:",

            'error_bubbling' => 'true'));

        

    }

    

    public function getName()

    {

        return 'assistanceform';

    }

    

        public function getDefaultOptions(array $options)

    {

        return array('data_class' => 'Dorcas\TabithaBundle\Entity\Assistance',);

    }

    

    public function setDefaultOptions(OptionsResolverInterface $resolver)

    {

    $resolver->setDefaults(array(

        'data_class' => 'Dorcas\TabithaBundle\Entity\Assistance',

    ));

    }

}

