<link rel="stylesheet" type="text/css" href="module/report/bulletin-report/css/bulletin-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>Bulletin 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="filter-area">
                             <!-- coded by soundariya -->
                            <div class="table_box">
                                    <div class="table-content table-fixed">
                                        <table class="table table-striped">
                                            <thead>
                                                <tr class="row-name" ng-if="totalValue.length>0">
                                                    <th>Title</th>
                                                    <th>Descripation</th>
                                                    <th class="centerdata">View Count</th> 
                                                    <th class="centerdata">Action</th> 
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <tr ng-if="totalValue.length>0" class="row-content" ng-repeat="totalData in totalValue">
                                                    <td>{{totalData.bulletin_title}}</td>
                                                    <td>{{totalData.bulletin_sdesc}}</td> 
                                                    <td class="centerdata">{{totalData.total_view}}</td> 
                                                    <td>
                                                        <div data-backdrop='static' data-toggle="modal" data-target="#myModal" ng-click="viewdetails(totalData)" class="editicon ion-eye ptr"
                                                        title="View"></div>
                                                        <div class="modal fade myViewModal" id="myModal">
                                                            <div class="modal-dialog modal-lg">
                                                                  <div class="modal-content">
                                                                        <div class="modal-header">
                                                                              <h4 class="modal-title">
                                                                                    <b class="font_14">Title: </b>{{topic_title_detail.bulletin_title}}</h4>
                                                                              <button type="button" class="close" ng-click="modal_dismiss()">&times;</button>
                                                                        </div>
                                                                        <div class="modal-body model_left">
                                                                            <div class="table-content table-fixed">
                                                                                <table class="table table-striped">
                                                                                    <thead>
                                                                                        <tr class="row-name" ng-if="contentViewValueReport.length>0">
                                                                                            <th>Employee ID</th>
                                                                                            <th>Name</th>
                                                                                            <th>Mobile No.</th>
                                                                                            <th>Dealer Code</th>
                                                                                            <th>ZM Name</th>
                                                                                            <th>RM Name</th>
                                                                                            <th>AM Name</th>
                                                                                        </tr>
                                                                                    </thead>
                                                                                    <tbody>
                                                                                        <tr ng-if="contentViewValueReport.length>0" class="row-content" ng-repeat="contentView in contentViewValueReport">
                                                                                            <td>{{contentView.smpin}}</td>
                                                                                            <td>{{contentView.fname}} {{contentView.lname}}</td> 
                                                                                            <td>{{contentView.mobileno}}</td>
                                                                                            <td>{{contentView.dealer_code}}</td>
                                                                                            <td>{{contentView.zm_name}}</td>
                                                                                            <td>{{contentView.rm_name}}</td>
                                                                                            <td>{{contentView.am_name}}</td>
                                                                                        </tr>
                                                                                    </tbody>
                                                                                </table>
                                                                            </div>
                                                                        </div>
                                                                        <!-- Modal footer -->
                                                                        <div class="modal-footer">
                                                                            <nav aria-label="Page navigation" id="div" ng-if="contentViewValueReport.length>0">
                                                                                <div class="download_export insidemodal" ng-click="exportTableData(topic_title_detail.bulletin_id)">
                                                                                    <img src="images/excel.png" alt="Export" title=" Export">
                                                                                    <span>Export Report</span>
                                                                                </div>
                                                                                <ul class="pagination-sm" uib-pagination total-items="totalItems" ng-model="currentPage" ng-change="pageChanged(currentPage)" max-size="maxSize" boundary-links="true" rotate="true" num-pages="numPages" items-per-page="itemsPerPage"></ul>
                                                                            </nav>
                                                                            <div ng-if="contentViewValueReport.length==0" class="no_report">
                                                                                <p>No records Found</p>
                                                                            </div>
                                                                              <!-- <button type="button" class="btn_close btn btn-danger" data-dismiss="modal">Close</button> -->
                                                                        </div>
                                                                  </div>
                                                            </div>
                                                      </div>
                                                    </td>
                                                </tr>
                                            </tbody>
                                            <tfoot ng-if="totalValue.length>0">
                                                <tr class="row-foot">
                                                    <th>Total</th>
                                                    <th></th>
                                                    <th class="centerdata">{{contentReport.total.total_view}}</th>
                                                    <th></th>
                                                </tr>
                                                </tbody>
                                                <div class="norecord" ng-if="totalValue.length==0">
                                                    No Records Found
                                                </div>
                                        </table>
                                    </div>
                                    <div class="download_export table_export" ng-click="exportTable()" ng-if="totalValue.length>0">
                                        <img src="images/excel.png" alt="Export" title=" Export">
                                        <span>Export table data</span>
                                    </div>
                                </div>
                        </div>
                        <!-- <div class="download_export table_export" ng-click="exportTableData()" ng-if="totalValue.length>0">
                                <img src="images/excel.png" alt="Export" title=" Export">
                                <span>Export table data</span>
                        </div> -->
                </div>
            </div>
        </div>
    </div>
</section>