<div class="page-content-wrapper">
    <div class="page-content all">
        <div class="row">
            <div class="col-md-12">
                <!-- BEGIN EXAMPLE TABLE PORTLET-->


                <div class="portlet box blue">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="fa fa-cogs"></i>Votes Report
                        </div>
                        <div class="actions">
                            <a class="btn btn-default btn-sm" href="{$hosturl}/controllers/{$controllname}.php?ac=show">
                                <i class="fa fa-eye"></i> Show </a>
                        </div>

                    </div>
                    <div class="portlet-body" style="padding: 15px;">
                        <input id="patientId" type="hidden" value="{$patientId}">
                        <form action="{$hosturl}/controllers/vote.php?ac=report" method="post" style="margin-bottom: 15px;">
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label class="col-md-2 control-label">Role</label>
                                    <div class="col-md-10">
                                        <select class="form-control select2me" required="required" name="role_id" data-placeholder="Select...">
                                            <option></option>
                                            {foreach $roles as $single}
                                                <option value="{$single->id}" {if $single->id eq $role_id}selected {/if}>{$single->name}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-2">
                                <div class="form-actions">
                                    <div class="row">
                                        <div class="col-md-offset-2 col-md-10">
                                            <button class="btn btn-sm blue" type="submit">Filter</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                        <div class="clearfix"></div>
                        <hr>
                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                            <tr>
                                <th style="width: 5%;">No</th>
                                <th>Employee Name</th>
                                <th>Vote no.</th>
                                <th>Last vote date</th>
                                <th style="width: 5%;">Details</th>
                            </tr>
                            </thead>
                            <tbody>
                            {if $users_votes|@count == 0}
                                <tr>
                                    <td colspan="5">No data found</td>
                                </tr>
                            {/if}

                            {assign var=m value=1}
                            {foreach $users_votes as $single}
                                <tr class="odd gradeX ">
                                    <td>{$m}</td>
                                    <td>{$single.name}</td>
                                    <td>{$single.votes}</td>
                                    <td>{$single.last_vote_date|date_format:"%d/%m/%Y %H:%M %p"}</td>
                                    <td>
                                        <a class="btn purple btn-block btn-xs" href="{$hosturl}/controllers/{$controllname}.php?ac=reportDetails&id={$single.user_id}"><i class="fa fa-bar-chart"></i>
                                            Details</a>
                                    </td>

                                </tr>
                                {capture assign=m}{$m+1}{/capture}
                            {/foreach}
                            </tbody>

                        </table>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>

