<link rel="stylesheet" type="text/css" href="module/report/certification-report/css/certification-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>Certification 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">
                            <!-- <label>From Date</label>
                            <input type="text" id="fromdate" class="datepicker" name="fromdate" ng-model="formData.from_date" autocomplete="off" placeholder="Start Date"
                                data-isblockdate="true" ng-reportpickermin>
                            <label>To Date</label>
                            <input type="text" id="todate" class="datepicker" name="todate" ng-model="formData.to_date" autocomplete="off" placeholder="End Date"
                                data-isblockdate="true" ng-reportpickermin>
                            <button class="btn export_update" ng-click="chartData()">
                                <p>Go</p>
                            </button> -->
                            <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">
                            <!-- <div class="inner-container">
                                <div class="inner-chart"><canvas id="certificationChart" width="300" height="300"></canvas></div>
                                <div class="legend-text" ng-if="showLegend">
                                    <div class="level-text "><span class="box1"></span><span class="level_list">Base</span></div>
                                    <div class="level-text "><span class="box2"></span><span class="level_list">Bronze</span></div>
                                    <div class="level-text "><span class="box3"></span><span class="level_list">Silver</span></div>
                                    <div class="level-text "><span class="box4"></span><span class="level_list">Gold</span></div>
                                </div>
                            </div> -->
                            
                            <!-- <div class="box_chart">
                                <div class="total-item">
                                    <p>Base <span>({{baseReport}})</span></p>
                                    <p>Bronze <span>({{bronzeReport}})</span></p>
                                    <p>Silver <span>({{silverReport}})</span></p>
                                    <p>Gold <span>({{goldReport}})</span></p>
                                </div>
                            </div> -->

                            <!-- coded by sound -->
                            <div class="table_box">
                                <div class="table-content table-fixed">
                                    <table class="table table-striped">
                                        <thead ng-if="assessmentReport.list.length>0;">
                                            <tr class="row-name">
                                                <th>Name</th>
                                                <th>Email ID</th>
                                                <th class="centerdata">Total TLR/BR</th>
                                                <th class="centerdata">Total DSE</th>
                                                <th class="centerdata">Base</th>
                                                <th class="centerdata">Bronze</th>
                                                <th class="centerdata">Silver L1</th>
                                                <th class="centerdata">Silver L2</th>
                                                <th class="centerdata">Gold L1</th> 
                                                <th class="centerdata">Gold L2</th> 
                                            </tr>
                                        </thead>
                                        <tbody ng-if="assessmentReport.list.length>0;">
                                            <tr ng-if="assessmentReport.list.length>0" class="row-content" ng-repeat="report in assessmentReport.list track by $index">
                                                <td>{{report.name}}</td> 
                                                <td>{{report.email}}</td>
                                                <td class="centerdata">{{report.dealer_count}}</td>
                                                <td class="centerdata">{{report.dse_count}}</td>
                                                <td class="centerdata">{{report.base}}</td>
                                                <td class="centerdata">{{report.bronze}}</td>
                                                <td class="centerdata">{{report.silver1}}</td>
                                                <td class="centerdata">{{report.silver}}</td>
                                                <td class="centerdata">{{report.gold1}}</td>
                                                <td class="centerdata">{{report.gold}}</td>
                                            </tr>
                                        </tbody>
                                        <tfoot ng-if="assessmentReport.list.length>0;">
                                            <tr class="row-foot">
                                                <th>Total</th>
                                                <th></th>
                                                <th class="centerdata">{{assessmentReport.total.dealer_count}}</th> 
                                                <th class="centerdata">{{assessmentReport.total.dse_count}}</th> 
                                                <th class="centerdata">{{assessmentReport.total.base}}</th> 
                                                <th class="centerdata">{{assessmentReport.total.bronze}}</th> 
                                                <th class="centerdata">{{assessmentReport.total.silver1}}</th>
                                                <th class="centerdata">{{assessmentReport.total.silver}}</th>
                                                <th class="centerdata">{{assessmentReport.total.gold1}}</th>
                                                <th class="centerdata">{{assessmentReport.total.gold}}</th>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="download_export table_export" ng-click="exportTableData()" ng-if="assessmentReport.list.length>0">
                                    <img src="images/excel.png" alt="Export" title=" Export">
                                    <span>Export table data</span>
                                </div>
                                <div class="norecord" ng-if="assessmentReport.list.length==0;">
                                    <p>No Records Found</p> 
                                </div>
                            </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>