<div class="container">
    
  <div class="row">
    <div class="col-12">
        <ul class="list-unstyled titileLi-w">
          <li class="headingText-w"> {{typeService}} / </li>
          <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typeLink}}  </li>
        </ul>
      <hr class="hr">
    </div>
  </div>
      
  <div class="row">
    <div class="col-12 col-sm-12 col-md-6 col-lg-6">
        <button type="button" class="btn btn-outline-success dashButton-w" (click)="onAddUser()" *ngIf="authSer.showAddBtn">إنشاء</button>
        <button type="button" class="btn btn-outline-danger dashButton-w" (click)="onDeleteUsers()" *ngIf="authSer.showDeleteBtn">حذف</button>
    </div>
    <div class="col-12 col-sm-12 col-md-6 col-lg-6">
      <div class="form-group">
        <input type="text" placeholder="البحث" class="form-control" style="margin-top:13px;" (input)="filtterFunc($event)"/>
        <hr>
      </div>
    </div>
  </div>

  <div class="row">
      <div class="col-6">
        <div class="form-group">
          <span class="spanSelect-w">أظهر
            <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
              <option value="5">5</option>
              <option value="10">10</option>
              <option value="15">15</option>
              <option value="20">20</option>
            </select>
            من العناصر
          </span>
        </div>
      </div>
      <div class="col-6">
      
      </div>
    </div>

  <table class="table table-bordered">
    <thead class="headBackground-w">
      <tr>
        <th>
          <div class="custom-control custom-checkbox">
              <input type="checkbox" class="custom-control-input" [(ngModel)]="selectedAll" (change)="selectAll();" id="customCheck" name="example1">
              <label class="custom-control-label fixedWidthLabel-w checkAll-w" for="customCheck" style="margin-bottom:20px; cursor:pointer"></label>
          </div>
        </th>
        <th>الاسم</th>
        <th>البريد الإلكتروني</th>
        <th *ngIf="authSer.showEditBtn">تعديل</th>
        <th *ngIf="authSer.showPermissionsBtn">الصلاحيات</th>
        <!-- <th *ngIf="authSer.showReport">التقارير</th> -->
      </tr>
    </thead>
    <tbody>
      <tr *ngFor="let user of usersList | paginate: { itemsPerPage: perPagePagenation, currentPage: currentPage, totalItems: count }; let i = index ">
        <td>
          <div class="custom-control custom-checkbox centerIneerItem">
            <input type="checkbox" class="custom-control-input" id="{{user.id}}" [(ngModel)]="user.selected" [value]='user' (change)="checkIfAllSelected()">
            <label class="custom-control-label disblayBlock-w" for="{{user.id}}" style="color:#2a2a2a; cursor:pointer"></label>
          </div>
        </td>
        <td>{{user.name}}</td>
        <td>{{user.email}}</td>
        <td *ngIf="authSer.showEditBtn"><button type="button" class="btn btn-outline-secondary" (click)="onEdit(user.id)"><i class="fas fa-edit"></i></button></td>
        <td *ngIf="authSer.showPermissionsBtn"><button type="button" class="btn btn-outline-secondary" (click)="onGetPermission(user.id)"><i class="fas fa-hand-paper"></i></button></td>
        <!-- <td *ngIf="authSer.showReport"><button class="btn btn-outline-secondary" (click)="onGetReport(user.id)"><i class="fas fa-address-card"></i></button></td> -->
      </tr>
    </tbody>
  </table>
  <pagination-controls (pageChange)="onPageChange($event)"></pagination-controls>
</div>
