<!-- <link rel="stylesheet" href="css/bootstrap-combined.min.css"> -->
<link rel="stylesheet" type="text/css" href="module/report/setsales-report/css/setsales-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>Set 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">
                        <div class="inner-tab pull-left">
                            <!-- <form class="form-horizontal pull-left" novalidate name="form" ng-submit="fsubmit()">
                                <div class="well">
                                  <div id="date" class="input-append" datetimez ng-model="formData.monthpicker">
                                    <input data-format="MM-yyyy" type="text" id="input1" name="input1"></input>
                                    <span class="add-on">
                                      <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
                                    </span>
                                  </div>
                                </div>
                            </form>
                            <button class="btn export_update pull-left" ng-click="chartData()">
                                <p>Go</p>
                            </button> -->
                        </div>
                        <div class="data_class">
                            
                            <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">
                            <div class="total-item">
                                <h4>Total Target</h4>
                                <p>{{setSalesReport.total}}</p>
                                <h4>Approved Target</h4>
                                <p>{{setSalesReport.approved}}</p>
                                <p>On {{monthpicker}}</p>
                            </div>
                        </div> -->
                        <div class="table_box">
                            <div class="table-content table-fixed">
                                <table class="table table-striped">
                                    <thead ng-if="setSalesReport.list.length>0;">
                                        <tr class="row-name">
                                            <th>Name</th>
                                            <!-- <th>Email ID</th> -->
                                            <th class="centerdata">Dealer / Branch Count</th>
                                            <th class="centerdata">DSE count</th>
                                            <th class="centerdata">Target Set by Dealers</th>
                                            <th class="centerdata">Target Approved by AMS</th>
                                            <th class="centerdata">Target Modified by AMS</th>
                                            <th class="centerdata">Auto Target Set</th>
                                            <!-- <th class="centerdata">Auto Target Approval</th> -->
                                        </tr>
                                    </thead>
                                    <tbody ng-if="setSalesReport.list.length>0;">
                                        <tr ng-if="setSalesReport.list.length>0" class="row-content" ng-repeat="setSales in setSalesReport.list track by $index">
                                            <td>{{setSales.name}}</td> 
                                            <!-- <td>{{setSales.email}}</td> -->
                                            <td class="centerdata">{{setSales.dealer_count}}</td>
                                            <td class="centerdata">{{setSales.dse_count}}</td>
                                            <td class="centerdata">{{setSales.dealer_target_set_dse_count}}</td>
                                            <td class="centerdata">{{setSales.am_target_set_dse_count}}</td>
                                            <td class="centerdata">{{setSales.am_target_mod_dse_count}}</td>
                                            <td class="centerdata">{{setSales.auto_target}}</td>
                                        </tr>
                                    </tbody>
                                    <tfoot ng-if="setSalesReport.list.length>0;">
                                        <tr class="row-foot">
                                            <th>Total</th>
                                            <!-- <th></th> -->
                                            <th class="centerdata">{{setSalesReport.total.dealer_count}}</th>
                                            <th class="centerdata">{{setSalesReport.total.dse_count}}</th>
                                            <th class="centerdata">{{setSalesReport.total.dealer_target_set_dse_count}}</th> 
                                            <th class="centerdata">{{setSalesReport.total.am_target_set_dse_count}}</th> 
                                            <th class="centerdata">{{setSalesReport.total.am_target_mod_dse_count}}</th> 
                                            <th class="centerdata">{{setSalesReport.total.auto_target}}</th> 
                                        </tr>
                                        </tbody>
                                </table>
                            </div>
                            <div class="download_export table_export" ng-click="exportTableData()" ng-if="setSalesReport.list.length>0">
                                <img src="images/excel.png" alt="Export" title=" Export">
                                <span>Export table data</span>
                            </div>
                            <div class="norecord" ng-if="setSalesReport.length==0;">
                              <p>No Records Found</p> 
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>