Kaynağa Gözat

final dashboard

Hima 5 yıl önce
ebeveyn
işleme
a5f5c605ca
34 değiştirilmiş dosya ile 1000 ekleme ve 416 silme
  1. 4 1
      src/app/External-Page/external-events-table/external-events-table.component.ts
  2. 11 3
      src/app/External-Page/external-page-content/external-page-content.component.css
  3. 4 3
      src/app/External-Page/external-page-content/external-page-content.component.html
  4. 7 2
      src/app/External-Page/external-page-content/external-page-content.component.ts
  5. 62 1
      src/app/External-Page/new-page/new-page.component.css
  6. 6 11
      src/app/External-Page/new-page/new-page.component.html
  7. 0 30
      src/app/Internal-Page/internal-page-content/internal-page-content.component.html
  8. 2 2
      src/app/Internal-Page/internal-page.module.ts
  9. 1 1
      src/app/Internal-Page/news-page/news-page.component.html
  10. 3 1
      src/app/Internal-Page/news-page/news-page.component.ts
  11. 74 28
      src/app/dashboard/external-services/add-external/add-external.component.ts
  12. 40 19
      src/app/dashboard/external-services/external-list/external-list.component.ts
  13. 2 2
      src/app/dashboard/footer/add-footer/add-footer.component.html
  14. 69 24
      src/app/dashboard/footer/add-footer/add-footer.component.ts
  15. 1 1
      src/app/dashboard/footer/footer-list/footer-list.component.html
  16. 32 8
      src/app/dashboard/footer/footer-list/footer-list.component.ts
  17. 23 14
      src/app/dashboard/hospitals/add-hospital/add-hospital.component.html
  18. 146 54
      src/app/dashboard/hospitals/add-hospital/add-hospital.component.ts
  19. 40 19
      src/app/dashboard/hospitals/hospital-list/hospital-list.component.ts
  20. 24 9
      src/app/dashboard/main-menu/add-menu/add-menu.component.html
  21. 103 28
      src/app/dashboard/main-menu/add-menu/add-menu.component.ts
  22. 1 1
      src/app/dashboard/main-menu/main-list/main-list.component.html
  23. 56 46
      src/app/dashboard/main-menu/main-list/main-list.component.ts
  24. 1 1
      src/app/dashboard/news/add-news/add-news.component.html
  25. 73 44
      src/app/dashboard/news/add-news/add-news.component.ts
  26. 1 1
      src/app/dashboard/news/news-list/news-list.component.html
  27. 28 9
      src/app/dashboard/news/news-list/news-list.component.ts
  28. 10 10
      src/app/dashboard/service-item/service-item.component.ts
  29. 9 24
      src/app/servicesItems/services.component.ts
  30. 92 7
      src/app/shared/dashboard.service.ts
  31. 1 1
      src/app/shared/external-ser.service.ts
  32. 0 1
      src/app/shared/hospital.service.ts
  33. 4 3
      src/app/shared/shared.module.ts
  34. 70 7
      src/styles.css

+ 4 - 1
src/app/External-Page/external-events-table/external-events-table.component.ts

@@ -16,7 +16,9 @@ export class ExternalEventsTableComponent implements OnInit {
   constructor(private authSer: AuthServiceService, 
     private http: HttpClient, 
     private spinner: NgxSpinnerService,
-    private route: ActivatedRoute) { }
+    private route: ActivatedRoute) { 
+      this.spinner.show();
+    }
     
     count: number;
     perPagePagenation: number;
@@ -39,6 +41,7 @@ export class ExternalEventsTableComponent implements OnInit {
         this.count = responce['count'];
         this.perPagePagenation = responce['per_page'];
         console.log('eveeeents', this.eventsData);
+        this.spinner.hide();
       },
       (error) => {
         console.log(error);

+ 11 - 3
src/app/External-Page/external-page-content/external-page-content.component.css

@@ -333,7 +333,7 @@ input,button {
 
 .externalPageContentt-w .recordsContent-w .records .body {
     width: 100%;
-    height: 209px;
+    height: 285px;
     background-color: #fff;
     box-shadow: 0 1px 1px #ccc;
     padding: 2px 0;
@@ -377,12 +377,13 @@ input,button {
 
 .externalPageContentt-w .recordsContent-w .medical .body {
     width: 100%;
-    height: 209px;
+    height: 285px;
     background-color: #fff;
     box-shadow: 0 1px 1px #ccc;
 }
 
 
+
 .externalPageContentt-w .recordsContent-w .medical .body #demo2 {
     width: 100%;
     height: 100;
@@ -436,9 +437,12 @@ input,button {
     width: 100%;
 }
 
+
+
+
+
 .externalPageContentt-w .datePicker-w .body {
     width: 100%;
-    height: 250px;;
     background-color: #fff;
     box-shadow: 0 1px 1px #ccc;
 }
@@ -562,6 +566,8 @@ input,button {
     }
   
 
+  
+
 
 agm-map {
     height: 300px;
@@ -580,3 +586,5 @@ agm-map {
         max-width: 1200px !important;
     }
 }
+
+

+ 4 - 3
src/app/External-Page/external-page-content/external-page-content.component.html

@@ -29,9 +29,10 @@
                       <div class="carousel-inner">
                           <div class="carousel-item" *ngFor="let event of events; let i = index" [ngClass]="i == 0 ? 'active' : ''">
                               <div class="carousel-caption">
-                                  <p><img src="../../../assets/image/eventX.png" /> <span> حدث :</span> {{event.name}}</p> <button class="moreEvent-w" (click)="oneventTable()">المزيد</button>
+                                  <p><img src="../../../assets/image/eventX.png" /> <span> حدث :</span> {{event.name}}</p>
                               </div>   
                           </div>
+                          <button class="moreEvent-w" (click)="oneventTable()">المزيد</button>
                       </div>
                   </div> 
               </div>
@@ -178,14 +179,14 @@
               </div>
             </div>
 
-            <div class="col-12">
+            <!-- <div class="col-12">
               <div class="maps">
                 <h1>إتصل بنا</h1>
                 <agm-map [latitude]="lat" [longitude]="lng">
                     <agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
                   </agm-map>
               </div>
-            </div>
+            </div> -->
       
           </div>
         </div>

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

@@ -2,7 +2,7 @@ import { Subscription } from 'rxjs';
 import { Router, ActivatedRoute } from '@angular/router';
 import { AuthServiceService } from './../../shared/auth-service.service';
 import { ExternalPageService } from './../../shared/external-page.service';
-import { Component, OnInit, OnDestroy } from '@angular/core';
+import { Component, OnInit, OnDestroy, AfterContentInit } from '@angular/core';
 import {MapsAPILoader} from '@agm/core';
 import * as $ from 'jquery';
 import { NgxSpinnerService } from 'ngx-spinner';
@@ -12,7 +12,7 @@ import { NgxSpinnerService } from 'ngx-spinner';
   templateUrl: './external-page-content.component.html',
   styleUrls: ['./external-page-content.component.css']
 })
-export class ExternalPageContentComponent implements OnInit, OnDestroy {
+export class ExternalPageContentComponent implements OnInit, OnDestroy, AfterContentInit {
 
   constructor(private externalService: ExternalPageService, 
     private spinner: NgxSpinnerService,
@@ -104,6 +104,11 @@ export class ExternalPageContentComponent implements OnInit, OnDestroy {
     this.contentSubscription.unsubscribe();
   }
 
+  ngAfterContentInit() {
+    // $(document).ready(function(){
+    //   $('.carousel').carousel(); 
+    // })
+  }
 
 
 }

+ 62 - 1
src/app/External-Page/new-page/new-page.component.css

@@ -138,11 +138,72 @@ transition: all 0.5s;
     background: linear-gradient(1turn,#e6ded5cc, #e6e6e6, #e6e6e6);
 }
 
+.saredLinks-w {
+    width: 50%;
+    float: left;
+    display: inline-block;
+    padding: 10px 0;
+}
+
+.saredLinks-w li {
+    display: inline-block;
+    margin: 0 5px;
+}
+
+.saredLinks-w li button {
+    width: 30px;
+    height: 30px;
+    background-color: transparent;
+    border: none;
+    color: #fff;
+    cursor: pointer;
+    transition: all 0.5s;
+	border-radius: 3px;
+}
+
+.saredLinks-w li button:hover {
+    transform: rotate(180deg);
+}
+
+.saredLinks-w li .facebook {
+    background-color: #3b5a97;
+}
+
+.saredLinks-w li .twitter {
+    background-color: #21a1f2;
+}
+
+.saredLinks-w li .linkedin {
+    background-color: #0676b5;
+}
+
+.saredLinks-w li .googleplus {
+    background-color: #e21414;
+}
+
+.saredLinks-w li .whatsapp{
+    background-color: #4fc248;
+}
+
+.saredLinks-w li .whatsapp a {
+    color: #fff;
+    text-decoration: none;
+}
+
 
 @media(max-width:767px){
     .inside_links{
 		display: none !important;
-	}
+    }
+    .saredLinks-w li button{
+        margin: 5px 0;
+    }
+}
+
+@media(min-width:767px) and (max-width: 991px) {
+    .saredLinks-w li button{
+        margin: 5px 0;
+    }
 }
 
 

+ 6 - 11
src/app/External-Page/new-page/new-page.component.html

@@ -14,12 +14,12 @@
                     <div class="row">
                       <div class="col-6">
                         <div class="socialMedia-w">
-                          <ul class="list-unstyled">
-                            <!-- <li><button class="facebook" ceiboShare  [facebook]="{u: repoUrl}"><i class="fab fa-facebook-f"></i></button></li>
+                          <ul class="list-unstyled saredLinks-w" style="float:right;">
+                            <li><button class="facebook" ceiboShare  [facebook]="{u: repoUrl}"><i class="fab fa-facebook-f"></i></button></li>
                             <li><button class="linkedin" ceiboShare  [linkedIn]="{url:repoUrl}"><i class="fab fa-linkedin-in"></i></button></li>
                             <li><button class="googleplus" ceiboShare  [googlePlus]="{url:repoUrl}"><i class="fab fa-google-plus-g"></i></button></li>
                             <li> <button class="whatsapp"> <a href="{{'http://example.org/?test=' + url}}"><i class="fab fa-whatsapp"></i></a></button></li>
-                            <li><button class="twitter" ceiboShare  [twitter]="{url:repoUrl, text:'Checkout this awesome ng2 social share directive', hashtags:'angular2, social, ceiboIT'}"><i class="fab fa-twitter"></i></button></li> -->
+                            <li><button class="twitter" ceiboShare  [twitter]="{url:repoUrl, text:'Checkout this awesome ng2 social share directive', hashtags:'angular2, social, ceiboIT'}"><i class="fab fa-twitter"></i></button></li>
                           </ul>
                         </div>
                       </div>
@@ -105,18 +105,13 @@
                 <div class="reprtDetail-w">
                   <div class="row">
                     <div class="col-6">
-                      <div class="dateReport-w">
-                        <p>{{reportData.created_at}}</p>
-                      </div>
-                    </div>
-                    <div class="col-6">
                       <div class="socialMedia-w">
-                        <ul class="list-unstyled">
-                          <!-- <li><button class="facebook" ceiboShare  [facebook]="{u: repoUrl}"><i class="fab fa-facebook-f"></i></button></li>
+                        <ul class="list-unstyled saredLinks-w" style="text-align: left; direction: ltr;float: left !important;width:100%">
+                          <li><button class="facebook" ceiboShare  [facebook]="{u: repoUrl}"><i class="fab fa-facebook-f"></i></button></li>
                           <li><button class="linkedin" ceiboShare  [linkedIn]="{url:repoUrl}"><i class="fab fa-linkedin-in"></i></button></li>
                           <li><button class="googleplus" ceiboShare  [googlePlus]="{url:repoUrl}"><i class="fab fa-google-plus-g"></i></button></li>
                           <li> <button class="whatsapp"> <a href="{{'http://example.org/?test=' + url}}"><i class="fab fa-whatsapp"></i></a></button></li>
-                          <li><button class="twitter" ceiboShare  [twitter]="{url:repoUrl, text:'Checkout this awesome ng2 social share directive', hashtags:'angular2, social, ceiboIT'}"><i class="fab fa-twitter"></i></button></li> -->
+                          <li><button class="twitter" ceiboShare  [twitter]="{url:repoUrl, text:'Checkout this awesome ng2 social share directive', hashtags:'angular2, social, ceiboIT'}"><i class="fab fa-twitter"></i></button></li>
                         </ul>
                       </div>
                     </div>

+ 0 - 30
src/app/Internal-Page/internal-page-content/internal-page-content.component.html

@@ -228,22 +228,6 @@
                                         </div>
                                     </div>
                                 </div>
-                                <!-- <div class="recordsContent-w">
-                                    <div class="accordion" id="accordionExample">
-                                        <div class="panel-group testGroup-w" *ngFor="let achiev of achievements; let i = index"  id="accordion">
-                                            <div class="panel panel-default">
-                                                <div class="panel-heading accordion-toggle collapsed" id="{{ 'heading' + (i+1) }}" data-toggle="collapse" [attr.data-target]=" '#collapse' + (i+1) " [attr.aria-controls] = " 'collapse' + (i+1) ">
-                                                    <h4 class="panel-title">{{achiev.title}}</h4>
-                                                </div>
-                                                <div id="{{ 'collapse'+(i+1) }}" class="panel-collapse collapse" [attr.aria-labelledby] = " 'heading' + (i+1) " data-parent="#accordionExample">
-                                                    <div class="panel-body testBody-w">
-                                                        <p [innerHTML]="achiev.description"></p>
-                                                    </div>
-                                                </div>
-                                            </div>
-                                        </div>
-                                    </div>
-                                </div> -->
                             </div>
                         </div>
                     </div>
@@ -463,20 +447,6 @@
                             General Statistics - Achievements
                         </div>
                         <div class="recordsContent-w">
-                            <!-- <div class="accordion" id="accordionExample">
-                                <div class="panel-group testGroupEn-w" *ngFor="let achiev of achievements; let i = index"  id="accordion">
-                                    <div class="panel panel-default">
-                                        <div class="panel-headingEn accordion-toggle collapsed" id="{{ 'heading' + (i+1) }}" data-toggle="collapse" [attr.data-target]=" '#collapse' + (i+1) " [attr.aria-controls] = " 'collapse' + (i+1) ">
-                                            <h4 class="panel-title">{{achiev.title_en}}</h4>
-                                        </div>
-                                        <div id="{{ 'collapse'+(i+1) }}" class="panel-collapse collapse" [attr.aria-labelledby] = " 'heading' + (i+1) " data-parent="#accordionExample">
-                                            <div class="panel-body testBodyEn-w">
-                                                <p [innerHTML]="achiev.description_en"></p>
-                                            </div>
-                                        </div>
-                                    </div>
-                                </div>
-                            </div> -->
                             <div id="accordion">
                                 <div class="card" *ngFor="let achiev of achievements; let i = index">
                                     <div class="card-header" [attr.id]="'heading'+(i+1)">

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

@@ -24,7 +24,7 @@ import { CircularsPageComponent } from './circulars-page/circulars-page.componen
 import { NgxSpinnerModule } from 'ngx-spinner';
 import { SharedModule } from '../shared/shared.module';
 
-import { CeiboShare } from 'ng2-social-share';
+//import { CeiboShare } from 'ng2-social-share';
 
 @NgModule({
     declarations: [
@@ -36,7 +36,7 @@ import { CeiboShare } from 'ng2-social-share';
         CircularsPageComponent,
         EventsDateComponent,
         NewsPagesComponent,
-        CeiboShare,
+        //CeiboShare,
     ],
     imports: [
         CommonModule,

+ 1 - 1
src/app/Internal-Page/news-page/news-page.component.html

@@ -22,7 +22,7 @@
                 <div class="row">
                   <div class="col-12 col-sm-12 col-md-11" style="margin-left: auto;margin-right: auto;">
                   
-                   <ul class="list-unstyled saredLinks-w">
+                   <ul class="list-unstyled saredLinks-w" style="float:right">
                       <li><button class="facebook" ceiboShare  [facebook]="{u: repoUrl}"><i class="fab fa-facebook-f"></i></button></li>
                       <li><button class="linkedin" ceiboShare  [linkedIn]="{url:repoUrl}"><i class="fab fa-linkedin-in"></i></button></li>
                       <li><button class="googleplus" ceiboShare  [googlePlus]="{url:repoUrl}"><i class="fab fa-google-plus-g"></i></button></li>

+ 3 - 1
src/app/Internal-Page/news-page/news-page.component.ts

@@ -3,7 +3,7 @@ import { ActivatedRoute, Params } from '@angular/router';
 import { Component, OnInit } from '@angular/core';
 import { InternalPageService } from '../../shared/internal-page.service';
 import { NgxSpinnerService } from 'ngx-spinner';
-import { CeiboShare } from 'ng2-social-share';
+//import { CeiboShare } from 'ng2-social-share';
 
 
 @Component({
@@ -13,8 +13,10 @@ import { CeiboShare } from 'ng2-social-share';
 })
 
 export class NewsPageComponent implements OnInit {
+
   public repoUrl = '';
   public imageUrl = '';
+  
   constructor(private route: ActivatedRoute, 
     private authSer:AuthServiceService, 
     private spinner: NgxSpinnerService,

+ 74 - 28
src/app/dashboard/external-services/add-external/add-external.component.ts

@@ -1,3 +1,4 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { ActivatedRoute, Params } from '@angular/router';
 import { Location } from '@angular/common';
@@ -26,7 +27,7 @@ export class AddExternalComponent implements OnInit {
   checkSaveClick:boolean = false;
   typeLink: string = '';
   externalId: number;
-
+  serviceId: number;
   external = {
     name: '',
     name_en: '',
@@ -40,6 +41,7 @@ export class AddExternalComponent implements OnInit {
     private location: Location,
     private route: ActivatedRoute,
     private authSer: AuthServiceService,
+    private dashBoardService: DashboardService,
     private authService: AuthServiceService,
     private externalService: ExternalSerService) { }
 
@@ -53,6 +55,13 @@ export class AddExternalComponent implements OnInit {
     this.authSer.showDashboardHeader = true;
     this.authSer.internalHeader = false;
     this.external.status = "1";
+
+    this.route.parent.params.subscribe(
+      (params: Params) => {
+        this.serviceId = params['serviceID'];
+      }
+    );
+
     this.route.params.subscribe(
       (params: Params) => {
         if(params['typeExternalMode'] == 'edit') {
@@ -60,7 +69,7 @@ export class AddExternalComponent implements OnInit {
           this.typeMode = true;
           this.typeLink = 'تعديل';
           this.externalId = params['editExternalId'];
-          this.externalService.getExternalData(this.externalId).subscribe(
+          this.dashBoardService.getItemData(this.externalId, 'externalService').subscribe(
             (responce) => {
               console.log(responce['external_service']);
               this.external.name = responce['external_service'].name;
@@ -77,7 +86,7 @@ export class AddExternalComponent implements OnInit {
             (error) => {
               console.log(error);
             }
-          )
+          );
         } else {
           this.typeLink = 'أنشاء جديد';
         }
@@ -108,8 +117,10 @@ export class AddExternalComponent implements OnInit {
 
  //on submitted
  onSubmitted() {
-   this.checkSaveClick = true;
+
+  this.checkSaveClick = true;
   const formData = this.externalFormData.value;
+
   if(this.checkChangeImage){
     formData['photo'] = this.imageBase64;
     formData['photo_type'] = this.photoType[1];
@@ -119,6 +130,7 @@ export class AddExternalComponent implements OnInit {
     this.photoEdit = false;
     console.log(formData);
   }
+
   if(this.typeMode){
     if((this.photoType[1] != 'png' && this.photoType[1] != 'gif') && this.photoEdit == true) {
       this.toastr.warning('الصوره يجب أن تكون بصيغه Png');
@@ -127,19 +139,35 @@ export class AddExternalComponent implements OnInit {
       this.toastr.warning('قم باختيار صوره !');
       this.checkSaveClick = false;
     } else {
-      this.externalService.editExternal(formData, this.externalId).subscribe(
-        (responce) => {
-          console.log(responce);
-          this.toastr.success('تمت التعديل بنجاح');
-          this.location.back();
-          this.checkSaveClick = true;
-        },
-        (error) => {
-          console.log(error);
-          this.checkSaveClick = false;
-          this.toastr.error('خطأ في التعديل !');
-        }
-      );
+      if(this.serviceId == 6) {
+        this.dashBoardService.editItem( this.externalId, formData, 'internalServiceExternalPage').subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تمت التعديل بنجاح');
+            this.location.back();
+            this.checkSaveClick = true;
+          },
+          (error) => {
+            console.log(error);
+            this.checkSaveClick = false;
+            this.toastr.error('خطأ في التعديل !');
+          }
+        );
+      } else if(this.serviceId == 2) {
+        this.dashBoardService.editItem( this.externalId, formData, 'externalServiceExternalPage').subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تمت التعديل بنجاح');
+            this.location.back();
+            this.checkSaveClick = true;
+          },
+          (error) => {
+            console.log(error);
+            this.checkSaveClick = false;
+            this.toastr.error('خطأ في التعديل !');
+          }
+        );
+      }
     }
   } else {
     if(this.photoType[1] != 'png' && this.photoType[1] != 'gif') {
@@ -149,19 +177,37 @@ export class AddExternalComponent implements OnInit {
       this.toastr.warning('قم باختيار صوره !');
       this.checkSaveClick = false;
     } else {
-      this.externalService.addExternal(formData).subscribe(
-        (responce) => {
-          console.log(responce);
+
+      if(this.serviceId == 6){
+        this.dashBoardService.addItem(formData, 'internalServiceExternalPage').subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تمت الاضافه بنجاح');
+            this.location.back();
+            this.checkSaveClick = true;
+          },
+          (error) => {
+            console.log(error);
+            this.toastr.error('خطأ في الحفظ !');
+            this.checkSaveClick = false;
+          }
+        );
+      } else if(this.serviceId == 2){
+        console.log(formData);
+        this.dashBoardService.addItem(formData, 'externalServiceExternalPage').subscribe(
+          (responce) => {
           this.toastr.success('تمت الاضافه بنجاح');
           this.location.back();
-          this.checkSaveClick = true;
-        },
-        (error) => {
-          console.log(error);
-          this.toastr.error('خطأ في الحفظ !');
-          this.checkSaveClick = false;
-        }
-      );
+          this.checkSaveClick = true
+          },
+          (error) => {
+            console.log(error);
+            this.toastr.error('خطأ في الحفظ !');
+            this.checkSaveClick = false;
+          }
+        );
+      }
+
     }
   }
  }

+ 40 - 19
src/app/dashboard/external-services/external-list/external-list.component.ts

@@ -1,3 +1,4 @@
+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';
@@ -37,6 +38,7 @@ export class ExternalListComponent implements OnInit {
     private externalService: ExternalSerService,
     private spinner: NgxSpinnerService,
     private modal: Modal,
+    private dashBoardService: DashboardService,
     private authSer: AuthServiceService) { }
 
   ngOnInit() {
@@ -70,21 +72,41 @@ export class ExternalListComponent implements OnInit {
           (responce) => {
             console.log(responce);
             this.pages = responce['pages'];
-            for(let i = 0; i< this.pages.length; i++) {
-              if(this.pages[i].id == 7) {
-                for(let j = 0; j < this.pages[i].permissions.length; j++) {
-                  if(this.pages[i].permissions[j].name == 'add_external_service'){
-                    this.authSer.showAddBtn = true;
+            if(this.serviceId == 6) {
+              for(let i = 0; i< this.pages.length; i++) {
+                if(this.pages[i].id == 7) {
+                  for(let j = 0; j < this.pages[i].permissions.length; j++) {
+                    if(this.pages[i].permissions[j].name == 'add_external_service'){
+                      this.authSer.showAddBtn = true;
+                    }
+                    if(this.pages[i].permissions[j].name == 'edit_external_service'){
+                      this.authSer.showEditBtn = true;
+                    }
+                    if(this.pages[i].permissions[j].name == 'delete_external_services'){
+                      this.authSer.showDeleteBtn = true;
+                    }
                   }
-                  if(this.pages[i].permissions[j].name == 'edit_external_service'){
-                    this.authSer.showEditBtn = true;
-                  }
-                  if(this.pages[i].permissions[j].name == 'delete_external_services'){
-                    this.authSer.showDeleteBtn = true;
+                }else {
+                  console.log('no events');
+                }
+              }
+            } else if(this.serviceId == 2){
+              for(let i = 0; i< this.pages.length; i++) {
+                if(this.pages[i].id == 19) {
+                  for(let j = 0; j < this.pages[i].permissions.length; j++) {
+                    if(this.pages[i].permissions[j].name == 'add_external_service_ex'){
+                      this.authSer.showAddBtn = true;
+                    }
+                    if(this.pages[i].permissions[j].name == 'edit_external_service_ex'){
+                      this.authSer.showEditBtn = true;
+                    }
+                    if(this.pages[i].permissions[j].name == 'delete_external_services_ex'){
+                      this.authSer.showDeleteBtn = true;
+                    }
                   }
+                }else {
+                  console.log('no events');
                 }
-              }else {
-                console.log('no events');
               }
             }
             this.spinner.hide();
@@ -95,7 +117,7 @@ export class ExternalListComponent implements OnInit {
     );
 
     //get list data 
-    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.externalsList = responce['external_services'];
@@ -133,7 +155,7 @@ export class ExternalListComponent implements OnInit {
     this.currentPage = 1;
     console.log('search curent page', this.currentPage);
     console.log('search page id', this.externalId);
-    this.externalService.getDataUSerSearchBar(dataSearch, this.externalId, this.currentPage, this.dataTableNumber).subscribe(
+    this.dashBoardService.getDataUSerSearchBar(dataSearch, this.externalId, this.currentPage, this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.externalsList = responce['external_services'];
@@ -155,7 +177,7 @@ export class ExternalListComponent implements OnInit {
       this.externalsList = [];
       //console.log(pagenationNumber);
       //console.log(this.pageId);
-      this.externalService.getExternalsList(this.externalId, pagenationNumber, this.dataTableNumber).subscribe(
+      this.dashBoardService.getListData(this.externalId, pagenationNumber, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.externalsList = responce['external_services'];
@@ -203,7 +225,7 @@ export class ExternalListComponent implements OnInit {
     this.spinner.show();
     this.externalsList = [];
     this.dataTableNumber = event.target.value;
-    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.externalsList = responce['external_services'];
@@ -238,13 +260,13 @@ export class ExternalListComponent implements OnInit {
       .open();
         dialogRef.result
         .then( result => 
-          this.externalService.deleteEvent(this.externalsListIds).subscribe(
+          this.dashBoardService.deleteItem(this.externalsListIds, this.externalId).subscribe(
             (responce) => {
               console.log(responce);
               this.toastr.success('تم الحذف');
               this.spinner.show();
               this.externalsList = [];
-              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.externalsList = responce['external_services'];
@@ -283,5 +305,4 @@ export class ExternalListComponent implements OnInit {
     this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'externalService/edit/' + editEventID]);
   }
   
-
 }

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

@@ -4,8 +4,8 @@
     <div class="row" style="margin-bottom: 30px;">
       <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">{{serviceName}} </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>

+ 69 - 24
src/app/dashboard/footer/add-footer/add-footer.component.ts

@@ -1,3 +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';
@@ -24,6 +25,9 @@ export class AddFooterComponent implements OnInit {
   photoEdit: boolean = true;
   typeLink: string = '';
   externalId: number;
+  serviceId: number;
+
+  serviceName: string = '';
 
   footer = {
     name: '',
@@ -38,6 +42,7 @@ export class AddFooterComponent implements OnInit {
     private location: Location,
     private authSer: AuthServiceService,
     private route: ActivatedRoute,
+    private dashBoardService: DashboardService,
     private footerService: FooterService) { }
 
   ngOnInit() {
@@ -53,6 +58,17 @@ export class AddFooterComponent implements OnInit {
     this.authSer.showHeaderDashBoard = true;
     this.authSer.showDashboardHeader = true;
     this.authSer.internalHeader = false;
+
+    this.route.parent.params.subscribe(
+      (params: Params) => {
+        this.serviceId = params['serviceID'];
+        if(this.serviceId == 2) {
+          this.serviceName = 'خدمه إداره الصفحه الخارجيه';
+        } else if (this.serviceId == 6) {
+          this.serviceName = 'خدمه إداره المحتوي';
+        }
+      }
+    );
     
     this.route.params.subscribe(
       (params: Params) => {
@@ -61,7 +77,7 @@ export class AddFooterComponent implements OnInit {
           this.spinner.show();
           this.typeMode = true;
           this.externalId = params['editFooterId'];
-          this.footerService.getFooterData(this.externalId).subscribe(
+          this.dashBoardService.getItemData(this.externalId, 'footer').subscribe(
             (responce) => {
               console.log(responce['footer']);
               this.footer.name = responce['footer'].name;
@@ -83,7 +99,8 @@ export class AddFooterComponent implements OnInit {
           this.typeLink = 'إنشاء جديد';
         }
       }
-    )
+    );
+
   }
 
 
@@ -126,17 +143,31 @@ export class AddFooterComponent implements OnInit {
     } else if(this.imageBase64 == '' && this.photoEdit == true){
       this.toastr.warning('قم باختيار صوره !');
     } else {
-      this.footerService.editFooter(formData, this.externalId).subscribe(
-        (responce) => {
-          console.log(responce);
-          this.toastr.success('تمت التعديل بنجاح');
-          this.location.back();
-        },
-        (error) => {
-          console.log(error);
-          this.toastr.error('خطأ في التعديل !');
-        }
-      );
+      if(this.serviceId == 2) {
+        this.dashBoardService.editItem( this.externalId, formData, 'internalFooter').subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تمت التعديل بنجاح');
+            this.location.back();
+          },
+          (error) => {
+            console.log(error);
+            this.toastr.error('خطأ في التعديل !');
+          }
+        );
+      } else if(this.serviceId == 6){
+        this.dashBoardService.editItem( this.externalId, formData, 'externalFooter').subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تمت التعديل بنجاح');
+            this.location.back();
+          },
+          (error) => {
+            console.log(error);
+            this.toastr.error('خطأ في التعديل !');
+          }
+        );
+      }
     }
   } else {
     if(this.photoType[1] != 'png') {
@@ -146,17 +177,31 @@ export class AddFooterComponent implements OnInit {
     } else {
       // formData['photo'] = this.imageBase64;
       // formData['photo_type'] = this.photoType[1];
-      this.footerService.addFooter(formData).subscribe(
-        (responce) => {
-          console.log(responce);
-          this.toastr.success('تمت الاضافه بنجاح');
-          this.location.back();
-        },
-        (error) => {
-          console.log(error);
-          this.toastr.error('خطأ في الحفظ !');
-        }
-      );
+      if(this.serviceId == 2) {
+        this.dashBoardService.addItem(formData, 'externalFooter').subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تمت الاضافه بنجاح');
+            this.location.back();
+          },
+          (error) => {
+            console.log(error);
+            this.toastr.error('خطأ في الحفظ !');
+          }
+        );
+      } else if(this.serviceId == 6){
+        this.dashBoardService.addItem(formData, 'internalFooter').subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تمت الاضافه بنجاح');
+            this.location.back();
+          },
+          (error) => {
+            console.log(error);
+            this.toastr.error('خطأ في الحفظ !');
+          }
+        );
+      }
     }
   }
   

+ 1 - 1
src/app/dashboard/footer/footer-list/footer-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">{{serviceName}}</li>
         <li class="headingText-w activeLi-w" style="margin-right:5px"> إدارة الفوتر</li>
       </ul>
     </div>

+ 32 - 8
src/app/dashboard/footer/footer-list/footer-list.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 { NgxSpinnerService } from 'ngx-spinner';
@@ -30,12 +31,16 @@ export class FooterListComponent implements OnInit {
   dataTableNumber: number = 5;
   pages = [];
 
+  serviceName: string = '';
+
+
   constructor(private route: ActivatedRoute, 
     private router: Router, 
     private userSer: UserService,
     private http: HttpClient,
     private modal: Modal,
     private toastr: ToastrService,
+    private dashboardService: DashboardService,
     private footerService: FooterService,
     private spinner: NgxSpinnerService,
     private authSer: AuthServiceService) { }
@@ -54,6 +59,7 @@ export class FooterListComponent implements OnInit {
     this.authSer.showHeaderDashBoard = true;
     this.authSer.showDashboardHeader = true;
     this.authSer.internalHeader = false;
+
     
     this.route.params.subscribe(
       (params: Params) => {
@@ -67,6 +73,11 @@ export class FooterListComponent implements OnInit {
     (params:Params) => {
         this.userLoginId = params['userID'];
         this.serviceId = params['serviceID'];
+        if(this.serviceId == 6) {
+          this.serviceName = 'خدمه إداره المحتوي';
+        } else if(this.serviceId == 2) {
+          this.serviceName = 'خدمه إداره الصفحه الخارجيه';
+        }
         this.userSer.getPagesPermetiotns(this.userLoginId, this.serviceId).subscribe(
           (responce) => {
             console.log(responce);
@@ -84,7 +95,20 @@ export class FooterListComponent implements OnInit {
                     this.authSer.showDeleteBtn = true;
                   }
                 }
-              }else {
+              } else if(this.pages[i].id == 29) {
+                for(let j = 0; j < this.pages[i].permissions.length; j++) {
+                  if(this.pages[i].permissions[j].name == 'add_footer_ex'){
+                    this.authSer.showAddBtn = true;
+                  }
+                  if(this.pages[i].permissions[j].name == 'edit_footer_ex'){
+                    this.authSer.showEditBtn = true;
+                  }
+                  if(this.pages[i].permissions[j].name == 'delete_footers_ex'){
+                    this.authSer.showDeleteBtn = true;
+                  }
+                }
+              }
+              else {
                 console.log('no events');
               }
             }
@@ -96,7 +120,7 @@ export class FooterListComponent implements OnInit {
     );
 
     //get list data 
-    this.footerService.getFooterList(this.footerId, this.currentPage ,this.dataTableNumber).subscribe(
+    this.dashboardService.getListData(this.footerId, this.currentPage ,this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.footerList = responce['footers'];
@@ -134,7 +158,7 @@ export class FooterListComponent implements OnInit {
     this.currentPage = 1;
     console.log('search curent page', this.currentPage);
     console.log('search page id', this.footerId);
-    this.footerService.getDataUSerSearchBar(dataSearch, this.footerId, this.currentPage, this.dataTableNumber).subscribe(
+    this.dashboardService.getDataUSerSearchBar(dataSearch, this.footerId, this.currentPage, this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.footerList = responce['footers'];
@@ -156,7 +180,7 @@ export class FooterListComponent implements OnInit {
       this.footerList = [];
       //console.log(pagenationNumber);
       //console.log(this.pageId);
-      this.footerService.getFooterList(this.footerId, pagenationNumber, this.dataTableNumber).subscribe(
+      this.dashboardService.getListData(this.footerId, pagenationNumber, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.footerList = responce['footers'];
@@ -177,7 +201,7 @@ export class FooterListComponent implements OnInit {
     this.spinner.show();
     this.footerList = [];
     this.dataTableNumber = event.target.value;
-    this.footerService.getFooterList(this.footerId, this.currentPage, this.dataTableNumber).subscribe(
+    this.dashboardService.getListData(this.footerId, this.currentPage, this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.footerList = responce['footers'];
@@ -196,7 +220,6 @@ export class FooterListComponent implements OnInit {
 
 
   onDelete() {
-    this.footerListIds = [];
     for(let i = 0; i < this.footerList.length; i++) {
       if(this.footerList[i].selected == true) {
         this.footerListIds.push(this.footerList[i].id);
@@ -205,6 +228,7 @@ export class FooterListComponent implements OnInit {
 
     console.log(this.footerListIds);
     if(this.footerListIds.length > 0) {
+      this.footerListIds = [];
       const dialogRef = this.modal.alert()
       .size('sm')
       .showClose(true)
@@ -216,13 +240,13 @@ export class FooterListComponent implements OnInit {
   
         dialogRef.result
         .then( result => 
-          this.footerService.deleteFooter(this.footerListIds).subscribe(
+          this.dashboardService.deleteItem(this.footerListIds, this.footerId).subscribe(
             (responce) => {
               console.log(responce);
               this.toastr.success('تم الحذف');
               this.spinner.show();
               this.footerList = [];
-              this.footerService.getFooterList(this.footerId, this.currentPage, this.dataTableNumber).subscribe(
+              this.dashboardService.getListData(this.footerId, this.currentPage, this.dataTableNumber).subscribe(
                 (responce) => {
                   console.log(responce);
                   this.footerList = responce['footers'];

+ 23 - 14
src/app/dashboard/hospitals/add-hospital/add-hospital.component.html

@@ -4,7 +4,7 @@
     <div class="row">
       <div class="col-12">
         <ul class="list-unstyled titileLi-w">
-          <li class="headingText-w">خدمه إداره المحتوي </li>
+          <li class="headingText-w">{{servicesType}} </li>
           <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()"> {{typeFirstLink}} > </li>
           <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typeLink}} </li>
         </ul>
@@ -19,14 +19,14 @@
                 <div class="row">
                   <div class="col-12 col-sm-12 col-md-4 col-lg-4">
                       <div class="form-group">
-                          <label style="float: right; margin: 5px 0">الاسم باللغه العربيه <span class="spanReqired-w">*</span></label>
-                          <input type="text" class="form-control" placeholder="الأسم باللغه العربيه" formControlName="name"/>
+                        <label style="float: right; margin: 5px 0">الاسم باللغه العربيه <span class="spanReqired-w">*</span></label>
+                        <input type="text" class="form-control" placeholder="الأسم باللغه العربيه" formControlName="name"/>
                       </div>
                   </div>
                   <div class="col-12 col-sm-12 col-md-4 col-lg-4">
                     <div class="form-group">
-                        <label style="float: right; margin: 5px 0">الاسم باللغه الأنجليزيه <span class="spanReqired-w">*</span></label>
-                        <input type="text" class="form-control" placeholder="الأسم باللغه الإنجليزيه" formControlName="name_en"/>
+                      <label style="float: right; margin: 5px 0">الاسم باللغه الأنجليزيه <span class="spanReqired-w">*</span></label>
+                      <input type="text" class="form-control" placeholder="الأسم باللغه الإنجليزيه" formControlName="name_en"/>
                     </div>
                   </div>
                   <div class="col-12 col-sm-12 col-md-4 col-lg-4">
@@ -34,6 +34,15 @@
                         <button class="btn btn-secondary rightW" type="button" style="margin-top:33px" (click)="onAddTitle()">أضف المزيد من العناوين </button>
                     </div>
                   </div>
+                  <div class="col-12 col-sm-12 col-md-4 col-lg-4" *ngIf="showAppearance">
+                    <div class="form-group">
+                      <label style="float: right; margin: 5px 0">الظهور<span class="spanReqired-w">*</span></label>
+                      <select class="form-control" formControlName="display_location" id="displayLocation">
+                        <option value="internal">داخليه</option>
+                        <option value="external">خارجيه</option>
+                      </select>
+                    </div>
+                  </div>
                 </div>
               
                 <div formArrayName="fields" *ngFor="let titleControl of addHospitalForm.get('fields').controls; let i = index" style="padding: 20px 0;">
@@ -66,17 +75,17 @@
                       </div>
                         
           
-                        <div class="col-12">
-                          <div class="form-group">
-                            <label id="description_en" style="float: right; margin: 10px 5px">الوصف باللغه الإنجليزيه</label>
-                            <quill-editor id="description_en" formControlName="description_en">
-                            </quill-editor>
-                          </div>
+                      <div class="col-12">
+                        <div class="form-group">
+                          <label id="description_en" style="float: right; margin: 10px 5px">الوصف باللغه الإنجليزيه</label>
+                          <quill-editor id="description_en" formControlName="description_en">
+                          </quill-editor>
                         </div>
+                      </div>
 
-                        <div class="col-12">
-                          <button type="button" class="btn btn-danger rightW" (click)="removeTitle(i)" *ngIf="i == 0 ? false : true">حذف</button>
-                        </div>
+                      <div class="col-12">
+                        <button type="button" class="btn btn-danger rightW" (click)="removeTitle(i)" *ngIf="i == 0 ? false : true">حذف</button>
+                      </div>
       
                     </div>
                   </div>

+ 146 - 54
src/app/dashboard/hospitals/add-hospital/add-hospital.component.ts

@@ -1,3 +1,4 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { ActivatedRoute, Params } from '@angular/router';
 import { Subscription } from 'rxjs';
@@ -23,6 +24,7 @@ export class AddHospitalComponent implements OnInit, OnDestroy {
     private spinner: NgxSpinnerService,
     private toastr: ToastrService, 
     private authSer: AuthServiceService,
+    private dashboardService: DashboardService,
     private location: Location) { }
 
   addHospitalForm: FormGroup;
@@ -32,12 +34,16 @@ export class AddHospitalComponent implements OnInit, OnDestroy {
   typePageEdit: string = '';
   typeCreatePage: string = '';
   typeLink = 'إنشاء جديد';
+  showAppearance: boolean = false;
   typeFirstLink: string;
+  servicesType: string = '';
   typeId: number;
   editSubscription: Subscription;
   typeCreateSubscription: Subscription;
   fieldsData = [];
   
+  serviceID:number;
+
   ngOnInit() {
     //show / hide notification search in header
     this.authSer.notificationLogin = true;
@@ -48,19 +54,39 @@ export class AddHospitalComponent implements OnInit, OnDestroy {
     this.authSer.internalHeader = false;
     
     //init form data 
-    this.addHospitalForm = new FormGroup({
-      name: new FormControl(null , Validators.required),
-      name_en: new FormControl(null , Validators.required),
-      fields: this.formBuilder.array([ this.createItem() ])
-    });
+    
+
+    //set side navigation bar 
+    this.route.parent.params.subscribe(
+      (params: Params) => {
+        this.serviceID = params['serviceID'];
+        if(params['serviceID'] == 2) {
+          this.servicesType = 'خدمه إداره الصفحه الخارجيه';
+        } else if(params['serviceID'] == 6) {
+          this.servicesType = 'خدمه إداره المحتوي';
+        }
+      }
+    );
 
     this.typeCreateSubscription = this.route.params.subscribe(
       (params: Params) => {
         this.typeCreatePage = params['typeAdd'];
         if(this.typeCreatePage == 'Hospital') {
           this.typeFirstLink = 'المستشفيات والمراكز';
+          this.showAppearance = true;
+          this.addHospitalForm = new FormGroup({
+            name: new FormControl(null , Validators.required),
+            name_en: new FormControl(null , Validators.required),
+            display_location: new FormControl(null, Validators.required),
+            fields: this.formBuilder.array([ this.createItem() ])
+          });
         } else if(this.typeCreatePage == 'Management') {
           this.typeFirstLink = 'الإدارات';
+          this.addHospitalForm = new FormGroup({
+            name: new FormControl(null , Validators.required),
+            name_en: new FormControl(null , Validators.required),
+            fields: this.formBuilder.array([ this.createItem() ])
+          });
         }
       }
     );
@@ -69,18 +95,21 @@ export class AddHospitalComponent implements OnInit, OnDestroy {
     this.editSubscription =  this.route.params.subscribe(
         (params: Params) => {
           if(params['typeHospitalMode'] == 'edithos') {
+            this.spinner.show();
             this.typeLink = 'تعديل';
             this.typeFirstLink = 'المستشفيات والمراكز';
+            this.showAppearance = true;
             this.addHospitalForm = new FormGroup({
               name: new FormControl(null , Validators.required),
               name_en: new FormControl(null , Validators.required),
+              display_location: new FormControl(null, Validators.required),
               fields: this.formBuilder.array([])
             });
             this.spinner.show();
             this.typeMode = true;
             this.typePageEdit = 'edithos';
-            this.typeId = params['editTypePageId'];
-            this.hospitalService.getHospitalData(this.typeId, 'edithos').subscribe(
+            this.typeId = +params['editTypePageId'];
+            this.dashboardService.getItemData(this.typeId, 'hospital').subscribe(
               (responce) => {
                 console.log('responcce', responce);
                 this.fieldsData = responce['hospital_center'].fields;
@@ -88,6 +117,7 @@ export class AddHospitalComponent implements OnInit, OnDestroy {
                 this.addHospitalForm.patchValue({
                   name: responce['hospital_center'].name,
                   name_en: responce['hospital_center'].name_en,
+                  display_location: responce['hospital_center'].display_location,
                 });
                   this.fields = this.addHospitalForm.get('fields') as FormArray;
                   for(let i = 0; i < this.fieldsData.length; i++) {
@@ -107,6 +137,7 @@ export class AddHospitalComponent implements OnInit, OnDestroy {
               }
             );
           } else if (params['typeHospitalMode'] == 'editman') {
+            this.spinner.show();
             this.typeLink = 'تعديل';
             this.typeFirstLink = 'الإدارات';
             this.addHospitalForm = new FormGroup({
@@ -114,11 +145,13 @@ export class AddHospitalComponent implements OnInit, OnDestroy {
               name_en: new FormControl(null , Validators.required),
               fields: this.formBuilder.array([])
             });
-            this.spinner.show();
             this.typeMode = true;
             this.typePageEdit = "editman";
-            this.typeId = params['editTypePageId'];
-            this.hospitalService.getHospitalData(this.typeId, 'editman').subscribe(
+            this.typeId = +params['editTypePageId'];
+
+            this.typeId = +params['editTypePageId'];
+
+            this.dashboardService.getItemData(this.typeId, 'managament').subscribe(
               (responce) => {
                 console.log('responcce', responce);
                 this.fieldsData = responce['management'].fields;
@@ -172,7 +205,6 @@ export class AddHospitalComponent implements OnInit, OnDestroy {
 
   //submitted form
   onSubmitted() {
-
     this.checkSaveClick = true;
     console.log(this.addHospitalForm.value);
     const formHospitalData = this.addHospitalForm.value;
@@ -183,26 +215,8 @@ export class AddHospitalComponent implements OnInit, OnDestroy {
         this.toastr.warning('أدخل عنوان ووصف واحد علي الاقل !');
         this.checkSaveClick = false;
       } else {
-        this.hospitalService.addHospital(formHospitalData, 'hospital').subscribe(
-          (responce) => {
-            this.checkSaveClick = false;
-            console.log(responce);
-            this.toastr.success('تم الاضافه بنجاح');
-            this.location.back();
-          },
-          (error) => {
-            this.checkSaveClick = false;
-            this.toastr.error('خطأ في الإنشاء');
-            console.log(error);
-          }
-        );
-      }
-    } else if(this.typeCreatePage == 'Management') {
-      if(formHospitalData.fields[0].title == '' || formHospitalData.fields[0].description == '') {
-          this.toastr.warning('أدخل عنوان ووصف واحد علي الاقل !');
-          this.checkSaveClick = false;
-        } else {
-          this.hospitalService.addHospital(formHospitalData, 'management').subscribe(
+        if(this.serviceID == 6) {
+          this.dashboardService.addItem(formHospitalData, 'internalHospital').subscribe(
             (responce) => {
               this.checkSaveClick = false;
               console.log(responce);
@@ -211,11 +225,61 @@ export class AddHospitalComponent implements OnInit, OnDestroy {
             },
             (error) => {
               this.checkSaveClick = false;
-              this.toastr.error('خطأ في الاضافه');
+              this.toastr.error('خطأ في الإنشاء');
+              console.log(error);
+            }
+          );
+        } else if(this.serviceID == 2) {
+          this.dashboardService.addItem(formHospitalData, 'externalHospital').subscribe(
+            (responce) => {
+              this.checkSaveClick = false;
+              console.log(responce);
+              this.toastr.success('تم الاضافه بنجاح');
+              this.location.back();
+            },
+            (error) => {
+              this.checkSaveClick = false;
+              this.toastr.error('خطأ في الإنشاء');
               console.log(error);
             }
           );
         }
+      }
+    } else if(this.typeCreatePage == 'Management') {
+      if(formHospitalData.fields[0].title == '' || formHospitalData.fields[0].description == '') {
+          this.toastr.warning('أدخل عنوان ووصف واحد علي الاقل !');
+          this.checkSaveClick = false;
+        } else {
+          if(this.serviceID == 6) {
+            this.dashboardService.addItem(formHospitalData, 'internalManagement').subscribe(
+              (responce) => {
+                this.checkSaveClick = false;
+                console.log(responce);
+                this.toastr.success('تم الاضافه بنجاح');
+                this.location.back();
+              },
+              (error) => {
+                this.checkSaveClick = false;
+                this.toastr.error('خطأ في الاضافه');
+                console.log(error);
+              }
+            );
+          } else if(this.serviceID == 2) {
+            this.dashboardService.addItem(formHospitalData, 'externalManagement').subscribe(
+              (responce) => {
+                this.checkSaveClick = false;
+                console.log(responce);
+                this.toastr.success('تم الاضافه بنجاح');
+                this.location.back();
+              },
+              (error) => {
+                this.checkSaveClick = false;
+                this.toastr.error('خطأ في الاضافه');
+                console.log(error);
+              }
+            );
+          }
+        }
     }
 
     if(this.typeMode) {
@@ -225,34 +289,62 @@ export class AddHospitalComponent implements OnInit, OnDestroy {
           this.toastr.warning('أدخل عنوان ووصف واحد علي الاقل !');
           this.checkSaveClick = false;
         } else {
-          this.hospitalService.editHospital(this.typeId, formHospitalData, 'hospital').subscribe(
-            (responce) => {
-              this.checkSaveClick = false;
-              console.log(responce);
-              this.toastr.success('تم التعديل بنجاح ');
-            }, (error) => {
-              this.checkSaveClick = false;
-              console.log(error);
-              this.toastr.error('فشل التعديل !');
-            }
-          );
+          if(this.serviceID == 6) {
+            this.dashboardService.editItem(this.typeId, formHospitalData, 'internalHospital').subscribe(
+              (responce) => {
+                this.checkSaveClick = false;
+                console.log(responce);
+                this.toastr.success('تم التعديل بنجاح ');
+              }, (error) => {
+                this.checkSaveClick = false;
+                console.log(error);
+                this.toastr.error('فشل التعديل !');
+              }
+            );
+          } else if(this.serviceID == 2) {
+            this.dashboardService.editItem(this.typeId, formHospitalData, 'externalHospital').subscribe(
+              (responce) => {
+                this.checkSaveClick = false;
+                console.log(responce);
+                this.toastr.success('تم التعديل بنجاح ');
+              }, (error) => {
+                this.checkSaveClick = false;
+                console.log(error);
+                this.toastr.error('فشل التعديل !');
+              }
+            );
+          }
         }
       } else if(this.typePageEdit == 'editman'){
         if(formHospitalData.fields[0].title == '' || formHospitalData.fields[0].description == '') {
           this.toastr.warning('أدخل عنوان ووصف واحد علي الاقل !');
           this.checkSaveClick = false;
         } else {
-          this.hospitalService.editHospital(this.typeId, formHospitalData, 'management').subscribe(
-            (responce) => {
-              this.checkSaveClick = false;
-              console.log(responce);
-              this.toastr.success('تم التعديل بنجاح ');
-            }, (error) => {
-              this.checkSaveClick = false;
-              console.log(error);
-              this.toastr.error('فشل التعديل !');
-            }
-          )
+          if(this.serviceID == 6) {
+            this.dashboardService.editItem(this.typeId, formHospitalData, 'internalManagement').subscribe(
+              (responce) => {
+                this.checkSaveClick = false;
+                console.log(responce);
+                this.toastr.success('تم التعديل بنجاح ');
+              }, (error) => {
+                this.checkSaveClick = false;
+                console.log(error);
+                this.toastr.error('فشل التعديل !');
+              }
+            );
+          } else if(this.serviceID == 2) {
+            this.dashboardService.editItem(this.typeId, formHospitalData, 'externalManagement').subscribe(
+              (responce) => {
+                this.checkSaveClick = false;
+                console.log(responce);
+                this.toastr.success('تم التعديل بنجاح ');
+              }, (error) => {
+                this.checkSaveClick = false;
+                console.log(error);
+                this.toastr.error('فشل التعديل !');
+              }
+            );
+          }
         }
       }
     }

+ 40 - 19
src/app/dashboard/hospitals/hospital-list/hospital-list.component.ts

@@ -1,3 +1,4 @@
+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';
@@ -21,7 +22,10 @@ export class HospitalListComponent implements OnInit {
     private spinner: NgxSpinnerService,
     private toastr: ToastrService,
     private modal: Modal,
-    private hospitalService: HospitalService) { }
+    private dashboardService: DashboardService,
+    private hospitalService: HospitalService) {
+      this.spinner.show();
+     }
 
   dataList = [];
   dataListIds = [];
@@ -41,7 +45,6 @@ export class HospitalListComponent implements OnInit {
 
   ngOnInit() {
 
-    this.spinner.show();
 
     //init the values of permision boolean
    this.authSer.showAddBtn = false;
@@ -63,11 +66,14 @@ export class HospitalListComponent implements OnInit {
           this.typeLink = 'المستشفيات والمراكز';
           this.typeServices = 'خدمه إداره المحتوي';
         } else if(this.pageId == 10) {
-          this.typeLink = 'الإدرات';
+          this.typeLink = 'الإدارات';
           this.typeServices = 'خدمه الصلاحيات';
         } else if(this.pageId == 30) {
           this.typeLink = 'المستشفيات والمراكز';
           this.typeServices = 'خدمه إداره الصفحه الخارجيه';
+        } else if(this.pageId == 31) {
+          this.typeServices = 'خدمه إداره الصفحه الخارجيه';
+          this.typeLink = 'الإدارات';
         }
       }
     );
@@ -78,7 +84,7 @@ export class HospitalListComponent implements OnInit {
         this.userLoginId = params['userID'];
         this.serviceId = params['serviceID'];
         if(this.pageId == 6 || this.pageId == 30) {
-          this.hospitalService.getHospitalsList(this.pageId , this.currentPage, this.dataTableNumber).subscribe(
+          this.dashboardService.getListData(this.pageId , this.currentPage, this.dataTableNumber).subscribe(
             (responce) => {
               console.log(responce);
               this.dataList = responce['hospital_centers'];
@@ -126,8 +132,9 @@ export class HospitalListComponent implements OnInit {
             },
             (error) => {console.log(error)}
           );
-        } else if(this.pageId == 10) {
-          this.hospitalService.getHospitalsList(this.pageId , this.currentPage, this.dataTableNumber).subscribe(
+        } else if(this.pageId == 10 || this.pageId == 31) {
+          
+          this.dashboardService.getListData(this.pageId , this.currentPage, this.dataTableNumber).subscribe(
             (responce) => {
               console.log(responce);
               this.dataList = responce['managements'];
@@ -138,6 +145,7 @@ export class HospitalListComponent implements OnInit {
               console.log(error);
             }
           );
+
           this.userSer.getPagesPermetiotns(this.userLoginId, this.serviceId).subscribe(
             (responce) => {
               this.pages = responce['pages'];
@@ -155,7 +163,20 @@ export class HospitalListComponent implements OnInit {
                       this.authSer.showDeleteBtn = true;
                     }
                   }
-                }else {
+                } else if(this.pageId == 31) {
+                  for(let j = 0; j < this.pages[i].permissions.length; j++) {
+                    if(this.pages[i].permissions[j].name == 'add_management_ex'){
+                      this.authSer.showAddBtn = true;
+                    }
+                    if(this.pages[i].permissions[j].name == 'edit_management_ex'){
+                      this.authSer.showEditBtn = true;
+                    }
+                    if(this.pages[i].permissions[j].name == 'delete_managements_ex'){
+                      this.authSer.showDeleteBtn = true;
+                    }
+                  }
+                }
+                else {
                   console.log('no roles');
                 }
               }
@@ -183,6 +204,7 @@ export class HospitalListComponent implements OnInit {
 
     //deleted function
     onDelete() {
+      
       this.dataListIds = [];
       for(let i = 0; i < this.dataList.length; i++) {
         if(this.dataList[i].selected == true) {
@@ -203,13 +225,13 @@ export class HospitalListComponent implements OnInit {
       .open();
         dialogRef.result
             .then( result => 
-              this.hospitalService.deleteDatas(this.dataListIds, this.pageId).subscribe(
+              this.dashboardService.deleteItem(this.dataListIds, this.pageId).subscribe(
                 (responce) => {
                   console.log(responce);
                   this.toastr.success('تم الحذف');
                   this.spinner.show();
                   this.dataList = [];
-                  if(this.pageId == 10) {
+                  if(this.pageId == 10, this.pageId == 31) {
                     this.hospitalService.getHospitalsList(this.pageId , this.currentPage, this.dataTableNumber).subscribe(
                       (responce) => {
                         console.log(responce);
@@ -236,7 +258,6 @@ export class HospitalListComponent implements OnInit {
                       }
                     );
                   }
-                
                 },
                 (error) => {
                   console.log(error);
@@ -259,7 +280,7 @@ export class HospitalListComponent implements OnInit {
     console.log('search curent page', this.currentPage);
     console.log('search page id', this.pageId);
     if(this.pageId == 6 || this.pageId == 30){
-      this.hospitalService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+      this.dashboardService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.dataList = responce['hospital_centers'];
@@ -272,8 +293,8 @@ export class HospitalListComponent implements OnInit {
           console.log(error)
         }
       );
-    } else if(this.pageId == 7) {
-      this.hospitalService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+    } else if(this.pageId == 10 || this.pageId == 31) {
+      this.dashboardService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.dataList = responce['managements'];
@@ -295,7 +316,7 @@ export class HospitalListComponent implements OnInit {
     this.dataList = [];
     this.dataTableNumber = event.target.value;
     if(this.pageId == 6 || this.pageId == 30) {
-      this.hospitalService.getHospitalsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+      this.dashboardService.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.dataList = responce['hospital_centers'];
@@ -308,8 +329,8 @@ export class HospitalListComponent implements OnInit {
           this.spinner.hide();
         }
       );
-    } else if(this.pageId == 10) {
-      this.hospitalService.getHospitalsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+    } else if(this.pageId == 10 || this.pageId == 31) {
+      this.dashboardService.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.dataList = responce['managements'];
@@ -329,16 +350,16 @@ export class HospitalListComponent implements OnInit {
   onAdd() {
     if(this.pageId == 6 || this.pageId == 30) {
       this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/add/Hospital']);
-    } else if(this.pageId == 10) {
+    } else if(this.pageId == 10 || this.pageId == 31) {
       this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/add/Management']);
     }
   }
 
   //on edit hospital 
   onEdit(hospitalIndex:number) {
-    if(this.pageId == 6){
+    if(this.pageId == 6 || this.pageId == 30){
       this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'Hospital/' + 'edithos/' + hospitalIndex]);
-    } else if(this.pageId == 10){
+    } else if(this.pageId == 10 || this.pageId == 31){
       this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'Management/' + 'editman/' + hospitalIndex]);
     }
   }

+ 24 - 9
src/app/dashboard/main-menu/add-menu/add-menu.component.html

@@ -4,7 +4,7 @@
       <div class="row" style="margin-bottom: 30px;">
           <div class="col-12">
             <ul class="list-unstyled titileLi-w">
-              <li class="headingText-w">خدمه إداره المحتوي / </li>
+              <li class="headingText-w">{{servicesName}} </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>
@@ -43,13 +43,6 @@
                     
                     <div class="col-12 col-sm-12 col-md-4 col-lg-4">
                       <div class="form-group">
-                        <label for="link" style="float: right; margin-right: 5px">الرابط <span class="spanReqired-w">*</span></label>
-                          <input type="text" class="form-control" placeholder="الرابط" id="link" name="link" ngModel [ngModel]="menu.link" #link="ngModel" required/>
-                      </div>
-                    </div>
-      
-                    <div class="col-12 col-sm-12 col-md-4 col-lg-4">
-                      <div class="form-group">
                         <label for="ranking" style="float: right; margin-right: 5px">الترتيب <span class="spanReqired-w">*</span></label>
                         <select class="form-control" name="ranking" [ngModel]="menu.ranking" id="ranking" required>  
                           <option value="1">1</option>
@@ -79,7 +72,29 @@
                       </select>
                     </div>
 
-                    <div class="col-6">
+                    <div class="col-12 col-sm-12 col-md-4 col-lg-4">
+                      <label for="link_type" style="float: right; margin-right: 5px"> نوع الرابط <span class="spanReqired-w">*</span></label>
+                      <select class="form-control" name="link_type" (input)="linkTypeValue($event)" [ngModel]="menu.link_type" required>
+                        <option value="internal">داخلي</option>
+                        <option value="external">خارجي</option>
+                      </select>
+                    </div>
+                    
+                    <div class="col-12 col-sm-12 col-md-4 col-lg-4" style="margin: 10px 0;" *ngIf="menu.link_type == 'external'">
+                      <div class="form-group">
+                        <label for="link2" style="float: right; margin-right: 5px">الرابط <span class="spanReqired-w">*</span></label>
+                          <input type="text" class="form-control" placeholder="الرابط" id="link" name="link2" ngModel [ngModel]="menu.link2" #link="ngModel" required/>
+                      </div>
+                    </div>
+
+                    <div class="col-12 col-sm-12 col-md-4 col-lg-4" style="margin: 10px 0;" *ngIf="menu.link_type == 'internal'">
+                      <label for="link" style="float: right; margin-right: 5px">الصفحات الخارجيه <span class="spanReqired-w">*</span> </label>
+                      <select class="form-control" name="link" [ngModel]="menu.link" required>
+                        <option *ngFor="let page of internalPages" [value]="page.id">{{page.name}}</option>
+                      </select>
+                    </div>
+
+                    <div class="col-12">
                         <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid || checkSaveClick">حفظ</button>
                         <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>
                     </div>

+ 103 - 28
src/app/dashboard/main-menu/add-menu/add-menu.component.ts

@@ -1,3 +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';
@@ -24,19 +26,27 @@ export class AddMenuComponent implements OnInit {
   typeMode: boolean = false;
   photoEdit: boolean = true;
   checkSaveClick:boolean = false;
+  servicesName:string = '';
   typeLink: string = '';
   menuId: number;
+  serviceId: number;
   parentList = [];
 
+  internalPages = [];
+
   menu = {
     name: '',
     name_en: '',
     parent_id: '',
     link: '',
+    link2: '',
     status: '',
     ranking: '',
+    link_type: '',
   };
 
+  linkTypeCahnge: string = '';
+
 
 
   constructor(private toastr: ToastrService, 
@@ -45,6 +55,8 @@ export class AddMenuComponent implements OnInit {
     private route: ActivatedRoute,
     private authSer: AuthServiceService,
     private authService: AuthServiceService,
+    private dashBoardService: DashboardService,
+    private http: HttpClient,
     private menuService: MainMenuService, ) { 
       this.spinner.show();
     }
@@ -59,13 +71,25 @@ export class AddMenuComponent implements OnInit {
     this.authSer.showDashboardHeader = true;
     this.authSer.internalHeader = false;
     this.menu.status = '1';
+
+    this.route.parent.params.subscribe(
+      (params: Params) => {
+        this.serviceId = params['serviceID'];
+        if(this.serviceId == 6) {
+          this.servicesName = 'خدمه إداره المحتوي';
+        } else if(this.serviceId == 2) {
+          this.servicesName = 'خدمه أدراه الصفحه الخارجيه';
+        }
+      }
+    );
+
     this.route.params.subscribe(
       (params: Params) => {
         if(params['typeMenuMode'] == 'edit') {
           this.typeMode = true;
           this.typeLink = 'تعديل';
           this.menuId = params['editMenuId'];
-          this.menuService.getMenuData(this.menuId).subscribe(
+          this.dashBoardService.getItemData(this.menuId, 'mainMenu').subscribe(
             (responce) => {
               console.log(responce);
               console.log(responce['menu']);
@@ -75,6 +99,9 @@ export class AddMenuComponent implements OnInit {
               this.menu.status = responce['menu'].status;
               this.menu.ranking = responce['menu'].ranking;
               this.menu.parent_id = responce['menu'].parent_id ? responce['menu'].parent_id : '';
+              this.menu.link_type = responce['menu'].link_type;
+              this.menu.link = responce['menu'].link ? responce['menu'].link : '';
+              this.menu.link2 = responce['menu'].link2 ? responce['menu'].link2 : '';  
               if(responce['menu'].photo) {
                 this.checkValidImg = false;
                 this.urlImg = this.authService.pathImg + responce['menu'].photo;
@@ -92,6 +119,15 @@ export class AddMenuComponent implements OnInit {
       }
     );
 
+
+    //get external pages 
+    this.http.get(this.authSer.pathApi + '/system_pages_list').subscribe(
+      (responce) => {
+        console.log('external pagesssssssssssssssss' , responce);
+        this.internalPages = responce['pages'];
+      }
+    )
+
     this.menuService.getParentList().subscribe(
       (responce) => {
         console.log('parents' , responce);
@@ -100,7 +136,8 @@ export class AddMenuComponent implements OnInit {
       (error) => {
         console.log(error);
       }
-    )
+    );
+
   };
 
 
@@ -124,10 +161,16 @@ export class AddMenuComponent implements OnInit {
   }
  }
 
+ linkTypeValue(linkTypeVal) {
+   console.log(linkTypeVal);
+  this.menu.link_type = linkTypeVal.target.value;
+ }
+
  //on submitted
  onSubmitted() {
    this.checkSaveClick = true;//to make save disabled after one click
   const formData = this.externalFormData.value;
+  console.log(formData);
   if(this.checkChangeImage){
     formData['photo'] = this.imageBase64;
     formData['photo_type'] = this.photoType[1];
@@ -142,38 +185,70 @@ export class AddMenuComponent implements OnInit {
       this.toastr.warning('قم باختيار صوره !');
       this.checkSaveClick = false;
     } else {
-      this.menuService.editMenu(formData, this.menuId).subscribe(
-        (responce) => {
-          console.log(responce);
-          this.toastr.success('تمت التعديل بنجاح');
-          this.location.back();
-          this.checkSaveClick = false;
-        },
-        (error) => {
-          this.checkSaveClick = false;
-          console.log(error);
-          this.toastr.error('خطأ في التعديل !');
-        }
-      );
+      if(this.serviceId == 6) {
+        this.dashBoardService.editItem( this.menuId, formData, 'internalMenu').subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تمت التعديل بنجاح');
+            this.location.back();
+            this.checkSaveClick = false;
+          },
+          (error) => {
+            this.checkSaveClick = false;
+            console.log(error);
+            this.toastr.error('خطأ في التعديل !');
+          }
+        );
+      } else if(this.serviceId == 2) {
+        this.dashBoardService.editItem( this.menuId, formData, 'externalMenu').subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تمت التعديل بنجاح');
+            this.location.back();
+            this.checkSaveClick = false;
+          },
+          (error) => {
+            this.checkSaveClick = false;
+            console.log(error);
+            this.toastr.error('خطأ في التعديل !');
+          }
+        );
+      }
     }
   } else {
     if(this.imageBase64 == ''){
       this.toastr.warning('قم باختيار صوره !');
       this.checkSaveClick = false;
     } else {
-      this.menuService.addMain(formData).subscribe(
-        (responce) => {
-          console.log(responce);
-          this.toastr.success('تمت الاضافه بنجاح');
-          this.location.back();
-          this.checkSaveClick = false;
-        },
-        (error) => {
-          console.log(error);
-          this.checkSaveClick = false;
-          this.toastr.error('خطأ في الحفظ !');
-        }
-      );
+      if(this.serviceId == 6){
+        this.dashBoardService.addItem(formData, 'internalMainMenu').subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تمت الاضافه بنجاح');
+            this.location.back();
+            this.checkSaveClick = false;
+          },
+          (error) => {
+            console.log(error);
+            this.checkSaveClick = false;
+            this.toastr.error('خطأ في الحفظ !');
+          }
+        );
+      } else if(this.serviceId == 2){
+        this.dashBoardService.addItem(formData, 'externalMainMenu').subscribe(
+          (responce) => {
+            console.log(responce);
+            this.toastr.success('تمت الاضافه بنجاح');
+            this.location.back();
+            this.checkSaveClick = false;
+          },
+          (error) => {
+            console.log(error);
+            this.checkSaveClick = false;
+            this.toastr.error('خطأ في الحفظ !');
+          }
+        );
+      }
     }
   }
  }

+ 1 - 1
src/app/dashboard/main-menu/main-list/main-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">{{servicesName}} </li>
           <li class="headingText-w activeLi-w" style="margin-right:5px">القائمه الرئيسيه</li>
         </ul>
     </div>

+ 56 - 46
src/app/dashboard/main-menu/main-list/main-list.component.ts

@@ -1,3 +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';
@@ -29,15 +30,16 @@ export class MainListComponent implements OnInit {
   serviceId:number;
   dataTableNumber: number = 5;
   pages = [];
+  servicesName: string = '';
 
   constructor(private route: ActivatedRoute, 
     private router: Router, 
     private userSer: UserService,
     private http: HttpClient,
     private toastr: ToastrService,
-    private mainService: MainMenuService,
     private spinner: NgxSpinnerService,
     private modal: Modal,
+    private dashBoardService: DashboardService,
     private authSer: AuthServiceService) { }
 
   ngOnInit() {
@@ -54,6 +56,8 @@ export class MainListComponent implements OnInit {
     this.authSer.showHeaderDashBoard = true;
     this.authSer.showDashboardHeader = true;
     this.authSer.internalHeader = false;
+
+    
     
     this.route.params.subscribe(
       (params: Params) => {
@@ -67,6 +71,13 @@ export class MainListComponent implements OnInit {
     (params:Params) => {
         this.userLoginId = params['userID'];
         this.serviceId = params['serviceID'];
+
+        if(this.serviceId == 6) {
+          this.servicesName = 'خدمه إداره المحتوي';
+        } else if(this.serviceId == 2){
+          this.servicesName = 'خدمه إداره الصفحه الخارجيه';
+        }
+
         this.userSer.getPagesPermetiotns(this.userLoginId, this.serviceId).subscribe(
           (responce) => {
             console.log(responce);
@@ -84,6 +95,18 @@ export class MainListComponent implements OnInit {
                     this.authSer.showDeleteBtn = true;
                   }
                 }
+              } else if(this.pages[i].id == 18) {
+                for(let j = 0; j < this.pages[i].permissions.length; j++) {
+                  if(this.pages[i].permissions[j].name == 'add_external_menu'){
+                    this.authSer.showAddBtn = true;
+                  }
+                  if(this.pages[i].permissions[j].name == 'edit_external_menu'){
+                    this.authSer.showEditBtn = true;
+                  }
+                  if(this.pages[i].permissions[j].name == 'delete_external_menus'){
+                    this.authSer.showDeleteBtn = true;
+                  }
+                }
               }else {
                 console.log('no events');
               }
@@ -96,7 +119,7 @@ export class MainListComponent implements OnInit {
     );
 
     //get list data 
-    this.mainService.getMainList(this.menuId, this.currentPage ,this.dataTableNumber).subscribe(
+    this.dashBoardService.getListData(this.menuId, this.currentPage ,this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.menuList = responce['menus'];
@@ -134,7 +157,7 @@ export class MainListComponent implements OnInit {
     this.currentPage = 1;
     console.log('search curent page', this.currentPage);
     console.log('search page id', this.menuId);
-    this.mainService.getDataUSerSearchBar(dataSearch, this.menuId, this.currentPage, this.dataTableNumber).subscribe(
+    this.dashBoardService.getDataUSerSearchBar(dataSearch, this.menuId, this.currentPage, this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.menuList = responce['menus'];
@@ -156,7 +179,7 @@ export class MainListComponent implements OnInit {
       this.menuList = [];
       //console.log(pagenationNumber);
       //console.log(this.pageId);
-      this.mainService.getMainList(this.menuId, pagenationNumber, this.dataTableNumber).subscribe(
+      this.dashBoardService.getListData(this.menuId, pagenationNumber, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.menuList = responce['menus'];
@@ -172,39 +195,39 @@ 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)},
-    );
-  };
+  // 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) {
     this.spinner.show();
     this.menuList = [];
     this.dataTableNumber = event.target.value;
-    this.mainService.getMainList(this.menuId, this.currentPage, this.dataTableNumber).subscribe(
+    this.dashBoardService.getListData(this.menuId, this.currentPage, this.dataTableNumber).subscribe(
       (responce) => {
         console.log(responce);
         this.menuList = responce['menus'];
@@ -241,13 +264,13 @@ export class MainListComponent implements OnInit {
   
         dialogRef.result
         .then( result => 
-          this.mainService.deleteMain(this.menuListIds).subscribe(
+          this.dashBoardService.deleteItem(this.menuListIds, this.menuId).subscribe(
               (responce) => {
                 console.log(responce);
                 this.toastr.success('تم الحذف');
                 this.spinner.show();
                 this.menuList = [];
-                this.mainService.getMainList(this.menuId, this.currentPage, this.dataTableNumber).subscribe(
+                this.dashBoardService.getListData(this.menuId, this.currentPage, this.dataTableNumber).subscribe(
                   (responce) => {
                     console.log(responce);
                     this.count = responce['count'];
@@ -271,19 +294,6 @@ export class MainListComponent implements OnInit {
     } else {
       this.toastr.warning('لم يتم أختيار أي عنصر للحذف !');
     }
-
-    
-    // this.mainService.deleteMain(this.menuListIds).subscribe(
-    //   (responce) => {
-    //     console.log(responce);
-    //     this.toastr.success('تم الحذف');
-    //     window.location.reload();
-    //   },
-    //   (error) => {
-    //     console.log(error);
-    //     this.spinner.hide();
-    //   },
-    // );
   };
 
   //add function

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

@@ -4,7 +4,7 @@
     <div class="row" style="margin-bottom: 30px;">
         <div class="col-12">
           <ul class="list-unstyled titileLi-w">
-            <li class="headingText-w">خدمه إداره المحتوي > </li>
+            <li class="headingText-w">{{serviceName}}</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>

+ 73 - 44
src/app/dashboard/news/add-news/add-news.component.ts

@@ -1,3 +1,4 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { HttpClient } from '@angular/common/http';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { NgxSpinnerService } from 'ngx-spinner';
@@ -29,9 +30,10 @@ export class AddNewsComponent implements OnInit {
   checkSaveClick: boolean = false;
   photoEdit:boolean = false;
   checkAddMode: boolean = false;
-  
+  serviceName: string = '';
   mainPhotoDefault: string = '../../../../assets/image/Group 408.png';
   mainPhotoPath: string = '';
+  serviceId: number;
   
 
   new = {
@@ -76,6 +78,7 @@ export class AddNewsComponent implements OnInit {
     private route: ActivatedRoute,
     private http: HttpClient, 
     private authService: AuthServiceService,
+    private dashBoardService: DashboardService,
     private spineer: NgxSpinnerService) { }
 
   ngOnInit() {
@@ -87,6 +90,17 @@ export class AddNewsComponent implements OnInit {
     this.authSer.showDashboardHeader = true;
     this.authSer.internalHeader = false;
     this.new.status = '1';
+
+    this.route.parent.params.subscribe(
+      (params: Params) => {
+        this.serviceId = params['serviceID'];
+        if(this.serviceId == 13) {
+          this.serviceName = 'خدمه إداره المحتوي';
+        } else if(this.serviceId == 2) {
+          this.serviceName = ' خدمه إداره الصفحه الخارجيه';
+        }
+      }
+    )
     
     this.route.params.subscribe(
       (params: Params) => {
@@ -96,7 +110,7 @@ export class AddNewsComponent implements OnInit {
           this.spineer.show();
           this.typeMode = true;
           this.newId = params['editNewId'];
-          this.newService.getNewData(this.newId).subscribe(
+          this.dashBoardService.getItemData(this.newId, 'news').subscribe(
             (responce) => {
               console.log(responce);
               const newData = responce['report'];
@@ -205,24 +219,6 @@ export class AddNewsComponent implements OnInit {
  }
 
 
-
-//  deleteImg(index, data) {
-//    if(this.typeMode) {
-//     this.images.splice(index , 1);
-//     this.http.get(this.authSer.pathApi + '/delete_report_photo/' + data.id).subscribe(
-//       (responce) => {
-//         console.log(responce);
-//       },
-//       (error) => {
-//         console.log(error);
-//       }
-//     );
-//    } else {
-//      this.images.splice(index,1);
-//    }
- 
-//  }
-
  deleteMainImg() {
    this.mainPhotoPath = '';
  }
@@ -261,17 +257,32 @@ export class AddNewsComponent implements OnInit {
 
         console.log(formData);
 
-        this.newService.editNew(formData, this.newId).subscribe(
-          (responce) => {
-            console.log(responce);
-            this.toastr.success('تمت التعديل بنجاح');
-            this.location.back();
-          },
-          (error) => {
-            console.log(error);
-            this.toastr.error('خطأ في التعديل !');
-          }
-        );
+        if(this.serviceId == 2) {
+          this.dashBoardService.editItem(this.newId, formData,'externalNew').subscribe(
+            (responce) => {
+              console.log(responce);
+              this.toastr.success('تمت التعديل بنجاح');
+              this.location.back();
+            },
+            (error) => {
+              console.log(error);
+              this.toastr.error('خطأ في التعديل !');
+            }
+          );
+        } else if(this.serviceId == 6){
+          this.dashBoardService.editItem(this.newId, formData, 'internalNew').subscribe(
+            (responce) => {
+              console.log(responce);
+              this.toastr.success('تمت التعديل بنجاح');
+              this.location.back();
+            },
+            (error) => {
+              console.log(error);
+              this.toastr.error('خطأ في التعديل !');
+            }
+          );
+        }
+    
     } else {
       if(this.images[0].base64 == ''){
         this.toastr.warning('قم باختيار الصوره الرئيسيه !');
@@ -299,19 +310,37 @@ export class AddNewsComponent implements OnInit {
 
         console.log(formData);
 
-        this.newService.addNew(formData).subscribe(
-          (responce) => {
-            console.log(responce);
-            this.toastr.success('تمت الاضافه بنجاح');
-            this.location.back();
-            this.checkSaveClick = false;
-          },
-          (error) => {
-            this.checkSaveClick = true;
-            console.log(error);
-            this.toastr.error('خطأ في الحفظ !');
-          }
-        );
+        if(this.serviceId == 6) {
+          this.dashBoardService.addItem(formData, 'internalNews').subscribe(
+            (responce) => {
+              console.log(responce);
+              this.toastr.success('تمت الاضافه بنجاح');
+              this.location.back();
+              this.checkSaveClick = false;
+            },
+            (error) => {
+              this.checkSaveClick = true;
+              console.log(error);
+              this.toastr.error('خطأ في الحفظ !');
+            }
+          );
+        } else if(this.serviceId == 2) {
+          this.dashBoardService.addItem(formData, 'externalNews').subscribe(
+            (responce) => {
+              console.log(responce);
+              this.toastr.success('تمت الاضافه بنجاح');
+              this.location.back();
+              this.checkSaveClick = false;
+            },
+            (error) => {
+              this.checkSaveClick = true;
+              console.log(error);
+              this.toastr.error('خطأ في الحفظ !');
+            }
+          );
+        }
+
+     
 
       }
     }

+ 1 - 1
src/app/dashboard/news/news-list/news-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">{{serviceName}} </li>
           <li class="headingText-w activeLi-w" style="margin-right:5px">الأخبار</li>
         </ul>
     </div>

+ 28 - 9
src/app/dashboard/news/news-list/news-list.component.ts

@@ -1,3 +1,4 @@
+import { DashboardService } from './../../../shared/dashboard.service';
 import { AuthServiceService } from './../../../shared/auth-service.service';
 import { HttpClient } from '@angular/common/http';
 import { UserService } from './../../../shared/user.service';
@@ -22,6 +23,7 @@ export class NewsListComponent implements OnInit {
     private toastr: ToastrService,
     private newService: NewService,
     private modal: Modal,
+    private dashBoardService: DashboardService,
     private spinner: NgxSpinnerService,
     private authSer: AuthServiceService) { }
 
@@ -37,6 +39,7 @@ export class NewsListComponent implements OnInit {
   userLoginId:number;
   serviceId:number;
   dataTableNumber: number = 5;
+  serviceName: string = '';
   pages = [];
 
 
@@ -75,6 +78,11 @@ export class NewsListComponent implements OnInit {
     (params:Params) => {
         this.userLoginId = params['userID'];
         this.serviceId = params['serviceID'];
+        if(this.serviceId == 2) {
+          this.serviceName = 'خدمه إداره الصفحه الخارجيه';
+        } else if(this.serviceId == 6) {
+          this.serviceName = 'خدمه إداره المحتوي';
+        }
         this.userSer.getPagesPermetiotns(this.userLoginId, this.serviceId).subscribe(
           (responce) => {
             console.log(responce);
@@ -92,6 +100,18 @@ export class NewsListComponent implements OnInit {
                     this.authSer.showDeleteBtn = true;
                   }
                 }
+              } else if(this.pages[i].id == 20) {
+                for(let j = 0; j < this.pages[i].permissions.length; j++) {
+                  if(this.pages[i].permissions[j].name == 'add_report_ex'){
+                    this.authSer.showAddBtn = true;
+                  }
+                  if(this.pages[i].permissions[j].name == 'edit_report_ex'){
+                    this.authSer.showEditBtn = true;
+                  }
+                  if(this.pages[i].permissions[j].name == 'delete_reports_ex'){
+                    this.authSer.showDeleteBtn = true;
+                  }
+                }
               }else {
                 console.log('no events');
               }
@@ -104,7 +124,7 @@ export class NewsListComponent implements OnInit {
     );
 
     //get list data 
-    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.newsList = responce['reports'];  
@@ -145,7 +165,7 @@ export class NewsListComponent implements OnInit {
       console.log(data.target.value);
       const dataSearch = data.target.value;     
       this.currentPage = 1;
-      this.newService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+      this.dashBoardService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
         (responce) => {
           console.log(responce);
           this.newsList = responce['reports'];
@@ -167,7 +187,7 @@ export class NewsListComponent implements OnInit {
         this.newsList = [];
         //console.log(pagenationNumber);
         //console.log(this.pageId);
-        this.newService.getnewsList(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
+        this.dashBoardService.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
           (responce) => {
             console.log(responce);
             this.newsList = responce['reports'];
@@ -215,7 +235,7 @@ export class NewsListComponent implements OnInit {
       this.spinner.show();
       this.newsList = [];
       this.dataTableNumber = event.target.value;
-      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.newsList = responce['reports'];
@@ -232,7 +252,6 @@ export class NewsListComponent implements OnInit {
     
     onDelete() {
 
-      this.newsListIds = [];
       for(let i = 0; i < this.newsList.length; i++) {
         if(this.newsList[i].selected == true) {
           this.newsListIds.push(this.newsList[i].id);
@@ -242,7 +261,7 @@ export class NewsListComponent implements OnInit {
       console.log(this.newsListIds);
 
       if(this.newsListIds.length > 0) {
-        this.newsList =[];
+        this.spinner.show();
         const dialogRef = this.modal.alert()
         .size('sm')
         .showClose(true)
@@ -254,12 +273,12 @@ export class NewsListComponent implements OnInit {
         dialogRef.result
         .then( result =>  
           
-          this.newService.deleteNew(this.newsListIds).subscribe(
+          this.dashBoardService.deleteItem(this.newsListIds, this.pageId).subscribe(
             (responce) => {
               console.log(responce);
               this.toastr.success('تم الحذف');
-              this.spinner.show();
-              this.newService.getnewsList(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
+              this.newsList =[];
+              this.dashBoardService.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
                 (responce) => {
                   console.log(responce);
                   this.newsList = responce['reports'];

+ 10 - 10
src/app/dashboard/service-item/service-item.component.ts

@@ -163,7 +163,7 @@ export class ServiceItemComponent implements OnInit {
           } else if(this.pages[0].id == 9) {
             console.log('/service/' + this.userId + '/' + service.id + '/joinUs/' + this.pages[0].id);
             this.router.navigate(['/service/' + this.userId + '/' + service.id + '/joinUs/' + this.pages[0].id]);
-          } else if(this.pages[0].id == 7) {
+          } else if(this.pages[0].id == 7 || this.pages[0].id == 19) {
             console.log('/service/' + this.userId + '/' + service.id + '/externalsList/' + this.pages[0].id);
             this.router.navigate(['/service/' + this.userId + '/' + service.id + '/externalsList/' + this.pages[0].id]);
           } else if(this.pages[0].id == 11) {
@@ -171,15 +171,15 @@ export class ServiceItemComponent implements OnInit {
             this.router.navigate(['/service/' + this.userId + '/' + service.id + '/achievementsList/' + this.pages[0].id]);
           } else if(this.pages[0].id == 12) {
             this.router.navigate(['/service/' + this.userId + '/' + service.id + '/tabs/' + this.pages[0].id]);
-          } else if(this.pages[0].id == 13) {
+          } else if(this.pages[0].id == 13, this.pages[0].id == 20) {
             this.router.navigate(['/service/' + this.userId + '/' + service.id + '/newsList/' + this.pages[0].id]);
-          } else if(this.pages[0].id == 16) {
+          } else if(this.pages[0].id == 16 || this.pages[0].id == 29) {
             this.router.navigate(['/service/' + this.userId + '/' + service.id + '/footerList/' + this.pages[0].id]);
           } else if(this.pages[0].id == 14) {
             this.router.navigate(['/service/' + this.userId + '/' + service.id + '/internalServicesList/' + this.pages[0].id]);
           } else if(this.pages[0].id == 15) {
             this.router.navigate(['/service/' + this.userId + '/' + service.id + '/lecturesList/' + this.pages[0].id]);
-          } else if(this.pages[0].id == 17) {
+          } else if(this.pages[0].id == 17 || this.pages[0].id == 18) {
             this.router.navigate(['/service/' + this.userId + '/' + service.id + '/mainMenuList/' + this.pages[0].id]);
           } else if(this.pages[0].id == 24) {
             this.router.navigate(['/service/' + this.userId + '/' + service.id + '/advertisimentList/' + this.pages[0].id]);
@@ -217,29 +217,29 @@ export class ServiceItemComponent implements OnInit {
       this.router.navigate(['sections/' + dataPage.id], {relativeTo: this.route});
     } else if(dataPage.id == 5) {
       this.router.navigate(['reports'], {relativeTo: this.route});
-    } else if(dataPage.id == 6) {
+    } else if(dataPage.id == 6 || dataPage.id == 30) {
       this.router.navigate(['hospitalsList/' + dataPage.id], {relativeTo: this.route});
-    } else if(dataPage.id == 10){
+    } else if(dataPage.id == 10 || dataPage.id == 31){
       this.router.navigate(['mangementList/' + dataPage.id], {relativeTo: this.route});
     } else if(dataPage.id == 8) {
       this.router.navigate(['eventsList/' + dataPage.id], {relativeTo: this.route});
     } else if(dataPage.id == 9){
       this.router.navigate(['joinUs/' + dataPage.id], {relativeTo: this.route});
-    } else if(dataPage.id == 7) {
+    } else if(dataPage.id == 7 || dataPage.id == 19) {
       this.router.navigate(['externalsList/' + dataPage.id], {relativeTo: this.route});
     } else if(dataPage.id == 11) {
       this.router.navigate(['achievementsList/' + dataPage.id], {relativeTo: this.route});
     }else if(dataPage.id == 12) {
       this.router.navigate(['tabs/' + dataPage.id], {relativeTo: this.route});
-    } else if(dataPage.id == 13) {
+    } else if(dataPage.id == 13 || dataPage.id == 20) {
       this.router.navigate(['newsList/' + dataPage.id], {relativeTo: this.route});
-    } else if(dataPage.id == 16) {
+    } else if(dataPage.id == 16 || dataPage.id == 29) {
       this.router.navigate(['footerList/' + dataPage.id], {relativeTo: this.route});
     } else if(dataPage.id == 14) {
       this.router.navigate(['internalServicesList/' + dataPage.id], {relativeTo: this.route});
     } else if(dataPage.id == 15) {
       this.router.navigate(['lecturesList/' + dataPage.id], {relativeTo: this.route});
-    } else if(dataPage.id == 17) {
+    } else if(dataPage.id == 17 || dataPage.id == 18){
       this.router.navigate(['mainMenuList/' + dataPage.id], {relativeTo: this.route});
     } else if(dataPage.id == 24) {
       this.router.navigate(['advertisimentList/' + dataPage.id], {relativeTo: this.route});

+ 9 - 24
src/app/servicesItems/services.component.ts

@@ -11,6 +11,7 @@ import { NgxSpinnerService } from 'ngx-spinner';
   templateUrl: './services.component.html',
   styleUrls: ['./sercices.component.css']
 })
+
 export class ServicesComponent implements OnInit, OnDestroy {
 
   idUser: number; //id user
@@ -88,17 +89,17 @@ export class ServicesComponent implements OnInit, OnDestroy {
         (error) => {console.log(error)}
       );
 
-    } else if(dataService.id == 6) {
+    } else if(dataService.id == 6 || dataService.id == 2) {
       //خدمه اداره المحتوي
       this.userservice.getPagesPermetiotns(this.idUser, dataService.id).subscribe(
         (responce) => {
           console.log(responce);
           this.pages = responce['pages'];
           console.log(this.pages);
-          if(this.pages[0].id == 6) {
+          if(this.pages[0].id == 6 || this.pages[0].id == 30) {
             console.log('/service/' + this.idUser + '/' + dataService.id + '/hospitalsList/' + this.pages[0].id);
             this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/hospitalsList/' + this.pages[0].id]);
-          } else if(this.pages[0].id == 10) {
+          } else if(this.pages[0].id == 10 || this.pages[0].id == 31) {
             console.log('/service/' + this.idUser + '/' + dataService.id + '/mangementList/' + this.pages[0].id);
             this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/mangementList/' + this.pages[0].id]);
           } else if(this.pages[0].id == 8){
@@ -107,7 +108,7 @@ export class ServicesComponent implements OnInit, OnDestroy {
           } else if(this.pages[0].id == 9) {
             console.log('/service/' + this.idUser + '/' + dataService.id + '/joinUs/' + this.pages[0].id);
             this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/joinUs/' + this.pages[0].id]);
-          } else if(this.pages[0].id == 7) {
+          } else if(this.pages[0].id == 7 || this.pages[0] == 19) {
             console.log('/service/' + this.idUser + '/' + dataService.id + '/externalsList/' + this.pages[0].id);
             this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/externalsList/' + this.pages[0].id]);
           } else if(this.pages[0].id == 11) {
@@ -115,38 +116,22 @@ export class ServicesComponent implements OnInit, OnDestroy {
             this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/achievementsList/' + this.pages[0].id]);
           } else if(this.pages[0].id == 12) {
             this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/tabs/' + this.pages[0].id]);
-          } else if(this.pages[0].id == 13) {
+          } else if(this.pages[0].id == 13 || this.pages[0].id == 20) {
             this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/newsList/' + this.pages[0].id]);
-          } else if(this.pages[0].id == 16) {
+          } else if(this.pages[0].id == 16 || this.pages[0].id == 29) {
             this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/footerList/' + this.pages[0].id]);
           } else if(this.pages[0].id == 14) {
             this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/internalServicesList/' + this.pages[0].id]);
           } else if(this.pages[0].id == 15){
             this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/lecturesList/' + this.pages[0].id]);
-          } else if(this.pages[0].id == 17) {
+          } else if(this.pages[0].id == 17 || this.pages[0].id == 18) {
             this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/mainMenuList/' + this.pages[0].id]);
           }
           this.spinner.hide();
         },
         (error) => {console.log(error)}
       );
-    } else if(dataService.id == 2) {
-      this.userservice.getPagesPermetiotns(this.idUser, dataService.id).subscribe(
-        (responce) => {
-          console.log(responce);
-          this.pages = responce['pages'];
-          if(this.pages[0].id == 30) {
-            console.log('/service/' + this.idUser + '/' + dataService.id + '/hospitalsList/' + this.pages[0].id);
-            this.router.navigate(['/service/' + this.idUser + '/' + dataService.id + '/hospitalsList/' + this.pages[0].id]);
-          } 
-        },
-        (error) => {
-          console.log(error);
-        }
-      )
-    }
-   
-   
+    } 
   }
 
   ngOnDestroy() {

+ 92 - 7
src/app/shared/dashboard.service.ts

@@ -31,20 +31,69 @@ export class DashboardService {
   
     //addEvent
     addItem(data, addType) {
-
       if(addType == 'advertisiment'){
         return this.http.post(this.authService.pathApi + '/add_main_ad' , data);
+      } else if(addType == 'internalHospital') {
+        return this.http.post(this.authService.pathApi + '/add_hospitals_centers' , data);
+      } else if(addType == 'externalHospital') {
+        return this.http.post(this.authService.pathApi + '/add_hospitals_centers_ex' , data);
+      } else if(addType == 'internalManagement') {
+        return this.http.post(this.authService.pathApi + '/add_management' , data);
+      } else if(addType == 'externalManagement') {
+        return this.http.post(this.authService.pathApi + '/add_management_ex' , data);
+      } else if(addType == 'internalMainMenu') {
+        return this.http.post(this.authService.pathApi + '/add_menu' , data);
+      } else if(addType == 'externalMainMenu') {
+        return this.http.post(this.authService.pathApi + '/add_external_menu' , data);
+      } else if(addType == 'internalServiceExternalPage') {
+        return this.http.post(this.authService.pathApi + '/add_external_service' , data);
+      } else if(addType == 'externalServiceExternalPage') {
+        return this.http.post(this.authService.pathApi + '/add_external_service_ex' , data);
+      } else if(addType == 'internalNews') {
+        return this.http.post(this.authService.pathApi + '/add_report' , data);
+      } else if(addType == 'externalNews') {
+        return this.http.post(this.authService.pathApi + '/add_report_ex' , data);
+      } else if(addType == 'internalFooter') {
+        return this.http.post(this.authService.pathApi + '/add_footer' , data);
+      } else if(addType == 'externalFooter') {
+        return this.http.post(this.authService.pathApi + '/add_footer_ex' , data);
       }
     }
   
     //edit event
-    editItem(dataEdit,editId,editPageName){
+    editItem(editId,dataEdit,editPageName){
       const editData = dataEdit;
-      editData.id = editId;
+      console.log(editId);
+      console.log(editPageName);
+      editData['id'] = editId;
+      console.log(dataEdit);
 
       if(editPageName == 'advertisiment') {
-        console.log(editData);
         return this.http.post(this.authService.pathApi + '/edit_main_ad', editData);
+      } else if(editPageName == 'internalHospital') {
+        return this.http.post(this.authService.pathApi + '/edit_hospitals_centers', editData);
+      } else if(editPageName == 'externalHospital') {
+        return this.http.post(this.authService.pathApi + '/edit_hospitals_centers_ex', editData);
+      } else if(editPageName == 'internalManagement') {
+        return this.http.post(this.authService.pathApi + '/edit_management' , dataEdit);
+      } else if(editPageName == 'externalManagement') {
+        return this.http.post(this.authService.pathApi + '/edit_management_ex' , dataEdit);
+      } else if(editPageName == 'internalMenu') {
+        return this.http.post(this.authService.pathApi + '/edit_menu' , dataEdit);
+      } else if(editPageName == 'externalMenu') {
+        return this.http.post(this.authService.pathApi + '/edit_external_menu' , dataEdit);
+      } else if(editPageName == 'internalServiceExternalPage') {
+        return this.http.post(this.authService.pathApi + '/edit_external_service' , dataEdit);
+      } else if(editPageName == 'externalServiceExternalPage') {
+        return this.http.post(this.authService.pathApi + '/edit_external_service_ex' , dataEdit);
+      } else if(editPageName == 'internalNew') {
+        return this.http.post(this.authService.pathApi + '/edit_report' , dataEdit);
+      } else if(editPageName == 'externalNew') {
+        return this.http.post(this.authService.pathApi + '/edit_report_ex' , dataEdit);
+      } else if(editPageName == 'internalFooter') {
+        return this.http.post(this.authService.pathApi + '/edit_footer', dataEdit);
+      } else if(editPageName == 'externalFooter') {
+        return this.http.post(this.authService.pathApi + '/edit_footer_ex', dataEdit);
       }
     }
   
@@ -53,19 +102,55 @@ export class DashboardService {
       console.log('wwwwwwwwwwwwwwwwwwwwwwwwwwww', pageId);
       if(typeGetData == 'advertisiment') {
         return this.http.get(this.authService.pathApi + '/get_main_ad/' + pageId);
+      } else if(typeGetData == 'hospital') {
+        return this.http.get(this.authService.pathApi + '/get_hospitals_centers/' + pageId);
+      } else if(typeGetData == 'managament') {
+        return this.http.get(this.authService.pathApi + '/get_management/' + pageId);
+      } else if(typeGetData == 'mainMenu') {
+        return this.http.get(this.authService.pathApi + '/get_menu/' + pageId);
+      } else if(typeGetData == 'externalService') {
+        return this.http.get(this.authService.pathApi + '/get_external_service/' + pageId);
+      } else if(typeGetData == 'news') {
+        return this.http.get(this.authService.pathApi + '/get_report/' + pageId);
+      } else if(typeGetData == 'footer') {
+        return this.http.get(this.authService.pathApi + '/get_footer/' + pageId);
       }
-    }
+  }
   
     //delete event 
     deleteItem(dataIds, pageId) {
       
       console.log(dataIds);
+      console.log(pageId);
 
       if(pageId == 24) {
         return this.http.post(this.authService.pathApi + '/delete_main_ads' , {'ads_id' : dataIds});
+      } else if(pageId == 10) {
+        return this.http.post(this.authService.pathApi + '/delete_managements' , {'managements_id' : dataIds});
+      } else if(pageId == 31) {
+        return this.http.post(this.authService.pathApi + '/delete_managements_ex' , {'managements_id' : dataIds});
+      } else if(pageId == 6) {
+        return this.http.post(this.authService.pathApi + '/delete_hospitals_centers' , {'hospitals_centers_id' : dataIds});
+      } else if(pageId == 30) {
+        return this.http.post(this.authService.pathApi + '/delete_hospitals_centers_ex' , {'hospitals_centers_id' : dataIds});
+      } else if(pageId == 17) {
+        return this.http.post(this.authService.pathApi + '/delete_menus' , {'menus_id' : dataIds});
+      } else if(pageId == 18) {
+        return this.http.post(this.authService.pathApi + '/delete_external_menus' , {'menus_id' : dataIds});
+      } else if(pageId == 19) {
+        return this.http.post(this.authService.pathApi + '/delete_external_services_ex' , {'external_services_id' : dataIds});
+      } else if(pageId == 7) {
+        return this.http.post(this.authService.pathApi + '/delete_external_services' , {'external_services_id' : dataIds});
+      } else if(pageId == 20) {
+        return this.http.post(this.authService.pathApi + '/delete_reports_ex' , {'reports_id' : dataIds});
+      } else if(pageId == 13) {
+        return this.http.post(this.authService.pathApi + '/delete_reports' , {'reports_id' : dataIds});
+      } else if(pageId == 16) {
+        return this.http.post(this.authService.pathApi + '/delete_footers' , {'footers_id' : dataIds});
+      } else if(pageId == 29) {
+        return this.http.post(this.authService.pathApi + '/delete_footers_ex' , {'footers_id' : dataIds});
       }
-      
-      
+    
     };
 
 

+ 1 - 1
src/app/shared/external-ser.service.ts

@@ -29,7 +29,7 @@ export class ExternalSerService {
 
   //delete data 
   deleteEvent(externalsIds) {
-      return this.http.post(this.authService.pathApi + '/delete_external_services' , {'external_services_id' : externalsIds});
+    return this.http.post(this.authService.pathApi + '/delete_external_services' , {'external_services_id' : externalsIds});
   };
 
   //add external 

+ 0 - 1
src/app/shared/hospital.service.ts

@@ -36,7 +36,6 @@ export class HospitalService {
       this.spinner.show();
         console.log(datasIds);
         return this.http.post(this.authService.pathApi + '/delete_managements' , {'managements_id' : datasIds});
-      
     }
   }
 

+ 4 - 3
src/app/shared/shared.module.ts

@@ -2,19 +2,20 @@ import { EnglishCharactersDirective } from './english-characters.directive';
 import { NgModule } from '@angular/core';
 import { CommonModule } from '@angular/common';
 import { OnlyNumberDirective } from './only-number.directive';
-//import { CeiboShare } from 'ng2-social-share';
+import { CeiboShare } from 'ng2-social-share';
 
 
 @NgModule({
   declarations: [
     OnlyNumberDirective,
     EnglishCharactersDirective,
-    //CeiboShare,
+    CeiboShare,
   ],
   exports: [
     CommonModule,
     OnlyNumberDirective,
-    EnglishCharactersDirective
+    EnglishCharactersDirective,
+    CeiboShare
   ]
 })
 

+ 70 - 7
src/styles.css

@@ -500,8 +500,11 @@ width: 100%;
     cursor: pointer;
   }
 
+  .cal-cell-top {
+    height: 50px !important;
+  }
+
 
- 
   /* .IN-5c1caa55-0e85-4bb1-925b-96b537f99da5-1G9ISYhSF8XoOmdcl0yKDu,
   .IN-5c1caa55-0e85-4bb1-925b-96b537f99da5-1G9ISYhSF8XoOmdcl0yKDu.IN-5c1caa55-0e85-4bb1-925b-96b537f99da5-3uCBSbQNVNf2QjqHe1rfb6 {
     width: 150px;
@@ -617,24 +620,84 @@ width: 100%;
 }
 
 /* .cal-month-view .cal-day-cell {
-  height: 50px !important;
+  min-height: 50px !important;
 }
 
 .cal-month-view .cal-day-cell {
-  height: 50px !important;
+  min-height: 50px !important;
 }
 
 .cal-month-view .cal-day-cell {
-  height: 50px !important;
-}
+  min-height: 50px !important;
+} */
 
 .cal-month-view .cal-days .cal-cell-row {
   height: 50px;
 }
   
 .cal-month-view .cal-day-cell {
-  height: 50px !important;
-} */
+  min-height: 50px !important;
+}
+
+.cal-month-view .cal-cell-top {
+  min-height: 50px !important;
+}
+
+.cal-events {
+  margin: 0 !important;
+}
+
+.cal-day-badge {
+  margin-top: 0 !important;
+  margin-left: 0 !important;
+}
+
+.cal-day-number {
+  font-size: 15px !important;
+  color: #252525;
+}
+
+.cal-month-view .cal-day-cell.cal-out-month .cal-day-number {
+  opacity: 0.7 !important;
+}
+
+.cal-day-badge {
+  padding: 2px 5px !important;
+  font-size: 10px !important;
+  text-align: initial !important;
+  float: left !important;
+  margin: 5px !important; 
+}
+
+.popUp {
+  width: 720px;
+  border: 1px solid #fff;
+  background-color: #fff;
+  box-shadow: 0px 2px 5px #252525;
+  border-radius: 5px;
+  margin: 0 auto;
+  text-align: left;
+  padding: 10px;
+  position: fixed;
+  top: 0;
+  left: 25%;
+  z-index: 999999999999999999;
+}
+
+.eventContent-w h1 {
+  font-size: 18px;
+}
+
+.eventContent-w p {
+  text-align: center;
+  font-size: 16px;
+}
+
+.eventContent-w button {
+  position: absolute;
+  top: 0;
+  right: 0px;
+}
 
   /* .IN-5c1caa55-0e85-4bb1-925b-96b537f99da5-1G9ISYhSF8XoOmdcl0yKDu,
   .IN-5c1caa55-0e85-4bb1-925b-96b537f99da5-1G9ISYhSF8XoOmdcl0yKDu.IN-5c1caa55-0e85-4bb1-925b-96b537f99da5-3uCBSbQNVNf2QjqHe1rfb6 {