<link rel="stylesheet" type="text/css" href="module/report/sales-report/css/sales-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>SALES 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">
                            <!-- <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="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()" ng-if="formData.from_date!='' && formData.to_date!=''">
                                        <p>Go</p>
                                    </button>
                                    <button class="btn export_update opacity" ng-if="formData.from_date=='' || formData.to_date==''"  >
                                            <p>Go</p>
                                    </button> -->
                                   
                                    <div class="pull-left">
                                        <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>

                                        <label for="from">Select Month :</label>
                                        <input name="startDate" id="startDate" class="datepicker" readonly="readonly" month-pick/>
                                        <button class="btn export" ng-click="chartData()">
                                            <p>Go</p>
                                        </button>
                                    </div>

                            <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="box_chart">
                                <h4>Total Target</h4>
                                <h2>{{totalValue.target}}</h2>
                                <h4>Total Achieved</h4>
                                <h2>{{totalValue.sales}}</h2>
                            </div> -->
                            <div class="table_box">
                                    <div class="table-content table-fixed">
                                        <table class="table table-striped">
                                            <thead ng-if="userReportData.length>0;">
                                                <tr class="row-name">
                                                    <th>Name</th>
                                                    <th>Email ID</th>
                                                    <th class="centerdata">Sales</th>
                                                    <th class="centerdata">Target</th>
                                                </tr>
                                            </thead>
                                            <tbody ng-if="userReportData.length>0;">
                                                <tr ng-if="userReportData.length>0" class="row-content" ng-repeat="report in userReportData track by $index">
                                                    <td>{{report.name}}</td> 
                                                    <td>{{report.email}}</td>
                                                    <td class="centerdata">{{report.sales}}</td>
                                                    <td class="centerdata">{{report.target}}</td>
                                                </tr>
                                            </tbody>
                                            <tfoot ng-if="userReportData.length>0;">
                                                <tr class="row-foot">
                                                    <th>Total</th>
                                                    <th></th>
                                                    <th class="centerdata">{{totalValue.sales}}</th> 
                                                    <th class="centerdata">{{totalValue.target}}</th> 
                                                </tr>
                                                </tbody>
                                        </table>
                                    </div>
                                    <div class="download_export table_export" ng-click="exportTableData()" ng-if="userReportData.length>0">
                                        <img src="images/excel.png" alt="Export" title=" Export">
                                        <span>Export table data</span>
                                    </div>
                                    <div class="norecord" ng-if="userReportData.length==0;">
                                      <p>No Records Found</p> 
                                    </div>
                                </div>
                        </div>
                </div>
            </div>
        </div>
    </div>
</section>