
<h4>
    Previous Dates Food Was Given
</h4>
<article style="background-color: #00b5cb; padding-top: 8px; padding-left: 5px; height: 60px; color: white;">
{% set fgstatus = 0 %}
{% for assistance in assistances %}
    
        <div style=" float:left;">
            {% if assistance.foodgivendate is not null and assistance.foodgivendate|date("Y") > 0
                and assistance.isActiveFood == 1 %} 
                {{ assistance.foodgivendate|date("m/d/Y") }}  

                {% set uri = app.request.uri %}
                {% if is_granted('ROLE_ADMIN') and not ("/assistance/" in uri) %}
                    {% set urlpath = path('DorcasTabithaBundle_assistance_delete_food', { 'assistance_id' : assistance.assistanceid } ) %}
                    <input type="button" value="Del" onClick="location.href='{{ urlpath }}'" />            
                {% endif %}
                &nbsp;&nbsp;&nbsp;
                {% set fgstatus = 1 %}
            {% endif %}
        </div>

{% endfor %}
{% if fgstatus == 0 %}
    <p>There has been no food given for this client. </p>
{% endif %}
    </article>
                <hr size="0" color="black" noshade/ style = "position:relative; top:-10px;">


 <h4>Previous Checks Issued</h4>

<div style="width:15%; float:left;">
    Purpose
</div>
<div style="width:11%; float:left;">
    Date           
</div>
<div style="width:24%; float:left;">
    Payee          
</div>
<div style="width:10%; float:left;">
    Dorcas $        
</div>
<div style="width:10%; float:left;">
    OASIS $       
</div>
<div style="width:10%; float:left;">
    SFUMC $        
</div>
<div style="width:10%; float:left;">
    Other $         
</div>

<br/>
<hr size="2" color="black" noshade/>

{% set dorcas = 0 %}
{% set oasis = 0 %}
{% set sfumc = 0 %}
{% set other = 0 %}
{% set cistatus = 0 %}
{% for assistance in assistances %}

    {% if (assistance.checkdorcas or assistance.checkoasis or assistance.checksfumc 
            or assistance.checkother) and assistance.isActiveCheck == 1 %}
        {% set cistatus = 1 %}
        <article style="background-color: #00b5cb; padding-top: 8px; padding-left: 5px; color: white;">
            <div style="width:15%; float:left;">
                {{ assistance.checkpurpose }}
            </div>

            <div style="width:11%; float:left;">
                        {{ assistance.checksissueddate is empty ? "" : assistance.checksissueddate|date("m/d/Y") }} &nbsp;
            </div>
            <div style="width:24%; float:left;">
                        {{ assistance.checksissuedpayee }} &nbsp;
            </div>
            <div style="width:10%; float:left;">
                        {{ assistance.checkdorcas|number_format(2, '.', ',') }} &nbsp;
            </div>
            <div style="width:10%; float:left;">
                        {{ assistance.checkoasis|number_format(2, '.', ',') }} &nbsp;
            </div>
            <div style="width:10%; float:left;">
                        {{ assistance.checksfumc|number_format(2, '.', ',') }} &nbsp;
            </div>
            <div style="width:10%; float:left;">
                        {{ assistance.checkother|number_format(2, '.', ',') }} &nbsp;
            </div>

            {% set uri = app.request.uri %}
            {# if not (uri in "/assistance/" #}

            {% if is_granted('ROLE_ADMIN') and not ("/assistance/" in uri) %}
                {% set urlpath = path('DorcasTabithaBundle_assistance_update', { 'assistance_id' : assistance.assistanceid } ) %}
                <input type="button" value="Edit" onclick="window.open(' {{ urlpath }} ','','width=880,height=310,location=no')" />
                {% set urlpath = path('DorcasTabithaBundle_assistance_delete_check', { 'assistance_id' : assistance.assistanceid } ) %}
                <input type="button" value="Del" onClick="location.href='{{ urlpath }}'" />
            {% endif %}

            {% set dorcas = dorcas + assistance.checkdorcas %}
            {% set oasis = oasis + assistance.checkoasis %}
            {% set sfumc = sfumc + assistance.checksfumc %}
            {% set other = other + assistance.checkother %}


            <br>
            <hr size="0" color="black" noshade/>
        </article>
    {% endif %}


    {% endfor %}
    {% if cistatus == 0 %}
        <p>There are no checks issued for this client. </p>
    {% endif %}

<hr size="0" color="black" noshade/>

{% set grandtotal = dorcas + oasis + sfumc + other %}
<div style="width:50%; float:left;">
            Total to Date 
</div>

<div style="width:10%; float:left;">
           ${{ dorcas|number_format(2, '.', ',') }} &nbsp;
</div>
<div style="width:10%; float:left;">
            ${{ oasis|number_format(2, '.', ',') }} &nbsp;
</div>
<div style="width:10%; float:left;">
            ${{ sfumc|number_format(2, '.', ',') }} &nbsp;
</div>
<div style="width:10%; float:left;">
            ${{ other|number_format(2, '.', ',') }} &nbsp;
</div>
<div style="width:10%; float:right;">
            ${{ grandtotal|number_format(2, '.', ',') }} <br/>Grand Total &nbsp;
</div>
<br/><br/>


 <h4>Previous Special Programs</h4>

<div style="width:20%; float:left;">
    Program
</div>
<div style="width:12%; float:left;">
    Date           
</div>
<div style="width:24%; float:left;">
    Recipient's Name          
</div>
<div style="width:24%; float:left;">
    Parent's Name          
</div>
<div style="width:10%; float:left;">
    Amount $        
</div>

<br/>
<hr size="2" color="black" noshade/>

{% set spstatus = 0 %}
{% for assistance in assistances %}
{% if assistance.specialprogramcheck and assistance.specialprogram !="" and assistance.isActiveProgram == 1 %}
    {% set spstatus = 1 %}
    <article style="background-color: #00b5cb; padding-top: 8px; padding-left: 5px; color: white;">
            <div style="width:20%; float:left;">
                {{ assistance.specialprogram }}
            </div>

            <div style="width:12%; float:left;">
                        {{ assistance.specialprogramdate is empty ? "" : assistance.specialprogramdate|date("m/d/Y") }} &nbsp;
            </div>
            <div style="width:24%; float:left;">
                        {{ assistance.specialprogramrecipientname }} &nbsp;
            </div>
            <div style="width:24%; float:left;">
                        {{ assistance.specialprogramparentname }} &nbsp;
            </div>
            <div style="width:10%; float:left;">
                        {{ assistance.specialprogramcheck|number_format(2, '.', ',') }} &nbsp;
            </div>

            {% set uri = app.request.uri %}
            {# if not (uri in "/assistance/" #}

            {% if is_granted('ROLE_ADMIN') and not ("/assistance/" in uri) %}
                {% set urlpath = path('DorcasTabithaBundle_assistance_updatesp', { 'assistance_id' : assistance.assistanceid } ) %}
                <input type="button" value="Edit" onclick="window.open(' {{ urlpath }} ','','width=980,height=310,location=no')" /> 
                {% set urlpath = path('DorcasTabithaBundle_assistance_delete_program', { 'assistance_id' : assistance.assistanceid } ) %}
                <input type="button" value="Del" onClick="location.href='{{ urlpath }}'" />
            {% endif %}

            <br>
            <hr size="0" color="black" noshade/>
        </article>
    {% endif %}
    {% endfor %}
    {% if spstatus == 0 %}
        <p>There are no special programs for this client. </p>
    {% endif %}

