<link rel="stylesheet" type="text/css" href="module/report/assessment-report/css/assessment-report.css" />
<link rel="stylesheet" type="text/css" href="module/report/enquiry-report/css/enquiry-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">
                        <span>ENQUIRY REPORT</span>
                        <!-- <div class="role">
                            <label>Segment</label>
                            <select ng-model="formData.segment" ng-change='segmentChange()'>
                                <option ng-repeat="zm in segmentarr" value="{{zm.id}}">{{zm.value}}</option>
                            </select>
                        </div> -->
                        <!-- <div class="pull-right" ng-if="maintabselected =='1'">
                            <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> -->

                    </div>


                    <div class="main_dropdown">
                        <div class="zmdropdown role">
                            <label>Zone</label>
                            <select ng-model="formData.zone" ng-change='getZm()'>
                                <option value="all">Pan India</option>
                                <option ng-repeat="zm in zone_list" value="{{zm.name}}">{{zm.name}}</option>
                            </select>
                        </div>
                        <div class="zmdropdown role" ng-if="!zmInactive">
                            <label>ZM</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 role" ng-if="!rmInactive">
                            <label>RM</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 role" ng-if="!amInactive">
                            <label>AM</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 class="amdropdown role" ng-if="!dealerInactive">
                            <label>DEALER</label>
                            <select ng-model="formData.dealer_email" ng-class="dealerInactive ?'disabled':''"
                                ng-change='dealerChange("0")'>
                                <option value="all">All</option>
                                <option ng-repeat="am in dealer_userlist" value="{{am.dealer_code}}">
                                    {{am.dealer_code}}-{{am.name}}</option>
                            </select>
                        </div>
                        <div class="amdropdown role" ng-if="!dseInactive && maintabselected !='2'">
                            <label>DSE</label>
                            <select ng-model="formData.dse_email" ng-class="dseInactive ?'disabled':''"
                                ng-change='dsechange()'>
                                <option value="all">All</option>
                                <option ng-repeat="am in dse_userlist" value="{{am.smpin}}">{{am.smpin}}-{{am.name}}
                                </option>
                            </select>
                        </div>
                    </div>
                    <div class="wid100">
                        <div class="pull-right" ng-if="maintabselected =='1'|| maintabselected =='3'">
                            <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>
                    </div>
                    <ul class="nav nav-tabs">
                        <li class="active"><a data-target="#tab1" data-toggle="tab" ng-click="getenquiry()">Enquiry
                                Report</a></li>
                        <li><a data-target="#tab2" data-toggle="tab" ng-click="getterms()">Terms & Condition</a></li>
                        <li><a data-target="#tab3" data-toggle="tab" ng-click="getsuspension()">Temporary Suspension</a>
                        </li>
                    </ul>
                    <style>
                        .ui-datepicker-calendar {
                            display: none;
                        }
                    </style>
                    <div class="data_class">
                        <div class="download_export" ng-click="exportData()">
                            <img src="images/excel.png" alt="Export" title=" Export">
                            <span>Export Report</span>
                        </div>
                        <div class="pull-right" ng-if="maintabselected =='1' || maintabselected =='3'">
                            <!-- <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="mcustom_month">
                                  
                                    <label class="m_lable" ng-if="maintabselected =='1'|| maintabselected =='3'">Segment :</label>
                                    <select ng-model="formData.segment" ng-change='segmentChange()' ng-if="maintabselected =='1' || maintabselected =='3'">
                                        <option ng-repeat="zm in segmentarr" value="{{zm.id}}">{{zm.value}}</option>
                                    </select>
                                
                                <div class="s_month" ng-if="maintabselected =='1' || maintabselected =='3'">
                                    <label for="from">Start Date :</label>
                                    <input name="startDate" id="startDate" class="datepicker" ng-model="startdatemdl"  readonly="readonly" month-pick  />
                                    <label for="from">End Date :</label>
                                    <input name="endDate" id="endDate" class="datepicker" ng-model="enddatemdl" readonly="readonly" month-pick />
                                    <p class="date_error" ng-if="dateerror">Start Date should not be greater than end date</p>
                                    <p class="date_error" ng-if="datemontherror">should not more than 3 months</p>

                                </div>

                                <button class="btn export" ng-click="chartData()" ng-if="maintabselected =='1' || maintabselected =='3'">
                                    <p>Go</p>
                                </button>
                                <button class="btn export ml_10"  style="margin-left: 5px !important;" ng-click="resetdate()" ng-if="maintabselected =='1' || maintabselected =='3'">
                                    <p>Reset</p>
                                </button>
                            </div>
                        </div>
                    </div>

                   
                    <div class="tab-content">
                        <div class="tab-pane fade in active" id="tab1">
                            <button type="button" ng-click="listtype('enquirystatus')" class="btn btn-default datas"
                                ng-class="reporttype='enquirystatus' ?'active':''">Enquiry Status</button>
                            <button type="button" ng-click="listtype('enquirytestride')"
                                class="btn btn-default datas">Enquiry Test Ride</button>
                            <button type="button" ng-click="listtype('conversionratio')"
                                class="btn btn-default datas">Conversion Ratio </button>
                            <button type="button" ng-click="listtype('productivity')"
                                class="btn btn-default datas">Productivity</button>
                            <!-- <button type="button" ng-click="listtype('follow')" class="btn btn-default datas">Follow
                                ups</button> -->
                            <!-- <button type="button" ng-click="listtype('achievedvstarget')" class="btn btn-default datas" >Acheived vs Target</button> -->


                            <!-- <div class="date_align">
                                <div class="inner-tab pull-left">
                                    <select class="cat-item" ng-model="formData.assessmentid" ng-change='selectAssessment()'>
                                        <option ng-repeat="assessment in assessmentData" value="{{assessment.assessmentid}}">
                                            {{assessment.assessmentname}}</option>
                                    </select>
                                </div>
                            </div> -->
                            <div class="filter-area">
                                <!-- <div class="box_chart">
                                    <div class="total-item" ng-repeat="totalData in assessmentDataReport">
                                        <p>{{totalData.title}}
                                            <span>({{totalData.value}})</span>
                                        </p>
                                    </div>
                                </div> -->
                                <div class="table_box">
                                    <div class="table-content table-fixed">
                                        <table class="table table-striped" ng-if="listheader.length>0">
                                            <thead>
                                                <tr class="row-name" ng-if="listheader.length>0">
                                                    <th ng-repeat="assessmentData in listheader" >{{assessmentData}}</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <tr ng-if="listbodysenddata.length>0" class="row-content"
                                                    ng-repeat="assessmentData in listbodysenddata track by $index">
                                                    <td ng-repeat="ad in assessmentData track by $index" >{{ad}}</td>
                                                </tr>
                                            </tbody>
                                            <tfoot ng-if="listfooter.length>0">
                                                <tr class="row-foot">
                                                    <th ng-repeat="ft in listfooter track by $index">{{ft}}</th>
                                                </tr>
                                            </tfoot>
                                            <div class="norecord text-center" ng-if="listheader.length==0">
                                                No Records Found
                                            </div>
                                        </table>
                                    </div>
                                    <!-- <div class="download_export table_export" ng-click="exportData()"
                                        ng-if="listheader.length>0 && maintabselected == '1'">
                                        <img src="images/excel.png" alt="Export" title=" Export">
                                        <span>Export table data</span>
                                    </div> -->

                                </div>
                            </div>

                        </div>

                        <div class="tab-pane fade" id="tab2">
                            <div class="table_box">
                                <div class="table-content table-fixed">
                                    <table class="table table-striped" ng-if="termslistheader.length>0">
                                        <thead>
                                            <tr class="row-name" ng-if="termslistheader.length>0">
                                                <th ng-repeat="assessmentData in termslistheader">{{assessmentData}}
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr ng-if="termslistbody.length>0" class="row-content"
                                                ng-repeat="assessmentData in termslistbody track by $index">
                                                <td ng-repeat="ad in assessmentData track by $index">{{ad}}</td>
                                            </tr>
                                        </tbody>
                                        <tfoot ng-if="termslistfooter.length>0">
                                            <tr class="row-foot">
                                                <th ng-repeat="ft in termslistfooter track by $index">{{ft}}</th>
                                            </tr>
                                        </tfoot>
                                        <div class="norecord text-center" ng-if="termslistheader.length==0">
                                            No Records Found
                                        </div>
                                    </table>
                                </div>
                                <!-- <div class="download_export table_export" ng-click="exportTableData()"
                                        ng-if="termslistheader.length>0">
                                        <img src="images/excel.png" alt="Export" title=" Export">
                                        <span>Export table data</span>
                                    </div> -->
                            </div>
                        </div>
                        <div class="tab-pane fade" id="tab3">
                            <div class="table_box">
                                <div class="table-content table-fixed">
                                    <table class="table table-striped" ng-if="termslistheader.length>0">
                                        <thead>
                                            <tr class="row-name" ng-if="termslistheader.length>0">
                                                <th ng-repeat="assessmentData in termslistheader">{{assessmentData}}
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr ng-if="termslistbody.length>0" class="row-content"
                                                ng-repeat="assessmentData in termslistbody track by $index">
                                                <td ng-repeat="ad in assessmentData track by $index">{{ad}}</td>
                                            </tr>
                                        </tbody>
                                        <!-- <tfoot ng-if="termslistfooter.length>0">
                                            <tr class="row-foot">
                                                <th ng-repeat="ft in termslistfooter track by $index">{{ft}}</th>
                                            </tr>
                                        </tfoot> -->
                                        <div class="norecord text-center" ng-if="termslistheader.length==0">
                                            No Records Found
                                        </div>
                                    </table>
                                </div>
                                <!-- <div class="download_export table_export" ng-click="exportTableData()"
                                      ng-if="termslistheader.length>0">
                                      <img src="images/excel.png" alt="Export" title=" Export">
                                      <span>Export table data</span>
                                  </div> -->
                            </div>
                        </div>
                    </div>



                </div>
            </div>
        </div>
    </div>
</section>