<div class="container">

  <div class="row">
    <div class="col-12">
      <ul class="list-unstyled titileLi-w">
        <li class="headingText-w">خدمه السكن  </li>
        <li class="headingText-w activeLi-w" style="margin-right:5px">عرض الطلبات للإدارة</li>
      </ul>
    </div>
  </div>

  <div class="containerContent-w">
    <div class="row">
      <div class="col-12 col-sm-12 col-md-6 col-lg-6">
        <button type="button" class="btn btn-outline-success butttonCreate dashButton-w" (click)="onAdd()" *ngIf="authSer.showAddBtn"><i class="fas fa-plus marginFontAowsome-w"></i>إنشاء جديد</button>
        <!-- <button type="button" class="btn btn-outline-danger butttonDelete dashButton-w" (click)="onDelete()" *ngIf="authSer.showDeleteBtn"><i class="fas fa-times marginFontAowsome-w"></i>حذف</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 inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
          <hr>
        </div>
      </div>
    </div>

    <div class="row">
        <div class="col-6 col-sm-12 col-md-12 col-lg-6">
          <div class="form-group">
            <span class="spanSelect-w" style="margin-right:10px;">
              <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 col-sm-12 col-md-12 col-lg-6">
          <div class="form-group">
            <span class="spanSelect-w" style="margin-right:10px;">
              <select [ngModel]="status" class="form-control selectButton-w" (input)="onGetStatus($event.target.value)">
                <option value="all">الكل</option>
                <option value="new">جديد</option>
                <option value="accepted">مقبول</option>
                <option value="confirmed">مُأكد</option>
                <option value="refused">مرفوض</option>
                <option value="waiting">الانتظار</option>
                <option value="ended">أنتهاء</option>
              </select>
             الحالة
            </span>
          </div>
        </div>
    </div>

    <table class="table table-bordered" *ngIf="this.count != 0">
      <thead class="headBackground-w">
        <tr>
          <th>رقم الطلب</th>
          <th>اسم صاحب الطلب</th>
          <th>رقم الجوال</th>
          <th>الإدارة</th>
          <th>الجنسية</th>
          <th>تاريخ التعين</th>
          <th>حالة</th> 
          <th *ngIf="authSer.showEditBtn">التفاصيل</th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let data of dataList | paginate: { itemsPerPage: perPagePagenation, currentPage: currentPage, totalItems: count }; let i = index ">
          <td>{{data.id}}</td>
          <td>{{data.employee_name}}</td>
          <td>{{data.phone}}</td>
          <td>{{data.adminstration_name}}</td>
          <td>{{data.country_arNationality}}</td>
          <td>{{data.date_of_employment_hij}}</td>
          <td>{{data.status == 'new' ? 'جديد' : data.status == 'accepted' ? ' مقبول' : data.status == 'confirmed' ? ' تم تأكيد': data.status == 'refused' ? 'مرفوض': data.status == 'waiting' ? 'انتظار':data.status == 'ended' ? 'انتهى': 'not found'}}</td>
        <td *ngIf="authSer.showEditBtn"><button type="button" class="btn btn-outline-secondary" (click)="onEdit(data.id)"><i class="fas fa-edit"></i></button></td>
      </tr>
    </tbody>
  </table>
  <div class="col-12" *ngIf="this.count == 0" >
    <!-- taaaaaaaaaaable -->
    <h2 class="title"> لا يوجد بيانات لعرضها </h2>

  </div>
  <pagination-controls nextLabel="التالي" previousLabel="السابق" (pageChange)="onPageChange($event)" *ngIf="this.count != 0"></pagination-controls>
  </div>
</div>
