<br/>


 <h4>User Profiles</h4>
 
<div style="width:10%; float:left;">
    Username
</div>
<div style="width:10%; float:left;">
    First Name
</div>
<div style="width:10%; float:left;">
    Last Name
</div>
<div style="width:20%; float:left;">
    Address           
</div>
<div style="width:14%; float:left;">
    Phone          
</div>
<div style="width:15%; float:left;">
    Email        
</div>
<div style="width:6%; float:left;">
    Admin       
</div>
<div style="width:5%; float:left;">
    Enabled        
</div>

<br/>

{% set userEmailList = "" %}

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

{% for user in users %}
    
    <article>
	
        <div style="width:10%; float:left;">
            {{ user.username }} &nbsp;
        </div>
		<div style="width:10%; float:left;">
            {{ user.firstname }} &nbsp;
        </div>
		<div style="width:10%; float:left;">
            {{ user.lastname }} &nbsp;
        </div>

        <div style="width:20%; float:left;">
                    {{ user.address }} &nbsp;
        </div>
        <div style="width:14%; float:left;">
                    {{ user.phone }} &nbsp;
        </div>
        <div style="width:17%; float:left;">
                    {{ user.email }} &nbsp;
        </div>
        <div style="width:6%; float:left;">
            {% if user.isAdmin %}
                    <input type="checkbox" name="isAdmin" disabled="disabled" checked="checked" />
             {% else %}
                    <input type="checkbox" name="isAdmin" disabled="disabled" />
            {% endif %}
        </div>
        <div style="width:4%; float:left;">
            {% if user.isActive %}
                    <input type="checkbox" name="isAdmin" disabled="disabled" checked="checked" />
             {% else %}
                    <input type="checkbox" name="isAdmin" disabled="disabled" />
            {% endif %}
        </div>
		

        {% if is_granted('ROLE_ADMIN') %}
            {% set urlpath = path('DorcasTabithaBundle_user_update', { 'id' : user.id } ) %}
            <input type="button" value="Edit" onclick="window.open(' {{ urlpath }} ','','width=1200,height=340,location=0')" />
            {% set urlpath = path('DorcasTabithaBundle_user_delete', { 'id' : user.id } ) %}
                <input type="button" value="Del" onClick='warnUsersDelete("{{ urlpath }}")' />
        {% endif %}
      
    </article>

    {% if user.email is not empty %}	
        {% set userEmailList =  [userEmailList, user.email]|join('; ') %} 
    {% endif %}

{% else %}
    <p>There are no users registered yet. </p>

{% endfor %}

<input type=button onClick="location.href='javascript: displayemail()'" value='Display Email' style="color:#00b5cb; background-color:white; font-size: 12px;">

<div id="emailList" style="display:none;">
    <br />
    <textarea rows="2" cols="80" readonly=true, style="font-size: 12px;">{{ userEmailList }}</textarea> 
</div>

<br/><br/>




