
{% extends "::base.html.twig" %}


{% block body %}

    <div id="navbar" style="font-size:18px;">   
        <ul>       
            <li><a href="{{ path('DorcasTabithaBundle_homepage' ) }}"
                style="background-color:#00b5cb; font-size:30px;">Home</a></li>
            <li><a href="{{ path('DorcasTabithaBundle_search_show' ) }}">Client Search</a></li> 
            <li><a href="{{ path('DorcasTabithaBundle_clientinformation_new' ) }}">New Client</a></li> 
            {% if is_granted('ROLE_ADMIN') %}
                <li><a href="{{ path('DorcasTabithaBundle_users_show' ) }}">Users</a></li> 
                <li><a href="{{ path('DorcasTabithaBundle_message_show' ) }}">Message/Reports</a></li>
            {% else %}
                <li><a href="{{ path('DorcasTabithaBundle_profile_show' ) }}">User Profile</a></li>
            {% endif %}
        </ul> 
    </div>

    {% if app.session.hasFlash('notice') %}
                    <div class="flash-notice" style="display:none;">
                        <br />
                        {{ app.session.flash('notice') }}
                    </div>
        {% endif %}

  <br>

<h5 style="color:#304145; padding-left:20px;" >
Hi {{ app.user.firstname }} {{ app.user.lastname }},  <br /> Welcome to the <big>Tabitha 
    C</big><small>lient</small> <big>S</big><small>ervices</small> <big>M</big><small>anagement</small>
     <big>S</big><small>ystem</small>.
</h5>
        
        <style>
            #container { position: relative; z-index: 4; padding: 5px; background-color: white; width: 60%; margin-left: 20%; margin-top: 5%;}
        </style>

        Number of client records in the database: 
         <canvas id="odoCanvas" height="50" width="300">No canvas support!</canvas>

<br>&nbsp;<br> 

    <div id="manager" style="border:5px solid #00b5cb; padding: 10px; border-radius: 9px;">
        <center><h2>Manager's Message</h2></center>
            {% render 'DorcasTabithaBundle:Default:message' %}
    </div>
    <br>&nbsp;<br> 
	<br>&nbsp;<br> 

<input type="hidden" value={{ totalrecs }} id="totalrecs" />
   
{% endblock %}

{% block javascripts %}

    {{ parent() }} 

   <script type="text/javascript">

    function goBack()
    {
        window.history.back()
    }


    window.onload = run(document.getElementById("totalrecs").value);


    //      var n = 1;
            var odo;

            function run(n) {
                var ctx = document.getElementById('odoCanvas').getContext('2d');
                odo = new odometer(ctx, {
                                    height: 40,
                                    digits: 6,
                                    decimals: 0,
                                    value: n,
                                    wobbleFactor: 0.07
                                    });
                odo.setValue(n);            
//              update();
            }

            function update() {
                n += 0.0001
                odo.setValue(n);
                setTimeout("update()", 50);
            }               


    </script>          
 
{% endblock %}
