Hima 5 年之前
父節點
當前提交
c99a4501d2

+ 2 - 3
src/app/dashboard/report-current-employees-officer/report-current-employee-officer/report-current-employee-officer.component.html

@@ -36,8 +36,7 @@
           </div>
         </div>
 
-        <div class="col-12" *ngIf="adminstraion_officers.length > 0">
-          <!-- <button class="btn btn-success" style="float: right; margin: 10px 0;" (click)="onPrint()">طباعه</button>  -->
+        <div class="col-12" *ngIf="adminstraion_officers.length > 0" id="print-section">
           <h3 class="heading">ظباط إتصال الإداره</h3>
           <table class="table table-bordered text-center">
             <thead class="headBackground-w">
@@ -57,7 +56,7 @@
           </table>
         </div>
 
-        <div class="col-12" *ngIf="department_officers.length > 0">
+        <div class="col-12" *ngIf="department_officers.length > 0" id="print-section">
             <h3 class="heading">ظباط إتصال القسم</h3>
             <table class="table table-bordered text-center">
               <thead class="headBackground-w">

+ 85 - 3
src/app/dashboard/report-current-employees-officer/report-current-employee-officer/report-current-employee-officer.component.ts

@@ -92,9 +92,91 @@ export class ReportCurrentEmployeeOfficerComponent implements OnInit {
     }
   }
 
-  //print function 
-  onPrint() {
-    window.print();
+  // //print function 
+  // onPrint() {
+  //   window.print();
+  // }
+
+  onPrint(): void {
+    let printContents, popupWin;
+    printContents = document.getElementById('print-section').innerHTML;
+    popupWin = window.open('', '_blank', 'top=0,left=0,height=100%,width=auto');
+    popupWin.document.open();
+    popupWin.document.write(`
+      <html>
+        <head>
+          <title></title>
+          <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> </link>
+          <style>
+            .row{
+              display: flex;
+              flex-wrap: wrap;
+              margin-right: -15px;
+              margin-left: -15px;
+            }
+            .col-6{
+              float: right;
+              flex: 0 0 50%;
+              max-width: 50%
+            }
+            .col-12{
+              flex-basis: 0;
+              flex-grow: 1;
+              max-width: 100%;
+            }
+            table {
+              font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+              border-collapse: collapse;
+              width: 100%;
+              direction: rtl;
+              text-align: center;
+            }
+            .heading {
+              text-align: center;
+            }
+            
+            table td, table th {
+              border: 1px solid #ddd;
+              padding: 8px;
+            }
+            
+            table tr:nth-child(even){background-color: #f2f2f2;}
+            
+            table tr:hover {background-color: #ddd;}
+            
+            table th {
+              padding-top: 12px;
+              padding-bottom: 12px;
+              text-align: center;
+              background-color: #4CAF50;
+              color: white;
+            }
+          </style>
+        </head>
+    <body onload="window.print();window.close()">
+   <div class="row">
+      <div class="col-6" style="float: left">
+        <img class="logo1" src="../../assets/image/logo2.png" style="width: 130px;float: left; margin-left: 20px;">
+      </div>
+      <div class="col-6" style="float: right">
+        <img  class="logo2" src="../../assets/image/logo1.png" style="width: 200px;float: right; margin-right: 20px;">
+       </div>
+    </div>
+    <div class="row">
+    <div class="col-12" style="width:100%;text-align: center">
+    <h1>تقرير ضابط الموظفين الحالي</h1>
+    </div>
+    </div>
+  
+   <div class="row">
+      <div class="col-12">
+      ${printContents}
+      </div>
+   </div>
+    </body>
+      </html>`
+    );
+    popupWin.document.close();
   }
 
 }

+ 1 - 1
src/app/dashboard/report-list/report-list.component.html

@@ -22,7 +22,7 @@
                 <tr>
                   <td>{{usersList?.name ? usersList.name : ''}}</td>
                   <td>{{usersList?.email ? usersList.email : ''}}</td>
-                  <td><button class="btn btn-outline-secondary" (click)="onGetReport(usersList.id)"><i class="fas fa-address-card"></i></button></td>
+                  <td (click)="onGetReport(usersList.id)" style="cursor:pointer"><button class="btn btn-outline-secondary"><i class="fas fa-address-card"></i></button></td>
                 </tr>
               </tbody>
             </table>

+ 1 - 1
src/app/dashboard/roles/add-roles/add-roles.component.html

@@ -34,7 +34,7 @@
                 <div class="col-12 col-sm-12 col-md-4">
                     <div class="form-group">
                       <label style="float: right;margin: 5px 0">الأنظمه</label>
-                      <select class="form-control" name="service_val" (change)="onSelectChange($event)">
+                      <select class="form-control" name="service_val" (change)="onSelectChange($event)" [ngModel]="serviceVal">
                           <option *ngFor="let service of pages" [value]="service.id">{{service.name}}</option>
                       </select>
                     </div>

+ 1 - 0
src/app/dashboard/roles/add-roles/add-roles.component.ts

@@ -33,6 +33,7 @@ export class AddRolesComponent implements OnInit, OnDestroy {
   typeLink: string = '';
   roleId: number;
   checkSaveDisabled:boolean = false;
+  serviceVal:string = '';
 
   pages = []; //فيها كل حاجه السيرفيس والصفحات والصلاحيات
   permisionsId = [];

+ 16 - 17
src/app/dashboard/roles/role-report/role-report.component.html

@@ -1,33 +1,32 @@
 <div class="reprot">
   <div class="container">
     <div class="containerContent-w">
-        <div class="row">
+        <div class="row" id="print-section">
             <div class="col-12">
-              <button class="btn btn-success" style="float: right; margin: 10px 0;" (click)="onPrint()">طباعه</button> 
-              <!-- <table class="table table-bordered">
+              <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">
-                        </div>
-                      </th>
-                      <th>الاسم</th>
+                      <th>إسم المجموغه</th>
+                      <th *ngIf="rolesList['pages'].length > 0">إسم الصفحه</th>
+                      <th>إسم النظام</th>
+                      <th>تاريخ الإضافه</th>
+                      <th>المستخدم</th>
                     </tr>
                   </thead>
                   <tbody>
-                    <tr *ngFor="let role of rolesList; let i = index ">
-                      <td>
-                        <div class="custom-control custom-checkbox centerIneerItem">
-                          <input type="checkbox" class="custom-control-input" id="{{role.id}}" [(ngModel)]="role.selected" [value]='role' (change)="checkIfAllSelected();">
-                        </div>
-                      </td>
-                      <td>{{role.role_name}}</td>
+                    <tr>
+                      <td>{{rolesList.role_name}}</td>
+                      <td *ngIf="rolesList['pages'].length > 0"><p *ngFor="let page of rolesList['pages']">{{page.name}}</p></td>
+                      <td>{{rolesList.role_name}}</td>
+                      <td>{{rolesList.created_at}}</td>
+                      <td>{{rolesList.name}}</td>
                     </tr>
                   </tbody>
-                </table> -->
+                </table>
             </div>
         </div>
+        <button class="btn btn-success" style="float: right; margin: 10px 0;" (click)="onPrint()">طباعه</button> 
+
     </div>
   </div>
 </div> 

+ 83 - 3
src/app/dashboard/roles/role-report/role-report.component.ts

@@ -64,8 +64,88 @@ export class RoleReportComponent implements OnInit {
   };
 
   //print function
-  onPrint() {
-    window.print();
-  }
+  // onPrint() {
+  //   window.print();
+  // }
+
+  onPrint(): void {
+    let printContents, popupWin;
+    printContents = document.getElementById('print-section').innerHTML;
+    popupWin = window.open('', '_blank', 'top=0,left=0,height=100%,width=auto');
+    popupWin.document.open();
+    popupWin.document.write(`
+      <html>
+        <head>
+          <title></title>
+          <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> </link>
+          <style>
+            .row{
+              display: flex;
+              flex-wrap: wrap;
+              margin-right: -15px;
+              margin-left: -15px;
+            }
+            .col-6{
+              float: right;
+              flex: 0 0 50%;
+              max-width: 50%
+            }
+            .col-12{
+              flex-basis: 0;
+              flex-grow: 1;
+              max-width: 100%;
+            }
+            table {
+              font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+              border-collapse: collapse;
+              width: 100%;
+              direction: rtl;
+              text-align: center;
+              
+            }
+            
+            table td, table th {
+              border: 1px solid #ddd;
+              padding: 8px;
+            }
+            
+            table tr:nth-child(even){background-color: #f2f2f2;}
+            
+            table tr:hover {background-color: #ddd;}
+            
+            table th {
+              padding-top: 12px;
+              padding-bottom: 12px;
+              text-align: center;
+              background-color: #4CAF50;
+              color: white;
+            }
+          </style>
+        </head>
+    <body onload="window.print();window.close()">
+   <div class="row">
+      <div class="col-6" style="float: left">
+        <img class="logo1" src="../../assets/image/logo2.png" style="width: 130px;float: left; margin-left: 20px;">
+      </div>
+      <div class="col-6" style="float: right">
+        <img  class="logo2" src="../../assets/image/logo1.png" style="width: 200px;float: right; margin-right: 20px;">
+       </div>
+    </div>
+    <div class="row">
+    <div class="col-12" style="width:100%;text-align: center">
+    <h1>تقرير الصفحات التابعه لمجموعه</h1>
+    </div>
+    </div>
+  
+   <div class="row">
+      <div class="col-12">
+      ${printContents}
+      </div>
+   </div>
+    </body>
+      </html>`
+    );
+    popupWin.document.close();
+}
 
 }

+ 2 - 2
src/app/dashboard/roles/role-report2/role-report2.component.html

@@ -1,7 +1,7 @@
 <div class="reprot">
   <div class="container">
       <div class="containerContent-w">
-          <div class="row">
+          <div class="row" id="print-section">
               <div class="col-12">
                 <table class="table table-bordered text-center">
                   <thead>
@@ -39,9 +39,9 @@
                     </tr>
                   </tbody>
                 </table>
-                <button class="btn btn-success" style="float:right;margin:10px 0;" (click)="onPrint()">طباعه</button>
               </div>
             </div>
+            <button class="btn btn-success" style="float:right;margin:10px 0;" (click)="onPrint()">طباعه</button>
       </div>
   </div>
 </div> 

+ 82 - 2
src/app/dashboard/roles/role-report2/role-report2.component.ts

@@ -56,8 +56,88 @@ export class RoleReport2Component implements OnInit {
     );
   };
 
-  onPrint() {
-    window.print();
+  // onPrint() {
+  //   window.print();
+  // }
+
+  onPrint(): void {
+    let printContents, popupWin;
+    printContents = document.getElementById('print-section').innerHTML;
+    popupWin = window.open('', '_blank', 'top=0,left=0,height=100%,width=auto');
+    popupWin.document.open();
+    popupWin.document.write(`
+      <html>
+        <head>
+          <title></title>
+          <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> </link>
+          <style>
+            .row{
+              display: flex;
+              flex-wrap: wrap;
+              margin-right: -15px;
+              margin-left: -15px;
+            }
+            .col-6{
+              float: right;
+              flex: 0 0 50%;
+              max-width: 50%
+            }
+            .col-12{
+              flex-basis: 0;
+              flex-grow: 1;
+              max-width: 100%;
+            }
+            table {
+              font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+              border-collapse: collapse;
+              width: 100%;
+              direction: rtl;
+              text-align: center;
+              
+            }
+            
+            table td, table th {
+              border: 1px solid #ddd;
+              padding: 8px;
+            }
+            
+            table tr:nth-child(even){background-color: #f2f2f2;}
+            
+            table tr:hover {background-color: #ddd;}
+            
+            table th {
+              padding-top: 12px;
+              padding-bottom: 12px;
+              text-align: center;
+              background-color: #4CAF50;
+              color: white;
+            }
+          </style>
+        </head>
+    <body onload="window.print();window.close()">
+   <div class="row">
+      <div class="col-6" style="float: left">
+        <img class="logo1" src="../../assets/image/logo2.png" style="width: 130px;float: left; margin-left: 20px;">
+      </div>
+      <div class="col-6" style="float: right">
+        <img  class="logo2" src="../../assets/image/logo1.png" style="width: 200px;float: right; margin-right: 20px;">
+       </div>
+    </div>
+    <div class="row">
+    <div class="col-12" style="width:100%;text-align: center">
+    <h1>تقرير الصفحات التابعه لمجموعه</h1>
+    </div>
+    </div>
+  
+   <div class="row">
+      <div class="col-12">
+      ${printContents}
+      </div>
+   </div>
+    </body>
+      </html>`
+    );
+    popupWin.document.close();
   }
 
 }

+ 16 - 15
src/app/dashboard/users/user-report/user-report.component.html

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

+ 85 - 3
src/app/dashboard/users/user-report/user-report.component.ts

@@ -86,8 +86,90 @@ export class UserReportComponent implements OnInit, OnDestroy {
     this.subscriptionReportData.unsubscribe();
   }
 
-  onPrint(){
-    window.print();
-  }
+  // onPrint(){
+  //   //window.print();
+  // }
+
+   //print function
+
+   onPrint(): void {
+    let printContents, popupWin;
+    printContents = document.getElementById('print-section').innerHTML;
+    popupWin = window.open('', '_blank', 'top=0,left=0,height=100%,width=auto');
+    popupWin.document.open();
+    popupWin.document.write(`
+      <html>
+        <head>
+          <title></title>
+          <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> </link>
+          <style>
+            .row{
+              display: flex;
+              flex-wrap: wrap;
+              margin-right: -15px;
+              margin-left: -15px;
+            }
+            .col-6{
+              float: right;
+              flex: 0 0 50%;
+              max-width: 50%
+            }
+            .col-12{
+              flex-basis: 0;
+              flex-grow: 1;
+              max-width: 100%;
+            }
+            table {
+              font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+              border-collapse: collapse;
+              width: 100%;
+              direction: rtl;
+              text-align: center;
+              
+            }
+            
+            table td, table th {
+              border: 1px solid #ddd;
+              padding: 8px;
+            }
+            
+            table tr:nth-child(even){background-color: #f2f2f2;}
+            
+            table tr:hover {background-color: #ddd;}
+            
+            table th {
+              padding-top: 12px;
+              padding-bottom: 12px;
+              text-align: center;
+              background-color: #4CAF50;
+              color: white;
+            }
+          </style>
+        </head>
+    <body onload="window.print();window.close()">
+   <div class="row">
+      <div class="col-6" style="float: left">
+        <img class="logo1" src="../../assets/image/logo2.png" style="width: 130px;float: left; margin-left: 20px;">
+      </div>
+      <div class="col-6" style="float: right">
+        <img  class="logo2" src="../../assets/image/logo1.png" style="width: 200px;float: right; margin-right: 20px;">
+       </div>
+    </div>
+    <div class="row">
+    <div class="col-12" style="width:100%;text-align: center">
+    <h1>تقرير  المستخدم</h1>
+    </div>
+    </div>
+  
+   <div class="row">
+      <div class="col-12">
+      ${printContents}
+      </div>
+   </div>
+    </body>
+      </html>`
+    );
+    popupWin.document.close();
+}
 
 }

+ 4 - 4
src/app/shared/auth-service.service.ts

@@ -50,11 +50,11 @@ export class AuthServiceService {
   showArabicIcon:boolean;
   showEnglishIcon:boolean;
 
-  pathApi: string = 'http://10.93.50.2/kfmc_back_end/index.php/api';
-  pathImg: string = "http://10.93.50.2/kfmc_back_end/public/";
+  // pathApi: string = 'http://10.93.50.2/kfmc_back_end/index.php/api';
+  // pathImg: string = "http://10.93.50.2/kfmc_back_end/public/";
 
-  // pathApi: string = 'http://kfmc.info/back_end/api';
-  // pathImg: string = "http://kfmc.info/back_end/public/";
+  pathApi: string = 'http://kfmc.info/back_end/api';
+  pathImg: string = "http://kfmc.info/back_end/public/";
   
   myInnerHeight = window.innerHeight;
   imgSrc: string =  '../../assets/image/avatar.png'; //page profile default