Hima vor 5 Jahren
Ursprung
Commit
715bad7428

+ 2 - 2
src/app/External-Page/external-page-content/external-page-content.component.ts

@@ -97,8 +97,8 @@ export class ExternalPageContentComponent implements OnInit, OnDestroy {
         
         this.achievements = responce['data'].external_achievements;
         this.initialMonthNumber = responce['data']['statistics'].month_id;
-        // this.lat = responce['data']['reach_map'].latitude;
-        // this.lng = responce['data']['reach_map'].longitude;
+        //this.lat = responce['data']['reach_map'].latitude;
+        //this.lng = responce['data']['reach_map'].longitude;
         this.spinner.hide();
       },
       (error) => {

+ 1 - 1
src/app/External-Page/external-page/external-page.component.html

@@ -1,6 +1,6 @@
 <app-external-page-header></app-external-page-header>
 
-<div class="externalPage-w" [style.min-height.px]="myInnerHeight">
+<div class="externalPage-w" [style.min-height.px]="screenHeight">
   <div class="routingContent-w">
       <router-outlet></router-outlet>
   </div>

+ 11 - 2
src/app/External-Page/external-page/external-page.component.ts

@@ -3,6 +3,7 @@ import { AuthServiceService } from './../../shared/auth-service.service';
 import { Component, OnInit } from '@angular/core';
 import { Route } from '@angular/compiler/src/core';
 import { NgxSpinnerService } from 'ngx-spinner';
+import { HostListener } from "@angular/core";
 
 @Component({
   selector: 'app-external-page',
@@ -12,9 +13,17 @@ import { NgxSpinnerService } from 'ngx-spinner';
 export class ExternalPageComponent implements OnInit {
 
   constructor(private authSer: AuthServiceService, 
-    private router:Router) { }
+    private router:Router) {
+      this.getScreenSize();
+     }
 
-  myInnerHeight = window.innerHeight;
+    screenHeight:any;
+
+    @HostListener('window:resize', ['$event'])
+    getScreenSize(event?) {
+          this.screenHeight = window.innerHeight;
+          console.log(this.screenHeight);
+    }
 
   ngOnInit() {
     this.authSer.checkExternalFooter = true;

+ 4 - 0
src/app/dashboard/adminstration-contact-officers/adminstration-contact-officers-list/adminstration-contact-officers-list.component.css

@@ -1,3 +1,7 @@
 .flex{
     display: flex
+}
+
+.table td {
+    border: none;
 }

+ 12 - 17
src/app/dashboard/adminstration-contact-officers/adminstration-contact-officers-list/adminstration-contact-officers-list.component.html

@@ -13,9 +13,7 @@
    <table class="table table-bordered " *ngIf="this.count != 0">
       <thead class="headBackground-w">
           <tr>
-           
             <th style=" width: 18%;">ضباط الاتصال الحاليين</th>
-  
           </tr>
         </thead>
       <tbody>
@@ -24,21 +22,18 @@
             <td class="flex" style=" margin-right: 10px;">الموظفين</td>
           </tr>
       </tbody>
-      <tbody  >
+      <tbody>
           <tr *ngFor="let admin of currentadmins">
             <th scope="row"></th>
               <td class="flex"  style=" margin-right: 10px;">{{admin.name}}</td>
           </tr>
-         
       </tbody>
 
    </table>
    <table class="table table-bordered " >
            <thead class="headBackground-w">
                <tr>
-                
                  <th style=" width: 18%;"> ضباط الاتصال اتصال</th>
-       
                </tr>
              </thead>
            <tbody>
@@ -51,18 +46,18 @@
                  <td class="flex" style="  margin-right: 10px;">الموظفين</td>
                </tr>
            </tbody>
-           <tbody  >
-               <tr  *ngFor="let emplyee of emplyees | paginate: { itemsPerPage: perPagePagenation, currentPage: currentPage, totalItems: count }; let i = index">
-                 <th scope="row">
-                  <div class="custom-control custom-checkbox centerIneerItem"  style=" display: flex;justify-content: center;">
-                    <input type="checkbox" class="custom-control-input" id="{{emplyee.id}}" [(ngModel)]="emplyee.selected" [value]='emplyee' (change)="checkIfAllSelected();">
-                  </div>
-                 </th>
-                 <td class="flex" style="  margin-right: 10px;">{{emplyee.name}}</td>
-               </tr>
-           </tbody>
+           <tbody>
+              <tr *ngFor="let emplyee of emplyees | paginate: { itemsPerPage: perPagePagenation, currentPage: currentPage, totalItems: count }; let i = index">
+                <th scope="row">
+                <div class="custom-control custom-checkbox centerIneerItem"  style=" display: flex;justify-content: center;">
+                  <input type="checkbox" class="custom-control-input" id="{{emplyee.id}}" [(ngModel)]="emplyee.selected" [value]='emplyee' (change)="checkIfAllSelected();">
+                </div>
+                </th>
+                <td class="flex" style="  margin-right: 10px;">{{emplyee.name}}</td>
+              </tr>
+          </tbody>
         </table>   
-        <button type="submit" class="btn btn-success pull-left" style="    width: 124px;text-align: -webkit-auto;" (click)="onSubmit()" [disabled]="checkSaveDisabled" >  <i class='fas fa-save' style='font-size:24px'></i> <span style="font-weight: bolder;
+        <button type="submit" class="btn btn-success pull-left" style="width: 124px;text-align: -webkit-auto;" (click)="onSubmit()" [disabled]="checkSaveDisabled" >  <i class='fas fa-save' style='font-size:24px'></i> <span style="font-weight: bolder;
           font-size: 20px;padding: 20px;">حـــفظ </span></button>
     </div>
     

+ 28 - 23
src/app/dashboard/adminstration-contact-officers/adminstration-contact-officers-list/adminstration-contact-officers-list.component.ts

@@ -1,9 +1,10 @@
+import { Subscription } from 'rxjs';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { NgxSpinnerService } from 'ngx-spinner';
 import { ActivatedRoute, Router, Params } from '@angular/router';
 import { DashboardService } from './../../../shared/dashboard.service';
 import { HttpClient } from '@angular/common/http';
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, OnDestroy } from '@angular/core';
 import { Modal } from 'ngx-modialog/plugins/bootstrap';
 import { UserService } from '../../../shared/user.service';
 import { ToastrService } from 'ngx-toastr';
@@ -13,7 +14,7 @@ import { ToastrService } from 'ngx-toastr';
   templateUrl: './adminstration-contact-officers-list.component.html',
   styleUrls: ['./adminstration-contact-officers-list.component.css']
 })
-export class AdminstrationContactOfficersListComponent implements OnInit {
+export class AdminstrationContactOfficersListComponent implements OnInit, OnDestroy {
 
   constructor(private http: HttpClient,
     private route: ActivatedRoute,
@@ -44,9 +45,24 @@ export class AdminstrationContactOfficersListComponent implements OnInit {
     selected: boolean = false;
     checkSaveDisabled:boolean = false;
 
+    subscriptionVar: Subscription;
+
   ngOnInit() {
+  //init the values of permision boolean
+  this.authSer.showAddBtn = false;
+  this.authSer.showDeleteBtn = false;
+  this.authSer.showEditBtn = false;
+  //show / hide notification search in header
+  this.authSer.notificationLogin = true;
+  this.authSer.showSearchHeader = false;
+  this.authSer.showHeaderLogin = false;
+  this.authSer.showHeaderDashBoard = true;
+  this.authSer.showDashboardHeader = true;
+  this.authSer.internalHeader = false;
+  
+    this.spinner.show();
 
-    this.route.params.subscribe(
+   this.subscriptionVar = this.route.params.subscribe(
       (params) =>{
       this.pageId = params['adminId'];
       localStorage.setItem('pageIdActive', params['adminId']);
@@ -55,8 +71,8 @@ export class AdminstrationContactOfficersListComponent implements OnInit {
         this.http.get(this.authSer.pathApi + '/current_employees_officer_for_adminstration').subscribe(
  
       (response) => {
-       console.log('xx', response);
        this.currentadmins = response['officers'];
+       this.spinner.hide();
       },
       (error) => {
        console.log(error);
@@ -69,11 +85,9 @@ export class AdminstrationContactOfficersListComponent implements OnInit {
          console.log(response);
          this.emplyees = response['users'];
          for (let i = 0; i< this.currentadmins.length; i++) {
-          for(let j = 0; j < this.emplyees.length; j++)
-          {
+          for(let j = 0; j < this.emplyees.length; j++) {
             if(this.currentadmins[i].id == this.emplyees[j].id){
               this.emplyees[i].selected = true;
-             
             }
           }
          }
@@ -84,18 +98,15 @@ export class AdminstrationContactOfficersListComponent implements OnInit {
       );
 
 
-     }
-    else if(this.pageId == 57){
-      
+     } else if(this.pageId == 57){
        this.http.get(this.authSer.pathApi + '/current_employees_officer_for_department').subscribe(
     
          (response) => {
-          console.log('xx', response);
           this.currentadmins = response['officers'];
+          this.spinner.hide();
          },
          (error) => {
           console.log(error);
-         
          }
          
          );
@@ -104,11 +115,9 @@ export class AdminstrationContactOfficersListComponent implements OnInit {
             console.log(response);
             this.emplyees = response['users'];
             for (let i = 0; i< this.currentadmins.length; i++) {
-              for(let j = 0; j < this.emplyees.length; j++)
-              {
+              for(let j = 0; j < this.emplyees.length; j++) {
                 if(this.currentadmins[i].id == this.emplyees[j].id){
                   this.emplyees[i].selected = true;
-                 
                 }
               }
              }
@@ -117,8 +126,6 @@ export class AdminstrationContactOfficersListComponent implements OnInit {
             console.log(error);
           }
          );
-        
-
         }
       }
     );
@@ -137,6 +144,10 @@ selectAll() {
         return item.selected == true;
       })
   }
+
+  ngOnDestroy() {
+    this.subscriptionVar.unsubscribe();
+  }
   
   onSubmit(){
     const employeesIds = [];
@@ -194,11 +205,5 @@ selectAll() {
         }
           this.checkSaveDisabled = false;
         }
-       
-     
-   
-
-  
-
   }
 }

+ 1 - 1
src/index.html

@@ -7,12 +7,12 @@
 
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <link rel="icon" type="image/x-icon" href="favicon.ico">
-  <script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyAxlgymaua-8BszEryfQIOr9PLKrtEqU2I&libraries=places"></script>
 
   <!-- <link href="https://fonts.googleapis.com/css?family=Dosis|Niramit" rel="stylesheet"> -->
   <!-- <link href="https://fonts.googleapis.com/css?family=Cairo" rel="stylesheet"> -->
   <link href="https://fonts.googleapis.com/css?family=Cairo" rel="stylesheet">
   <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">
+  <script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyAxlgymaua-8BszEryfQIOr9PLKrtEqU2I&libraries=places"></script>
 
 </head>
 <body>