<div class="content-wrapper" ng-if="!myAccess.tipReport">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-6 offset-sm-1 offset-md-2 offset-lg-3 mt-5">
                <div class="alert alert-warning alert-dismissible">
                    <h5><i class="icon fas fa-ban"></i> 	!</h5>
                    Unauthorised Access.
                </div>
            </div>
        </div>
    </div>
</div>
<div class="content-wrapper" ng-if="myAccess.tipReport">
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="text-indigo">
                        <go-back/>
                        <i class="fas fa-envelope"></i> Tip Report ({{tipReport.length}})
                    </h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a ng-href="{{baseurl}}/dashboard">Home</a></li>
                        <li class="breadcrumb-item active">Tip Report</li>
                    </ol>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>
    <section class="content">
        <div class="container-fluid">
            <div class="row">
			 <div class="col-md-12">
                    <div class="form-group row">
                        <div class="col-sm-4">
                            <ui-select id="tip" ng-model="filter.tip" theme="bootstrap" title="Select Tip" class="">
                                <ui-select-match placeholder="Select or search a Tip in the list...">{{$select.selected.title}}</ui-select-match>
                                <ui-select-choices repeat="e.id as e in tip | filter: $select.search">
                                    <span ng-bind-html="e.title | highlight: $select.search"></span>
                                </ui-select-choices>
                            </ui-select>
                        </div>
                        <div class="col-sm-1">
                            <button class="btn btn-success" ng-click="dateChanged(filter.tip)"> Filter</button>
                        </div>
                    </div>
                </div>
              <div class="col-md-12">
                    <div class="card card-primary card-outline" ng-show="filter.selType==='Default'">
                        <div class="card-header border-transparent  mb-1">
                            <h3 class="card-title">Report</h3>
                            <div class="card-tools">
                                <div class="btn-group">
                                    <button type="button" title="Fullscreen Toggle" class="btn btn-dark toggle-fullscreen"><i class="fas fa-expand"></i></button>
                                    <button type="button" class="btn btn-dark" data-widget="collapse"><i class="fas fa-minus"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="card-body p-0">
                            <div class="table table-responsive">
                                <table class="tipreportDataTableView table table-bordered table-striped table-sm">
                                    <thead>
                                    <tr>
                                        <th>#</th>
                                        <th>Hero</th>
                                        <th>Revenue Center</th>
                                        <th>Line Manager</th>
                                        <th>Hero Id</th>
                                        <th>Hero Action</th>
                                        <th>RMS Action</th>
                                        <th>Help Comment</th>
                                        <th>DateTime</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="d in tipReport | orderBy:'-tipID'">
                                        <td>{{$index+1}}</td>
                                        <td><span>{{d.emp_first_name +' '+d.emp_last_name}}</span></td>
                                        <td><span>{{d.rc_name}}</span></td>
                                        <td><span>{{d.lm_fn + ' ' + d.lm_ln}}​​​​​</span></td>
                                        <td><span>{{d.emp_code}}</span></td>
                                        <td><span ng-if="d.heroAction=='1'">OK, Understood</span><span ng-if="d.heroAction=='0'">Need Help To Understand</span></td>
                                        <td><span ng-if="d.rmsAction=='1'" style="color:green;"><b>Done</b></span>
										<a href="#" ng-if="d.rmsAction=='0' && d.heroAction=='0'"  ng-click="updateRmsModel(d)" ><b>Not Done</b></a></td>
                                        <td><span>{{d.helpComment}} </span></div></td>
                                        <td><span>{{d.dateTime | date:'h:mm a'}} </span></div></td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <button type="button" class="btn btn-danger" ng-click="deletereport();">Delete Records</button>
               </div>
           </div>
    </section>
    <script type="text/ng-template" id="UpdateCa.html">
        <div class="" >
            <div class="modal-header bg-info">
                <h4 class="modal-title" id="modal-title">RMS Action</h4>
            </div>
			<textarea id="helpComment" class="form-control" rows="5" Placeholder="Add Help Comment"></textarea>
            <div class="modal-footer bg-info">
                <button class="btn btn-default" type="button" ng-click="ok()">Add</button>
                <button class="btn btn-primary" type="button" ng-click="cancel()">Cancel</button>
            </div>
        </div>
    </script>
</div>
 