<div class="reprot">
  <div class="container">
      <div class="containerContent-w">
          <div class="row" id="print-section">
              <div class="col-12">
                 <table class="table table-bordered text-center" >
                  <thead>
                    <tr>
                      <th class="text-center">إسم الموظف</th>
                      <th class="text-center">إسم المجموعه</th>
                      <th class="text-center">إسم الصفحه</th>
                      <th class="text-center">نوع الصلاحيه</th>
                      <th class="text-center">إسم الموظف مانح الصلاحيه</th>
                      <th class="text-center">تاريخ المنح</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr *ngFor="let data of reportData; let i = index">
                      <td><p>{{data['user']?.name? data['user'].name : '-'}}</p></td>
                      <td><p *ngFor="let role of data['roles']">{{role.role_name ? role.role_name : ''}}</p></td>
                      <td *ngIf="data['roles'].length > 0"><p *ngFor="let role of data['roles']">
                        <span style="display:block; margin: 10px 0;" *ngFor="let page of role['pages']">
                          {{page.name ? page.name : ''}}
                          <span style="display:block" *ngFor="let p of page.permissions"><br></span>
                        </span>
                      </p></td>
                      <td *ngIf="data['roles'].length == 0">-</td>
                      <td *ngIf="data['roles'].length > 0"><p *ngFor="let role of data['roles'][i].pages"><span style="display: block; margin-bottom: 6px;" *ngFor="let page of role['permissions']">{{page.permission_name ? page.permission_name : ''}}</span></p></td>
                      <td *ngIf="data['roles'].length > 0"><p *ngFor="let role of data['roles'][i].pages"><span style="display: block; margin-bottom: 6px;" *ngFor="let page of role['permissions']">{{page.asigned_by ? page.asigned_by : ''}}</span></p></td>
                      <td *ngIf="data['roles'].length > 0"><p *ngFor="let role of data['roles'][i].pages"><span style="display: block; margin-bottom: 6px; font-size:14px" *ngFor="let page of role['permissions']">{{page.created_at ? page.created_at : ''}}</span></p></td>
                      <td *ngIf="data['roles'].length == 0">-</td>
                      <td *ngIf="data['roles'].length == 0">-</td>
                      <td *ngIf="data['roles'].length == 0">-</td>
                    </tr>
                  </tbody>
                </table>
              </div>
            </div>
            <button class="btn btn-success" style="float:right; margin: 10px 0;" (click)="onPrint()" *ngIf="authSer.showPrintBtn">طباعه</button>

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

