Hima hace 5 años
padre
commit
517dae8fbc
Se han modificado 93 ficheros con 2199 adiciones y 820 borrados
  1. 0 1
      src/app/External-Page/external-hospital/external-hospital.component.ts
  2. 2 2
      src/app/External-Page/external-page-header/external-page-header.component.ts
  3. 2 2
      src/app/Internal-Page/internal-page-header/internal-page-header.component.ts
  4. 1 1
      src/app/Internal-Page/internal-routing-module.ts
  5. 14 8
      src/app/app-routing.module.ts
  6. 6 4
      src/app/app.module.ts
  7. 24 0
      src/app/auth-services/auth-services-routing.module.ts
  8. 1 0
      src/app/auth-services/auth-services.component.html
  9. 8 0
      src/app/auth-services/auth-services.component.ts
  10. 56 0
      src/app/auth-services/auth-services.module.ts
  11. 2 1
      src/app/login/login.component.css
  12. 1 1
      src/app/login/login.component.html
  13. 12 6
      src/app/login/login.component.ts
  14. 0 0
      src/app/auth-services/regester/regester.component.css
  15. 0 0
      src/app/auth-services/regester/regester.component.html
  16. 4 4
      src/app/regester/regester.component.ts
  17. 0 1
      src/app/dashboard/absorpation-plan/absorpation-list/absorpation-list.component.ts
  18. 8 8
      src/app/dashboard/achievements/achievement-list/achievement.component.ts
  19. 5 5
      src/app/dashboard/achievements/add-achievement/add-achievement.component.ts
  20. 1 2
      src/app/dashboard/adminstration-contact-officers/adminstration-contact-officers-list/adminstration-contact-officers-list.component.ts
  21. 40 0
      src/app/dashboard/create-report/add-new-report/add-new-report.component.html
  22. 19 1
      src/app/dashboard/dashboard-routing.ts
  23. 13 18
      src/app/dashboard/dashboard.module.ts
  24. 1 1
      src/app/dashboard/definition-of-classification/definition-add/definition-add.component.html
  25. 4 0
      src/app/dashboard/definition-of-classification/definition-add/definition-add.component.ts
  26. 1 1
      src/app/dashboard/definition-of-classification/definition-list/definition-list.component.html
  27. 3 2
      src/app/dashboard/definition-of-classification/definition-list/definition-list.component.ts
  28. 0 0
      src/app/dashboard/definition-of-covenants/definition-of-covenants-add/definition-of-covenants-add.component.css
  29. 65 0
      src/app/dashboard/definition-of-covenants/definition-of-covenants-add/definition-of-covenants-add.component.html
  30. 124 0
      src/app/dashboard/definition-of-covenants/definition-of-covenants-add/definition-of-covenants-add.component.ts
  31. 30 0
      src/app/dashboard/definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component.css
  32. 83 0
      src/app/dashboard/definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component.html
  33. 281 0
      src/app/dashboard/definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component.ts
  34. 1 1
      src/app/dashboard/definition-of-location/location-add/location-add.component.html
  35. 7 3
      src/app/dashboard/definition-of-location/location-add/location-add.component.ts
  36. 1 1
      src/app/dashboard/definition-of-location/location-list/location-list.component.html
  37. 3 3
      src/app/dashboard/definition-of-location/location-list/location-list.component.ts
  38. 2 2
      src/app/dashboard/definition-of-time/definition-time-list/definition-time-list.component.html
  39. 3 2
      src/app/dashboard/definition-of-time/definition-time-list/definition-time-list.component.ts
  40. 2 2
      src/app/dashboard/department/add-department/add-department.component.html
  41. 5 5
      src/app/dashboard/department/add-department/add-department.component.ts
  42. 1 1
      src/app/dashboard/department/department-list/department-list.component.html
  43. 8 8
      src/app/dashboard/department/department-list/department-list.component.ts
  44. 1 3
      src/app/dashboard/external-services/add-external/add-external.component.ts
  45. 1 3
      src/app/dashboard/external-services/external-list/external-list.component.ts
  46. 1 3
      src/app/dashboard/footer/add-footer/add-footer.component.ts
  47. 0 2
      src/app/dashboard/footer/footer-list/footer-list.component.ts
  48. 1 1
      src/app/dashboard/header/header.component.ts
  49. 6 8
      src/app/dashboard/internal-services/add-internal-services/add-internal-services.component.ts
  50. 8 8
      src/app/dashboard/internal-services/internal-services.component.ts
  51. 0 0
      src/app/dashboard/living-service/living-service-add/living-service-add.component.css
  52. 42 0
      src/app/dashboard/living-service/living-service-add/living-service-add.component.html
  53. 104 0
      src/app/dashboard/living-service/living-service-add/living-service-add.component.ts
  54. 30 0
      src/app/dashboard/living-service/living-service-list/living-service-list.component.css
  55. 79 0
      src/app/dashboard/living-service/living-service-list/living-service-list.component.html
  56. 279 0
      src/app/dashboard/living-service/living-service-list/living-service-list.component.ts
  57. 2 4
      src/app/dashboard/main-menu/add-menu/add-menu.component.ts
  58. 0 27
      src/app/dashboard/main-menu/main-list/main-list.component.ts
  59. 1 3
      src/app/dashboard/news/add-news/add-news.component.ts
  60. 1 3
      src/app/dashboard/news/news-list/news-list.component.ts
  61. 0 0
      src/app/dashboard/record-info-building/record-info-building-add/record-info-building-add.component.css
  62. 77 0
      src/app/dashboard/record-info-building/record-info-building-add/record-info-building-add.component.html
  63. 132 0
      src/app/dashboard/record-info-building/record-info-building-add/record-info-building-add.component.ts
  64. 30 0
      src/app/dashboard/record-info-building/record-info-building-list/record-info-building-list.component.css
  65. 89 0
      src/app/dashboard/record-info-building/record-info-building-list/record-info-building-list.component.html
  66. 278 0
      src/app/dashboard/record-info-building/record-info-building-list/record-info-building-list.component.ts
  67. 1 1
      src/app/dashboard/reports-page/reports-page.component.html
  68. 2 2
      src/app/dashboard/roles/add-roles/add-roles.component.html
  69. 6 15
      src/app/dashboard/roles/add-roles/add-roles.component.ts
  70. 3 3
      src/app/dashboard/roles/role-report/role-report.component.ts
  71. 3 3
      src/app/dashboard/roles/role-report2/role-report2.component.ts
  72. 1 1
      src/app/dashboard/roles/roles-list/roles-list.component.html
  73. 9 19
      src/app/dashboard/roles/roles-list/roles-list.component.ts
  74. 2 2
      src/app/dashboard/sections/add-section/add-section.component.html
  75. 6 6
      src/app/dashboard/sections/add-section/add-section.component.ts
  76. 1 1
      src/app/dashboard/sections/section-list/section-list.component.html
  77. 8 8
      src/app/dashboard/sections/section-list/section-list.component.ts
  78. 7 0
      src/app/dashboard/service-item/service-item.component.ts
  79. 0 1
      src/app/dashboard/supervisor/supervisor-list/supervisor-list.component.ts
  80. 6 6
      src/app/dashboard/tabs/add-tab/add-tab.component.ts
  81. 9 9
      src/app/dashboard/tabs/tab-list/tab-list.component.ts
  82. 21 0
      src/app/servicesItems/services.component.ts
  83. 0 55
      src/app/shared/achievements.service.ts
  84. 108 4
      src/app/shared/dashboard.service.ts
  85. 0 53
      src/app/shared/department.service.ts
  86. 0 56
      src/app/shared/external-ser.service.ts
  87. 0 55
      src/app/shared/footer.service.ts
  88. 0 59
      src/app/shared/internal-ser.service.ts
  89. 0 58
      src/app/shared/main-menu.service.ts
  90. 0 55
      src/app/shared/new.service.ts
  91. 0 71
      src/app/shared/roles.service.ts
  92. 0 61
      src/app/shared/section.service.ts
  93. 0 54
      src/app/shared/tabs.service.ts

+ 0 - 1
src/app/External-Page/external-hospital/external-hospital.component.ts

@@ -1,7 +1,6 @@
 import { NgxSpinnerService } from 'ngx-spinner';
 import { AuthServiceService } from './../../shared/auth-service.service';
 import { ExternalPageService } from './../../shared/external-page.service';
-import { ExternalSerService } from './../../shared/external-ser.service';
 import { ActivatedRoute, Params } from '@angular/router';
 import { Component, OnInit } from '@angular/core';
 

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

@@ -60,7 +60,7 @@ export class ExternalPageHeaderComponent implements OnInit {
 
 
   onLogin() {
-    this.router.navigate(['/login']);
+    this.router.navigate(['auth/login']);
   }
 
   onGetProfile() {
@@ -71,7 +71,7 @@ export class ExternalPageHeaderComponent implements OnInit {
   //log out function
   onLogout() { 
     localStorage.clear();
-    this.router.navigate(['login']);
+    this.router.navigate(['auth/login']);
   }
 
 }

+ 2 - 2
src/app/Internal-Page/internal-page-header/internal-page-header.component.ts

@@ -68,7 +68,7 @@ export class InternalPageHeaderComponent implements OnInit {
   }
 
   onLogin() {
-    this.router.navigate(['/login']);
+    this.router.navigate(['auth/login']);
   }
 
   onGetProfile() {
@@ -79,7 +79,7 @@ export class InternalPageHeaderComponent implements OnInit {
   //log out function
   onLogout() { 
     localStorage.clear();
-    this.router.navigate(['login']);
+    this.router.navigate(['auth/login']);
   }
 
   onDashBoard() {

+ 1 - 1
src/app/Internal-Page/internal-routing-module.ts

@@ -9,7 +9,7 @@ import { RouterModule, Routes } from '@angular/router';
 import { InternalPageComponent } from './internal-page/internal-page.component';
 
 import { HospitalContentComponent } from './hospital-content/hospital-content.component';
-import { LoginComponent } from './../login/login.component';
+import { LoginComponent } from '../auth-services/login/login.component';
 import { ExternalServiceDetailsComponent } from './external-service-details/external-service-details.component';
 import { InternalContactUsComponent } from './internal-contact-us/internal-contact-us.component';
 import { InternalPolicyComponent } from './internal-policy/internal-policy.component';

+ 14 - 8
src/app/app-routing.module.ts

@@ -3,8 +3,8 @@ import { AddRequestComponent } from './trainning-service/add-request/add-request
 import { CanDeactivateGuard } from './shared/can-deactivate-guards.service';
 import { NgModule } from '@angular/core';
 import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
-import { LoginComponent } from './login/login.component';
-import { RegesterComponent } from './regester/regester.component';
+import { LoginComponent } from './auth-services/login/login.component';
+import { RegesterComponent } from './auth-services/regester/regester.component';
 import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
 import { AuthGuardService as AuthGuard } from './shared/auth-guard.service';
 import { ServicesComponent } from './servicesItems/services.component';
@@ -13,19 +13,25 @@ import { TrainningServicesComponent } from './trainning-service/trainning-servic
 
 const routes: Routes = [
   {path: '', redirectTo: '/ExternalPage', pathMatch: 'full'},
-  {path: 'login', component: LoginComponent},
-  {path: 'signup', component: RegesterComponent},
+  {path: 'auth', loadChildren:'./auth-services/auth-services.module#AuthServicesModule'},
+  {path: 'InternalPage' , loadChildren: './Internal-Page/internal-page.module#InternalPageModule', canLoad: [AuthGuard]},
+  {path: 'ExternalPage', loadChildren: './External-Page/external-page.module#ExternalPageModule', canLoad: [AuthGuard]},
+  {path: 'service/:userID/:serviceID', loadChildren: './dashboard/dashboard.module#DashBoardModule', canLoad: [AuthGuard]},
+
+
   {path: 'services/:id', component: ServicesComponent, canActivate: [AuthGuard]},
+
   {path: 'addRequest/:visitorId', component: AddRequestComponent, canActivate: [AuthGuard]},
   {path: 'editRequest/:visitorId/:requestId', component: AddRequestComponent, canActivate: [AuthGuard]},
   {path: 'allRequests/:visitorID', component: AllRequestsComponent, canActivate: [AuthGuard]}, 
+
   {path: 'trainingServices/:visitorId/:trainningServicesId', component: TrainningServicesComponent, canActivate:[AuthGuard]},
-  {path: 'service/:userID/:serviceID', loadChildren: './dashboard/dashboard.module#DashBoardModule', canLoad: [AuthGuard]},
-  {path: 'InternalPage' , loadChildren: './Internal-Page/internal-page.module#InternalPageModule', canLoad: [AuthGuard]},
-  {path: 'ExternalPage', loadChildren: './External-Page/external-page.module#ExternalPageModule', canLoad: [AuthGuard]},
-  {path: 'profile/:idProfile', component: RegesterComponent, canActivate: [AuthGuard]},
+
+ {path: 'profile/:idProfile', component: RegesterComponent, canActivate: [AuthGuard]},
+
   {path: 'page-not-found', component: PageNotFoundComponent},
   {path: '**', redirectTo: '/page-not-found', pathMatch: 'full'}
+
 ];
 
 @NgModule({

+ 6 - 4
src/app/app.module.ts

@@ -28,8 +28,8 @@ import { AppComponent } from './app.component';
 import { HttpModule } from '@angular/http';
 import { HttpClientModule } from '@angular/common/http';
 import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
-import { LoginComponent } from './login/login.component';
-import { RegesterComponent } from './regester/regester.component';
+import { LoginComponent } from './auth-services/login/login.component';
+import { RegesterComponent } from './auth-services/regester/regester.component';
 import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
 import { AuthServiceService } from './shared/auth-service.service';
 import { HTTP_INTERCEPTORS } from '@angular/common/http';
@@ -56,6 +56,7 @@ import {SharedModule} from './shared/shared.module';
 import { AddRequestComponent } from './trainning-service/add-request/add-request.component';
 import { AllRequestsComponent } from './trainning-service/all-requests/all-requests.component';
 import { TrainningServicesComponent } from './trainning-service/trainning-services/trainning-services.component';
+import { AuthServicesModule } from './auth-services/auth-services.module';
 
 
 @NgModule({
@@ -63,8 +64,8 @@ import { TrainningServicesComponent } from './trainning-service/trainning-servic
     AppComponent,
     HeaderComponent,
     FooterComponent,
-    LoginComponent,
-    RegesterComponent,
+    // LoginComponent,
+    // RegesterComponent,
     ServicesComponent,
     PageNotFoundComponent,
     NumberDerictiveDirective,
@@ -79,6 +80,7 @@ import { TrainningServicesComponent } from './trainning-service/trainning-servic
     HttpModule,
     HttpClientModule,
     DashBoardModule,
+    AuthServicesModule,
     InternalPageModule,
     ExternalPageModule,
     SharedModule,

+ 24 - 0
src/app/auth-services/auth-services-routing.module.ts

@@ -0,0 +1,24 @@
+import { NgModule, Component } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { AuthServicesComponent } from './auth-services.component';
+import { LoginComponent } from './login/login.component';
+import { RegesterComponent } from './regester/regester.component';
+
+
+
+
+const routes: Routes = [
+    {path: 'auth',  component: AuthServicesComponent, children: [
+      {path: '', redirectTo: 'login', pathMatch: 'full'},
+      {path: 'login', component: LoginComponent},
+      {path: 'register', component: RegesterComponent},
+     
+      {path: '**', redirectTo: 'login', pathMatch: 'full'},
+    ]},
+  ];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule],
+})
+export class AuthServicesRoutingModule {}

+ 1 - 0
src/app/auth-services/auth-services.component.html

@@ -0,0 +1 @@
+<router-outlet></router-outlet>

+ 8 - 0
src/app/auth-services/auth-services.component.ts

@@ -0,0 +1,8 @@
+import { Component } from '@angular/core';
+
+@Component({
+  selector: 'app-auth-services',
+  templateUrl: './auth-services.component.html',
+})
+export class AuthServicesComponent {
+}

+ 56 - 0
src/app/auth-services/auth-services.module.ts

@@ -0,0 +1,56 @@
+import { NgModule } from '@angular/core';
+import { AuthServicesRoutingModule } from './auth-services-routing.module';
+import { AuthServicesComponent } from './auth-services.component';
+import { LoginComponent } from './login/login.component';
+import { RegesterComponent } from './regester/regester.component';
+import { BrowserModule } from '@angular/platform-browser';
+import { FormsModule, ReactiveFormsModule, FormGroup } from '@angular/forms';
+import { AlifeFileToBase64Module } from 'alife-file-to-base64';
+import { FlatpickrModule } from 'angularx-flatpickr';
+import { CalendarModule, DateAdapter } from 'angular-calendar';
+// import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
+// import { MomentModule } from 'ngx-moment';
+import { NgxPaginationModule } from 'ngx-pagination';
+import { NgxSpinnerModule } from 'ngx-spinner';
+import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
+import { CollapsibleModule } from 'angular2-collapsible';
+import { BootstrapModalModule } from 'ngx-modialog/plugins/bootstrap/public_api';
+import { Ng2CarouselamosModule } from 'ng2-carouselamos';
+import { ToastrModule } from 'ngx-toastr';
+import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import { CommonModule } from '@angular/common';
+import { JwSocialButtonsModule } from 'jw-angular-social-buttons';
+import { CarouselModule } from 'ngx-owl-carousel-o';
+import { SharedModule } from '../shared/shared.module';
+import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
+
+
+
+@NgModule({
+  imports: [
+    CommonModule,
+    AuthServicesRoutingModule,
+    CollapsibleModule,
+    NgxPaginationModule,
+    JwSocialButtonsModule,
+    CarouselModule,
+    NgxSpinnerModule,
+    SharedModule,
+    NgbModule.forRoot(),
+    FlatpickrModule.forRoot(),
+    CalendarModule.forRoot({
+      provide: DateAdapter,
+      useFactory: adapterFactory
+    }),
+    FormsModule,
+    ReactiveFormsModule,
+    AlifeFileToBase64Module,
+  ],
+    declarations: [
+        AuthServicesComponent,
+        LoginComponent,
+        RegesterComponent,
+  ],
+  providers: [],
+})
+export class AuthServicesModule { }

+ 2 - 1
src/app/login/login.component.css

@@ -4,7 +4,8 @@
     margin-top: -6px;
     justify-content: center;
     /* background-color: #ebeff5; */
-    background: url('../../assets/image/background_login.jpg') no-repeat top center;
+    /* ./../assets/image/background_login.jpg */
+    background: url('../../../assets/image/background_login.jpg') no-repeat top center;
     background-size: cover;
     direction: rtl;
     font-family: 'Cairo', sans-serif;

+ 1 - 1
src/app/login/login.component.html

@@ -18,7 +18,7 @@
                         <span class="help-block" *ngIf="!password.valid && password.touched">من فضلك ، قم بادخال كود صحيح</span>
                     </div>
                     <div class="form-group">
-                      <a [routerLink]="['/signup']" class="signUp-w" style="float: left; margin-left:10px">إنشاء حساب جديد</a>
+                      <a (click)="registerFun()" class="signUp-w" style="float: left; margin-left:10px; cursor: pointer">إنشاء حساب جديد</a>
                       <a routerLink="/page-not-found" class="forgetPassword-w" style="margin-right: 10px">نسيت كلمه المرور ؟</a>
                     </div>
                     <button class="btn btn-success form-control" type="submit" [disabled]="!f.valid">الدخول</button>

+ 12 - 6
src/app/login/login.component.ts

@@ -1,11 +1,13 @@
+import { Component, OnInit, ViewChild, HostListener } from "@angular/core";
+import { AuthServiceService } from "src/app/shared/auth-service.service";
+import { Router, ActivatedRoute } from "@angular/router";
+
 import { Location } from '@angular/common';
-import { Router, ActivatedRoute } from '@angular/router';
-import { AuthServiceService } from './../shared/auth-service.service';
-import { Component, OnInit, ViewChild, HostListener } from '@angular/core';
-import { NgForm } from '@angular/forms';
+import { NgxSpinnerService } from "ngx-spinner";
+import { ToastrService } from "ngx-toastr";
+import { NgForm } from "@angular/forms";
 import { Response } from '@angular/http';
-import { ToastrService } from 'ngx-toastr';
-import { NgxSpinnerService } from 'ngx-spinner';
+
 
 
 @Component({
@@ -48,6 +50,10 @@ export class LoginComponent implements OnInit {
     
   }
 
+  registerFun() {
+    this.router.navigate(['../register'], {relativeTo: this.route});
+  }
+
   //login function from services
   onSubmitedForm(){
     console.log(this.loginFormData.value);

src/app/regester/regester.component.css → src/app/auth-services/regester/regester.component.css


src/app/regester/regester.component.html → src/app/auth-services/regester/regester.component.html


+ 4 - 4
src/app/regester/regester.component.ts

@@ -1,7 +1,7 @@
 import { Modal } from 'ngx-modialog/plugins/bootstrap';
 import { Observable } from 'rxjs/Observable';
-import { AuthServiceService } from './../shared/auth-service.service';
-import { UserService } from './../shared/user.service';
+import { AuthServiceService } from '../../shared/auth-service.service';
+import { UserService } from '../../shared/user.service';
 import { Component, OnInit, Injectable } from '@angular/core';
 import { NgForm, FormGroup, FormControl, Validators, FormControlName } from '@angular/forms';
 import { Router, ActivatedRoute, Params } from '@angular/router';
@@ -580,7 +580,7 @@ export class RegesterComponent implements OnInit {
               (responce) => {
                 console.log(responce);
                 this.toastr.success('تم اضافتك بنجاح ، من فضلك سجل الدخول')
-                this.router.navigate(['login']);
+                this.router.navigate(['auth/login']);
               },
               (error) => {
                 console.log(error);
@@ -612,7 +612,7 @@ export class RegesterComponent implements OnInit {
               (responce) => {
                 console.log(responce);
                 this.toastr.success('تم اضافتك بنجاح ، من فضلك سجل الدخول')
-                this.router.navigate(['login']);
+                this.router.navigate(['auth/login']);
               },
               (error) => {
                 console.log(error);

+ 0 - 1
src/app/dashboard/absorpation-plan/absorpation-list/absorpation-list.component.ts

@@ -1,5 +1,4 @@
 import { DashboardService } from './../../../shared/dashboard.service';
-import { MainMenuService } from './../../../shared/main-menu.service';
 import { Component, OnInit } from '@angular/core';
 import { HttpClient } from '@angular/common/http';
 import { AuthServiceService } from './../../../shared/auth-service.service';

+ 8 - 8
src/app/dashboard/achievements/achievement-list/achievement.component.ts

@@ -1,6 +1,6 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { Modal } from 'ngx-modialog/plugins/bootstrap';
 import { AuthServiceService } from './../../../shared/auth-service.service';
-import { AchievementsService } from './../../../shared/achievements.service';
 import { ActivatedRoute, Router, Params } from '@angular/router';
 import { Component, OnInit } from '@angular/core';
 import { NgxSpinnerService } from 'ngx-spinner';
@@ -23,7 +23,7 @@ export class AchievementComponent implements OnInit {
     private userSer: UserService,
     private toastr: ToastrService,
     private modal: Modal,
-    private achievementsServie: AchievementsService) { }
+    private dashboardSer: DashboardService) { }
 
   pageId: number;
   achievementsList = [];
@@ -60,7 +60,7 @@ export class AchievementComponent implements OnInit {
         this.pageId = params['listPageId'];
         localStorage.setItem('pageIdActive', '11');
 
-        this.achievementsServie.getAchievementsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+        this.dashboardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
           (responce) => {
             console.log(responce);
             this.achievementsList = responce['achievements'];
@@ -127,7 +127,7 @@ export class AchievementComponent implements OnInit {
     this.achievementsList = [];
     //console.log(pagenationNumber);
     //console.log(this.pageId);
-    this.achievementsServie.getAchievementsList(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
+    this.dashboardSer.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.achievementsList = responce['achievements'];
@@ -148,7 +148,7 @@ export class AchievementComponent implements OnInit {
     this.spinner.show();
     this.achievementsList = [];
     this.dataTableNumber = event.target.value;
-    this.achievementsServie.getAchievementsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+    this.dashboardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.achievementsList = responce['achievements'];
@@ -171,7 +171,7 @@ export class AchievementComponent implements OnInit {
     this.currentPage = 1;
     console.log('search curent page', this.currentPage);
     console.log('search page id', this.pageId);
-    this.achievementsServie.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+    this.dashboardSer.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.achievementsList = responce['achievements'];
@@ -208,13 +208,13 @@ export class AchievementComponent implements OnInit {
       .open();
       dialogRef.result
       .then( result =>     
-        this.achievementsServie.deleteAchievement(this.rolesId).subscribe(
+        this.dashboardSer.deleteItem(this.rolesId, this.pageId).subscribe(
           (responce) => {
             console.log(responce);
             this.toastr.success('تم الحذف');
             this.spinner.show();
             this.achievementsList = [];
-            this.achievementsServie.getAchievementsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+            this.dashboardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
               (responce) => {
                 console.log(responce);
                 this.achievementsList = responce['achievements'];

+ 5 - 5
src/app/dashboard/achievements/add-achievement/add-achievement.component.ts

@@ -1,6 +1,6 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { ActivatedRoute, Params } from '@angular/router';
 import { Location } from '@angular/common';
-import { AchievementsService } from './../../../shared/achievements.service';
 import { NgForm } from '@angular/forms';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { UserService } from './../../../shared/user.service';
@@ -24,7 +24,7 @@ export class AddAchievementComponent implements OnInit {
     private route: ActivatedRoute,
     private spinner: NgxSpinnerService,
     private location: Location,
-    private achievService: AchievementsService) { }
+    private dashboardSer: DashboardService) { }
   
     typeMode: boolean = false;
     typeLink: string = '';
@@ -58,7 +58,7 @@ export class AddAchievementComponent implements OnInit {
           this.typeLink = 'تعديل';
           this.typeMode = true;
           this.achievId = params['editAchievementId'];
-          this.achievService.getAchievementData(this.achievId).subscribe(
+          this.dashboardSer.getItemData(this.achievId, 'achiev').subscribe(
             (responce) => {
               console.log(responce);
               this.achiv.title = responce['achievement'].title;
@@ -84,7 +84,7 @@ export class AddAchievementComponent implements OnInit {
 
     const dataFormAchiev = this.dataForm.value;
     if(this.typeMode) {
-      this.achievService.editAchievement(dataFormAchiev, this.achievId).subscribe(
+      this.dashboardSer.editItem( this.achievId, dataFormAchiev, 'achiev').subscribe(
         (responce) => {
           console.log(responce);
           this.toastr.success('تم التعديل بنجاح ');
@@ -98,7 +98,7 @@ export class AddAchievementComponent implements OnInit {
         }
       );
     } else {
-      this.achievService.addAchievements(dataFormAchiev).subscribe(
+      this.dashboardSer.addItem(dataFormAchiev, 'achiev').subscribe(
         (responce) => {
           this.toastr.success('تم الاضافه بنجاح');
           this.checkDisabledSave = false;

+ 1 - 2
src/app/dashboard/adminstration-contact-officers/adminstration-contact-officers-list/adminstration-contact-officers-list.component.ts

@@ -174,7 +174,6 @@ selectAll() {
             };  
           }
           this.toastr.success('تم نعين ضباط الاتصال');
-          location.reload();
           console.log(response);
           for(let i = 0; i < this.emplyees.length; i++){
             this.emplyees[i].selected == false;
@@ -197,7 +196,7 @@ selectAll() {
           }
           this.toastr.success('تم نعين ضباط الاتصال');
           console.log(response);
-          location.reload();
+          
         },
         (error) => {
           this.toastr.error('حدث خطأ في التعين يرجا المحاوله لاحقاً')

+ 40 - 0
src/app/dashboard/create-report/add-new-report/add-new-report.component.html

@@ -23,6 +23,46 @@
             </div>
           </div>
 
+
+          <div class="col-12" *ngIf="reportVal">
+            <h2 class="title">بيانات صاحب البلاغ</h2>
+            <div class="row">
+              <div class="col-12">
+                <div class="wrapper">
+                  <div class="col-12">
+                    <input type="text" class="form-control searchEmp" placeholder="البحث ( برقم الهويه / الرقم الوظيفي )" style="width:85%; float:right" appOnlyNumber [(ngModel)]="search" [ngModelOptions]="{standalone: true}"/>
+                    <button class="btn btn-success" type="button" style="float:right; margin:0 2px;" (click)="getValue()">أبحث</button>
+                  </div>
+
+                  <div class="col-12 col-md-4" style="margin: 20px 0">
+                    <div class="form-group">
+                      <label for="name" style="float:right">الإسم<span class="spanReqired-w">*</span></label>
+                      <input type="text" class="form-control" id="name" [ngModel]="reportAuthor.name" [ngModelOptions]="{standalone: true}" [disabled]="true"/>
+                    </div>
+                  </div>
+                  <div class="col-12 col-md-4" style="margin: 20px 0">
+                    <div class="form-group">
+                      <label for="identityNumber" style="float:right">رقم الهويه <span class="spanReqired-w">*</span></label>
+                      <input type="phone" class="form-control" id="identityNumber" [ngModel]="reportAuthor.identity_number" [ngModelOptions]="{standalone: true}" [disabled]="true"/>
+                    </div>
+                  </div>
+                  <div class="col-12 col-md-4" style="margin: 20px 0">
+                    <div class="form-group">
+                      <label for="functionalNumber" style="float:right">رقم الوظيفي <span class="spanReqired-w">*</span></label>
+                      <input type="phone" class="form-control" id="functionalNumber" [ngModel]="reportAuthor.functional_number" [ngModelOptions]="{standalone: true}" [disabled]="true"/>
+                    </div>
+                  </div>
+                  <div class="col-12 col-md-4">
+                    <div class="form-group">
+                      <label for="phone" style="float:right">الهاتف<span class="spanReqired-w">*</span></label>
+                      <input type="phone" class="form-control" id="phone" [ngModel]="reportAuthor.phone" [ngModelOptions]="{standalone: true}" [disabled]="true"/>
+                    </div>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+
           <div class="col-12">
             <h2 class="title">بيانات مقدم البلاغ</h2>
             <div class="row">

+ 19 - 1
src/app/dashboard/dashboard-routing.ts

@@ -99,7 +99,13 @@ import { AdminstrationContactOfficersListComponent } from './adminstration-conta
 import { AddNewReportComponent } from './create-report/add-new-report/add-new-report.component';
 import { MaintenanceCommunicationsListComponent } from './maintenance-communications/maintenance-communications-list/maintenance-communications-list.component';
 import { ReportCurrentEmployeeOfficerComponent } from './report-current-employees-officer/report-current-employee-officer/report-current-employee-officer.component';
-
+import { LivingServiceListComponent } from './living-service/living-service-list/living-service-list.component';
+import { LivingServiceAddComponent } from './living-service/living-service-add/living-service-add.component';
+import { DefinitionOfCovenantsListComponent } from './definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component';
+import { DefinitionOfCovenantsAddComponent } from './definition-of-covenants/definition-of-covenants-add/definition-of-covenants-add.component';
+import { RecordInfoBuildingListComponent } from './record-info-building/record-info-building-list/record-info-building-list.component';
+import { RecordInfoBuildingAddComponent } from './record-info-building/record-info-building-add/record-info-building-add.component';
+    
 const dashboardRouting: Routes = [
     {path: 'service/:userID/:serviceID', component: ServiceItemComponent, canActivate: [AuthGuard], children: [
     {path: 'users/:listPageId', component: UsersComponent, canActivate: [AuthGuard]},
@@ -237,6 +243,18 @@ const dashboardRouting: Routes = [
     {path: 'followCommunicationSecEdit/:followSectEditId', component: FollowCommunicationSectionsDetailsComponent, canActivate: [AuthGuard] },
     {path: 'reportCurrentEmployeeOfficer', component: ReportCurrentEmployeeOfficerComponent, canActivate: [AuthGuard] },
     {path: 'reportCommunication', component: ReportCommunicationsComponent, canActivate: [AuthGuard] },
+    {path: 'livingServiceList/:listPageId', component: LivingServiceListComponent, canActivate: [AuthGuard]},
+    {path: 'livingService/add', component: LivingServiceAddComponent, canActivate: [AuthGuard]},
+    {path: 'livingService/edit/:listPageEditId', component: LivingServiceAddComponent, canActivate: [AuthGuard]},
+    {path: 'definitionOfConvenats/:listPageId', component: DefinitionOfCovenantsListComponent, canActivate: [AuthGuard]},
+    {path: 'definitionOfConvenats', component: DefinitionOfCovenantsAddComponent, canActivate: [AuthGuard]},
+    {path: 'definitionOfConvenats/edit/:listPageEditId', component: DefinitionOfCovenantsAddComponent, canActivate: [AuthGuard]},
+    {path: 'recordInfoBuilding/:listPageId', component: RecordInfoBuildingListComponent, canActivate: [AuthGuard]},
+    {path: 'recordInfoBuilding', component: RecordInfoBuildingAddComponent, canActivate: [AuthGuard]},
+    {path: 'recordInfoBuilding/edit/:listPagEditId', component: RecordInfoBuildingAddComponent, canActivate: [AuthGuard]},
+    
+    
+    
     ]},
 ];
 

+ 13 - 18
src/app/dashboard/dashboard.module.ts

@@ -31,18 +31,9 @@ import { HigriDateComponent } from '../higri-date/higri-date.component';
 import { DashBoardRouting } from './dashboard-routing';
 
 import { DashboardService } from './../shared/dashboard.service';
-import { InternalSerService } from './../shared/internal-ser.service';
-import { AchievementsService } from './../shared/achievements.service';
-import { ExternalSerService } from './../shared/external-ser.service';
-import { MainMenuService } from './../shared/main-menu.service';
-import { FooterService } from './../shared/footer.service';
-import { NewService } from './../shared/new.service';
 import { EventService } from './../shared/event.service';
 import { HospitalService } from './../shared/hospital.service';
 import { ReportService } from './../shared/report.service';
-import { DepartmentService } from './../shared/department.service';
-import { SectionService } from './../shared/section.service';
-import { RolesService } from './../shared/roles.service';
 
 import { DashboardContent } from './dashboard-content';
 
@@ -144,6 +135,12 @@ import { FollowCommunicationsAdminstrationEditComponent } from './follow-communi
 import { FollowCommunicationSectionsDetailsComponent } from './follow-communications-sections/follow-communication-sections-details/follow-communication-sections-details.component';
 import { ReportCurrentEmployeeOfficerComponent } from './report-current-employees-officer/report-current-employee-officer/report-current-employee-officer.component';
 import { ReportCommunicationsComponent } from './report-communication/report-communications/report-communications.component';
+import { LivingServiceListComponent } from './living-service/living-service-list/living-service-list.component';
+import { LivingServiceAddComponent } from './living-service/living-service-add/living-service-add.component';
+import { DefinitionOfCovenantsListComponent } from './definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component';
+import { DefinitionOfCovenantsAddComponent } from './definition-of-covenants/definition-of-covenants-add/definition-of-covenants-add.component';
+import { RecordInfoBuildingListComponent } from './record-info-building/record-info-building-list/record-info-building-list.component';
+import { RecordInfoBuildingAddComponent } from './record-info-building/record-info-building-add/record-info-building-add.component';
 
 
 
@@ -252,6 +249,13 @@ import { ReportCommunicationsComponent } from './report-communication/report-com
         FollowCommunicationSectionsDetailsComponent,
         ReportCurrentEmployeeOfficerComponent,
         ReportCommunicationsComponent,
+        LivingServiceListComponent,
+        LivingServiceAddComponent,
+        DefinitionOfCovenantsListComponent,
+        DefinitionOfCovenantsAddComponent,
+        RecordInfoBuildingListComponent,
+        RecordInfoBuildingAddComponent,
+    
     ],
     imports: [
         CommonModule,
@@ -272,18 +276,9 @@ import { ReportCommunicationsComponent } from './report-communication/report-com
     ],
     providers: [
         UserService,
-        RolesService,
-        SectionService,
-        DepartmentService,
         ReportService,
         HospitalService,
         EventService,
-        NewService,
-        FooterService,
-        MainMenuService,
-        ExternalSerService,
-        AchievementsService,
-        InternalSerService,
         DashboardService,
     ],
 })

+ 1 - 1
src/app/dashboard/definition-of-classification/definition-add/definition-add.component.html

@@ -54,7 +54,7 @@
               
           </div>
           <div class=" row col-6">
-              <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid || checkSaveDisabled">حفظ</button>
+              <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid || disable">حفظ</button>
               <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>
           </div>
         </form>

+ 4 - 0
src/app/dashboard/definition-of-classification/definition-add/definition-add.component.ts

@@ -31,6 +31,7 @@ export class DefinitionAddComponent implements OnInit {
   valueType: string = '';
   checkSaveclick:boolean = false;
   check : boolean = false;
+  disable: boolean = false;
   isEdit: boolean = false;
   types = [
     {
@@ -113,14 +114,17 @@ export class DefinitionAddComponent implements OnInit {
  
   onSubmitted() {
     console.log('HERE',this.definitionForm.value);
+    this.disable = true;
     if(this.editPageId) {
       this.dashBoardSer.editItem(this.editPageId, this.definitionForm.value, 'definitionOfClassification').subscribe(
         (responce) => {
+          this.disable = true;
           console.log(responce);
           this.toastr.success('تم التعديل بنجاح');
           this.location.back();
         },
         (error) => {
+          this.disable = false;
           console.log(error);
           this.toastr.error('خطأ في الخادم ، رجاء المحارله لاحقا');
         }

+ 1 - 1
src/app/dashboard/definition-of-classification/definition-list/definition-list.component.html

@@ -17,7 +17,7 @@
       </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)"/>
+          <input type="text" placeholder="البحث (رمز التصنيف)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
           <hr>
         </div>
       </div>

+ 3 - 2
src/app/dashboard/definition-of-classification/definition-list/definition-list.component.ts

@@ -109,8 +109,9 @@ export class DefinitionListComponent implements OnInit {
   }
 //make all checkbox of user checked 
 selectAll() {
-  for (var i = 0; i < this.absorpationListIds.length; i++) {
-    this.absorpationListIds[i].selected = this.selectedAll;
+  console.log('selected alllllll');
+  for(let i = 0; i < this.dataList.length; i++){
+    this.dataList[i].selected = this.selectedAll;
   }
 }
 

+ 0 - 0
src/app/dashboard/definition-of-covenants/definition-of-covenants-add/definition-of-covenants-add.component.css


+ 65 - 0
src/app/dashboard/definition-of-covenants/definition-of-covenants-add/definition-of-covenants-add.component.html

@@ -0,0 +1,65 @@
+<div class="addDepartment-w">
+
+    
+  <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"> {{typePage}} </li>
+          </ul>
+        </div>
+      </div>
+
+    <div class="containerContent-w">
+        <form (ngSubmit)="onSubmitted()" #f="ngForm" style="margin-top: 40px;">
+            <div class="row">
+          <div class="col-12 col-sm-12 col-md-4">
+            <div class="form-group">
+              <label for="name" style="float: right; margin-right: 5px">اسم التصنيف<span class="spanReqired-w">*</span></label>
+              <input type="text" class="form-control" id="name" name="name" placeholder="اسم التصنيف" ngModel [ngModel]="formData.name" required/>
+            </div>
+          </div>
+                
+          <!-- <div class="col-12 col-sm-12 col-md-4">
+            <div class="form-group">
+              <label for="category_id" style="float: right; margin-right: 5px">اسم المادة او العهدة<span class="spanReqired-w">*</span></label>
+              <input type="number" class="form-control" id="category_id" name="category_id" placeholder="اسم المادة او العهدة	" ngModel [ngModel]="formData.category_id" required/>
+            </div>
+          </div> -->
+            
+          <div class="col-12 col-sm-12 col-md-4">
+            <div class="form-group">
+              <label style="float: right; margin-right: 5px">الحاله</label>
+              <select class="form-control" name="category_id" [ngModel]="formData.category_id" required>
+                <option *ngFor="let category of categories" [value]="category.id">{{category.name}}</option>
+              </select>
+            </div>
+          </div>
+
+          <div class="col-12 col-sm-12 col-md-4">
+            <div class="form-group">
+              <label for="amount" style="float: right; margin-right: 5px">العدد الموجود	<span class="spanReqired-w">*</span></label>
+              <input type="number" class="form-control" id="amount" name="amount" placeholder="العدد الموجود		" ngModel [ngModel]="formData.amount" required/>
+            </div>
+          </div>
+
+          <div class="col-12 col-sm-12 col-md-4">
+            <div class="form-group">
+              <label style="float: right; margin-right: 5px">الحاله</label>
+              <select class="form-control" name="status" [ngModel]="formData.status" required>
+                <option value="1">فعال</option>
+                <option value="0">غير فعال</option>
+              </select>
+            </div>
+          </div>
+              
+          </div>
+          <div class=" row col-6">
+              <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid">حفظ</button>
+              <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>
+          </div>
+        </form>
+    </div>
+  </div>
+</div>

+ 124 - 0
src/app/dashboard/definition-of-covenants/definition-of-covenants-add/definition-of-covenants-add.component.ts

@@ -0,0 +1,124 @@
+import { HttpClient } from '@angular/common/http';
+import { NgxSpinnerService } from 'ngx-spinner';
+import { ActivatedRoute, Params } from '@angular/router';
+import { Location } from '@angular/common';
+import { AuthServiceService } from './../../../shared/auth-service.service';
+import { ToastrService } from 'ngx-toastr';
+import { DashboardService } from './../../../shared/dashboard.service';
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { NgForm } from '@angular/forms';
+
+@Component({
+  selector: 'app-definition-of-covenants-add',
+  templateUrl: './definition-of-covenants-add.component.html',
+  styleUrls: ['./definition-of-covenants-add.component.css']
+})
+export class DefinitionOfCovenantsAddComponent implements OnInit {
+
+  constructor(
+    private dashBoardSer: DashboardService,
+    private toastr: ToastrService,
+    private authSer: AuthServiceService,
+    private route: ActivatedRoute,
+    private spinner: NgxSpinnerService,
+    private location: Location,
+    private http: HttpClient
+  ) { }
+
+  @ViewChild('f') definitionForm : NgForm;
+
+  typePage: string = '';
+  locations =[];
+  categories = [];
+  valueType: string = '';
+  checkSaveclick:boolean = false;
+  check : boolean = false;
+  isEdit: boolean = false;
+  editPageId: number;
+
+  formData = {
+    name: '',
+    category_id:'',
+    amount:'',
+    status: '',
+  }
+
+  ngOnInit() {
+
+    this.route.params.subscribe(
+      (params: Params) => {
+        this.editPageId = +params['listPageEditId'];;
+        console.log(this.editPageId);
+      }
+    );
+
+    this.http.get(this.authSer.pathApi + '/get_covenant_categories_list')
+          .subscribe(
+            res => {
+              console.log('gg', res);
+              this.categories = res[('covenant_categories')];
+            },
+            err =>{
+              console.log(err);
+
+              
+            }
+          );
+
+    if (this.editPageId) {
+      this.spinner.show();
+      this.isEdit = true;
+      this.typePage = 'تعديل';
+      this.dashBoardSer.getItemData(this.editPageId, 'definitionOfCovenant' ).subscribe(
+        res => {
+          console.log('ssss', res);
+          this.formData.name = res['covenant'].name;
+          this.formData.category_id = res[('covenant')].category_id;
+          this.formData.amount = res[('covenant')].amount;
+          this.formData.status  = res['covenant'].status;
+          this.spinner.hide();
+        },
+        err => {
+          console.log(err);
+        }
+      );
+    }else {
+      this.typePage = 'اضافة';
+    }
+    
+
+  }
+
+
+  onSubmitted(){
+    console.log('HERE',this.definitionForm.value);
+    if(this.editPageId) {
+      this.dashBoardSer.editItem(this.editPageId, this.definitionForm.value, 'definitionOfCovenant').subscribe(
+        res => {
+          console.log(res);
+          this.toastr.success('تم التعديل بنجاح');
+          this.location.back();
+        },
+        err => {
+          console.log(err);
+          this.toastr.error('خطأ في الخادم ، رجاء المحارله لاحقا');
+        }
+      )
+    } else {
+      this.dashBoardSer.addItem( this.definitionForm.value , 'definitionOfCovenant').subscribe(
+        res => {
+          console.log('ADD',res);
+          this.toastr.success('تم الإضافه بنجاح');
+          this.checkSaveclick = false;
+          this.location.back();
+        },
+        err => {
+          console.log(err);
+          this.checkSaveclick = false;
+          this.toastr.error('خطأ في الخادم ، حاول لاحقا');
+        }
+      );
+      }
+  }
+
+}

+ 30 - 0
src/app/dashboard/definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component.css

@@ -0,0 +1,30 @@
+.table {
+    margin: 30px 0;
+}
+
+.dashButton-w {
+    float: right;
+    margin: 10px;
+}
+
+.custom-control-label::after,
+.custom-control-label::before {
+    width: 1.5rem;
+    height: 1.5rem;
+}
+
+.fixedWidthLabel-w::after,
+.fixedWidthLabel-w::before {
+    width: 1.5rem;
+    height: 1.5rem;
+}
+
+.disblayBlock-w {
+    display: block;
+}
+
+/* .centerIneerItem {
+    display: flex;
+    justify-content: center;
+    text-align: center;
+} */

+ 83 - 0
src/app/dashboard/definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component.html

@@ -0,0 +1,83 @@
+<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-12 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>
+
+    <table class="table table-bordered" *ngIf="this.count != 0">
+      <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>العدد الموجود</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>
+            <div class="custom-control custom-checkbox centerIneerItem">
+              <input type="checkbox" class="custom-control-input" id="{{data.id}}" [(ngModel)]="data.selected" [value]='data' (change)="checkIfAllSelected();">
+              <!-- <label class="custom-control-label disblayBlock-w" for="{{tab.id}}" style="color:#2a2a2a"></label> -->
+            </div>
+          </td>
+          <td>{{data.name}}</td>
+          <td>{{data.category_name}}</td>
+          <td>{{data.amount}}</td>
+          <td>{{data.status == '0' ? 'غير فعال' : data.status == '1' ? ' فعال' : '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>

+ 281 - 0
src/app/dashboard/definition-of-covenants/definition-of-covenants-list/definition-of-covenants-list.component.ts

@@ -0,0 +1,281 @@
+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 { Modal } from 'ngx-modialog/plugins/bootstrap';
+import { UserService } from '../../../shared/user.service';
+import { ToastrService } from 'ngx-toastr';
+
+
+@Component({
+  selector: 'app-definition-of-covenants-list',
+  templateUrl: './definition-of-covenants-list.component.html',
+  styleUrls: ['./definition-of-covenants-list.component.css']
+})
+export class DefinitionOfCovenantsListComponent implements OnInit {
+
+  dataList = [];
+  pages= [];
+  pageId: number;
+  Ids = [];
+  count: number;
+  perPagePagenation: number;
+  currentPage:number = 1;
+  filtterStatus = 'all';
+  selectedAll: any;
+  userLoginId:number;
+  serviceId:number;
+  dataTableNumber: number = 5;
+  absorpationListIds = [];
+  dataListIds = [];
+
+  constructor(
+    private route: ActivatedRoute,
+    private router: Router,
+    private modal: Modal,
+    private userSer: UserService,
+    private spinner: NgxSpinnerService,
+    private authSer: AuthServiceService,
+    private toastr: ToastrService,
+    private dashboardSer: DashboardService,
+    private http: HttpClient
+  ) { }
+
+  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.route.params.subscribe(
+         (parmas: Params) => {
+           this.pageId =  +parmas['listPageId'];
+           localStorage.setItem('pageIdActive', parmas['listPageId']);
+           console.log(this.pageId);
+         }
+       );
+
+
+
+       this.route.parent.params.subscribe(
+        (params:Params) => {
+            this.userLoginId = params['userID'];
+            this.serviceId = params['serviceID'];
+           
+    
+            this.userSer.getPagesPermetiotns(this.userLoginId, this.serviceId).subscribe(
+              (responce) => {
+                console.log(responce);
+                this.pages = responce['pages'];
+                for(let i = 0; i< this.pages.length; i++) {
+                  if(this.pages[i].id == 64){
+                    if(this.pages[i]['permissions'][0].name == 'covenants') {
+                      this.authSer.showAddBtn = true;
+                      this.authSer.showEditBtn = true;
+                      this.authSer.showDeleteBtn = true;
+                    } else {
+                      console.log('no permissions');
+                    }
+                  } else {
+                    console.log('no events');
+                  }
+                }
+                this.spinner.hide();
+              },
+              (error) => {console.log(error)}
+            );
+          }
+        );
+
+        console.log('current page',this.pageId)
+        this.dashboardSer.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
+          res => {
+            console.log(res);
+          this.dataList = res['covenants'];
+          this.count = res['count'];
+          this.perPagePagenation = res['per_page'];
+          },
+          err => {
+            console.log(err);
+            
+          }
+
+        );
+
+  }
+  selectAll() {
+    console.log('selected alllllll');
+    for(let i = 0; i < this.dataList.length; i++){
+      this.dataList[i].selected = this.selectedAll;
+    }
+  }
+  
+  checkIfAllSelected() {
+    this.selectedAll = this.absorpationListIds.every(function(item:any) {
+      return item.selected == true;
+    });
+  }
+  filtterFunc(data) {
+    this.dataList =[];
+    this.absorpationListIds = [];
+    console.log(data.target.value);
+    const dataSearch = data.target.value;     
+    this.currentPage = 1;
+    console.log('search curent page', this.currentPage);
+    console.log('search page id', this.pageId);
+    this.dashboardSer.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+      res => {
+        console.log(res);
+        this.dataList = res['covenants'];
+        console.log('hey',this.dataList)
+        this.count = res['count'];
+        this.perPagePagenation = res['per_page'];
+        console.log('filtter count', this.count);
+        console.log('filtter perPagePAgenation', this.perPagePagenation);
+      },
+      err => {
+        console.log(err);
+      }
+    );
+  };  
+
+  onPageChange(pagenationNumber) {
+    this.spinner.show();
+    this.currentPage = pagenationNumber;
+    this.absorpationListIds = [];
+    console.log(pagenationNumber);
+    console.log(this.pageId);
+    this.dashboardSer.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
+      res => {
+        console.log(res);
+        this.dataList = res['covenants'];
+        this.count = res['count'];
+        this.perPagePagenation = res['per_page'];
+        console.log('FFFFFF', this.absorpationListIds);
+        this.spinner.hide();
+      },
+      err => {
+        console.log(err);
+        this.spinner.hide();
+      }
+    );
+  }
+
+  //determine the list count from select element 
+onGetValue(event) {
+  this.spinner.show();
+  this.absorpationListIds = [];
+  this.dataTableNumber = event.target.value;
+  this.dashboardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+    res => {
+      console.log(res);
+      this.absorpationListIds = res['covenants'];
+      this.count = res['count'];
+      this.perPagePagenation = res['per_page'];
+      this.spinner.hide();
+    },
+    err => {
+      console.log(err);
+      this.spinner.hide();
+    }
+  );
+};
+onGetValueFiltter(event) {
+  console.log(event.target.value)
+  this.spinner.show();
+  this.dataList = [];
+  const typeId = event.target.value;
+  this.filtterStatus = event.target.value;
+  console.log(this.filtterStatus);
+  this.http.get(this.authSer.pathApi +'/page_list/' + this.pageId + '/' + this.currentPage + '/' + this.dataTableNumber + '/' + typeId).subscribe(
+    res => {
+      console.log(res);
+      this.dataList = res['covenants'];
+      this.count = res['count'];
+      this.perPagePagenation = res['per_page'];
+      this.spinner.hide();
+      console.log('UrL>>', this.authSer.pathApi +'/page_list/' + this.pageId + '/' + this.currentPage + '/' + this.dataTableNumber + '/' + typeId)
+    },
+    err=> {
+      console.log(err);
+    }
+  );
+}
+
+
+onDelete() {
+
+  this.dataListIds = [];
+  for(let i = 0; i < this.dataList.length; i++) {
+    if(this.dataList[i].selected == true) {
+      this.dataListIds.push(this.dataList[i].id);
+    }
+  }
+  console.log(this.dataListIds);
+
+  if(this.dataListIds.length > 0) {
+    const dialogRef = this.modal.alert()
+    .size('sm')
+    .showClose(true)
+    .title('تأكيد الحذف')
+    .body(`
+        <h4>هل ترغب في حذف العناصر المحدده ؟ </h4>
+        `)
+    .open();
+
+      dialogRef.result
+      .then( result =>
+        this.dashboardSer.deleteItem(this.dataListIds , this.pageId).subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تم الحذف');
+            this.spinner.show();
+            this.dataList = [];
+             //get list data
+            this.dashboardSer.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
+              (responce) => {
+                console.log(responce);
+                this.dataList = responce['covenants'];
+                this.count = responce['count'];
+                this.perPagePagenation = responce['per_page'];
+                this.spinner.hide();
+              },
+              (error) => {
+                console.log(error);
+                this.spinner.hide();
+              }
+            );
+          },
+          (error) => {
+            console.log(error);
+            this.spinner.hide();
+            },
+          )
+      );
+  } else {
+    this.toastr.warning('لم يتم إختيار أي عنصر للمسح !');
+  }
+};
+onAdd() {
+  this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'definitionOfConvenats']);
+  
+}
+
+onEdit(editId: number) {
+  this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'definitionOfConvenats/edit/' + editId]);
+}
+
+}

+ 1 - 1
src/app/dashboard/definition-of-location/location-add/location-add.component.html

@@ -48,7 +48,7 @@
               
           </div>
           <div class=" row col-6">
-              <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid || checkSaveDisabled">حفظ</button>
+              <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid || disable">حفظ</button>
               <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>
           </div>
         </form>

+ 7 - 3
src/app/dashboard/definition-of-location/location-add/location-add.component.ts

@@ -31,7 +31,8 @@ export class LocationAddComponent implements OnInit {
   typePage: string = '';
   locations =[];
   valueType: string = '';
-  checkSaveclick:boolean = false;
+  checkSaveclick:boolean = true;
+  disable: boolean = false;
   check : boolean = false;
   isEdit: boolean = false;
   types = [
@@ -114,14 +115,17 @@ export class LocationAddComponent implements OnInit {
   }
   onSubmitted() {
     console.log('HERE',this.definitionForm.value);
+    this.disable = true;
     if(this.editPageId) {
       this.dashBoardSer.editItem(this.editPageId, this.definitionForm.value, 'definitionOfLocation').subscribe(
         (responce) => {
+          this.disable = true;
           console.log(responce);
           this.toastr.success('تم التعديل بنجاح');
           this.location.back();
         },
         (error) => {
+          this.disable = false;
           console.log(error);
           this.toastr.error('خطأ في الخادم ، رجاء المحارله لاحقا');
         }
@@ -131,12 +135,12 @@ export class LocationAddComponent implements OnInit {
       (responce) => {
         console.log('ADD',responce);
         this.toastr.success('تم الإضافه بنجاح');
-        this.checkSaveclick = false;
+        this.disable = true;
         this.location.back();
       },
       (error) => {
         console.log(error);
-        this.checkSaveclick = false;
+        this.disable = false;
         this.toastr.error('خطأ في الخادم ، حاول لاحقا');
       }
     );

+ 1 - 1
src/app/dashboard/definition-of-location/location-list/location-list.component.html

@@ -17,7 +17,7 @@
       </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)"/>
+          <input type="text" placeholder="البحث (اسم الموقع)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
           <hr>
         </div>
       </div>

+ 3 - 3
src/app/dashboard/definition-of-location/location-list/location-list.component.ts

@@ -110,11 +110,11 @@ export class LocationListComponent implements OnInit {
   }
 //make all checkbox of user checked 
 selectAll() {
-  for (var i = 0; i < this.absorpationListIds.length; i++) {
-    this.absorpationListIds[i].selected = this.selectedAll;
+  console.log('selected alllllll');
+  for(let i = 0; i < this.dataList.length; i++){
+    this.dataList[i].selected = this.selectedAll;
   }
 }
-
 checkIfAllSelected() {
   this.selectedAll = this.absorpationListIds.every(function(item:any) {
     return item.selected == true;

+ 2 - 2
src/app/dashboard/definition-of-time/definition-time-list/definition-time-list.component.html

@@ -17,7 +17,7 @@
       </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)"/>
+          <input type="text" placeholder="البحث (اسم المدة)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
           <hr>
         </div>
       </div>
@@ -64,7 +64,7 @@
             </div>
           </td>
           <td>{{data.name}}</td>
-          <td>{{data.period}}</td>
+          <td>{{data.period}} ساعة</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>

+ 3 - 2
src/app/dashboard/definition-of-time/definition-time-list/definition-time-list.component.ts

@@ -113,8 +113,9 @@ export class DefinitionTimeListComponent implements OnInit {
   }
 //make all checkbox of user checked 
 selectAll() {
-  for (var i = 0; i < this.absorpationListIds.length; i++) {
-    this.absorpationListIds[i].selected = this.selectedAll;
+  console.log('selected alllllll');
+  for(let i = 0; i < this.dataList.length; i++){
+    this.dataList[i].selected = this.selectedAll;
   }
 }
 

+ 2 - 2
src/app/dashboard/department/add-department/add-department.component.html

@@ -5,8 +5,8 @@
       <div class="row">
         <div class="col-12">
           <ul class="list-unstyled titileLi-w">
-            <li class="headingText-w">خدمه الصلاحيات > </li>
-            <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">الادارات > </li>
+            <li class="headingText-w">خدمه الصلاحيات </li>
+            <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">الادارات</li>
             <li class="headingText-w activeLi-w" style="margin-right:5px">  {{typeLink}} </li>
           </ul>
         </div>

+ 5 - 5
src/app/dashboard/department/add-department/add-department.component.ts

@@ -1,5 +1,5 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { Location } from '@angular/common';
-import { DepartmentService } from './../../../shared/department.service';
 import { UserService } from './../../../shared/user.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { Component, OnInit, ViewChild } from '@angular/core';
@@ -17,7 +17,7 @@ export class AddDepartmentComponent implements OnInit {
 
   constructor(private authService: AuthServiceService,
       private userService: UserService,
-      private departmentSer: DepartmentService,
+      private dashboardSer: DashboardService,
       private spinner: NgxSpinnerService,
       private toastr: ToastrService,
       private router: Router,
@@ -67,7 +67,7 @@ export class AddDepartmentComponent implements OnInit {
           this.typeLink = 'تعديل';
           this.checkEditMode = true;
           this.departId = params['editAdminId'];
-          this.departmentSer.getDataAdmin(this.departId).subscribe(
+          this.dashboardSer.getItemData(this.departId, 'department').subscribe(
             (responce) => {
               console.log(responce);
               this.admin.name = responce['adminstration'].name;
@@ -97,7 +97,7 @@ export class AddDepartmentComponent implements OnInit {
 
     console.log(this.addDepertmentForm.value);
     if(this.checkEditMode) {
-      this.departmentSer.editAdmin(this.addDepertmentForm, this.departId).subscribe(
+      this.dashboardSer.editItem( this.departId, this.addDepertmentForm.value , 'department').subscribe(
         (responce) => {
           this.checkSaveDisabled = false;
           console.log(responce);
@@ -111,7 +111,7 @@ export class AddDepartmentComponent implements OnInit {
         }
       );
     } else {
-      this.departmentSer.addDepartment(this.addDepertmentForm).subscribe(
+      this.dashboardSer.addItem(this.addDepertmentForm.value, 'department').subscribe(
         (responce) => {
           this.checkSaveDisabled= false;
           console.log(responce);

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

@@ -2,7 +2,7 @@
     <div class="row">
       <div class="col-12">
           <ul class="list-unstyled titileLi-w">
-            <li class="headingText-w">خدمه الصلاحيات > </li>
+            <li class="headingText-w">خدمه الصلاحيات </li>
             <li class="headingText-w activeLi-w" style="margin-right:5px">الإدارات</li>
           </ul>
       </div>

+ 8 - 8
src/app/dashboard/department/department-list/department-list.component.ts

@@ -1,7 +1,7 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { Modal } from 'ngx-modialog/plugins/bootstrap';
 import { UserService } from './../../../shared/user.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
-import { DepartmentService } from './../../../shared/department.service';
 import { ActivatedRoute, Params, Router } from '@angular/router';
 import { NgxSpinnerService } from 'ngx-spinner';
 import { Component, OnInit } from '@angular/core';
@@ -16,7 +16,7 @@ import { ToastrService } from 'ngx-toastr';
 export class DepartmentListComponent implements OnInit {
 
   constructor(private route: ActivatedRoute,
-    private departService: DepartmentService,
+    private dashBoardSer: DashboardService,
     private router: Router,
     private spinner: NgxSpinnerService,
     private modal: Modal,
@@ -89,7 +89,7 @@ export class DepartmentListComponent implements OnInit {
       }
     );
 
-    this.departService.getDeparmentsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+    this.dashBoardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.departmentsList = responce['adminstrations'];
@@ -114,7 +114,7 @@ export class DepartmentListComponent implements OnInit {
     this.spinner.show();
     this.currentPage = pagenationNumber;
     this.departmentsList = [];
-    this.departService.getDeparmentsList(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
+    this.dashBoardSer.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.departmentsList = responce['adminstrations'];
@@ -151,7 +151,7 @@ export class DepartmentListComponent implements OnInit {
       this.currentPage = 1;
       console.log('search curent page', this.currentPage);
       console.log('search page id', this.pageId);
-      this.departService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+      this.dashBoardSer.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.departmentsList = responce['adminstrations'];
@@ -170,7 +170,7 @@ export class DepartmentListComponent implements OnInit {
       this.spinner.show();
       this.departmentsList = [];
       this.dataTableNumber = event.target.value;
-      this.departService.getDeparmentsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+      this.dashBoardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.departmentsList = responce['adminstrations'];
@@ -205,13 +205,13 @@ export class DepartmentListComponent implements OnInit {
         .open();
         dialogRef.result
         .then( result =>  
-          this.departService.deleteDepart(this.departsId).subscribe(
+          this.dashBoardSer.deleteItem(this.departsId , this.pageId).subscribe(
             (responce) => {
               console.log(responce);
               this.toastr.success('تم المسح');
               this.spinner.show();
               this.departmentsList = [];
-              this.departService.getDeparmentsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+              this.dashBoardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
                 (responce) => {
                   console.log(responce);
                   this.departmentsList = responce['adminstrations'];

+ 1 - 3
src/app/dashboard/external-services/add-external/add-external.component.ts

@@ -2,7 +2,6 @@ import { DashboardService } from './../../../shared/dashboard.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { ActivatedRoute, Params } from '@angular/router';
 import { Location } from '@angular/common';
-import { ExternalSerService } from './../../../shared/external-ser.service';
 import { Component, OnInit, ViewChild } from '@angular/core';
 import { NgxSpinnerService } from 'ngx-spinner';
 import { ToastrService } from 'ngx-toastr';
@@ -45,8 +44,7 @@ export class AddExternalComponent implements OnInit {
     private route: ActivatedRoute,
     private authSer: AuthServiceService,
     private dashBoardService: DashboardService,
-    private authService: AuthServiceService,
-    private externalService: ExternalSerService) { }
+    private authService: AuthServiceService) { }
 
   ngOnInit() {
     

+ 1 - 3
src/app/dashboard/external-services/external-list/external-list.component.ts

@@ -1,7 +1,6 @@
 import { DashboardService } from './../../../shared/dashboard.service';
 import { Modal } from 'ngx-modialog/plugins/bootstrap';
 import { HttpClient } from '@angular/common/http';
-import { ExternalSerService } from './../../../shared/external-ser.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { ActivatedRoute, Router, Params } from '@angular/router';
 import { Component, OnInit } from '@angular/core';
@@ -35,7 +34,6 @@ export class ExternalListComponent implements OnInit {
     private userSer: UserService,
     private http: HttpClient,
     private toastr: ToastrService,
-    private externalService: ExternalSerService,
     private spinner: NgxSpinnerService,
     private modal: Modal,
     private dashBoardService: DashboardService,
@@ -203,7 +201,7 @@ export class ExternalListComponent implements OnInit {
     this.http.post(this.authSer.pathApi + '/rank_external_service', data).subscribe(
       (responce) => {
         console.log(responce);
-        this.externalService.getExternalsList(this.externalId, this.currentPage, this.dataTableNumber).subscribe(
+        this.dashBoardService.getListData(this.externalId, this.currentPage, this.dataTableNumber).subscribe(
           (responce) => {
             console.log(responce);
             this.count = responce['count'];

+ 1 - 3
src/app/dashboard/footer/add-footer/add-footer.component.ts

@@ -1,5 +1,4 @@
 import { DashboardService } from './../../../shared/dashboard.service';
-import { FooterService } from './../../../shared/footer.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { ActivatedRoute, Params } from '@angular/router';
 import { Location } from '@angular/common';
@@ -52,8 +51,7 @@ export class AddFooterComponent implements OnInit {
     private location: Location,
     private authSer: AuthServiceService,
     private route: ActivatedRoute,
-    private dashBoardService: DashboardService,
-    private footerService: FooterService) { }
+    private dashBoardService: DashboardService) { }
 
   ngOnInit() {
     //show / hide notification search in header

+ 0 - 2
src/app/dashboard/footer/footer-list/footer-list.component.ts

@@ -2,7 +2,6 @@ import { DashboardService } from './../../../shared/dashboard.service';
 import { Modal } from 'ngx-modialog/plugins/bootstrap';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { NgxSpinnerService } from 'ngx-spinner';
-import { FooterService } from './../../../shared/footer.service';
 import { HttpClient } from '@angular/common/http';
 import { UserService } from './../../../shared/user.service';
 import { ActivatedRoute, Router, Params } from '@angular/router';
@@ -41,7 +40,6 @@ export class FooterListComponent implements OnInit {
     private modal: Modal,
     private toastr: ToastrService,
     private dashboardService: DashboardService,
-    private footerService: FooterService,
     private spinner: NgxSpinnerService,
     private authSer: AuthServiceService) { }
 

+ 1 - 1
src/app/dashboard/header/header.component.ts

@@ -65,7 +65,7 @@ export class HeaderComponent implements OnInit {
   onLogout() {
     localStorage.clear();
     //localStorage.setItem('token' , '');
-    this.router.navigate(['login']);
+    this.router.navigate(['auth/login']);
   }
 
   onInternalPage() {

+ 6 - 8
src/app/dashboard/internal-services/add-internal-services/add-internal-services.component.ts

@@ -1,5 +1,5 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { HttpClient } from '@angular/common/http';
-import { InternalSerService } from './../../../shared/internal-ser.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { ActivatedRoute, Params } from '@angular/router';
 import { Subscription, empty } from 'rxjs';
@@ -20,7 +20,7 @@ import { ToastrService } from 'ngx-toastr';
 export class AddInternalServicesComponent implements OnInit {
 
   constructor(private formBuilder: FormBuilder, 
-    private internalServices: InternalSerService, 
+    private dashboardSer: DashboardService, 
     private route: ActivatedRoute,
     private spinner: NgxSpinnerService,
     private toastr: ToastrService, 
@@ -74,7 +74,7 @@ export class AddInternalServicesComponent implements OnInit {
     this.authSer.showDashboardHeader = true;
     this.authSer.internalHeader = false;
 
-    this.internalServices.getInternalPages().subscribe(
+    this.dashboardSer.getInternalPages().subscribe(
       (responce) => {
         console.log(responce);
         this.internalPages = responce['pages'];
@@ -113,7 +113,7 @@ export class AddInternalServicesComponent implements OnInit {
             this.typeMode = true;
             this.pageId = params['editInternalId'];
 
-            this.internalServices.getInternalData(this.pageId).subscribe(
+            this.dashboardSer.getItemData(this.pageId, 'internalSer').subscribe(
               (responce) => {
 
                 console.log('responcce', responce);
@@ -365,7 +365,7 @@ export class AddInternalServicesComponent implements OnInit {
       if(this.checkValidateField) {
         console.log('valid imagaes');
       } else {
-        this.internalServices.editInternal(this.pageId, formInternalData).subscribe(
+        this.dashboardSer.editItem(this.pageId, formInternalData, 'internalSer').subscribe(
           (responce) => {
             console.log(responce);
             this.toastr.success('تم التعديل بنجاح ');
@@ -381,8 +381,6 @@ export class AddInternalServicesComponent implements OnInit {
       
 
     } else {
-      //save create 
-
 
       //for loop to add photo & photo type in form data 
       for(let i = 0; i< formInternalData['fields'].length; i++) {
@@ -422,7 +420,7 @@ export class AddInternalServicesComponent implements OnInit {
       if(this.checkValidateField) {
         console.log('logical images error');
       }else {
-        this.internalServices.addInternal(formInternalData).subscribe(
+        this.dashboardSer.addItem(formInternalData, 'internalSer').subscribe(
           (responce) => {
             console.log(responce);
             this.toastr.success('تم الاضافه بنجاح');

+ 8 - 8
src/app/dashboard/internal-services/internal-services.component.ts

@@ -1,3 +1,4 @@
+import { DashboardService } from './../../shared/dashboard.service';
 import { Modal } from 'ngx-modialog/plugins/bootstrap';
 import { AuthServiceService } from './../../shared/auth-service.service';
 import { ActivatedRoute, Router, Params } from '@angular/router';
@@ -5,7 +6,6 @@ import { Component, OnInit } from '@angular/core';
 import { NgxSpinnerService } from 'ngx-spinner';
 import { ToastrService } from 'ngx-toastr';
 import { UserService } from '../../shared/user.service';
-import { InternalSerService } from '../../shared/internal-ser.service';
 
 
 @Component({
@@ -22,7 +22,7 @@ export class InternalServicesComponent implements OnInit {
     private spinner: NgxSpinnerService,
     private toastr: ToastrService,
     private modal: Modal,
-    private internalService: InternalSerService) { }
+    private dashboardSer: DashboardService) { }
 
   dataList = [];
   dataListIds = [];
@@ -70,7 +70,7 @@ export class InternalServicesComponent implements OnInit {
         this.userLoginId = params['userID'];
         this.serviceId = params['serviceID'];
 
-        this.internalService.getInternalsList(this.pageId , this.currentPage, this.dataTableNumber).subscribe(
+        this.dashboardSer.getListData(this.pageId , this.currentPage, this.dataTableNumber).subscribe(
           (responce) => {
             console.log(responce);
             this.dataList = responce['internal_services'];
@@ -146,13 +146,13 @@ export class InternalServicesComponent implements OnInit {
         .open();
           dialogRef.result
           .then( result => 
-            this.internalService.deleteDatas(this.dataListIds, this.pageId).subscribe(
+            this.dashboardSer.deleteItem(this.dataListIds, this.pageId).subscribe(
               (responce) => {
                 console.log(responce);
                 this.toastr.success('تم الحذف');
                 this.spinner.show();
                 this.dataList = [];
-                this.internalService.getInternalsList(this.pageId , this.currentPage, this.dataTableNumber).subscribe(
+                this.dashboardSer.getListData(this.pageId , this.currentPage, this.dataTableNumber).subscribe(
                   (responce) => {
                     console.log(responce);
                     this.dataList = responce['internal_services'];
@@ -184,7 +184,7 @@ export class InternalServicesComponent implements OnInit {
     this.currentPage = 1;
     console.log('search curent page', this.currentPage);
     console.log('search page id', this.pageId);
-      this.internalService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+      this.dashboardSer.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.dataList = responce['internal_services'];
@@ -206,7 +206,7 @@ export class InternalServicesComponent implements OnInit {
       this.dataList = [];
       //console.log(pagenationNumber);
       //console.log(this.pageId);
-      this.internalService.getInternalsList(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
+      this.dashboardSer.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.dataList = responce['internal_services'];
@@ -227,7 +227,7 @@ export class InternalServicesComponent implements OnInit {
     this.spinner.show();
     this.dataList = [];
     this.dataTableNumber = event.target.value;
-      this.internalService.getInternalsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+      this.dashboardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.dataList = responce['internal_services'];

+ 0 - 0
src/app/dashboard/living-service/living-service-add/living-service-add.component.css


+ 42 - 0
src/app/dashboard/living-service/living-service-add/living-service-add.component.html

@@ -0,0 +1,42 @@
+<div class="addDepartment-w">
+
+    
+  <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"> {{typePage}} </li>
+          </ul>
+        </div>
+      </div>
+
+    <div class="containerContent-w">
+        <form (ngSubmit)="onSubmitted()" #f="ngForm" style="margin-top: 40px;">
+            <div class="row">
+                <div class="col-12 col-sm-12 col-md-4">
+                    <div class="form-group">
+                      <label for="name" style="float: right; margin-right: 5px">اسم التصنيف<span class="spanReqired-w">*</span></label>
+                      <input type="text" class="form-control" id="name" name="name" placeholder="اسم التصنيف" ngModel [ngModel]="formData.name" required/>
+                    </div>
+                  </div>
+              
+            <div class="col-12 col-sm-12 col-md-4">
+              <div class="form-group">
+                <label style="float: right; margin-right: 5px">الحاله</label>
+                <select class="form-control" name="status" [ngModel]="formData.status" required>
+                  <option value="1">فعال</option>
+                  <option value="0">غير فعال</option>
+                </select>
+              </div>
+            </div>
+              
+          </div>
+          <div class=" row col-6">
+              <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid">حفظ</button>
+              <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>
+          </div>
+        </form>
+    </div>
+  </div>
+</div>

+ 104 - 0
src/app/dashboard/living-service/living-service-add/living-service-add.component.ts

@@ -0,0 +1,104 @@
+import { HttpClient } from '@angular/common/http';
+import { NgxSpinnerService } from 'ngx-spinner';
+import { ActivatedRoute, Params } from '@angular/router';
+import { Location } from '@angular/common';
+import { AuthServiceService } from './../../../shared/auth-service.service';
+import { ToastrService } from 'ngx-toastr';
+import { DashboardService } from './../../../shared/dashboard.service';
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { NgForm } from '@angular/forms';
+
+@Component({
+  selector: 'app-living-service-add',
+  templateUrl: './living-service-add.component.html',
+  styleUrls: ['./living-service-add.component.css']
+})
+export class LivingServiceAddComponent implements OnInit {
+
+  constructor(
+    private dashBoardSer: DashboardService,
+    private toastr: ToastrService,
+    private authSer: AuthServiceService,
+    private route: ActivatedRoute,
+    private spinner: NgxSpinnerService,
+    private location: Location,
+    private http: HttpClient
+  ) { }
+
+  @ViewChild('f') definitionForm : NgForm;
+
+  typePage: string = '';
+  locations =[];
+  valueType: string = '';
+  checkSaveclick:boolean = false;
+  check : boolean = false;
+  isEdit: boolean = false;
+  editPageId: number;
+
+  formData = {
+    name: '',
+    status: '1',
+  }
+
+
+  ngOnInit() {
+
+    this.route.params.subscribe(
+      (params: Params) => {
+        this.editPageId = +params['listPageEditId'];
+        console.log(this.editPageId);
+      }
+    );
+
+    if (this.editPageId) {
+      this.spinner.show();
+      this.isEdit = true;
+      this.typePage = 'تعديل';
+      this.dashBoardSer.getItemData(this.editPageId, 'livingService' ).subscribe(
+        res => {
+          console.log('ssss', res);
+          this.formData.name = res['covenant_category'].name;
+          this.formData.status  = res['covenant_category'].status;
+          this.spinner.hide();
+        },
+        err => {
+          console.log(err);
+        }
+      );
+    }else {
+      this.typePage = 'اضافة';
+    }
+
+  }
+  onSubmitted(){
+    console.log('HERE',this.definitionForm.value);
+    if(this.editPageId) {
+      this.dashBoardSer.editItem(this.editPageId, this.definitionForm.value, 'livingService').subscribe(
+        res => {
+          console.log(res);
+          this.toastr.success('تم التعديل بنجاح');
+          this.location.back();
+        },
+        err => {
+          console.log(err);
+          this.toastr.error('خطأ في الخادم ، رجاء المحارله لاحقا');
+        }
+      )
+    } else {
+      this.dashBoardSer.addItem( this.definitionForm.value , 'livingService').subscribe(
+        res => {
+          console.log('ADD',res);
+          this.toastr.success('تم الإضافه بنجاح');
+          this.checkSaveclick = false;
+          this.location.back();
+        },
+        err => {
+          console.log(err);
+          this.checkSaveclick = false;
+          this.toastr.error('خطأ في الخادم ، حاول لاحقا');
+        }
+      );
+      }
+  }
+
+}

+ 30 - 0
src/app/dashboard/living-service/living-service-list/living-service-list.component.css

@@ -0,0 +1,30 @@
+.table {
+    margin: 30px 0;
+}
+
+.dashButton-w {
+    float: right;
+    margin: 10px;
+}
+
+.custom-control-label::after,
+.custom-control-label::before {
+    width: 1.5rem;
+    height: 1.5rem;
+}
+
+.fixedWidthLabel-w::after,
+.fixedWidthLabel-w::before {
+    width: 1.5rem;
+    height: 1.5rem;
+}
+
+.disblayBlock-w {
+    display: block;
+}
+
+/* .centerIneerItem {
+    display: flex;
+    justify-content: center;
+    text-align: center;
+} */

+ 79 - 0
src/app/dashboard/living-service/living-service-list/living-service-list.component.html

@@ -0,0 +1,79 @@
+<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-12 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>
+
+    <table class="table table-bordered" *ngIf="this.count != 0">
+      <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="authSer.showEditBtn">تعديل</th>
+        </tr>
+      </thead>
+      <tbody>
+        <tr *ngFor="let data of dataList | 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="{{data.id}}" [(ngModel)]="data.selected" [value]='data' (change)="checkIfAllSelected();">
+              <!-- <label class="custom-control-label disblayBlock-w" for="{{tab.id}}" style="color:#2a2a2a"></label> -->
+            </div>
+          </td>
+          <td>{{data.name}}</td>
+          <td>{{data.status == '0' ? 'غير فعال' : data.status == '1' ? ' فعال' : '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>

+ 279 - 0
src/app/dashboard/living-service/living-service-list/living-service-list.component.ts

@@ -0,0 +1,279 @@
+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 { Modal } from 'ngx-modialog/plugins/bootstrap';
+import { UserService } from '../../../shared/user.service';
+import { ToastrService } from 'ngx-toastr';
+
+@Component({
+  selector: 'app-living-service-list',
+  templateUrl: './living-service-list.component.html',
+  styleUrls: ['./living-service-list.component.css']
+})
+export class LivingServiceListComponent implements OnInit {
+
+  dataList = [];
+  pages= [];
+  pageId: number;
+  Ids = [];
+  count: number;
+  perPagePagenation: number;
+  currentPage:number = 1;
+  filtterStatus = 'all';
+  selectedAll: any;
+  userLoginId:number;
+  serviceId:number;
+  dataTableNumber: number = 5;
+  absorpationListIds = [];
+  dataListIds = [];
+
+  constructor(
+    private route: ActivatedRoute,
+    private router: Router,
+    private modal: Modal,
+    private userSer: UserService,
+    private spinner: NgxSpinnerService,
+    private authSer: AuthServiceService,
+    private toastr: ToastrService,
+    private dashboardSer: DashboardService,
+    private http: HttpClient
+  ) { }
+
+  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.route.params.subscribe(
+          (parmas: Params) => {
+            this.pageId =  +parmas['listPageId'];
+            localStorage.setItem('pageIdActive', parmas['listPageId']);
+            console.log(this.pageId);
+          }
+        );
+          
+
+        this.route.parent.params.subscribe(
+          (params:Params) => {
+              this.userLoginId = params['userID'];
+              this.serviceId = params['serviceID'];
+             
+      
+              this.userSer.getPagesPermetiotns(this.userLoginId, this.serviceId).subscribe(
+                (responce) => {
+                  console.log(responce);
+                  this.pages = responce['pages'];
+                  for(let i = 0; i< this.pages.length; i++) {
+                    if(this.pages[i].id == 63){
+                      if(this.pages[i]['permissions'][0].name == 'covenant_categories') {
+                        this.authSer.showAddBtn = true;
+                        this.authSer.showEditBtn = true;
+                        this.authSer.showDeleteBtn = true;
+                      } else {
+                        console.log('no permissions');
+                      }
+                    } else {
+                      console.log('no events');
+                    }
+                  }
+                  this.spinner.hide();
+                },
+                (error) => {console.log(error)}
+              );
+            }
+          );
+          console.log('current page',this.pageId)
+          this.dashboardSer.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
+            res => {
+              console.log(res);
+              this.dataList = res['covenant_categories'];
+            this.count = res['count'];
+            this.perPagePagenation = res['per_page'];
+            },
+            err => {
+              console.log(err);
+              
+            }
+
+          );
+  
+  
+  }
+  //make all checkbox of user checked 
+selectAll() {
+  console.log('selected alllllll');
+  for(let i = 0; i < this.dataList.length; i++){
+    this.dataList[i].selected = this.selectedAll;
+  }
+}
+
+checkIfAllSelected() {
+  this.selectedAll = this.absorpationListIds.every(function(item:any) {
+    return item.selected == true;
+  });
+}
+
+filtterFunc(data) {
+  this.dataList =[];
+  this.absorpationListIds = [];
+  console.log(data.target.value);
+  const dataSearch = data.target.value;     
+  this.currentPage = 1;
+  console.log('search curent page', this.currentPage);
+  console.log('search page id', this.pageId);
+  this.dashboardSer.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+    res => {
+      console.log(res);
+      this.dataList = res['covenant_categories'];
+      console.log('hey',this.dataList)
+      this.count = res['count'];
+      this.perPagePagenation = res['per_page'];
+      console.log('filtter count', this.count);
+      console.log('filtter perPagePAgenation', this.perPagePagenation);
+    },
+    err => {
+      console.log(err);
+    }
+  );
+};
+
+onPageChange(pagenationNumber) {
+  this.spinner.show();
+  this.currentPage = pagenationNumber;
+  this.absorpationListIds = [];
+  console.log(pagenationNumber);
+  console.log(this.pageId);
+  this.dashboardSer.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
+    res => {
+      console.log(res);
+      this.dataList = res['covenant_categories'];
+      this.count = res['count'];
+      this.perPagePagenation = res['per_page'];
+      console.log('FFFFFF', this.absorpationListIds);
+      this.spinner.hide();
+    },
+    err => {
+      console.log(err);
+      this.spinner.hide();
+    }
+  );
+}
+
+//determine the list count from select element 
+onGetValue(event) {
+  this.spinner.show();
+  this.absorpationListIds = [];
+  this.dataTableNumber = event.target.value;
+  this.dashboardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+    res => {
+      console.log(res);
+      this.absorpationListIds = res['covenant_categories'];
+      this.count = res['count'];
+      this.perPagePagenation = res['per_page'];
+      this.spinner.hide();
+    },
+    err => {
+      console.log(err);
+      this.spinner.hide();
+    }
+  );
+};
+
+onGetValueFiltter(event) {
+  console.log(event.target.value)
+  this.spinner.show();
+  this.dataList = [];
+  const typeId = event.target.value;
+  this.filtterStatus = event.target.value;
+  console.log(this.filtterStatus);
+  this.http.get(this.authSer.pathApi +'/page_list/' + this.pageId + '/' + this.currentPage + '/' + this.dataTableNumber + '/' + typeId).subscribe(
+    res => {
+      console.log(res);
+      this.dataList = res['covenant_categories'];
+      this.count = res['count'];
+      this.perPagePagenation = res['per_page'];
+      this.spinner.hide();
+      console.log('UrL>>', this.authSer.pathApi +'/page_list/' + this.pageId + '/' + this.currentPage + '/' + this.dataTableNumber + '/' + typeId)
+    },
+    err=> {
+      console.log(err);
+    }
+  );
+}
+
+onDelete() {
+
+  this.dataListIds = [];
+  for(let i = 0; i < this.dataList.length; i++) {
+    if(this.dataList[i].selected == true) {
+      this.dataListIds.push(this.dataList[i].id);
+    }
+  }
+  console.log(this.dataListIds);
+
+  if(this.dataListIds.length > 0) {
+    const dialogRef = this.modal.alert()
+    .size('sm')
+    .showClose(true)
+    .title('تأكيد الحذف')
+    .body(`
+        <h4>هل ترغب في حذف العناصر المحدده ؟ </h4>
+        `)
+    .open();
+
+      dialogRef.result
+      .then( result =>
+        this.dashboardSer.deleteItem(this.dataListIds , this.pageId).subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تم الحذف');
+            this.spinner.show();
+            this.dataList = [];
+             //get list data
+            this.dashboardSer.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
+              (responce) => {
+                console.log(responce);
+                this.dataList = responce['covenant_categories'];
+                this.count = responce['count'];
+                this.perPagePagenation = responce['per_page'];
+                this.spinner.hide();
+              },
+              (error) => {
+                console.log(error);
+                this.spinner.hide();
+              }
+            );
+          },
+          (error) => {
+            console.log(error);
+            this.spinner.hide();
+            },
+          )
+      );
+  } else {
+    this.toastr.warning('لم يتم إختيار أي عنصر للمسح !');
+  }
+};
+onAdd() {
+  this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'livingService/add']);
+}
+
+onEdit(editId: number) {
+  this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'livingService/edit/' + editId]);
+}
+
+}

+ 2 - 4
src/app/dashboard/main-menu/add-menu/add-menu.component.ts

@@ -1,6 +1,5 @@
 import { HttpClient } from '@angular/common/http';
 import { DashboardService } from './../../../shared/dashboard.service';
-import { MainMenuService } from './../../../shared/main-menu.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { ActivatedRoute, Params } from '@angular/router';
 import { Location } from '@angular/common';
@@ -56,8 +55,7 @@ export class AddMenuComponent implements OnInit {
     private authSer: AuthServiceService,
     private authService: AuthServiceService,
     private dashBoardService: DashboardService,
-    private http: HttpClient,
-    private menuService: MainMenuService, ) { 
+    private http: HttpClient ) { 
       this.spinner.show();
     }
 
@@ -128,7 +126,7 @@ export class AddMenuComponent implements OnInit {
       }
     );
 
-    this.menuService.getParentList().subscribe(
+    this.dashBoardService.getParentList().subscribe(
       (responce) => {
         console.log('parents' , responce);
         this.parentList = responce['menus'];

+ 0 - 27
src/app/dashboard/main-menu/main-list/main-list.component.ts

@@ -1,5 +1,4 @@
 import { DashboardService } from './../../../shared/dashboard.service';
-import { MainMenuService } from './../../../shared/main-menu.service';
 import { Component, OnInit } from '@angular/core';
 import { HttpClient } from '@angular/common/http';
 import { AuthServiceService } from './../../../shared/auth-service.service';
@@ -197,32 +196,6 @@ export class MainListComponent implements OnInit {
       );
     }
 
-  // changeRanking(event, id) {
-  //   const data = {
-  //     id: id,
-  //     ranking: event.target.value,
-  //   };
-  //   console.log(data);
-  //   this.http.post(this.authSer.pathApi + '/rank_menu', data).subscribe(
-  //     (responce) => {
-  //       console.log(responce);
-  //       this.mainService.getMainList(this.menuId, this.currentPage, this.dataTableNumber).subscribe(
-  //         (responce) => {
-  //           console.log(responce);
-  //           this.count = responce['count'];
-  //           this.perPagePagenation = responce['per_page'];
-  //           this.menuList = responce['menus'];
-  //           console.log(this.menuList);
-  //           this.spinner.hide();
-  //         },
-  //         (error) => {
-  //           console.log(error);
-  //         }
-  //       )
-  //     },
-  //     (error) => {console.log(error)},
-  //   );
-  // };
 
   //determine the list count from select element 
   onGetValue(event) {

+ 1 - 3
src/app/dashboard/news/add-news/add-news.component.ts

@@ -5,7 +5,6 @@ import { NgxSpinnerService } from 'ngx-spinner';
 import { ActivatedRoute, Params } from '@angular/router';
 import { ToastrService } from 'ngx-toastr';
 import { Location } from '@angular/common';
-import { NewService } from './../../../shared/new.service';
 import { Component, OnInit, ViewChild } from '@angular/core';
 import { UserService } from '../../../shared/user.service';
 import { NgForm } from '@angular/forms';
@@ -70,8 +69,7 @@ export class AddNewsComponent implements OnInit {
 
 
 
-  constructor(private newService: NewService,
-    private userService: UserService,
+  constructor(private userService: UserService,
     private authSer: AuthServiceService,
     private location: Location,
     private toastr: ToastrService,

+ 1 - 3
src/app/dashboard/news/news-list/news-list.component.ts

@@ -6,7 +6,6 @@ import { ActivatedRoute, Params, Router } from '@angular/router';
 import { Component, OnInit } from '@angular/core';
 import { ToastrService } from 'ngx-toastr';
 import { NgxSpinnerService } from 'ngx-spinner';
-import { NewService } from '../../../shared/new.service';
 import { Modal } from 'ngx-modialog/plugins/bootstrap';
 
 @Component({
@@ -21,7 +20,6 @@ export class NewsListComponent implements OnInit {
     private userSer: UserService,
     private http: HttpClient,
     private toastr: ToastrService,
-    private newService: NewService,
     private modal: Modal,
     private dashBoardService: DashboardService,
     private spinner: NgxSpinnerService,
@@ -215,7 +213,7 @@ export class NewsListComponent implements OnInit {
       this.http.post(this.authSer.pathApi + '/rank_report', data).subscribe(
         (responce) => {
           console.log(responce);
-          this.newService.getnewsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+          this.dashBoardService.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
             (responce) => {
               console.log(responce);
               this.count = responce['count'];

+ 0 - 0
src/app/dashboard/record-info-building/record-info-building-add/record-info-building-add.component.css


+ 77 - 0
src/app/dashboard/record-info-building/record-info-building-add/record-info-building-add.component.html

@@ -0,0 +1,77 @@
+<div class="addDepartment-w">
+
+    
+  <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"> {{typePage}} </li>
+          </ul>
+        </div>
+      </div>
+
+    <div class="containerContent-w">
+        <form (ngSubmit)="onSubmitted()" #f="ngForm" style="margin-top: 40px;">
+            <div class="row">
+       
+          <div class="col-12 col-sm-12 col-md-4">
+            <div class="form-group">
+              <label for="complex_number" style="float: right; margin-right: 5px">رقم المجمع السكني<span class="spanReqired-w">*</span></label>
+              <input type="number" class="form-control" id="complex_number" name="complex_number" placeholder="رقم المجمع السكني" ngModel [(ngModel)]="formData.complex_number" required/>
+            </div>
+          </div>
+
+          <div class="col-12 col-sm-12 col-md-4">
+            <div class="form-group">
+              <label for="name" style="float: right; margin-right: 5px">اسم المجمع السكني<span class="spanReqired-w">*</span></label>
+              <input type="text" class="form-control" id="name" name="name" placeholder="اسم المجمع السكني" ngModel [(ngModel)]="formData.name" required/>
+            </div>
+          </div>
+
+          <div class="col-12 col-sm-12 col-md-4">
+            <div class="form-group">
+              <label for="land_area" style="float: right; margin-right: 5px">مساحة الأرض الإجمالية<span class="spanReqired-w">*</span></label>
+              <input type="text" class="form-control" id="land_area" name="land_area" placeholder="عدد العماير" ngModel [(ngModel)]="formData.land_area" required/>
+            </div>
+          </div>
+
+          <div class="col-12 col-sm-12 col-md-4" >
+            <div class="form-group">
+              <label style="float: right; margin-right: 5px">الحاله</label>
+              <select class="form-control" name="status" [(ngModel)]="formData.status" required>
+                <option value="1">فعال</option>
+                <option value="0">غير فعال</option>
+              </select>
+            </div>
+          </div>
+              
+          </div>
+          <div class="row">
+            <div class="ol-12">
+                <h3>انواع المباني</h3>
+            </div>
+          
+            <div class="col-12 col-sm-12 col-md-12" *ngFor="let building of formData.building_types; let i = index" style="padding: 20px;">
+              <div class="form-group">
+                <div class="col-4">
+                <input type="text" class="form-control" id="building_types" name="building.name" placeholder="نوع المنى" ngModel [(ngModel)]="building.name" required/>
+              </div>
+              <div class="col-4">
+                  <input type="number" class="form-control" id="building_types" name="building.value" placeholder="عدد المبنى" ngModel [(ngModel)]="building.value" required/>
+              </div>
+              <div class="col-3">
+                  <button type="button" class="btn btn-danger" (click)="onDeleteRow(i)" style="margin: 10px 15px;">حذف</button>
+              </div>
+              </div>
+            </div>
+            <button type="button" class="btn btn-success rightW"  (click)="plusBuilding()">اضافة نوع جديد</button>
+          </div>
+          <div class=" row col-6">
+              <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid">حفظ</button>
+              <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>
+          </div>
+        </form>
+    </div>
+  </div>
+</div>

+ 132 - 0
src/app/dashboard/record-info-building/record-info-building-add/record-info-building-add.component.ts

@@ -0,0 +1,132 @@
+import { HttpClient } from '@angular/common/http';
+import { NgxSpinnerService } from 'ngx-spinner';
+import { ActivatedRoute, Params } from '@angular/router';
+import { Location } from '@angular/common';
+import { AuthServiceService } from './../../../shared/auth-service.service';
+import { ToastrService } from 'ngx-toastr';
+import { DashboardService } from './../../../shared/dashboard.service';
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { NgForm } from '@angular/forms';
+
+
+@Component({
+  selector: 'app-record-info-building-add',
+  templateUrl: './record-info-building-add.component.html',
+  styleUrls: ['./record-info-building-add.component.css']
+})
+export class RecordInfoBuildingAddComponent implements OnInit {
+
+  constructor(
+    private dashBoardSer: DashboardService,
+    private toastr: ToastrService,
+    private authSer: AuthServiceService,
+    private route: ActivatedRoute,
+    private spinner: NgxSpinnerService,
+    private location: Location,
+    private http: HttpClient
+  ) { }
+
+  @ViewChild('f') definitionForm : NgForm;
+
+  typePage: string = '';
+  locations =[];
+  valueType: string = '';
+  checkSaveclick:boolean = false;
+  check : boolean = false;
+  isEdit: boolean = false;
+  editPageId: number;
+
+  formData = {
+    complex_number : '',
+    name : '',
+    land_area : '',
+    status: '',
+    building_types:[
+      {
+        name : '',
+        value : ''
+      }
+    ]
+  }
+  
+
+  ngOnInit() {
+
+    this.route.params.subscribe(
+      (params: Params) => {
+        this.editPageId = +params['listPagEditId'];
+        console.log(this.editPageId);
+      }
+    );
+
+    if (this.editPageId) {
+      this.spinner.show();
+      this.isEdit = true;
+      this.typePage = 'تعديل';
+      this.dashBoardSer.getItemData(this.editPageId, 'recordInfoBuilding' ).subscribe(
+        res => {
+          console.log('ssss', res);
+          const array =this.formData.building_types;
+          this.formData.name = res['housing_complex'].complex_number;
+          this.formData.name = res['housing_complex'].name;
+          this.formData.name = res['housing_complex'].land_area;
+          this.formData.status  = res['housing_complex'].status;
+          for (let i = 0,n = array.length; i < n ; i++) {
+           array[i] = res['housing_complex'].building_types[i];
+            
+          }
+          this.spinner.hide();
+        },
+        err => {
+          console.log(err);
+        }
+      );
+    }else {
+      this.typePage = 'اضافة';
+    }
+  }
+  plusBuilding(){
+    this.formData.building_types.push({
+      name:'',
+      value:''
+    });
+    console.log('forms after plus' , this.formData.building_types);
+     }
+     onDeleteRow(index:number) {
+      this.formData.building_types.splice(index , 1);
+      console.log('files after delete ',this.formData.building_types);
+    }
+    onSubmitted(){
+    console.log('HERE',this.definitionForm.value);
+    console.log(this.formData);
+    
+    if(this.editPageId) {
+      this.dashBoardSer.editItem(this.editPageId, this.definitionForm.value, 'recordInfoBuilding').subscribe(
+        res => {
+          console.log(res);
+          this.toastr.success('تم التعديل بنجاح');
+          this.location.back();
+        },
+        err => {
+          console.log(err);
+          this.toastr.error('خطأ في الخادم ، رجاء المحارله لاحقا');
+        }
+      )
+    } else {
+      this.dashBoardSer.addItem( this.definitionForm.value , 'recordInfoBuilding').subscribe(
+        res => {
+          console.log('ADD',res);
+          this.toastr.success('تم الإضافه بنجاح');
+          this.checkSaveclick = false;
+          this.location.back();
+        },
+        err => {
+          console.log(err);
+          this.checkSaveclick = false;
+          this.toastr.error('خطأ في الخادم ، حاول لاحقا');
+        }
+      );
+      }
+  }
+
+}

+ 30 - 0
src/app/dashboard/record-info-building/record-info-building-list/record-info-building-list.component.css

@@ -0,0 +1,30 @@
+.table {
+    margin: 30px 0;
+}
+
+.dashButton-w {
+    float: right;
+    margin: 10px;
+}
+
+.custom-control-label::after,
+.custom-control-label::before {
+    width: 1.5rem;
+    height: 1.5rem;
+}
+
+.fixedWidthLabel-w::after,
+.fixedWidthLabel-w::before {
+    width: 1.5rem;
+    height: 1.5rem;
+}
+
+.disblayBlock-w {
+    display: block;
+}
+
+/* .centerIneerItem {
+    display: flex;
+    justify-content: center;
+    text-align: center;
+} */

+ 89 - 0
src/app/dashboard/record-info-building/record-info-building-list/record-info-building-list.component.html

@@ -0,0 +1,89 @@
+<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-12 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>
+
+    <table class="table table-bordered" *ngIf="this.count != 0">
+      <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>عدد المباني</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>
+            <div class="custom-control custom-checkbox centerIneerItem">
+              <input type="checkbox" class="custom-control-input" id="{{data.id}}" [(ngModel)]="data.selected" [value]='data' (change)="checkIfAllSelected();">
+              <!-- <label class="custom-control-label disblayBlock-w" for="{{tab.id}}" style="color:#2a2a2a"></label> -->
+            </div>
+          </td>
+          <td>{{data.complex_number}}</td>
+          <td>{{data.name}}</td>
+          <td>{{data.buildings_number}}</td>
+          <td>{{data.villas_number}}</td>
+          <td>{{data.mini_buildings_number}}</td>
+          <td>{{data.land_area}}</td>
+          <td>{{data.status == '0' ? 'غير فعال' : data.status == '1' ? ' فعال' : '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>

+ 278 - 0
src/app/dashboard/record-info-building/record-info-building-list/record-info-building-list.component.ts

@@ -0,0 +1,278 @@
+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 { Modal } from 'ngx-modialog/plugins/bootstrap';
+import { UserService } from '../../../shared/user.service';
+import { ToastrService } from 'ngx-toastr';
+
+@Component({
+  selector: 'app-record-info-building-list',
+  templateUrl: './record-info-building-list.component.html',
+  styleUrls: ['./record-info-building-list.component.css']
+})
+export class RecordInfoBuildingListComponent implements OnInit {
+
+  dataList = [];
+  pages= [];
+  pageId: number;
+  Ids = [];
+  count: number;
+  perPagePagenation: number;
+  currentPage:number = 1;
+  filtterStatus = 'all';
+  selectedAll: any;
+  userLoginId:number;
+  serviceId:number;
+  dataTableNumber: number = 5;
+  absorpationListIds = [];
+  dataListIds = [];
+
+
+  constructor(
+    private route: ActivatedRoute,
+    private router: Router,
+    private modal: Modal,
+    private userSer: UserService,
+    private spinner: NgxSpinnerService,
+    private authSer: AuthServiceService,
+    private toastr: ToastrService,
+    private dashboardSer: DashboardService,
+    private http: HttpClient
+  ) { }
+
+  ngOnInit() {
+
+            //init the values of permision boolean
+   this.authSer.showAddBtn = true;
+   this.authSer.showDeleteBtn = true;
+   this.authSer.showEditBtn = true;
+    //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.route.params.subscribe(
+      (parmas: Params) => {
+        this.pageId =  +parmas['listPageId'];
+        localStorage.setItem('pageIdActive', parmas['listPageId']);
+        console.log(this.pageId);
+      }
+    );
+      
+    this.route.parent.params.subscribe(
+      (params:Params) => {
+          this.userLoginId = params['userID'];
+          this.serviceId = params['serviceID'];
+         
+  
+          this.userSer.getPagesPermetiotns(this.userLoginId, this.serviceId).subscribe(
+            (responce) => {
+              console.log(responce);
+              this.pages = responce['pages'];
+              for(let i = 0; i< this.pages.length; i++) {
+                if(this.pages[i].id == 63){
+                  if(this.pages[i]['permissions'][0].name == 'housing_complexes_information') {
+                    this.authSer.showAddBtn = true;
+                    this.authSer.showEditBtn = true;
+                    this.authSer.showDeleteBtn = true;
+                  } else {
+                    console.log('no permissions');
+                  }
+                } else {
+                  console.log('no events');
+                }
+              }
+              this.spinner.hide();
+            },
+            (error) => {console.log(error)}
+          );
+        }
+      );
+
+      console.log('current page',this.pageId)
+      this.dashboardSer.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
+        res => {
+          console.log('',res);
+          this.dataList = res['housing_complexes'];
+          this.count = res['count'];
+          this.perPagePagenation = res['per_page'];
+        },
+        err => {
+          console.log(err);
+          
+        }
+
+      );
+
+  }
+
+  selectAll() {
+    console.log('selected alllllll');
+    for(let i = 0; i < this.dataList.length; i++){
+      this.dataList[i].selected = this.selectedAll;
+    }
+  }
+  
+  checkIfAllSelected() {
+    this.selectedAll = this.absorpationListIds.every(function(item:any) {
+      return item.selected == true;
+    });
+  }
+
+
+  filtterFunc(data) {
+    this.dataList =[];
+    this.absorpationListIds = [];
+    console.log(data.target.value);
+    const dataSearch = data.target.value;     
+    this.currentPage = 1;
+    console.log('search curent page', this.currentPage);
+    console.log('search page id', this.pageId);
+    this.dashboardSer.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+      res => {
+        console.log(res);
+        this.dataList = res['housing_complexes'];
+        console.log('hey',this.dataList)
+        this.count = res['count'];
+        this.perPagePagenation = res['per_page'];
+        console.log('filtter count', this.count);
+        console.log('filtter perPagePAgenation', this.perPagePagenation);
+      },
+      err => {
+        console.log(err);
+      }
+    );
+  };
+
+  onPageChange(pagenationNumber) {
+    this.spinner.show();
+    this.currentPage = pagenationNumber;
+    this.absorpationListIds = [];
+    console.log(pagenationNumber);
+    console.log(this.pageId);
+    this.dashboardSer.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
+      res => {
+        console.log(res);
+        this.dataList = res['housing_complexes'];
+        this.count = res['count'];
+        this.perPagePagenation = res['per_page'];
+        console.log('FFFFFF', this.absorpationListIds);
+        this.spinner.hide();
+      },
+      err => {
+        console.log(err);
+        this.spinner.hide();
+      }
+    );
+  }
+
+  //determine the list count from select element 
+onGetValue(event) {
+  this.spinner.show();
+  this.absorpationListIds = [];
+  this.dataTableNumber = event.target.value;
+  this.dashboardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+    res => {
+      console.log(res);
+      this.absorpationListIds = res['housing_complexes'];
+      this.count = res['count'];
+      this.perPagePagenation = res['per_page'];
+      this.spinner.hide();
+    },
+    err => {
+      console.log(err);
+      this.spinner.hide();
+    }
+  );
+};
+
+onGetValueFiltter(event) {
+  console.log(event.target.value)
+  this.spinner.show();
+  this.dataList = [];
+  const typeId = event.target.value;
+  this.filtterStatus = event.target.value;
+  console.log(this.filtterStatus);
+  this.http.get(this.authSer.pathApi +'/page_list/' + this.pageId + '/' + this.currentPage + '/' + this.dataTableNumber + '/' + typeId).subscribe(
+    res => {
+      console.log(res);
+      this.dataList = res['housing_complexes'];
+      this.count = res['count'];
+      this.perPagePagenation = res['per_page'];
+      this.spinner.hide();
+      console.log('UrL>>', this.authSer.pathApi +'/page_list/' + this.pageId + '/' + this.currentPage + '/' + this.dataTableNumber + '/' + typeId)
+    },
+    err=> {
+      console.log(err);
+    }
+  );
+}
+onDelete() {
+
+  this.dataListIds = [];
+  for(let i = 0; i < this.dataList.length; i++) {
+    if(this.dataList[i].selected == true) {
+      this.dataListIds.push(this.dataList[i].id);
+    }
+  }
+  console.log(this.dataListIds);
+
+  if(this.dataListIds.length > 0) {
+    const dialogRef = this.modal.alert()
+    .size('sm')
+    .showClose(true)
+    .title('تأكيد الحذف')
+    .body(`
+        <h4>هل ترغب في حذف العناصر المحدده ؟ </h4>
+        `)
+    .open();
+
+      dialogRef.result
+      .then( result =>
+        this.dashboardSer.deleteItem(this.dataListIds , this.pageId).subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تم الحذف');
+            this.spinner.show();
+            this.dataList = [];
+             //get list data
+            this.dashboardSer.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
+              (responce) => {
+                console.log(responce);
+                this.dataList = responce['housing_complexes'];
+                this.count = responce['count'];
+                this.perPagePagenation = responce['per_page'];
+                this.spinner.hide();
+              },
+              (error) => {
+                console.log(error);
+                this.spinner.hide();
+              }
+            );
+          },
+          (error) => {
+            console.log(error);
+            this.spinner.hide();
+            },
+          )
+      );
+  } else {
+    this.toastr.warning('لم يتم إختيار أي عنصر للمسح !');
+  }
+};
+onAdd() {
+  this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'recordInfoBuilding']);
+}
+
+onEdit(editId: number) {
+  this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'recordInfoBuilding/edit/' + editId]);
+}
+
+
+}

+ 1 - 1
src/app/dashboard/reports-page/reports-page.component.html

@@ -3,7 +3,7 @@
     <div class="row">
       <div class="col-12">
           <ul class="list-unstyled titileLi-w">
-            <li class="headingText-w">خدمه الصلاحيات / </li>
+            <li class="headingText-w">خدمه الصلاحيات </li>
             <li class="headingText-w activeLi-w" style="margin-right:5px">التقارير</li>
           </ul>
       </div>

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

@@ -3,8 +3,8 @@
     <div class="row">
       <div class="col-12">
         <ul class="list-unstyled titileLi-w">
-          <li class="headingText-w">خدمه الصلاحيات > </li>
-          <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">المجموعات > </li>
+          <li class="headingText-w">خدمه الصلاحيات </li>
+          <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">المجموعات</li>
           <li class="headingText-w activeLi-w" style="margin-right:5px">  {{typeLink}} </li>
         </ul>
       </div>

+ 6 - 15
src/app/dashboard/roles/add-roles/add-roles.component.ts

@@ -1,10 +1,10 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { HttpClient } from '@angular/common/http';
 import { Location } from '@angular/common';
 import { Router, ActivatedRoute, Params } from '@angular/router';
 import { UserService } from './../../../shared/user.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { NgForm } from '@angular/forms';
-import { RolesService } from './../../../shared/roles.service';
 import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core';
 import { ToastrService } from 'ngx-toastr';
 import { NgxSpinnerService } from 'ngx-spinner';
@@ -17,7 +17,7 @@ import { Subscription } from 'rxjs';
 })
 
 export class AddRolesComponent implements OnInit, OnDestroy {
-  constructor(private rolesService: RolesService,
+  constructor(private dashboardSer: DashboardService,
       private userService: UserService,
       private location: Location,
       private toastr: ToastrService,
@@ -64,7 +64,7 @@ export class AddRolesComponent implements OnInit, OnDestroy {
     this.authSer.showDashboardHeader = true;
     this.authSer.internalHeader = false;
     
-    this.rolesService.getPermissionList().subscribe(
+    this.dashboardSer.getPermissionList().subscribe(
       (responce) => {
         this.pages = responce['services'];
         for(let i = 0; i < this.pages.length; i++){
@@ -93,7 +93,7 @@ export class AddRolesComponent implements OnInit, OnDestroy {
           this.checkModePage = true;
           this.roleId = params['roleEditId'];
           //alert(this.checkModePage);
-          this.rolesService.getRoleData(this.roleId).subscribe(
+          this.dashboardSer.getItemData(this.roleId, 'role').subscribe(
             (responce) => {
               console.log('rrrrrr',responce);
               this.user.roleName = responce['role'].role_name;
@@ -144,15 +144,6 @@ export class AddRolesComponent implements OnInit, OnDestroy {
 
   onSubmitted() {
 
-    // for(let i = 0 ; i < this.pages.length; i++) {
-    //   for(let j = 0 ; j < this.pages[i].permissions.length ; j++) {
-    //     if(this.pages[i].permissions[j].selected == true) {
-    //       alert(this.pages[i].permissions[j].name)
-    //       this.permisionsId.push(this.pages[i].permissions[j].id);
-    //     }
-    //   } 
-    // };
-
     this.checkSaveDisabled = true;
 
     for(let i = 0; i < this.allPages.length; i++) {
@@ -169,7 +160,7 @@ export class AddRolesComponent implements OnInit, OnDestroy {
     console.log(this.addRoleData);
 
     if(this.checkModePage){      
-      this.rolesService.editRole(this.addRoleData.value, this.roleId).subscribe(
+      this.dashboardSer.editItem( this.roleId, this.addRoleData.value , 'role').subscribe(
         (responce) => {
           this.checkSaveDisabled = false;
           this.toastr.success('تم التعديل');
@@ -182,7 +173,7 @@ export class AddRolesComponent implements OnInit, OnDestroy {
         }
       );
     } else {
-      this.rolesService.addRoles(this.addRoleData).subscribe(
+      this.dashboardSer.addItem(this.addRoleData.value, 'role').subscribe(
         (responce)=>{
           this.checkSaveDisabled = false;
           this.toastr.success('تم الاضافه بنجاح');

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

@@ -1,8 +1,8 @@
 import { UserService } from './../../../shared/user.service';
-import { RolesService } from './../../../shared/roles.service';
 import { ActivatedRoute, Params } from '@angular/router';
 import { Component, OnInit } from '@angular/core';
 import { NgxSpinnerService } from 'ngx-spinner';
+import { DashboardService } from '../../../shared/dashboard.service';
 
 @Component({
   selector: 'app-role-report',
@@ -18,7 +18,7 @@ export class RoleReportComponent implements OnInit {
   reportPages = [];
 
   constructor(private route: ActivatedRoute, 
-    private roleService:RolesService, 
+    private dashboardSer: DashboardService, 
     private userService: UserService,
     private spinner: NgxSpinnerService ) { 
       this.spinner.show();
@@ -31,7 +31,7 @@ export class RoleReportComponent implements OnInit {
     this.route.params.subscribe(
       (params: Params) => {
         this.roleId = params['roleReportId'];
-        this.roleService.get_report_pages_inside_roles(this.roleId).subscribe(
+        this.dashboardSer.get_report_pages_inside_roles(this.roleId).subscribe(
           (responce) => {
             //console.log(responce);
             this.reportPages.push(responce['role']);

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

@@ -1,6 +1,6 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { ActivatedRoute, Params } from '@angular/router';
 import { Component, OnInit } from '@angular/core';
-import { RolesService } from '../../../shared/roles.service';
 import { UserService } from '../../../shared/user.service';
 import { NgxSpinnerService } from 'ngx-spinner';
 
@@ -14,7 +14,7 @@ export class RoleReport2Component implements OnInit {
 
   roleId: number;
   reportData = [];
-  constructor(private roleServise: RolesService, 
+  constructor(private dashboardSer: DashboardService, 
     private route: ActivatedRoute, 
     private userService: UserService,
     private spinner: NgxSpinnerService) { 
@@ -26,7 +26,7 @@ export class RoleReport2Component implements OnInit {
     this.route.params.subscribe(
       (params:Params) => {
         this.roleId = params['userRoleReportId'];
-        this.roleServise.get_report_users_inside_roles(this.roleId).subscribe(
+        this.dashboardSer.get_report_users_inside_roles(this.roleId).subscribe(
           (repsonce) => {
             //console.log(repsonce);
             this.reportData.push(repsonce['role']);

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

@@ -3,7 +3,7 @@
   <div class="row">
     <div class="col-12">
         <ul class="list-unstyled titileLi-w">
-          <li class="headingText-w">خدمه الصلاحيات > </li>
+          <li class="headingText-w">خدمه الصلاحيات </li>
           <li class="headingText-w activeLi-w" style="margin-right:5px">المجموعات</li>
         </ul>
       <!-- <p class="headingText-w"> </p> -->

+ 9 - 19
src/app/dashboard/roles/roles-list/roles-list.component.ts

@@ -1,7 +1,7 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { Modal } from 'ngx-modialog/plugins/bootstrap';
 import { UserService } from './../../../shared/user.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
-import { RolesService } from './../../../shared/roles.service';
 import { ActivatedRoute, Router, Params } from '@angular/router';
 import { Component, OnInit } from '@angular/core';
 import { NgxSpinnerService } from 'ngx-spinner';
@@ -13,6 +13,7 @@ import { ToastrService } from 'ngx-toastr';
   templateUrl: './roles-list.component.html',
   styleUrls: ['./roles-list.component.css']
 })
+
 export class RolesListComponent implements OnInit {
 
   rolesList = [];
@@ -31,7 +32,7 @@ export class RolesListComponent implements OnInit {
 
   constructor(private route: ActivatedRoute,
       private router: Router,
-      private rolesService: RolesService,
+      private dashoardSer: DashboardService,
       private userSer: UserService,
       private modal: Modal,
       private authSer: AuthServiceService, 
@@ -92,7 +93,7 @@ export class RolesListComponent implements OnInit {
     }
   );
 
-    this.rolesService.getRolesList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+    this.dashoardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
       (responce) => {
         console.log('responce', responce);
         this.rolesList = responce['roles'];
@@ -130,7 +131,7 @@ export class RolesListComponent implements OnInit {
       this.rolesList = [];
       //console.log(pagenationNumber);
       //console.log(this.pageId);
-      this.rolesService.getRolesList(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
+      this.dashoardSer.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.rolesList = responce['roles'];
@@ -154,7 +155,7 @@ export class RolesListComponent implements OnInit {
     this.currentPage = 1;
     console.log('search curent page', this.currentPage);
     console.log('search page id', this.pageId);
-    this.rolesService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+    this.dashoardSer.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.rolesList = responce['roles'];
@@ -174,7 +175,7 @@ export class RolesListComponent implements OnInit {
     this.spinner.show();
     this.rolesList = [];
     this.dataTableNumber = event.target.value;
-    this.rolesService.getRolesList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+    this.dashoardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.rolesList = responce['roles'];
@@ -210,13 +211,13 @@ export class RolesListComponent implements OnInit {
         dialogRef.result
         .then( result =>  
           
-          this.rolesService.deleteUser(this.rolesId).subscribe(
+          this.dashoardSer.deleteItem( this.rolesId , this.pageId).subscribe(
             (responce) => {
               console.log(responce);
               this.toastr.success('تم الحذف');
               this.spinner.show();
               this.rolesList = [];
-              this.rolesService.getRolesList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+              this.dashoardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
                 (responce) => {
                   console.log(responce);
                   this.rolesList = responce['roles'];
@@ -241,17 +242,6 @@ export class RolesListComponent implements OnInit {
         this.toastr.warning('لم يتم إختيار أي عنصر للمسح !');
       }
 
-    this.rolesService.deleteUser(this.rolesId).subscribe(
-      (responce) => {
-        console.log(responce);
-        this.toastr.success('تم الحذف');
-        window.location.reload();
-      },
-      (error) => {
-        console.log(error);
-        this.spinner.hide();
-      },
-    );
   }
 
   //add roles

+ 2 - 2
src/app/dashboard/sections/add-section/add-section.component.html

@@ -3,8 +3,8 @@
        <div class="row">
         <div class="col-12">
           <ul class="list-unstyled titileLi-w">
-            <li class="headingText-w">خدمه الصلاحيات > </li>
-            <li class="headingText-w" style="cursor:pointer" (click)="perviousLocation()">الاقسام > </li>
+            <li class="headingText-w">خدمه الصلاحيات </li>
+            <li class="headingText-w" style="cursor:pointer" (click)="perviousLocation()">الاقسام</li>
             <li class="headingText-w activeLi-w" style="margin-right:5px">  {{typeLink}} </li>
           </ul>
         </div>

+ 6 - 6
src/app/dashboard/sections/add-section/add-section.component.ts

@@ -1,7 +1,7 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { NgForm } from '@angular/forms';
 import { Location } from '@angular/common';
 import { Router, ActivatedRoute, Params } from '@angular/router';
-import { SectionService } from './../../../shared/section.service';
 import { UserService } from './../../../shared/user.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { Component, OnInit, ViewChild } from '@angular/core';
@@ -18,7 +18,7 @@ export class AddSectionComponent implements OnInit {
 
   constructor(private authService: AuthServiceService,
     private userService: UserService,
-    private sectionService: SectionService,
+    private dashboardSer: DashboardService,
     private spinner: NgxSpinnerService,
     private authSer: AuthServiceService,
     private toastr: ToastrService,
@@ -57,7 +57,7 @@ ngOnInit() {
   this.userService.getUserDataProfile();
     
     //get adminstartionsList
-    this.sectionService.getAdinstration().subscribe(
+    this.dashboardSer.getAdinstration().subscribe(
       (responce) => {
         console.log(responce);
         this.adminstartionsList = responce['adminstrations'];
@@ -73,7 +73,7 @@ ngOnInit() {
         this.typeLink = 'تعديل';
         this.checkEditMode = true;
         this.departId = params['editSectionId'];
-        this.sectionService.getDataSection(this.departId).subscribe(
+        this.dashboardSer.getItemData(this.departId, 'section').subscribe(
           (responce) => {
             console.log(responce);
             this.section.name = responce['department'].name;
@@ -104,7 +104,7 @@ onSubmitted() {
   this.checkSaveDisabled = true;
   console.log(this.addSectionForm.value);
   if(this.checkEditMode) {
-    this.sectionService.editSection(this.addSectionForm, this.departId).subscribe(
+    this.dashboardSer.editItem(this.departId, this.addSectionForm.value, 'section').subscribe(
       (responce) => {
         this.checkSaveDisabled = false;
         console.log(responce);
@@ -118,7 +118,7 @@ onSubmitted() {
       }
     );
   } else {
-    this.sectionService.addSection(this.addSectionForm).subscribe(
+    this.dashboardSer.addItem(this.addSectionForm.value, 'section').subscribe(
       (responce) => {
         this.checkSaveDisabled = false;
         console.log(responce);

+ 1 - 1
src/app/dashboard/sections/section-list/section-list.component.html

@@ -3,7 +3,7 @@
     <div class="row">
       <div class="col-12">
         <ul class="list-unstyled titileLi-w">
-            <li class="headingText-w">خدمه الصلاحيات  > </li>
+            <li class="headingText-w">خدمه الصلاحيات </li>
             <li class="headingText-w activeLi-w" style="margin-right:5px">الأقسام</li>
         </ul>
       </div>

+ 8 - 8
src/app/dashboard/sections/section-list/section-list.component.ts

@@ -1,6 +1,6 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { Modal } from 'ngx-modialog/plugins/bootstrap';
 import { UserService } from './../../../shared/user.service';
-import { SectionService } from './../../../shared/section.service';
 import { ActivatedRoute, Params, Router } from '@angular/router';
 import { Component, OnInit } from '@angular/core';
 import { ToastrService } from 'ngx-toastr';
@@ -30,7 +30,7 @@ export class SectionListComponent implements OnInit {
       private spinner: NgxSpinnerService, 
       private toastr: ToastrService,
       private authSer: AuthServiceService,
-      private sectionService: SectionService,
+      private dashboardSer: DashboardService,
       private userSer: UserService,
       private modal: Modal,
       private router: Router) { }
@@ -55,7 +55,7 @@ export class SectionListComponent implements OnInit {
       }
     );
 
-    this.sectionService.getSectionsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+    this.dashboardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.sectionsList = responce['departments'];
@@ -113,7 +113,7 @@ export class SectionListComponent implements OnInit {
       this.spinner.show();
       this.currentPage = pagenationNumber;
       this.sectionsList = [];
-      this.sectionService.getSectionsList(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
+      this.dashboardSer.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.sectionsList = responce['departments'];
@@ -149,7 +149,7 @@ export class SectionListComponent implements OnInit {
       this.currentPage = 1;
       console.log('search curent page', this.currentPage);
       console.log('search page id', this.pageId);
-      this.sectionService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+      this.dashboardSer.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.sectionsList = responce['departments'];
@@ -168,7 +168,7 @@ export class SectionListComponent implements OnInit {
       this.spinner.show();
       this.sectionsList = [];
       this.dataTableNumber = event.target.value;
-      this.sectionService.getSectionsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+      this.dashboardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.sectionsList = responce['departments'];
@@ -204,13 +204,13 @@ export class SectionListComponent implements OnInit {
         .open();
         dialogRef.result
         .then( result =>  
-          this.sectionService.deleteSection(this.sectionsId).subscribe(
+          this.dashboardSer.deleteItem(this.sectionsId, this.pageId).subscribe(
             (responce) => {
               console.log(responce);
               this.toastr.success('تم الحذف');
               this.spinner.show();
               this.sectionsList = [];
-              this.sectionService.getSectionsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+              this.dashboardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
                 (responce) => {
                   console.log(responce);
                   this.sectionsList = responce['departments'];

+ 7 - 0
src/app/dashboard/service-item/service-item.component.ts

@@ -451,9 +451,16 @@ export class ServiceItemComponent implements OnInit {
       this.router.navigate(['reportCurrentEmployeeOfficer'], {relativeTo: this.route});
     } else if(dataPage.id == 62) {
       this.router.navigate(['reportCommunication'], {relativeTo: this.route});
+    }else if(dataPage.id == 63) {
+      this.router.navigate(['livingServiceList/' + dataPage.id], {relativeTo: this.route});
+    }else if(dataPage.id == 64) {
+      this.router.navigate(['definitionOfConvenats/' + dataPage.id], {relativeTo: this.route});
+    }else if(dataPage.id == 65) {
+      this.router.navigate(['recordInfoBuilding/' + dataPage.id], {relativeTo: this.route});
     }
     
   }
+  // livingService
 
   onAddUser() {
     this.router.navigate(['addUser'],  {relativeTo: this.route});

+ 0 - 1
src/app/dashboard/supervisor/supervisor-list/supervisor-list.component.ts

@@ -1,5 +1,4 @@
 import { DashboardService } from './../../../shared/dashboard.service';
-import { MainMenuService } from './../../../shared/main-menu.service';
 import { Component, OnInit } from '@angular/core';
 import { HttpClient } from '@angular/common/http';
 import { AuthServiceService } from './../../../shared/auth-service.service';

+ 6 - 6
src/app/dashboard/tabs/add-tab/add-tab.component.ts

@@ -1,8 +1,8 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { ActivatedRoute, Params } from '@angular/router';
 import { ToastrService } from 'ngx-toastr';
 import { Location } from '@angular/common';
-import { TabsService } from './../../../shared/tabs.service';
 import { Component, OnInit, ViewChild } from '@angular/core';
 import { NgForm } from '@angular/forms';
 import { UserService } from '../../../shared/user.service';
@@ -39,7 +39,7 @@ export class AddTabComponent implements OnInit {
   }
   
 
-  constructor(private tabService: TabsService,
+  constructor(private dashboardSer: DashboardService,
     private userService: UserService,
     private location: Location,
     private authSer: AuthServiceService,
@@ -63,7 +63,7 @@ export class AddTabComponent implements OnInit {
           this.typeMode = true;
           this.typeLink = 'تعديل';
           this.tabId = params['editTabId'];
-          this.tabService.getTabData(this.tabId).subscribe(
+          this.dashboardSer.getItemData(this.tabId, 'tab').subscribe(
             (responce) => {
               console.log(responce);
               const tabData = responce['tab'];
@@ -134,7 +134,7 @@ export class AddTabComponent implements OnInit {
     if(this.typeMode) {
       if(this.checkFileChange){
         if(this.formTabData.value['file']){
-          this.tabService.editEvent(this.formTabData.value, this.tabId).subscribe(
+          this.dashboardSer.editItem(this.tabId, this.formTabData.value, 'tab').subscribe(
             (responce) => {
               console.log(responce);
               this.toastr.success('تم التعديل بنجاح');
@@ -151,7 +151,7 @@ export class AddTabComponent implements OnInit {
           this.toastr.warning('قم برفع ملف !')
         }
       } else {
-        this.tabService.editEvent(this.formTabData.value, this.tabId).subscribe(
+        this.dashboardSer.editItem(this.tabId, this.formTabData.value, 'tab').subscribe(
           (responce) => {
             console.log(responce);
             this.toastr.success('تم التعديل بنجاح');
@@ -167,7 +167,7 @@ export class AddTabComponent implements OnInit {
       }
      
     } else {
-      this.tabService.addTab(this.formTabData.value).subscribe(
+      this.dashboardSer.addItem(this.formTabData.value, 'tab').subscribe(
         (responce) => {
           console.log(responce);
           this.toastr.success('تم الاضافه بنجاح');

+ 9 - 9
src/app/dashboard/tabs/tab-list/tab-list.component.ts

@@ -1,5 +1,5 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { Modal } from 'ngx-modialog/plugins/bootstrap';
-import { TabsService } from './../../../shared/tabs.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { ToastrService } from 'ngx-toastr';
 import { HttpClient } from '@angular/common/http';
@@ -33,7 +33,7 @@ export class TabListComponent implements OnInit {
     private router: Router, 
     private userSer: UserService,
     private http: HttpClient,
-    private tabService: TabsService,
+    private dashboardSer: DashboardService,
     private toastr: ToastrService,
     private spinner: NgxSpinnerService,
     private modal: Modal,
@@ -94,7 +94,7 @@ export class TabListComponent implements OnInit {
     );
 
     //get list data 
-    this.tabService.getTabsList(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
+    this.dashboardSer.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.tabsList = responce['tabs'];
@@ -134,7 +134,7 @@ export class TabListComponent implements OnInit {
       const dataSearch = data.target.value;     
       this.currentPage = 1;
       console.log('search curent page', this.currentPage);
-      this.tabService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+      this.dashboardSer.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.tabsList = responce['tabs'];
@@ -156,7 +156,7 @@ export class TabListComponent implements OnInit {
       this.tabsList = [];
       //console.log(pagenationNumber);
       //console.log(this.pageId);
-      this.tabService.getTabsList(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
+      this.dashboardSer.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.tabsList = responce['tabs'];
@@ -181,7 +181,7 @@ export class TabListComponent implements OnInit {
       this.http.post(this.authSer.pathApi + '/rank_tab', data).subscribe(
         (responce) => {
           console.log(responce);
-          this.tabService.getTabsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+          this.dashboardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
             (responce) => {
               console.log(responce);
               this.count = responce['count'];
@@ -204,7 +204,7 @@ export class TabListComponent implements OnInit {
     this.spinner.show();
     this.tabsList = [];
     this.dataTableNumber = event.target.value;
-    this.tabService.getTabsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+    this.dashboardSer.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.tabsList = responce['tabs'];
@@ -242,14 +242,14 @@ export class TabListComponent implements OnInit {
   
         dialogRef.result
         .then( result => 
-          this.tabService.deleteTab(this.tabsListIds).subscribe(
+          this.dashboardSer.deleteItem(this.tabsListIds, this.pageId).subscribe(
             (responce) => {
               console.log(responce);
               this.toastr.success('تم الحذف');
               this.spinner.show();
               this.tabsList = [];
                //get list data 
-              this.tabService.getTabsList(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
+              this.dashboardSer.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
                 (responce) => {
                   console.log(responce);
                   this.tabsList = responce['tabs'];

+ 21 - 0
src/app/servicesItems/services.component.ts

@@ -265,6 +265,27 @@ getDataService(dataService){
           console.log(error);
         }
       );
+      //خدمة السكن
+     }else if(dataService.id == 7){
+       this.userservice.getPagesPermetiotns(this.idUser, dataService.id).subscribe(
+         res => {
+           console.log(res);
+           this.pages = res['pages'];
+           console.log(this.pages);
+           if(this.pages[0].id == 63) {
+            this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/livingServiceList/' + this.pages[0].id]);
+           }else if (this.pages[0].id == 64){
+            this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/definitionOfConvenats/' + this.pages[0].id]);            
+           }else if (this.pages[0].id == 65){
+            this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/recordInfoBuilding/' + this.pages[0].id]);            
+           }
+           
+         },
+         err => {
+           console.log(err);
+           
+         }
+       );
      }
   }
 

+ 0 - 55
src/app/shared/achievements.service.ts

@@ -1,55 +0,0 @@
-import { AuthServiceService } from './auth-service.service';
-import { HttpClient } from '@angular/common/http';
-import { Injectable } from '@angular/core';
-import { NgxSpinnerService } from 'ngx-spinner';
-import { ToastrService } from 'ngx-toastr';
-
-@Injectable({
-  providedIn: 'root'
-})
-export class AchievementsService {
-
-  constructor(private http: HttpClient, 
-    private authService: AuthServiceService,
-    private spinner: NgxSpinnerService, 
-    private toastr: ToastrService) { }
-
-    //get achievements list 
-    getAchievementsList(pageId: number, currentPage: number, dataTableNumber: number){
-      this.spinner.show();
-      console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-      return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-    }
-     //get data user from searchBar 
-    getDataUSerSearchBar(data, pageId, pagenationNumber, dataTableNumber) {
-      console.log('url', this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-      return this.http.get(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-    }
-
-    //delete user 
-    deleteAchievement(achievementsIds) {
-      console.log(achievementsIds);
-      return this.http.post(this.authService.pathApi + '/delete_achievements' , {'achievements_id' : achievementsIds});
-    };
-
-    //add
-    addAchievements(dataAchievements) {
-      console.log(dataAchievements);
-      return this.http.post(this.authService.pathApi + '/add_achievement', dataAchievements);
-    };
-
-    //edit
-    editAchievement( dataAchievementEdit, EditAchievementId){
-      const editData = dataAchievementEdit;
-      editData.id = EditAchievementId;
-      console.log(editData);
-      return this.http.post(this.authService.pathApi + '/edit_achievement', editData);
-    };
-
-    //get data of one element
-    getAchievementData(achievId: number) {
-      return this.http.get(this.authService.pathApi + '/get_achievement/' + achievId);
-    };
-
-
-}

+ 108 - 4
src/app/shared/dashboard.service.ts

@@ -45,6 +45,18 @@ export class DashboardService {
     addItem(data, addType) {
       if(addType == 'advertisiment'){
         return this.http.post(this.authService.pathApi + '/add_main_ad' , data);
+      } else if(addType == 'role') {
+        return this.http.post(this.authService.pathApi + '/add_role' , data);
+      } else if(addType == 'department'){
+        return this.http.post(this.authService.pathApi + '/add_adminstration' , data);
+      } else if(addType == 'section'){
+        return this.http.post(this.authService.pathApi + '/add_department' , data);
+      } else if(addType == 'tab'){
+        return this.http.post(this.authService.pathApi + '/add_tab' , data);
+      } else if(addType == 'internalSer'){
+        return this.http.post(this.authService.pathApi + '/add_internal_service' , data);
+      } else if(addType == 'achiev'){
+        return this.http.post(this.authService.pathApi + '/add_achievement' , data);
       } else if(addType == 'internalHospital') {
         return this.http.post(this.authService.pathApi + '/add_hospitals_centers' , data);
       } else if(addType == 'externalHospital') {
@@ -107,19 +119,36 @@ export class DashboardService {
         return this.http.post(this.authService.pathApi + '/add_location', data);
       }else if(addType == 'definitionOfTime') {
         return this.http.post(this.authService.pathApi + '/add_time_period', data);
+      }else if(addType == 'livingService') {
+        return this.http.post(this.authService.pathApi + '/add_covenant_category', data);
+      }else if(addType == 'definitionOfCovenant') {
+        return this.http.post(this.authService.pathApi + '/add_covenant', data);
+      }else if(addType == 'recordInfoBuilding') {
+        return this.http.post(this.authService.pathApi + '/add_housing_complex', data);
       }
     }
 
-    //edit event
+    //edit event 
     editItem(editId,dataEdit,editPageName){
       const editData = dataEdit;
-      console.log(editId);
       console.log(editPageName);
       editData['id'] = editId;
-      console.log(dataEdit);
+      console.log(editData);
 
       if(editPageName == 'advertisiment') {
         return this.http.post(this.authService.pathApi + '/edit_main_ad', editData);
+      } else if(editPageName == 'role') {
+        return this.http.post(this.authService.pathApi + '/edit_role', editData);
+      } else if(editPageName == 'department'){
+        return this.http.post(this.authService.pathApi + '/edit_adminstration', editData);
+      } else if(editPageName == 'section'){
+        return this.http.post(this.authService.pathApi + '/edit_adminstration', editData);
+      } else if(editPageName == 'tab'){
+        return this.http.post(this.authService.pathApi + '/edit_tab', editData);
+      } else if(editPageName == 'achiev'){
+        return this.http.post(this.authService.pathApi + '/edit_achievement', editData);
+      } else if(editPageName == 'internalSer'){
+        return this.http.post(this.authService.pathApi + '/', editData);
       } else if(editPageName == 'internalHospital') {
         return this.http.post(this.authService.pathApi + '/edit_hospitals_centers', editData);
       } else if(editPageName == 'externalHospital') {
@@ -187,14 +216,32 @@ export class DashboardService {
         return this.http.post(this.authService.pathApi + '/edit_location', editData);
       }else if(editPageName == 'definitionOfTime') {
         return this.http.post(this.authService.pathApi + '/edit_time_period', editData);
+      }else if(editPageName == 'livingService') {
+        return this.http.post(this.authService.pathApi + '/edit_covenant_category', editData);
+      }else if(editPageName == 'definitionOfCovenant') {
+        return this.http.post(this.authService.pathApi + '/edit_covenant', editData);
+      }else if(editPageName == 'recordInfoBuilding') {
+        return this.http.post(this.authService.pathApi + '/edit_housing_complex', editData);
       }
     }
     
-    //get item data
+    //get item data 
     getItemData(pageId: number, typeGetData:string) {
       console.log('wwwwwwwwwwwwwwwwwwwwwwwwwwww', pageId);
       if(typeGetData == 'advertisiment') {
         return this.http.get(this.authService.pathApi + '/get_main_ad/' + pageId);
+      } else if(typeGetData == 'role'){
+        return this.http.get(this.authService.pathApi + '/get_role/' + pageId);
+      } else if(typeGetData == 'department') {
+        return this.http.get(this.authService.pathApi + '/get_adminstration/' + pageId);
+      } else if(typeGetData == 'section'){
+        return this.http.get(this.authService.pathApi + '/get_department/' + pageId);
+      } else if(typeGetData == 'tab'){
+        return this.http.get(this.authService.pathApi + '/get_tab/' + pageId);
+      } else if(typeGetData == 'internalSer'){
+        return this.http.get(this.authService.pathApi + '/get_internal_service/' + pageId);
+      } else if(typeGetData == 'achiev') {
+        return this.http.get(this.authService.pathApi + '/get_achievement/' + pageId);
       } else if(typeGetData == 'hospital') {
         return this.http.get(this.authService.pathApi + '/get_hospitals_centers/' + pageId);
       } else if(typeGetData == 'managament') {
@@ -249,6 +296,12 @@ export class DashboardService {
         return this.http.get(this.authService.pathApi + '/get_time_period/' + pageId);
       } else if(typeGetData == 'maintenance') {
         return this.http.get(this.authService.pathApi + '/get_communication/' + pageId);
+      } else if(typeGetData == 'livingService') {
+        return this.http.get(this.authService.pathApi + '/get_covenant_category/' + pageId);
+      }else if(typeGetData == 'definitionOfCovenant') {
+        return this.http.get(this.authService.pathApi + '/get_covenant/' + pageId);
+      }else if(typeGetData == 'recordInfoBuilding') {
+        return this.http.get(this.authService.pathApi + '/get_housing_complex/' + pageId);
       }
   }
     //delete event
@@ -259,6 +312,18 @@ export class DashboardService {
 
       if(pageId == 24) {
         return this.http.post(this.authService.pathApi + '/delete_main_ads' , {'ads_id' : dataIds});
+      } else if(pageId == 2) {
+        return this.http.post(this.authService.pathApi + '/delete_role' , {'roles_id' : dataIds});
+      } else if(pageId == 3){
+        return this.http.post(this.authService.pathApi + '/delete_adminstration' , {'adminstrations_id' : dataIds});
+      } else if(pageId == 4){
+        return this.http.post(this.authService.pathApi + '/delete_department' , {'departments_id' : dataIds});
+      } else if(pageId == 12){
+        return this.http.post(this.authService.pathApi + '/delete_tabs' , {'tabs_id' : dataIds});
+      } else if(pageId == 11){
+        return this.http.post(this.authService.pathApi + '/delete_achievements' , {'achievements_id' : dataIds});
+      } else if(pageId == 14){
+        return this.http.post(this.authService.pathApi + '/delete_internal_services' , {'internal_services_id' : dataIds});
       } else if(pageId == 10) {
         return this.http.post(this.authService.pathApi + '/delete_managements' , {'managements_id' : dataIds});
       } else if(pageId == 31) {
@@ -317,12 +382,51 @@ export class DashboardService {
         return this.http.post(this.authService.pathApi + '/delete_location', {'locations_id' : dataIds});
       }else if(pageId == 53) {
         return this.http.post(this.authService.pathApi + '/delete_time_period', {'time_periods_id' : dataIds});
+      }else if(pageId == 63) {
+        return this.http.post(this.authService.pathApi + '/delete_covenant_category', {'covenant_category_ids' : dataIds});
+      }else if(pageId == 64) {
+        return this.http.post(this.authService.pathApi + '/delete_covenant', {'covenant_ids' : dataIds});
+      }else if(pageId == 65) {
+        return this.http.post(this.authService.pathApi + '/delete_housing_complex', {'housing_complex_ids' : dataIds});
       }
 
 
+
     };
 
 
+    //get permissions list of roles
+    getPermissionList() {
+      return this.http.get(this.authService.pathApi + '/permissions_list');
+    }
+
+
+    //get report pages inside roles
+    get_report_pages_inside_roles(roleId: number) {
+      return this.http.get(this.authService.pathApi + '/report_pages_inside_roles/' + roleId);
+    }
+
+    //get report of users inside roles
+    get_report_users_inside_roles(roleId: number) {
+      return this.http.get(this.authService.pathApi + '/report_users_inside_roles/' + roleId);
+    }
+
+     //get adminstartion 
+     getAdinstration() {
+      return this.http.get(this.authService.pathApi + '/adminstrations_list');
+    }
+
+      //get parent list 
+  getParentList() {
+    return this.http.get(this.authService.pathApi + '/parents_list');
+  }
+
+
+    //get internal pages 
+    getInternalPages() {
+      return this.http.get(this.authService.pathApi + '/system_pages_list');
+    }
+
     //return seconds inot hh-mm-ss
      secondsToDhms(seconds) {
         seconds = Number(seconds);

+ 0 - 53
src/app/shared/department.service.ts

@@ -1,53 +0,0 @@
-import { AuthServiceService } from './auth-service.service';
-import { HttpClient } from '@angular/common/http';
-import { NgxSpinnerService } from 'ngx-spinner';
-import { ToastrService } from 'ngx-toastr';
-import { Injectable } from '@angular/core';
-
-@Injectable({
-  providedIn: 'root'
-})
-export class DepartmentService {
-
-  constructor(private http:HttpClient,
-      private authService: AuthServiceService,
-      private spinner: NgxSpinnerService,
-      private toastr: ToastrService,
-    ) { }
-
-      //get roles list 
-  getDeparmentsList(pageId: number, currentPage: number, dataTableNumber: number){
-    this.spinner.show();
-    console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-    return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-  }
-
-  //get data user from searchBar 
-  getDataUSerSearchBar(data, pageId, pagenationNumber, dataTableNumber) {
-    console.log('url', this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-      return this.http.get(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-  }
-
-  //delete user 
-  deleteDepart(departsIds) {
-    console.log(departsIds);
-    return this.http.post(this.authService.pathApi + '/delete_adminstration' , {'adminstrations_id' : departsIds});
-  };
-
-  addDepartment(formData) {
-    const data = formData.value;
-    return this.http.post(this.authService.pathApi + '/add_adminstration' , data);
-  }
-
-  getDataAdmin(idAdmin:number) {
-    return this.http.get( this.authService.pathApi + '/get_adminstration/' + idAdmin);
-  }
-
-  editAdmin(dataDepartEdit, EditDepartId) {
-    const newData = dataDepartEdit.value;
-    newData.id = EditDepartId;
-    console.log('new data', newData);
-    return this.http.post(this.authService.pathApi + '/edit_adminstration' , newData);
-  }
-      
-}

+ 0 - 56
src/app/shared/external-ser.service.ts

@@ -1,56 +0,0 @@
-import { AuthServiceService } from './auth-service.service';
-import { HttpClient } from '@angular/common/http';
-import { Injectable } from '@angular/core';
-import { NgxSpinnerService } from 'ngx-spinner';
-import { ToastrService } from 'ngx-toastr';
-
-@Injectable({
-  providedIn: 'root'
-})
-export class ExternalSerService {
-
-  constructor(private http: HttpClient, 
-    private spinner: NgxSpinnerService, 
-    private toastr: ToastrService, 
-    private authService: AuthServiceService) { }
-
-      //get externals list 
-  getExternalsList(pageId: number, currentPage: number, dataTableNumber: number){
-    this.spinner.show();
-    console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-    return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-  }
-
-   //get data data from searchBar 
-   getDataUSerSearchBar(data, pageId, pagenationNumber, dataTableNumber) {
-    console.log('url', this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-     return this.http.get(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-  }
-
-  //delete data 
-  deleteEvent(externalsIds) {
-    return this.http.post(this.authService.pathApi + '/delete_external_services' , {'external_services_id' : externalsIds});
-  };
-
-  //add external 
-  addExternal(dataExternals) {
-    console.log(dataExternals);
-    return this.http.post(this.authService.pathApi + '/add_external_service', dataExternals);
-  }
-
-  //get external data
-  getExternalData(externalId: number) {
-    return this.http.get(this.authService.pathApi + '/get_external_service/' + externalId);
-  };
-
-  //edit extrnal
-  editExternal( dataRoleEdit,EditRoleId){
-    const editData = dataRoleEdit;
-    editData.id = EditRoleId;
-    console.log(editData);
-    return this.http.post(this.authService.pathApi + '/edit_external_service', editData);
-  }
-
-
-
-}

+ 0 - 55
src/app/shared/footer.service.ts

@@ -1,55 +0,0 @@
-import { AuthServiceService } from './auth-service.service';
-import { HttpClient } from '@angular/common/http';
-import { Injectable } from '@angular/core';
-import { NgxSpinnerService } from 'ngx-spinner';
-import { ToastrService } from 'ngx-toastr';
-
-@Injectable({
-  providedIn: 'root'
-})
-
-export class FooterService {
-  constructor(private http: HttpClient, 
-    private spinner: NgxSpinnerService, 
-    private toastr: ToastrService, 
-    private authService: AuthServiceService) { }
-
-      //get externals list 
-  getFooterList(pageId: number, currentPage: number, dataTableNumber: number){
-    this.spinner.show();
-    console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-    return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-  }
-
-   //get data data from searchBar 
-   getDataUSerSearchBar(data, pageId, pagenationNumber, dataTableNumber) {
-    console.log('url', this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-     return this.http.get(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-  }
-
-  //delete data 
-  deleteFooter(footersId) {
-    console.log(footersId);
-    return this.http.post(this.authService.pathApi + '/delete_footers' , {'footers_id' : footersId});
-  };
-
-  //add external 
-  addFooter(dataExternals) {
-    console.log(dataExternals);
-    return this.http.post(this.authService.pathApi + '/add_footer', dataExternals);
-  }
-
-  //get external data
-  getFooterData(externalId: number) {
-    return this.http.get(this.authService.pathApi + '/get_footer/' + externalId);
-  };
-
-  //edit extrnal
-  editFooter( dataRoleEdit,EditRoleId){
-    const editData = dataRoleEdit;
-    editData.id = EditRoleId;
-    console.log(editData);
-    return this.http.post(this.authService.pathApi + '/edit_footer', editData);
-  }
-
-}

+ 0 - 59
src/app/shared/internal-ser.service.ts

@@ -1,59 +0,0 @@
-import { ToastrService } from 'ngx-toastr';
-import { HttpClient } from '@angular/common/http';
-import { AuthServiceService } from './auth-service.service';
-import { Injectable } from '@angular/core';
-import { NgxSpinnerService } from 'ngx-spinner';
-
-@Injectable({
-  providedIn: 'root'
-})
-export class InternalSerService {
-
-
-  constructor(private authService: AuthServiceService, 
-    private http: HttpClient,
-    private spinner: NgxSpinnerService, 
-    private toastr: ToastrService) { }
-
-  //get hospitals list 
-  getInternalsList(pageId: number, currentPage: number, dataTableNumber: number){
-    this.spinner.show();
-    console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-    return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-  }
-
-  //get data user from searchBar 
-  getDataUSerSearchBar(data, pageId, pagenationNumber, dataTableNumber) {
-    console.log('url', this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-    return this.http.get(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-  }
-
-  //delete hospitals
-  deleteDatas(datasIds, pageId) {
-    console.log(datasIds);
-    return this.http.post(this.authService.pathApi + '/delete_internal_services' , {'internal_services_id' : datasIds});
-  }
-
-  //add hospital 
-  addInternal(internalDataForm) {
-    return this.http.post(this.authService.pathApi + '/add_internal_service', internalDataForm);
-  }
-
-  //get hospital data
-  getInternalData(typeId: number) {
-      return this.http.get(this.authService.pathApi + '/get_internal_service/' + typeId);
-  }
-
-  //edit hospital data
-  editInternal(id: number, newData) {
-    newData['id'] = id;
-    console.log(newData);
-      return this.http.post(this.authService.pathApi + '/edit_internal_service', newData);
-    }
-
-    //get internal pages 
-  getInternalPages() {
-    return this.http.get(this.authService.pathApi + '/system_pages_list');
-  }
-
-}

+ 0 - 58
src/app/shared/main-menu.service.ts

@@ -1,58 +0,0 @@
-import { Injectable } from '@angular/core';
-import { AuthServiceService } from './auth-service.service';
-import { HttpClient } from '@angular/common/http';
-import { NgxSpinnerService } from 'ngx-spinner';
-import { ToastrService } from 'ngx-toastr';
-
-@Injectable({
-  providedIn: 'root'
-})
-export class MainMenuService {
-  constructor(private http: HttpClient, 
-    private spinner: NgxSpinnerService, 
-    private toastr: ToastrService, 
-    private authService: AuthServiceService) { }
-
-      //get externals list 
-  getMainList(pageId: number, currentPage: number, dataTableNumber: number){
-    this.spinner.show();
-    console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-    return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-  }
-
-   //get data data from searchBar 
-   getDataUSerSearchBar(data, pageId, pagenationNumber, dataTableNumber) {
-    console.log('url', this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-     return this.http.get(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-  }
-
-  //delete data 
-  deleteMain(mainsIds) {
-    return this.http.post(this.authService.pathApi + '/delete_menus' , {'menus_id' : mainsIds});
-  };
-
-  //add external 
-  addMain(dataMains) {
-    console.log(dataMains);
-    return this.http.post(this.authService.pathApi + '/add_menu', dataMains);
-  }
-
-  //get external data
-  getMenuData(menuId: number) {
-    return this.http.get(this.authService.pathApi + '/get_menu/' + menuId);
-  };
-
-  //edit extrnal
-  editMenu( dataMenuEdit,EditMenuId){
-    const editData = dataMenuEdit;
-    editData.id = EditMenuId;
-    console.log(editData);
-    return this.http.post(this.authService.pathApi + '/edit_menu', editData);
-  }
-
-  //get parent list 
-  getParentList() {
-    return this.http.get(this.authService.pathApi + '/parents_list');
-  }
-
-}

+ 0 - 55
src/app/shared/new.service.ts

@@ -1,55 +0,0 @@
-import { AuthServiceService } from './auth-service.service';
-import { HttpClient } from '@angular/common/http';
-import { Injectable } from '@angular/core';
-import { NgxSpinnerService } from 'ngx-spinner';
-import { ToastrService } from 'ngx-toastr';
-
-@Injectable({
-  providedIn: 'root'
-})
-export class NewService {
-
-  constructor(private http: HttpClient, 
-    private spinner: NgxSpinnerService, 
-    private toastr: ToastrService, 
-    private authService: AuthServiceService) { }
-  //get externals list 
-  getnewsList(pageId: number, currentPage: number, dataTableNumber: number){
-    this.spinner.show();
-    console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-    return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-  }
-
-    //get data data from searchBar 
-  getDataUSerSearchBar(data, pageId, pagenationNumber, dataTableNumber) {
-    console.log('url', this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-    return this.http.get(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-  }
-
-    //delete data 
-    deleteNew(externalsIds) {
-      console.log(externalsIds);
-      return this.http.post(this.authService.pathApi + '/delete_reports' , {'reports_id' : externalsIds});  
-    };
-  
-    //add external 
-    addNew(dataExternals) {
-      console.log(dataExternals);
-      return this.http.post(this.authService.pathApi + '/add_report', dataExternals);
-    }
-  
-    //get external data
-    getNewData(externalId: number) {
-      return this.http.get(this.authService.pathApi + '/get_report/' + externalId);
-    };
-  
-    //edit extrnal
-    editNew( dataRoleEdit, EditRoleId){
-      const editData = dataRoleEdit;
-      editData.id = EditRoleId;
-      console.log(editData);
-      return this.http.post(this.authService.pathApi + '/edit_report', editData);
-    }
-
-    
-}

+ 0 - 71
src/app/shared/roles.service.ts

@@ -1,71 +0,0 @@
-import { AuthServiceService } from './auth-service.service';
-import { HttpClient } from '@angular/common/http';
-import { Injectable } from '@angular/core';
-import { NgxSpinnerService } from 'ngx-spinner';
-import { ToastrService } from 'ngx-toastr';
-
-
-@Injectable({
-  providedIn: 'root'
-})
-export class RolesService {
-
-  constructor(private http: HttpClient,
-      private authService: AuthServiceService,
-      private spinner: NgxSpinnerService, 
-      private toastr: ToastrService) { }
-
-  //get roles list 
-    getRolesList(pageId: number, currentPage: number, dataTableNumber: number){
-      this.spinner.show();
-      console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-      return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-    }
-
-    //get data user from searchBar 
-    getDataUSerSearchBar(data, pageId, pagenationNumber, dataTableNumber) {
-      console.log('url', this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-      return this.http.get(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-    }
-
-    //delete user 
-    deleteUser(rolesIds) {
-      console.log(rolesIds);
-      return this.http.post(this.authService.pathApi + '/delete_role' , {'roles_id' : rolesIds});      
-    };
-
-    addRoles(dataRoles) {
-      const dataRoleForm = dataRoles.value;
-      return this.http.post(this.authService.pathApi + '/add_role', dataRoleForm);
-    }
-
-    editRole( dataRoleEdit,EditRoleId){
-      const editData = dataRoleEdit;
-      editData.id = EditRoleId;
-      console.log(editData);
-      return this.http.post(this.authService.pathApi + '/edit_role', editData);
-    }
-
-    getRoleData(roleId: number) {
-      return this.http.get(this.authService.pathApi + '/get_role/' + roleId);
-    }
-
-  
-
-    //get report pages inside roles
-    get_report_pages_inside_roles(roleId: number) {
-      return this.http.get(this.authService.pathApi + '/report_pages_inside_roles/' + roleId);
-    }
-
-    //get report of users inside roles
-    get_report_users_inside_roles(roleId: number) {
-      return this.http.get(this.authService.pathApi + '/report_users_inside_roles/' + roleId);
-    }
-
-    //get permissions list
-    getPermissionList() {
-      return this.http.get(this.authService.pathApi + '/permissions_list');
-    }
-    
-}
-

+ 0 - 61
src/app/shared/section.service.ts

@@ -1,61 +0,0 @@
-import { HttpClient } from '@angular/common/http';
-import { AuthServiceService } from './auth-service.service';
-import { Injectable } from '@angular/core';
-import { ToastrService } from 'ngx-toastr';
-import { NgxSpinnerService } from 'ngx-spinner';
-
-@Injectable({
-  providedIn: 'root'
-})
-export class SectionService {
-
-  constructor(private authService: AuthServiceService,
-     private http: HttpClient, 
-     private toastr: ToastrService,
-    private spinner: NgxSpinnerService) { }
-
-  //get roles list 
-  getSectionsList(pageId: number, currentPage: number, dataTableNumber:number){
-    this.spinner.show();
-    console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-    return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-  }
-
-    //get data user from searchBar 
-    getDataUSerSearchBar(data, pageId, pagenationNumber, dataTableNumber) {
-      console.log('url', this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-        return this.http.get(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-    }
-
-    //delete user 
-    deleteSection(sectionsIds) {
-      console.log(sectionsIds);
-      return this.http.post(this.authService.pathApi + '/delete_department' , {'departments_id' : sectionsIds});
-    };
-
-    //get section data
-    getDataSection(sectionId:number) {
-      return this.http.get( this.authService.pathApi + '/get_department/' + sectionId);
-    }
-
-    //add section
-    addSection(formData) {
-      const data = formData.value;
-      return this.http.post(this.authService.pathApi + '/add_department' , data);
-    }
-  
-
-    editSection(dataSectionEdit, EditSectionId) {
-      const newData = dataSectionEdit.value;
-      newData.id = EditSectionId;
-      console.log('new data', newData);
-      return this.http.post(this.authService.pathApi + '/edit_department' , newData);
-    }
-
-    //get adminstartion 
-    getAdinstration() {
-      return this.http.get(this.authService.pathApi + '/adminstrations_list');
-    }
-
-
-}

+ 0 - 54
src/app/shared/tabs.service.ts

@@ -1,54 +0,0 @@
-import { Injectable } from '@angular/core';
-import { AuthServiceService } from './auth-service.service';
-import { HttpClient } from '@angular/common/http';
-import { NgxSpinnerService } from 'ngx-spinner';
-import { ToastrService } from 'ngx-toastr';
-
-@Injectable({
-  providedIn: 'root'
-})
-export class TabsService {
-
-  constructor(private http: HttpClient, 
-    private spinner: NgxSpinnerService, 
-    private toastr: ToastrService, 
-    private authService: AuthServiceService) { }
-
-  //get hospitals list 
-  getTabsList(pageId: number, currentPage: number, dataTableNumber: number){
-    this.spinner.show();
-    console.log(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-    return this.http.get(this.authService.pathApi +'/page_list/' + pageId + '/' + currentPage + '/' + dataTableNumber + '/all');
-  }
-
-   //get data data from searchBar 
-   getDataUSerSearchBar(data, pageId, pagenationNumber, dataTableNumber) {
-    console.log('url', this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-     return this.http.get(this.authService.pathApi + '/page_list' + '/' + pageId + '/' + pagenationNumber + '/' + dataTableNumber + '/all/' + data);
-  }
-
-   //delete event 
-   deleteTab(tabsIds) {
-    console.log(tabsIds);
-    return this.http.post(this.authService.pathApi + '/delete_tabs' , {'tabs_id' : tabsIds});
-  };
-
-    //addEvent
-    addTab(dataTab) {
-      return this.http.post(this.authService.pathApi + '/add_tab' , dataTab);
-    }
-  
-    //edit event
-    editEvent( dataTabEdit,EditTabId){
-      const editData = dataTabEdit;
-      editData.id = EditTabId;
-      console.log(editData);
-      return this.http.post(this.authService.pathApi + '/edit_tab', editData);
-    }
-
-    //get tab data
-    getTabData(tabId: number) {
-      return this.http.get(this.authService.pathApi + '/get_tab/' + tabId);
-    }
-  
-}