<!--   Copyright JLS Consulting 2012 -->

{% if app.session.hasFlash('notice') %}
    <div class="flash-notice" style="padding-left:27px; position:relative; top:-14px;">
        &sdot; {{ app.session.flash('notice') }}
    </div>
{% endif %}

<div id="override_javascript_alert"></div>
<div id="override_javascript_alertx"></div>
<br />
        {% if ((history.checksHistory is defined and history.checksHistory !=NULL) or (history.totalAssist is defined and history.totalAssist != NULL )) and history.isActive == 1 %}
            <div style="border:3px solid gray; border-radius: 9px; width:95%; padding:25px;">

                {% if  history.totalAssist is defined and history.isActive == 1 and history.totalAssist !=NULL  %}  	
                    <h4 style="line-height:20%;">	
                    Assistance History: Total Assistance
                    </h4>
                    <textarea rows="2" cols="100" readonly>{{ history.totalAssist }}  </textarea> 
                {% endif %}

                {% if history.checksHistory is defined and history.isActive == 1 and history.checksHistory != NULL %}	
                    <h4>	
                    Assistance History: Checks Issued / Last Results
                    </h4>
                    <textarea rows="3" cols="100" readonly>{{ history.checksHistory }}  </textarea> 
                    <br>&nbsp;<br>
                {% endif %}


                {% set uri = app.request.uri %}
                {% if is_granted('ROLE_ADMIN') and not ("/assistance/" in uri) %}
                    {% set urlpath = path('DorcasTabithaBundle_assistance_delete_history', { 'history_id' : history.historyid } ) %}
                    <input type="button" value="Delete History" onClick="location.href='{{ urlpath }}'" />            
                {% endif %} 
                <br/><br />
            </div>  
            <br/><br />
            <br/><br />      
        {% endif %}


<div style="border:3px solid gray; border-radius: 9px; width:97%; padding:15px;">

<form id="clientform" action="{{ path('DorcasTabithaBundle_assistance_create', { 'client_id' : assistance.client.clientid } ) }}" method="post" {{ form_enctype(form) }} class="dorcas">

    <h4>Food Given:</h4>

<div id="western_wake">
            {{ form_label(form.food_given) }}
            {{ form_errors(form.food_given) }}
            {{ form_widget(form.food_given, { 'attr': {'size': '3', 'onchange': 'fgcheckbox(this)'} }) }} 
        </div>
        <div id="western_wake_date";>
            {{ form_label(form.food_given_date) }}
            {{ form_errors(form.food_given_date) }}
            {{ form_widget(form.food_given_date, { 'attr': {'size': '11', 'class': 'datepicker', 'onchange': 'fgdate(this)'} }) }}
        </div>


    <br/><br />	  
	  
    <h4>Checks Issued:</h4>
    <div style=" width: 362px; position:relative; top:-40px; left:58%;">
        Must enter amount in at least one dollar field<hr>
    </div>
    <div style="position:relative; top:-40px;">
        <div style="width:17%; float:left;">
                    Purpose*
                    {{ form_widget(form.checkpurpose, { 'attr': {'style': 'width: 160px;'} }) }}
        </div>
        <div style="width:12%; float:left;">
                    {{ form_label(form.checks_issued_date) }}
                    {{ form_errors(form.checks_issued_date) }}
                    {{ form_widget(form.checks_issued_date, { 'attr': {'size': '11', 'class': 'datepicker'} }) }}
        </div>
        <div style="width:26%; float:left;">
                    {{ form_label(form.checks_issued_payee) }}
                    {{ form_errors(form.checks_issued_payee) }}
                    {{ form_widget(form.checks_issued_payee, { 'attr': {'size': '30'} }) }}
        </div>

        <div style="width:11%; float:left;">
                    {{ form_label(form.check_dorcas) }}
                    {{ form_errors(form.check_dorcas) }}
                    {{ form_widget(form.check_dorcas, { 'attr': {'size': '10', 'onchange': 'isNumber(this)'} }) }} 
        </div>
        <div style="width:11%; float:left;">
                    {{ form_label(form.check_oasis) }}
                    {{ form_errors(form.check_oasis) }}
                    {{ form_widget(form.check_oasis, { 'attr': {'size': '10', 'onchange': 'isNumber(this)'} }) }}
        </div>
        <div style="width:11%; float:left;">
                    {{ form_label(form.check_sfumc) }}
                    {{ form_errors(form.check_sfumc) }}
                    {{ form_widget(form.check_sfumc, { 'attr': {'size': '10', 'onchange': 'isNumber(this)'} }) }}
        </div>
        <div style="width:11%; float:left;">
                    {{ form_label(form.check_other) }}
                    {{ form_errors(form.check_other) }}
                    {{ form_widget(form.check_other, { 'attr': {'size': '10', 'onchange': 'isNumber(this)'} }) }}
        </div>


        <br/><br /><br />
     <h4>Special Programs:</h4>

    <div style="width:23%; float:left;">
                    Program*
                    {{ form_widget(form.special_program, { 'attr': {'style': 'width: 220px;'} }) }}
        </div>
        <div style="width:12%; float:left;">
                    {{ form_label(form.special_program_date) }}
                    {{ form_errors(form.special_program_date) }}
                    {{ form_widget(form.special_program_date, { 'attr': {'size': '11', 'class': 'datepicker'} }) }}
        </div>
        <div style="width:26%; float:left;">
                    {{ form_label(form.special_program_recipient_name) }}
                    {{ form_errors(form.special_program_recipient_name) }}
                    {{ form_widget(form.special_program_recipient_name, { 'attr': {'size': '30'} }) }}
        </div>
        <div style="width:26%; float:left;">
                    {{ form_label(form.special_program_parent_name) }}
                    {{ form_errors(form.special_program_parent_name) }}
                    {{ form_widget(form.special_program_parent_name, { 'attr': {'size': '30'} }) }}
        </div>
        <div style="width:11%; float:left;">
                    {{ form_label(form.special_program_check) }}
                    {{ form_errors(form.special_program_check) }}
                    {{ form_widget(form.special_program_check, { 'attr': {'size': '10', 'onchange': 'isNumber(this)'} }) }} 
        </div>



            <br /><br /><br />
            <div style=" padding-top: 18px;">
                <input type="button" value="Save All Above" onclick="saveallabove(false)" >
            </div> 
    </div> 
		
                {{ form_rest(form) }}



   
</form>

</div>

<br /><br /><br />