<link rel="stylesheet" type="text/css" href="module/report/current-login-report/css/current-login-report.css" />
<section class="user_page container">
    <div class="sales_report">
        <div class="sales_report_in">
            <div class="sales_card">
                <div class="container-fluid table_area">
                    <div class="page-head">
                        <p>Current Login Report</p>
                    </div>
                    <div class="main_dropdown">
                        <div class="zmdropdown">
                            <label>Zonal Manager</label>
                            <select ng-model="formData.zm_email" ng-change='zmChange()'>
                                <option value="all">All</option>
                                <option ng-repeat="zm in zmuser_list" value="{{zm.email}}">{{zm.name}}</option>
                            </select>
                        </div>
                        <div class="rmdropdown" ng-if="!rmInactive">
                            <label>Regional Manager</label>
                            <select ng-model="formData.rm_email" ng-class="rmInactive ?'disabled':''" ng-change='rmChange()'>
                                <option value="all">All</option>
                                <option ng-repeat="rm in rmuser_list" value="{{rm.email}}">{{rm.name}}</option>
                            </select>
                        </div>
                        <div class="amdropdown" ng-if="!amInactive">
                            <label>Area Manager</label>
                            <select ng-model="formData.am_email" ng-class="amInactive ?'disabled':''" ng-change='amChange()'>
                                <option value="all">All</option>
                                <option ng-repeat="am in amuser_list" value="{{am.email}}">{{am.name}}</option>
                            </select>
                        </div>
                    </div>
                    <div class="date_align">
                        
                        <div class="data_class">
                            <input type="checkbox" class="check_cls" ng-model="formData.regtype" ng-true-value="0" ng-false-value="1" ng-click="selectStatus()"> 
                            <label class="lbl_font">Include Historical Data</label>
                            <div class="download_export" ng-click="exportData()">
                                <img src="images/excel.png" alt="Export" title=" Export">
                                <span>Export Report</span>
                            </div>
                        </div>
                    </div>
                    <div class="filter-area">
                            <!-- coded by sound -->
                            <div class="table_box">
                                <div class="table-content table-fixed">
                                    <table class="table table-striped">
                                        <thead ng-if="assessmentReport.report.length>0;">
                                            <tr class="row-name">
                                                <th>User Id</th>
                                                <th>Name</th>
                                                <th>Dealer Code</th>
                                                <th>Dealer Name</th>
                                                <th>AM Name</th>
                                                <th>RM Name</th>
                                                <th>AM Name</th>
                                                <th>Created at</th>
                                            </tr>
                                        </thead>
                                        <tbody ng-if="assessmentReport.report.length>0;">
                                            <tr ng-if="assessmentReport.report.length>0" class="row-content" ng-repeat="report in assessmentReport.report track by $index">
                                                <td>{{report.userid}}</td> 
                                                <td>{{report.fname}} {{report.lname}}</td>
                                                <td>{{report.dealer_code}}</td>
                                                <td>{{report.dealer_name}}</td>
                                                <td>{{report.zm_name}}</td>
                                                <td>{{report.rm_name}}</td>
                                                <td>{{report.am_name}}</td>
                                                <td>{{report.created_on}}</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <nav aria-label="Page navigation" id="div1" ng-if="assessmentReport.report.length>0;">
                                    <ul class="pagination pager" uib-pagination total-items="totalItems" ng-model="currentPage" ng-change="pageChanged(currentPage)" max-size="maxSize"
                                    boundary-links="true" rotate="false" num-pages="numPages" items-per-page="itemsPerPage"></ul>
                                </nav>
                                <div class="norecord" ng-if="assessmentReport.report.length==0;">
                                    <p>No Records Found</p> 
                                </div>
                            </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>