Quellcode durchsuchen

external finished

Hima vor 5 Jahren
Ursprung
Commit
d8ffb3f767
57 geänderte Dateien mit 1297 neuen und 220 gelöschten Zeilen
  1. 25 0
      src/app/External-Page/event-details/event-details.component.css
  2. 29 0
      src/app/External-Page/event-details/event-details.component.html
  3. 23 0
      src/app/External-Page/event-details/event-details.component.ts
  4. 0 16
      src/app/External-Page/external-contact-us/external-contact-us.component.css
  5. 111 17
      src/app/External-Page/external-contact-us/external-contact-us.component.html
  6. 31 27
      src/app/External-Page/external-contact-us/external-contact-us.component.ts
  7. 2 1
      src/app/External-Page/external-events/external-events.component.css
  8. 1 1
      src/app/External-Page/external-events/external-events.component.html
  9. 4 1
      src/app/External-Page/external-events/external-events.component.ts
  10. 56 2
      src/app/External-Page/external-page-content/external-page-content.component.css
  11. 28 14
      src/app/External-Page/external-page-content/external-page-content.component.html
  12. 109 0
      src/app/External-Page/external-page-content/external-page-content.component.ts
  13. 2 2
      src/app/External-Page/external-page-header/external-page-header.component.ts
  14. 8 4
      src/app/External-Page/external-page.module.ts
  15. 0 0
      src/app/External-Page/external-policy/external-policy.component.css
  16. 29 0
      src/app/External-Page/external-policy/external-policy.component.html
  17. 44 0
      src/app/External-Page/external-policy/external-policy.component.ts
  18. 8 3
      src/app/External-Page/external-routing-module.ts
  19. 25 0
      src/app/External-Page/inernal-service-page/inernal-service-page.component.css
  20. 30 0
      src/app/External-Page/inernal-service-page/inernal-service-page.component.html
  21. 43 0
      src/app/External-Page/inernal-service-page/inernal-service-page.component.ts
  22. 25 0
      src/app/Internal-Page/external-service-details/external-service-details.component.css
  23. 30 0
      src/app/Internal-Page/external-service-details/external-service-details.component.html
  24. 49 0
      src/app/Internal-Page/external-service-details/external-service-details.component.ts
  25. 0 0
      src/app/Internal-Page/internal-contact-us/internal-contact-us.component.css
  26. 114 0
      src/app/Internal-Page/internal-contact-us/internal-contact-us.component.html
  27. 59 0
      src/app/Internal-Page/internal-contact-us/internal-contact-us.component.ts
  28. 24 20
      src/app/Internal-Page/internal-page-content/internal-page-content.component.html
  29. 16 0
      src/app/Internal-Page/internal-page-content/internal-page-content.component.ts
  30. 6 0
      src/app/Internal-Page/internal-page.module.ts
  31. 0 0
      src/app/Internal-Page/internal-policy/internal-policy.component.css
  32. 29 0
      src/app/Internal-Page/internal-policy/internal-policy.component.html
  33. 44 0
      src/app/Internal-Page/internal-policy/internal-policy.component.ts
  34. 6 0
      src/app/Internal-Page/internal-routing-module.ts
  35. 0 20
      src/app/app.module.ts
  36. 5 1
      src/app/dashboard/add-join-us/add-join-us.component.ts
  37. 1 1
      src/app/dashboard/advertisiment/add-advertisiment/add-adver/add-adver.component.ts
  38. 1 1
      src/app/dashboard/bar-events/add-bar-event/add-bar-event.component.ts
  39. 1 1
      src/app/dashboard/contact-us/add-contact-us/add-contact-us.component.ts
  40. 3 1
      src/app/dashboard/dashboard-content.ts
  41. 1 1
      src/app/dashboard/event-calendars/add-event-calendar/add-event-calendar.component.ts
  42. 19 19
      src/app/dashboard/event-calendars/event-calendars-list/event-calendars-list.component.ts
  43. 0 1
      src/app/dashboard/events/add-event/add-event.component.html
  44. 6 2
      src/app/dashboard/events/add-event/add-event.component.ts
  45. 2 0
      src/app/dashboard/events/events.component.html
  46. 1 1
      src/app/dashboard/external-achievements/add-external-achievement/add-external-achievement.component.ts
  47. 36 9
      src/app/dashboard/external-services/add-external/add-external.component.html
  48. 42 6
      src/app/dashboard/external-services/add-external/add-external.component.ts
  49. 37 11
      src/app/dashboard/footer/add-footer/add-footer.component.html
  50. 74 2
      src/app/dashboard/footer/add-footer/add-footer.component.ts
  51. 16 9
      src/app/dashboard/header/header.component.ts
  52. 1 1
      src/app/dashboard/main-footer/footer.component.html
  53. 20 2
      src/app/dashboard/main-footer/footer.component.ts
  54. 1 1
      src/app/dashboard/statistics/add-statistic/add-statistic.component.ts
  55. 1 1
      src/app/dashboard/visiting-times/add-visiting-time/add-visiting-time.component.ts
  56. 1 1
      src/app/servicesItems/services.component.ts
  57. 18 20
      src/styles.css

+ 25 - 0
src/app/External-Page/event-details/event-details.component.css

@@ -0,0 +1,25 @@
+.eventDetails-w {
+    width: 100%;
+    display: inline-block;
+}
+
+.eventDetails-w .contentEvent-w {
+    width: 100%;
+    padding: 20px 0;
+    display: inline-block;
+}
+
+.eventDetails-w .contentEvent-w h2 {
+    color: #27c5ba;
+}
+
+.eventDetails-w .contentEvent-w .date {
+    margin: 10px 0;
+    font-size: 18px;
+    text-align: center;
+    color: #a6a6a8;
+}
+
+.eventDetails-w .contentEvent-w p {
+    text-align: right;
+}

+ 29 - 0
src/app/External-Page/event-details/event-details.component.html

@@ -0,0 +1,29 @@
+<div class="eventDetails-w">
+  <div class="container">
+    <div class="containerContent-w">
+      <ng-template [ngIf]="authSer.arabicTemplate" [ngIfElse]="englishTemplate">
+        <div class="row">
+          <div class="col-12">
+              <div class="contentEvent-w">
+                <h2 class="text-center">{{eventData.title}}</h2>
+                <p class="text-center date">{{eventData.start}}</p>
+                <p [innerHtml]="eventData.description"></p>
+              </div>
+          </div>
+        </div>
+      </ng-template>
+
+      <ng-template #englishTemplate>
+        <div class="row">
+          <div class="col-12">
+              <div class="contentEvent-w">
+                <h2 class="text-center">{{eventData.title_en}}</h2>
+                <p class="text-center date">{{eventData.start}}</p>
+                <p style="direction:ltr" [innerHtml]="eventData.description_en"></p>
+              </div>
+          </div>
+        </div>
+      </ng-template>
+    </div>
+  </div>
+</div>

+ 23 - 0
src/app/External-Page/event-details/event-details.component.ts

@@ -0,0 +1,23 @@
+import { AuthServiceService } from './../../shared/auth-service.service';
+import { ActivatedRoute, Params } from '@angular/router';
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-event-details',
+  templateUrl: './event-details.component.html',
+  styleUrls: ['./event-details.component.css']
+})
+export class EventDetailsComponent implements OnInit {
+
+  constructor(private route: ActivatedRoute, 
+    private authSer:AuthServiceService) { }
+
+  eventData: any;
+
+  ngOnInit() {
+   this.eventData = JSON.parse(localStorage.getItem('eventData'));
+    console.log(this.eventData);
+    this.eventData.start = this.eventData.start.split('T')[0];
+  }
+
+}

+ 0 - 16
src/app/External-Page/external-contact-us/external-contact-us.component.css

@@ -1,16 +0,0 @@
-.contactUs-w {
-    width: 100%;
-}
-
-
-.contactUs-w .containerContent-w {
-    border-top: 3px solid green !important;
-}
-
-
-
-@media(min-width: 1200px) {
-    .container {
-        width: 1200px !important;
-    }
-}

+ 111 - 17
src/app/External-Page/external-contact-us/external-contact-us.component.html

@@ -1,21 +1,115 @@
-<div class="contactUs-w">
+
+<div class="hospitalContent-w">
   <div class="container">
-    <div class="containerContent-w">
-      <ng-template [ngIf]="authSer.arabicTemplate" [ngIfElse]="englishTemplate">
-        <div class="row">
-          <div class="col-12">
-            <p [innerHTML]="contactUs.field"></p>
-          </div>
+    <div class="row">
+        <div class="containerContent-w">
+
+            <ng-template [ngIf]="authSer.arabicTemplate" [ngIfElse]="englishTemplate">
+              <form (ngSubmit)="onSubmitted()" #f="ngForm">
+                <div class="row">
+                  
+                  <div class="col-12 col-sm-12 col-md-4">
+                    <div class="form-group">
+                      <label for="name" style="float: right;margin-right: 5px">الإسم <span class="spanReqired-w">*</span></label>
+                      <input type="text" placeholder="الإسم" class="form-control" ngModel name="name" required/>
+                    </div>
+                  </div>
+                  
+                  <div class="col-12 col-sm-12 col-md-4">
+                    <div class="form-group">
+                      <label for="phone" style="float: right;margin-right: 5px">الجوال <span class="spanReqired-w">*</span></label>
+                      <input type="phone" placeholder="الجوال" class="form-control" appOnlyNumber ngModel name="phone" required/>
+                    </div>
+                  </div>
+
+                  <div class="col-12 col-sm-12 col-md-4">
+                      <label for="email" style="float: right;margin-right: 5px">البريد الإلكتروني <span class="spanReqired-w">*</span></label>
+                      <input type="email" placeholder="البريد الإلكتروني" class="form-control" appEnglishCharacters ngModel name="email" required/>
+                  </div>
+                  
+                  <div class="col-12 col-sm-12 col-md-6">
+                    <div class="form-group">
+                      <label for="subject" style="float: right;margin-right: 5px">عنوان الموضوع <span class="spanReqired-w">*</span></label>
+                      <input type="text" placeholder="عنوان الموضوع" class="form-control" ngModel name="subject" required/>
+                    </div>
+                  </div>
+
+                  <div class="col-12 col-sm-12 col-md-6">
+
+                  </div>
+
+                  <div class="col-12 col-sm-12 col-md-6">
+                    <div class="form-group">
+                      <label for="subject" style="float: right;margin-right: 5px">نص الرساله <span class="spanReqired-w">*</span></label>
+                      <textarea name="message" class="form-control" ngModel cols="3" required></textarea>
+                    </div>
+                  </div>
+                  
+                  <div class="col-12 col-sm-12 col-md-6">
+                    
+                  </div>
+                    
+                  <!-- <div class="col-12">
+                    <button type="submit" class="btn btn-success" [disabled]="!f.valid">إرسال</button>
+                  </div> -->
+                </div>
+                <button type="submit" class="btn btn-success" [disabled]="!f.valid || checkSaveButton">إرسال</button>
+
+              </form>
+            </ng-template>
+
+            <ng-template #englishTemplate>
+              <form (ngSubmit)="onSubmitted()" #f="ngForm">
+                  <form (ngSubmit)="onSubmitted()" #f="ngForm">
+                      <div class="row" style="direction:ltr">
+                      
+                          <div class="col-12 col-sm-12 col-md-4">
+                            <div class="form-group">
+                              <label for="name" style="float: left;margin-left: 5px">Name<span class="spanReqired-w">*</span></label>
+                              <input type="text" placeholder="name" class="form-control" ngModel name="name" required/>
+                            </div>
+                          </div>
+                          
+                          <div class="col-12 col-sm-12 col-md-4">
+                            <div class="form-group">
+                              <label for="phone" style="float: left;margin-left: 5px">Phone<span class="spanReqired-w">*</span></label>
+                              <input type="phone" placeholder="phone" class="form-control" appOnlyNumber ngModel name="phone" required/>
+                            </div>
+                          </div>
+        
+                          <div class="col-12 col-sm-12 col-md-4">
+                              <label for="email" style="float: left;margin-left: 5px">Email <span class="spanReqired-w">*</span></label>
+                              <input type="email" placeholder="Email" class="form-control" appEnglishCharacters ngModel name="email" required/>
+                          </div>
+                          
+                          <div class="col-12 col-sm-12 col-md-6">
+                            <div class="form-group">
+                              <label for="subject" style="float: left;margin-left: 5px">Subject <span class="spanReqired-w">*</span></label>
+                              <input type="text" placeholder="Subject" class="form-control" ngModel name="subject" required/>
+                            </div>
+                          </div>
+        
+                          <div class="col-12 col-sm-12 col-md-6">
+        
+                          </div>
+        
+                          <div class="col-12 col-sm-12 col-md-6">
+                            <div class="form-group">
+                              <label for="subject" style="float: left;margin-left: 5px">Message <span class="spanReqired-w">*</span></label>
+                              <textarea name="message" class="form-control" ngModel cols="3" required></textarea>
+                            </div>
+                          </div>
+                          
+                          <div class="col-12 col-sm-12 col-md-6">
+                            
+                          </div>
+                        </div>
+                        <button type="submit" class="btn btn-success" [disabled]="!f.valid || checkSaveButton">send</button>    
+                  </form>
+              </form>
+            </ng-template>
+
         </div>
-      </ng-template>
-
-      <ng-template #englishTemplate>
-          <div class="row">
-            <div class="col-12">
-              <p [innerHTML]="contactUs.field_en"></p>
-            </div>
-          </div>
-      </ng-template>
     </div>
   </div>
-</div>
+</div>

+ 31 - 27
src/app/External-Page/external-contact-us/external-contact-us.component.ts

@@ -1,6 +1,9 @@
 import { AuthServiceService } from './../../shared/auth-service.service';
-import { ExternalPageService } from './../../shared/external-page.service';
-import { Component, OnInit } from '@angular/core';
+import { ActivatedRoute, Params } from '@angular/router';
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { NgForm } from '@angular/forms';
+import { ToastrService } from 'ngx-toastr';
 import { NgxSpinnerService } from 'ngx-spinner';
 
 @Component({
@@ -10,43 +13,44 @@ import { NgxSpinnerService } from 'ngx-spinner';
 })
 export class ExternalContactUsComponent implements OnInit {
 
-  constructor(private externalService: ExternalPageService, 
+  constructor(private route: ActivatedRoute, 
+    private authSer: AuthServiceService,
     private spinner: NgxSpinnerService,
-    private authSer:AuthServiceService) { 
-      this.spinner.show();
-    }
-  
-  contactUs = [];
+    private toastr: ToastrService,
+    private http: HttpClient) { }
+
+  contactId:number;
+  checkSaveButton:boolean = false;
+
+  @ViewChild('f') contactForm: NgForm;
 
-  ngOnInit() {
 
+  ngOnInit() {
+  
     this.authSer.homeActivate = false;
-    //add active class in contact us menu header "active = 1"
-    this.externalService.getHeader().subscribe(
-      (responce) => {
-        this.externalService.headerMenus = responce['parents'];
-        for(let i = 0; i < this.externalService.headerMenus.length; i++) {
-          if(this.externalService.headerMenus[i].id == 23) {
-            this.externalService.headerMenus[i].active = 1;
-          } else {
-            this.externalService.headerMenus[i].active = 0;
-          }
-        }
-      },
-      (error) => {
-        console.log(error);
+    this.route.params.subscribe(
+      (params: Params) => {
+        this.contactId = params['contactId'];
       }
     );
 
-    this.externalService.getContactUs().subscribe(
+    this.spinner.hide();
+
+  }
+
+  onSubmitted() {
+    this.checkSaveButton = true;
+    console.log(this.contactForm);
+    this.http.post(this.authSer.pathApi + '/add_contact_message', this.contactForm.value).subscribe(
       (responce) => {
         console.log(responce);
-        this.contactUs = responce['contact_us'];
-        console.log('contact uus', this.contactUs);
-        this.spinner.hide();
+        this.toastr.success('تم الارسال بنجاح');
+        this.contactForm.reset();
       },
       (error) => {
         console.log(error);
+        this.checkSaveButton = false;
+        this.toastr.error('خطأ في السيرفر ، سيتم المعالجه لاخقاً');
       }
     )
   }

+ 2 - 1
src/app/External-Page/external-events/external-events.component.css

@@ -21,4 +21,5 @@
 
 .cal-month-view .cal-day-cell {
     height: 50px !important;
-}
+}
+

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

@@ -1,4 +1,4 @@
-<div class="eventContent-w" [ngClass]="{'eventContentChange-w': showDetailsEvent}">
+<div class="externalEventContent-w" [ngClass]="{'eventContentChange-w': showDetailsEvent}">
   
     <ng-template #modalContent let-close="close">
       <div class="modal-header">

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

@@ -30,6 +30,7 @@ import {
   CalendarEventTimesChangedEvent,
   CalendarView
 } from 'angular-calendar';
+import { Router, NavigationExtras } from '@angular/router';
 const colors: any = {
   red: {
     primary: '#ad2121',
@@ -65,6 +66,7 @@ export class ExternalEventsComponent implements OnInit {
 
   constructor(private modal: NgbModal, 
     private http: HttpClient,
+    private router: Router,
     private authSer: AuthServiceService,
     private spinner:NgxSpinnerService) {}
 
@@ -143,7 +145,8 @@ export class ExternalEventsComponent implements OnInit {
       this.showDetailsEvent = true;
       console.log(ssss , event);
       this.dataLecture = event;
-      console.log('dataaaaaa lectrueeeeee',this.dataLecture);
+      localStorage.setItem('eventData', JSON.stringify(this.dataLecture));
+      this.router.navigate(['ExternalPage/eventsDetails']);
     }
 
     closeDetailEvent() {

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

@@ -339,10 +339,22 @@ input,button {
 
 .externalPageContentt-w .recordsContent-w .records .body {
     width: 100%;
-    height: 285px;
+    height: 357px;
     background-color: #fff;
     box-shadow: 0 1px 1px #ccc;
     padding: 2px 0;
+    position: relative;
+}
+
+.externalPageContentt-w .recordsContent-w .records .body .spinnerContainer-w {
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    top: 0;
+    bottom: 0;
+    right: 0;
+    left: 0;
+    background-color: #fff;
 }
 
 .externalPageContentt-w .recordsContent-w .records .body ul {
@@ -384,7 +396,7 @@ input,button {
 
 .externalPageContentt-w .recordsContent-w .medical .body {
     width: 100%;
-    height: 285px;
+    height: 357px;
     background-color: #fff;
     box-shadow: 0 1px 1px #ccc;
 }
@@ -453,6 +465,9 @@ input,button {
     width: 100%;
     background-color: #fff;
     box-shadow: 0 1px 1px #ccc;
+    height: 400px;
+    overflow: auto;
+    padding: 0 20px;
 }
 
 .externalPageContentt-w .datePicker-w h1 {
@@ -599,6 +614,45 @@ agm-map {
     height: 300px;
   }
 
+  .rightArrow-w {
+    display: inline-block;
+    position: absolute;
+    right: 25px;
+    top: 5px;
+    cursor: pointer;
+    font-size: 25px;
+  }
+
+  .leftArrow-w{
+    position: absolute;
+    left: 25px;
+    top: 5px;
+    font-size: 25px;
+    cursor: pointer;
+    display: inline-block;
+  }
+
+  .loader {
+    border: 10px solid #f3f3f3;
+    border-radius: 50%;
+    border-top: 10px solid #3498db;
+    width: 50px;
+    height: 50px;
+    -webkit-animation: spin 2s linear infinite; /* Safari */
+    animation: spin 2s linear infinite;
+    margin: 100px auto;
+  }
+  
+  /* Safari */
+  @-webkit-keyframes spin {
+    0% { -webkit-transform: rotate(0deg); }
+    100% { -webkit-transform: rotate(360deg); }
+  }
+  
+  @keyframes spin {
+    0% { transform: rotate(0deg); }
+    100% { transform: rotate(360deg); }
+  }
 
 
 @media(max-width: 767px) {

+ 28 - 14
src/app/External-Page/external-page-content/external-page-content.component.html

@@ -3,6 +3,7 @@
         <div class="container">
           <div class="contentPage-w">
             <div class="row">
+
               <div class="col-12">
                 <div class="sliderNews-w">
                   <div id="demo" class="carousel slide" data-ride="carousel">
@@ -26,16 +27,16 @@
         
               <div class="col-12">
                 <div class="eventPart-w">
-                    <div id="demo1" class="carousel slide" data-ride="carousel">
-                        <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>
-                                </div>   
-                            </div>
-                            <button class="moreEvent-w" (click)="oneventTable()">المزيد</button>
-                        </div>
-                    </div> 
+                  <div id="demo1" class="carousel slide" data-ride="carousel">
+                      <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>
+                              </div>   
+                          </div>
+                          <button class="moreEvent-w" (click)="oneventTable()">المزيد</button>
+                      </div>
+                  </div> 
                 </div>
               </div>
         
@@ -44,7 +45,7 @@
                   <div class="row">
                     <div class="col-6 col-sm-6 col-md-3 col-lg-3" *ngFor="let service of services; let i = index">
                       <div class="animated" style="position:relative">
-                        <a href="{{service.link}}">
+                        <a (click)="onGetService(service)">
                             <div class="item text-center">
                               <img src="{{authSer.pathImg + service.photo}}" />
                               <p>{{service.name}}</p>
@@ -158,9 +159,17 @@
                         <div class="row">
                           <div class="col-12 col-sm-12 col-md-6">
                             <div class="records">
+                              <span class="rightArrow-w" (click)="prevMonth()"><i class="fas fa-angle-right"></i></span>
                               <h1> إحصائيات شهر  {{recordsOfMonth.statistics_month}}</h1>
+                              <span class="leftArrow-w" (click)="nextMonth()"><i class="fas fa-angle-left"></i></span>
                               <div class="body">
+                                <div class="spinnerContainer-w" *ngIf="showSmallSpinner">
+                                  <div class="loader">
+
+                                  </div>
+                                </div>
                                 <ul class="list-unstyled">
+                                  <li *ngIf="checkStatisticShow">لا يوجد إحصائيات لعرضها الأن</li>
                                   <li *ngFor="let static of recordsOfMonth['statistics_values']; let i = index"> <span>{{static.value}}</span>{{static.name}}</li>
                                 </ul>
                               </div>
@@ -356,9 +365,17 @@
                         <div class="row">
                           <div class="col-12 col-sm-12 col-md-6">
                             <div class="records">
+                              <span class="rightArrow-w" (click)="nextMonth()"><i class="fas fa-angle-right"></i></span>
                               <h1> Stqtistics Month {{recordsOfMonth.statistics_month_en}}</h1>
+                              <span class="leftArrow-w" (click)="prevMonth()"><i class="fas fa-angle-left"></i></span>
                               <div class="body">
+                                <div class="spinnerContainer-w" *ngIf="showSmallSpinner">
+                                  <div class="loader">
+
+                                  </div>
+                                </div>
                                 <ul class="list-unstyled" style="direction:ltr">
+                                  <li *ngIf="checkStatisticShow">No Statistics To Show !</li>
                                   <li *ngFor="let static of recordsOfMonth['statistics_values']; let i = index"> {{static.name_en}} <span>{{static.value}}</span></li>
                                 </ul>
                               </div>
@@ -397,9 +414,6 @@
                     </agm-map>
                 </div>
               </div>
-          
-    
-    
         </div>
       </div>
     </div>

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

@@ -6,6 +6,8 @@ import { Component, OnInit, OnDestroy } from '@angular/core';
 import {MapsAPILoader} from '@agm/core';
 import * as $ from 'jquery';
 import { NgxSpinnerService } from 'ngx-spinner';
+import { HttpClient } from '@angular/common/http';
+import { ToastrService } from 'ngx-toastr';
 
 @Component({
   selector: 'app-external-page-content',
@@ -17,7 +19,9 @@ export class ExternalPageContentComponent implements OnInit, OnDestroy {
   constructor(private externalService: ExternalPageService, 
     private spinner: NgxSpinnerService,
     private router: Router,
+    private http: HttpClient,
     private route: ActivatedRoute,
+    private toastr: ToastrService,
     private authSer:AuthServiceService) { 
       this.spinner.show();
     }
@@ -30,6 +34,9 @@ export class ExternalPageContentComponent implements OnInit, OnDestroy {
   intensiveCare = []; 
   recordsOfMonth = [];
   achievements = [];
+  initialMonthNumber: number;
+  checkStatisticShow: boolean = false;
+  showSmallSpinner: boolean = false;
 
   title: string = 'My first AGM project';
   
@@ -80,6 +87,7 @@ export class ExternalPageContentComponent implements OnInit, OnDestroy {
         this.intensiveCare = responce['data'].visiting_times_ic;
         this.recordsOfMonth = responce['data']['statistics'];
         this.achievements = responce['data'].external_achievements;
+        this.initialMonthNumber = responce['data']['statistics'].month_id;
         this.lat = responce['data']['reach_map'].latitude;
         this.lng = responce['data']['reach_map'].longitude;
         console.log('fiiiiiiiiiiiiiiiiiiiii' , this.firstAdvertisiment);
@@ -93,6 +101,107 @@ export class ExternalPageContentComponent implements OnInit, OnDestroy {
   }
 
 
+  nextMonth() {
+    this.showSmallSpinner = true;
+    this.recordsOfMonth = [];
+    if(this.initialMonthNumber == 12) {
+      this.initialMonthNumber = 12;
+      console.log(this.initialMonthNumber);
+      this.toastr.warning('أخر شهور العام !');
+      this.http.get(this.authSer.pathApi + '/get_statistics_by_month_id/' + 12).subscribe(
+        (responce) => {
+          console.log(responce);
+          this.showSmallSpinner = false;
+          this.recordsOfMonth = responce['statistics'];
+          if(responce['statistics'].statistics_values.length > 0) {
+            this.checkStatisticShow = false;
+          } else {
+            this.checkStatisticShow = true;
+          }
+        },
+        (error) => {
+          console.log(error);
+        }
+      );
+    } else {
+      this.initialMonthNumber++;
+      console.log(this.initialMonthNumber);
+      this.http.get(this.authSer.pathApi + '/get_statistics_by_month_id/' + this.initialMonthNumber).subscribe(
+        (responce) => {
+          console.log(responce);
+          this.showSmallSpinner = false;
+          this.recordsOfMonth = responce['statistics'];
+          if(responce['statistics'].statistics_values.length > 0) {
+            this.checkStatisticShow = false;
+          } else {
+            this.checkStatisticShow = true;
+          }
+        },
+        (error) => {
+          console.log(error);
+        }
+      );
+    }
+ 
+  }
+
+  prevMonth() {
+    this.showSmallSpinner = true;
+    this.recordsOfMonth = [];
+    console.log(this.initialMonthNumber);
+    if(this.initialMonthNumber == 1) {
+      this.initialMonthNumber = 1;
+      this.toastr.warning('أول شهور العام !');
+      this.http.get(this.authSer.pathApi + '/get_statistics_by_month_id/' + 1).subscribe(
+        (responce) => {
+          this.showSmallSpinner = true;
+          this.showSmallSpinner = false;
+          this.recordsOfMonth = responce['statistics'];
+          if(responce['statistics'].statistics_values.length > 0) {
+            this.checkStatisticShow = false;
+          } else {
+            this.checkStatisticShow = true;
+          }
+        },
+        (error) => {
+          console.log(error);
+        }
+      );
+    } else {
+      this.initialMonthNumber--;
+      this.http.get(this.authSer.pathApi + '/get_statistics_by_month_id/' + this.initialMonthNumber).subscribe(
+        (responce) => {
+          console.log(responce);
+          this.showSmallSpinner = true;
+          this.showSmallSpinner = false;
+          this.recordsOfMonth = responce['statistics'];
+          if(responce['statistics'].statistics_values.length > 0) {
+            this.checkStatisticShow = false;
+          } else {
+            this.checkStatisticShow = true;
+          }
+        },
+        (error) => {
+          console.log(error);
+        }
+      );
+    }
+  }
+
+  onGetService(serviceData) {
+    console.log(serviceData);
+    if(serviceData.type == 'internal') {
+      this.router.navigate(['ExternalPage/externalServiceDetails/' + serviceData.id]);
+    } else if(serviceData.type == 'external') {
+      window.location.href = serviceData.link;
+    }
+  }
+
+  onGetServiceData(serviceData) {
+    console.log('service Data' , serviceData);
+  }
+
+
   goPageNew(reprotData) {
     console.log(reprotData);
     this.router.navigate( ['ExternalPage/newPage/' + reprotData.id]);

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

@@ -26,10 +26,10 @@ export class ExternalPageHeaderComponent implements OnInit {
 
     this.authSer.footerData = [];
 
-    this.authSer.onGetFooterData('internal').subscribe(
+    this.authSer.onGetFooterData('external').subscribe(
       (responce) => {
         this.authSer.footerData = responce['footer'];
-        console.log(this.authSer.footerData);
+        console.log('fooooooooooooooter dattaaa' , this.authSer.footerData);
       },
       (error) => {
         console.log(error);

+ 8 - 4
src/app/External-Page/external-page.module.ts

@@ -1,3 +1,4 @@
+import { EventDetailsComponent } from './event-details/event-details.component';
 import { ExternalManagamentsComponent } from './external-managaments/external-managaments.component';
 import { SharedModule } from './../shared/shared.module';
 import { ExternalEventsComponent } from './external-events/external-events.component';
@@ -15,13 +16,14 @@ import { OwlModule } from 'ngx-owl-carousel';
 import { CalendarModule, DateAdapter } from 'angular-calendar';
 import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
 import { ExternalHospitalComponent } from './external-hospital/external-hospital.component';
-import { ExternalContactUsComponent } from './external-contact-us/external-contact-us.component';
 import { NewPageComponent } from './new-page/new-page.component';
 import { ExternalEventsTableComponent } from './external-events-table/external-events-table.component';
 import {NgxPaginationModule} from 'ngx-pagination';
 import { MoreNewsComponent } from './more-news/more-news.component';
+import { InernalServicePageComponent } from './inernal-service-page/inernal-service-page.component';
+import { ExternalContactUsComponent } from './external-contact-us/external-contact-us.component';
+import { ExternalPolicyComponent } from './external-policy/external-policy.component';
 
-//import { CeiboShare } from 'ng2-social-share';
 
 
 @NgModule({
@@ -30,12 +32,14 @@ import { MoreNewsComponent } from './more-news/more-news.component';
         ExternalPageComponent,
         ExternalEventsComponent,
         ExternalHospitalComponent,
-        ExternalContactUsComponent,
         NewPageComponent,
         ExternalEventsTableComponent,
         MoreNewsComponent,
         ExternalManagamentsComponent,
-        //CeiboShare,
+        EventDetailsComponent,
+        InernalServicePageComponent,
+        ExternalContactUsComponent,
+        ExternalPolicyComponent,
     ],
     imports: [
         CommonModule,

+ 0 - 0
src/app/External-Page/external-policy/external-policy.component.css


+ 29 - 0
src/app/External-Page/external-policy/external-policy.component.html

@@ -0,0 +1,29 @@
+
+<div class="hospitalContent-w">
+    <div class="container">
+      <div class="row">
+          <div class="containerContent-w">
+  
+              <ng-template [ngIf]="authSer.arabicTemplate" [ngIfElse]="englishTemplate">
+                <div class="row">
+                  <div class="col-12">
+                    <h2 class="text-center">{{data.name}}</h2>
+                    <p>{{data.description}}</p>
+                  </div>
+                </div>
+              </ng-template>
+  
+              <ng-template #englishTemplate>
+                <div class="row" style="direction:ltr">
+                  <div class="col-12">
+                    <h2 class="text-center">{{data.name_en}}</h2>
+                    <p>{{data.description_en}}</p>
+                  </div>
+                </div>
+              </ng-template>
+  
+          </div>
+      </div>
+    </div>
+  </div>
+  

+ 44 - 0
src/app/External-Page/external-policy/external-policy.component.ts

@@ -0,0 +1,44 @@
+import { NgxSpinnerService } from 'ngx-spinner';
+import { AuthServiceService } from './../../shared/auth-service.service';
+import { ActivatedRoute, Params } from '@angular/router';
+import { Component, OnInit } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+
+@Component({
+  selector: 'app-external-policy',
+  templateUrl: './external-policy.component.html',
+  styleUrls: ['./external-policy.component.css']
+})
+export class ExternalPolicyComponent implements OnInit {
+
+  constructor(private route: ActivatedRoute, 
+    private http: HttpClient,
+    private spinner: NgxSpinnerService,
+    private authSer:AuthServiceService) { }
+
+  policyId: number;
+  data = [];
+
+  ngOnInit() {
+
+    this.spinner.show();
+    this.authSer.homeActivate = false;
+    this.route.params.subscribe(
+      (params: Params) => {
+        this.policyId = params['policyId'];
+        this.data = [];
+        this.http.get(this.authSer.pathApi + '/get_footer/' + this.policyId).subscribe(
+          (responce) => {
+            this.data = responce['footer'];
+            console.log(this.data);
+            this.spinner.hide();
+          },
+          (error) => {
+            console.log(error);
+          }
+        );
+      }
+    );
+  }
+
+}

+ 8 - 3
src/app/External-Page/external-routing-module.ts

@@ -1,6 +1,7 @@
+import { ExternalPolicyComponent } from './external-policy/external-policy.component';
+import { ExternalContactUsComponent } from './external-contact-us/external-contact-us.component';
 import { ExternalEventsTableComponent } from './external-events-table/external-events-table.component';
 import { NewPageComponent } from './new-page/new-page.component';
-import { ExternalContactUsComponent } from './external-contact-us/external-contact-us.component';
 import { ExternalHospitalComponent } from './external-hospital/external-hospital.component';
 import { ExternalPageContentComponent } from './external-page-content/external-page-content.component';
 import { ExternalPageComponent } from './external-page/external-page.component';
@@ -8,15 +9,19 @@ import { NgModule } from '@angular/core';
 import { RouterModule, Routes } from '@angular/router';
 import { MoreNewsComponent } from './more-news/more-news.component';
 import { ExternalManagamentsComponent } from './external-managaments/external-managaments.component';
-
+import { EventDetailsComponent } from './event-details/event-details.component';
+import {InernalServicePageComponent} from './inernal-service-page/inernal-service-page.component';
 
 
 const externalPageRoutes: Routes = [
     {path: 'ExternalPage' , component: ExternalPageComponent, children:[
         {path: 'home', component: ExternalPageContentComponent},
-        {path: 'contactUs', component: ExternalContactUsComponent},
         {path: 'EventsTable', component: ExternalEventsTableComponent},
         {path: 'moreNews', component: MoreNewsComponent},
+        {path: 'eventsDetails', component: EventDetailsComponent},
+        {path: 'contactUs/:contactId', component: ExternalContactUsComponent},
+        {path: 'externalPolicy/:policyId', component: ExternalPolicyComponent},
+        {path: 'externalServiceDetails/:externalServiceId', component: InernalServicePageComponent},
         {path: 'newPage/:reportId', component: NewPageComponent},
         {path: 'hospital', component: ExternalHospitalComponent},
         {path: 'managements', component: ExternalManagamentsComponent},

+ 25 - 0
src/app/External-Page/inernal-service-page/inernal-service-page.component.css

@@ -0,0 +1,25 @@
+.serviceDetails-w {
+    width: 100%;
+    display: inline-block;
+}
+
+.serviceDetails-w .contentEvent-w {
+    width: 100%;
+    padding: 20px 0;
+    display: inline-block;
+}
+
+.serviceDetails-w .contentEvent-w h2 {
+    color: #27c5ba;
+}
+
+.serviceDetails-w .contentEvent-w .date {
+    margin: 10px 0;
+    font-size: 18px;
+    text-align: center;
+    color: #a6a6a8;
+}
+
+.serviceDetails-w .contentEvent-w p {
+    text-align: right;
+}

+ 30 - 0
src/app/External-Page/inernal-service-page/inernal-service-page.component.html

@@ -0,0 +1,30 @@
+<div class="serviceDetails-w">
+    <div class="container">
+      <div class="containerContent-w">
+        <ng-template [ngIf]="authSer.arabicTemplate" [ngIfElse]="englishTemplate">
+          <div class="row">
+            <div class="col-12">
+                <div class="contentEvent-w">
+                  <!-- <h2 class="text-center">{{eventData.title}}</h2>
+                  <p class="text-center date">{{eventData.start}}</p> -->
+                  <p [innerHtml]="serviceData.description"></p>
+                </div>
+            </div>
+          </div>
+        </ng-template>
+  
+        <ng-template #englishTemplate>
+          <div class="row">
+            <div class="col-12">
+                <div class="contentEvent-w">
+                  <!-- <h2 class="text-center">{{eventData.title_en}}</h2>
+                  <p class="text-center date">{{eventData.start}}</p> -->
+                  <p style="direction:ltr" [innerHtml]="serviceData.description_en"></p>
+                </div>
+            </div>
+          </div>
+        </ng-template>
+      </div>
+    </div>
+  </div>
+  

+ 43 - 0
src/app/External-Page/inernal-service-page/inernal-service-page.component.ts

@@ -0,0 +1,43 @@
+import { HttpClient } from '@angular/common/http';
+import { AuthServiceService } from './../../shared/auth-service.service';
+import { ActivatedRoute, Params } from '@angular/router';
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-inernal-service-page',
+  templateUrl: './inernal-service-page.component.html',
+  styleUrls: ['./inernal-service-page.component.css']
+})
+export class InernalServicePageComponent implements OnInit {
+
+  constructor(private route: ActivatedRoute,
+    private authSer: AuthServiceService, 
+    private http: HttpClient) { }
+
+  serviceId: number;
+  serviceData = [];
+
+  ngOnInit() {
+    
+    this.route.params.subscribe(
+      (params:Params) => {
+        this.serviceId = params['externalServiceId'];
+      },
+      (error) => {
+        console.log(error);
+      }
+    );
+
+    this.http.get(this.authSer.pathApi + '/get_external_service/' + this.serviceId).subscribe(
+      (responce) => {
+        console.log(responce);
+        this.serviceData = responce['external_service'];
+      },
+      (error) => {
+        console.log(error);
+      }
+    );
+
+  }
+
+}

+ 25 - 0
src/app/Internal-Page/external-service-details/external-service-details.component.css

@@ -0,0 +1,25 @@
+.serviceDetails-w {
+    width: 100%;
+    display: inline-block;
+}
+
+.serviceDetails-w .contentEvent-w {
+    width: 100%;
+    padding: 20px 0;
+    display: inline-block;
+}
+
+.serviceDetails-w .contentEvent-w h2 {
+    color: #27c5ba;
+}
+
+.serviceDetails-w .contentEvent-w .date {
+    margin: 10px 0;
+    font-size: 18px;
+    text-align: center;
+    color: #a6a6a8;
+}
+
+.serviceDetails-w .contentEvent-w p {
+    text-align: right;
+}

+ 30 - 0
src/app/Internal-Page/external-service-details/external-service-details.component.html

@@ -0,0 +1,30 @@
+<div class="serviceDetails-w">
+  <div class="container">
+    <div class="containerContent-w">
+      <ng-template [ngIf]="authSer.arabicTemplate" [ngIfElse]="englishTemplate">
+        <div class="row">
+          <div class="col-12">
+              <div class="contentEvent-w">
+                <!-- <h2 class="text-center">{{eventData.title}}</h2>
+                <p class="text-center date">{{eventData.start}}</p> -->
+                <p [innerHtml]="serviceData.description"></p>
+              </div>
+          </div>
+        </div>
+      </ng-template>
+
+      <ng-template #englishTemplate>
+        <div class="row">
+          <div class="col-12">
+              <div class="contentEvent-w">
+                <!-- <h2 class="text-center">{{eventData.title_en}}</h2>
+                <p class="text-center date">{{eventData.start}}</p> -->
+                <p style="direction:ltr" [innerHtml]="serviceData.description_en"></p>
+              </div>
+          </div>
+        </div>
+      </ng-template>
+    </div>
+  </div>
+</div>
+

+ 49 - 0
src/app/Internal-Page/external-service-details/external-service-details.component.ts

@@ -0,0 +1,49 @@
+import { ActivatedRoute, Params } from '@angular/router';
+import { HttpClient } from '@angular/common/http';
+import { AuthServiceService } from './../../shared/auth-service.service';
+import { Component, OnInit } from '@angular/core';
+import { NgxSpinnerService } from 'ngx-spinner';
+
+@Component({
+  selector: 'app-external-service-details',
+  templateUrl: './external-service-details.component.html',
+  styleUrls: ['./external-service-details.component.css']
+})
+export class ExternalServiceDetailsComponent implements OnInit {
+
+  constructor(private route: ActivatedRoute,
+    private authSer: AuthServiceService, 
+    private spinner: NgxSpinnerService,
+    private http: HttpClient) { }
+
+  serviceId: number;
+  serviceData = [];
+
+  ngOnInit() {
+
+    this.spinner.show();
+    this.authSer.homeActivate = false;
+    
+    this.route.params.subscribe(
+      (params:Params) => {
+        this.serviceId = params['serviceId'];
+      },
+      (error) => {
+        console.log(error);
+      }
+    );
+
+    this.http.get(this.authSer.pathApi + '/get_external_service/' + this.serviceId).subscribe(
+      (responce) => {
+        console.log(responce);
+        this.serviceData = responce['external_service'];
+        this.spinner.hide();
+      },
+      (error) => {
+        console.log(error);
+      }
+    );
+
+  }
+
+}

+ 0 - 0
src/app/Internal-Page/internal-contact-us/internal-contact-us.component.css


+ 114 - 0
src/app/Internal-Page/internal-contact-us/internal-contact-us.component.html

@@ -0,0 +1,114 @@
+
+<div class="hospitalContent-w">
+    <div class="container">
+      <div class="row">
+          <div class="containerContent-w">
+  
+              <ng-template [ngIf]="authSer.arabicTemplate" [ngIfElse]="englishTemplate">
+                <form (ngSubmit)="onSubmitted()" #f="ngForm">
+                  <div class="row">
+                    
+                    <div class="col-12 col-sm-12 col-md-4">
+                      <div class="form-group">
+                        <label for="name" style="float: right;margin-right: 5px">الإسم <span class="spanReqired-w">*</span></label>
+                        <input type="text" placeholder="الإسم" class="form-control" ngModel name="name" required/>
+                      </div>
+                    </div>
+                    
+                    <div class="col-12 col-sm-12 col-md-4">
+                      <div class="form-group">
+                        <label for="phone" style="float: right;margin-right: 5px">الجوال <span class="spanReqired-w">*</span></label>
+                        <input type="phone" placeholder="الجوال" class="form-control" appOnlyNumber ngModel name="phone" required/>
+                      </div>
+                    </div>
+  
+                    <div class="col-12 col-sm-12 col-md-4">
+                        <label for="email" style="float: right;margin-right: 5px">البريد الإلكتروني <span class="spanReqired-w">*</span></label>
+                        <input type="email" placeholder="البريد الإلكتروني" class="form-control" appEnglishCharacters ngModel name="email" required/>
+                    </div>
+                    
+                    <div class="col-12 col-sm-12 col-md-6">
+                      <div class="form-group">
+                        <label for="subject" style="float: right;margin-right: 5px">عنوان الموضوع <span class="spanReqired-w">*</span></label>
+                        <input type="text" placeholder="عنوان الموضوع" class="form-control" ngModel name="subject" required/>
+                      </div>
+                    </div>
+  
+                    <div class="col-12 col-sm-12 col-md-6">
+  
+                    </div>
+  
+                    <div class="col-12 col-sm-12 col-md-6">
+                      <div class="form-group">
+                        <label for="subject" style="float: right;margin-right: 5px">نص الرساله <span class="spanReqired-w">*</span></label>
+                        <textarea name="message" class="form-control" ngModel cols="3" required></textarea>
+                      </div>
+                    </div>
+                    
+                    <div class="col-12 col-sm-12 col-md-6">
+                      
+                    </div>
+                      
+                    <!-- <div class="col-12">
+                      <button type="submit" class="btn btn-success" [disabled]="!f.valid">إرسال</button>
+                    </div> -->
+                  </div>
+                  <button type="submit" class="btn btn-success" [disabled]="!f.valid || checkSaveButton">إرسال</button>
+  
+                </form>
+              </ng-template>
+  
+              <ng-template #englishTemplate>
+                <form (ngSubmit)="onSubmitted()" #f="ngForm">
+                    <div class="row" style="direction:ltr">
+                    
+                        <div class="col-12 col-sm-12 col-md-4">
+                          <div class="form-group">
+                            <label for="name" style="float: left;margin-left: 5px">Name<span class="spanReqired-w">*</span></label>
+                            <input type="text" placeholder="name" class="form-control" ngModel name="name" required/>
+                          </div>
+                        </div>
+                        
+                        <div class="col-12 col-sm-12 col-md-4">
+                          <div class="form-group">
+                            <label for="phone" style="float: left;margin-left: 5px">Phone<span class="spanReqired-w">*</span></label>
+                            <input type="phone" placeholder="phone" class="form-control" appOnlyNumber ngModel name="phone" required/>
+                          </div>
+                        </div>
+      
+                        <div class="col-12 col-sm-12 col-md-4">
+                            <label for="email" style="float: left;margin-left: 5px">Email <span class="spanReqired-w">*</span></label>
+                            <input type="email" placeholder="Email" class="form-control" appEnglishCharacters ngModel name="email" required/>
+                        </div>
+                        
+                        <div class="col-12 col-sm-12 col-md-6">
+                          <div class="form-group">
+                            <label for="subject" style="float: left;margin-left: 5px">Subject <span class="spanReqired-w">*</span></label>
+                            <input type="text" placeholder="Subject" class="form-control" ngModel name="subject" required/>
+                          </div>
+                        </div>
+      
+                        <div class="col-12 col-sm-12 col-md-6">
+      
+                        </div>
+      
+                        <div class="col-12 col-sm-12 col-md-6">
+                          <div class="form-group">
+                            <label for="subject" style="float: left;margin-left: 5px">Message <span class="spanReqired-w">*</span></label>
+                            <textarea name="message" class="form-control" ngModel cols="3" required></textarea>
+                          </div>
+                        </div>
+                        
+                        <div class="col-12 col-sm-12 col-md-6">
+                          
+                        </div>
+                      </div>
+                      <button type="submit" class="btn btn-success" [disabled]="!f.valid || checkSaveButton">send</button>    
+                </form>
+              </ng-template>
+  
+          </div>
+      </div>
+    </div>
+  </div>
+  

+ 59 - 0
src/app/Internal-Page/internal-contact-us/internal-contact-us.component.ts

@@ -0,0 +1,59 @@
+import { ToastrService } from 'ngx-toastr';
+import { AuthServiceService } from './../../shared/auth-service.service';
+import { Params, ActivatedRoute } from '@angular/router';
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { NgForm } from '@angular/forms';
+import { HttpClient } from '@angular/common/http';
+import { NgxSpinnerService } from 'ngx-spinner';
+
+@Component({
+  selector: 'app-internal-contact-us',
+  templateUrl: './internal-contact-us.component.html',
+  styleUrls: ['./internal-contact-us.component.css']
+})
+export class InternalContactUsComponent implements OnInit {
+
+  constructor(private route: ActivatedRoute, 
+    private authSer: AuthServiceService,
+    private spinner: NgxSpinnerService,
+    private toastr: ToastrService,
+    private http: HttpClient) { }
+
+  contactId:number;
+  checkSaveButton:boolean = false;
+
+  @ViewChild('f') contactForm: NgForm;
+
+
+  ngOnInit() {
+    
+    this.authSer.homeActivate = false;
+    this.route.params.subscribe(
+      (params: Params) => {
+        this.contactId = params['contactId'];
+      }
+    );
+
+    this.spinner.hide();
+    
+
+  }
+
+  onSubmitted() {
+    this.checkSaveButton = true;
+    console.log(this.contactForm);
+    this.http.post(this.authSer.pathApi + '/add_contact_message', this.contactForm.value).subscribe(
+      (responce) => {
+        console.log(responce);
+        this.toastr.success('تم الارسال بنجاح');
+        this.contactForm.reset();
+      },
+      (error) => {
+        console.log(error);
+        this.checkSaveButton = false;
+        this.toastr.error('خطأ في السيرفر ، سيتم المعالجه لاخقاً');
+      }
+    )
+  }
+
+}

+ 24 - 20
src/app/Internal-Page/internal-page-content/internal-page-content.component.html

@@ -11,7 +11,7 @@
                         <div class="col-12 col-md-4 order-2 order-sm-2 order-md-1">
                             <div class="row">
                                 <div class="col-lg-6 col-md-12 col-sm-4 col-xs-12 editRowPadding-w" *ngFor="let service of externalServices">
-                                    <a class="hyperLink" href="{{service.link}}">
+                                    <a class="hyperLink" (click)="onGetService(service)">
                                         <div class="serviceItem-w">
                                             <img src="{{authSer.pathImg + service.photo}}" title="TITLE NEED SHOW ON HOVER"/>
                                             <p>{{service.name}}</p>
@@ -60,6 +60,7 @@
                     </div>
                 </div>
             </div>
+
             <div class="contentsData-w">
                 <div class="container containerPaddingEdit-w">
                     <div class="row">
@@ -197,8 +198,10 @@
                                 <div class="menuTabContent-w">
                                     <h2 class="text-center" *ngIf="checkShowData">لايوجد بيانات الأن لعرضها</h2>
                                     <ol>
-                                        <li *ngFor="let data of tabsData">{{data.name}}
-                                             <button class="btn btn-default" *ngIf="data.file" type="button" style="position: absolute; background:transparent; border:none; left:45px"> <a href="{{authSer.pathImg + data.file}}" target="_blank"><i class="fas fa-download"></i></a></button>
+                                        <li *ngFor="let data of tabsData">
+                                            {{data.name}}
+                                            <span style="margin: 0 50px;">( {{data.created_at}} )</span>
+                                            <button class="btn btn-default" *ngIf="data.file" type="button" style="position: absolute; background:transparent; border:none; left:45px"> <a href="{{authSer.pathImg + data.file}}" target="_blank"><i class="fas fa-download"></i></a></button>
                                         </li>
                                     </ol>
                                     <button class="btn btn-primary" (click)="onPageCir()" style="margin:0 auto; display:block; background-color:#bda380; width:150px;border:none;">المزيد</button>
@@ -214,17 +217,17 @@
                                 <div id="accordion">
                                     <div class="card" *ngFor="let achiev of achievements; let i = index">
                                         <div class="card-header" [attr.id]="'heading'+(i+1)">
-                                        <h5 class="mb-0">
-                                            <button class="btn btn-link" data-toggle="collapse" [attr.data-target]="'#collapse'+(i+1)" [attr.aria-expanded]="(i+1)==1 ? true :false" [attr.aria-controls]="'collapse'+(i+1)">
-                                            <h4 class="panel-title">{{achiev.title}}</h4>
-                                            </button>
-                                        </h5>
+                                            <h5 class="mb-0">
+                                                <button class="btn btn-link" data-toggle="collapse" [attr.data-target]="'#collapse'+(i+1)" [attr.aria-expanded]="(i+1)==1 ? true :false" [attr.aria-controls]="'collapse'+(i+1)">
+                                                <h4 class="panel-title">{{achiev.title}}</h4>
+                                                </button>
+                                            </h5>
                                         </div>
                                     
                                         <div [attr.id]="'collapse'+(i+1)" class="collapse" [ngClass]="{'show' : (i+1) == 1}" [attr.aria-labelledby]="'heading' + (i+1)" data-parent="#accordion">
-                                        <div class="card-body testBody-w">
-                                            <p [innerHTML]="achiev.description"></p>
-                                        </div>
+                                            <div class="card-body testBody-w">
+                                                <p [innerHTML]="achiev.description"></p>
+                                            </div>
                                         </div>
                                     </div>
                                 </div>
@@ -248,20 +251,20 @@
 
             <div class="col-12">
                 <div class="advertisiment">
-                        <img src="{{ authSer.pathImg + advertisiment.photo }}" />
+                    <img src="{{ authSer.pathImg + advertisiment.photo }}" />
                 </div>
             </div>
             
             <div class="col-12 col-md-4 order-2 order-sm-2 order-md-1">
                 <div class="row">
-                <div class="col-6 col-md-6 editRowPadding-w" *ngFor="let service of externalServices">
-                    <a class="hyperLink" href="{{service.link}}">
-                        <div class="serviceItem-w">
-                            <img src="{{authSer.pathImg + service.photo}}" />
-                            <p>{{service.name_en}}</p>
-                        </div>
-                    </a>
-                </div>
+                    <div class="col-6 col-md-6 editRowPadding-w" *ngFor="let service of externalServices">
+                        <a class="hyperLink" href="{{service.link}}">
+                            <div class="serviceItem-w">
+                                <img src="{{authSer.pathImg + service.photo}}" />
+                                <p>{{service.name_en}}</p>
+                            </div>
+                        </a>
+                    </div>
                 </div>
             </div>
 
@@ -434,6 +437,7 @@
                         <ol [className]="authSer.arabicTemplate ? '' : 'achievementsLang-w' ">
                             <li *ngFor="let data of tabsData">
                                 {{data.name_en}}
+                                <span style="margin: 0 50px;">( {{data.created_at}} )</span>
                                 <button class="btn btn-default" *ngIf="data.file" type="button" style="position: absolute; background:transparent; border:none; right:45px"> <a href="{{authSer.pathImg + data.file}}" target="_blank"><i class="fas fa-download"></i></a></button>
                             </li>
                         </ol>

+ 16 - 0
src/app/Internal-Page/internal-page-content/internal-page-content.component.ts

@@ -48,6 +48,7 @@ export class InternalPageContentComponent implements OnInit {
     internalServices = [];
     tabsData = [];
     achievements = [];
+    
     tabCongaData= {
       employee_name: '',
       employee_name_en: '',
@@ -55,6 +56,7 @@ export class InternalPageContentComponent implements OnInit {
       name: '',
       name_en: '',
     };
+
     tabSadData = {
       employee_name: '',
       employee_name_en: '',
@@ -150,6 +152,11 @@ export class InternalPageContentComponent implements OnInit {
 
         this.tabsData = responce['data'].tabs;
         
+        this.tabsData.map( (tab) => {
+          tab.created_at = tab.created_at.split(' ')[0]; 
+        });
+
+
         if(this.tabsData.length > 0) {
             this.checkShowData = false;
         } else {
@@ -280,6 +287,15 @@ export class InternalPageContentComponent implements OnInit {
     this.router.navigate(['InternalPage/newpages/']);
   }
 
+  onGetService(serviceData) {
+    console.log(serviceData);
+    if(serviceData.type == 'internal') {
+      this.router.navigate(['InternalPage/externalServiceDetails/' + serviceData.id]);
+    } else if(serviceData.type == 'external') {
+      window.location.href = serviceData.link;
+    }
+  }
+
 
 
 

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

@@ -1,3 +1,5 @@
+import { InternalPolicyComponent } from './internal-policy/internal-policy.component';
+import { InternalContactUsComponent } from './internal-contact-us/internal-contact-us.component';
 import { EventsDateComponent } from './events/events-date.component';
 import { NewsPagesComponent } from './news-pages/news-pages.component';
 import { NewsPageComponent } from './news-page/news-page.component';
@@ -23,6 +25,7 @@ import { CircularsPageComponent } from './circulars-page/circulars-page.componen
 
 import { NgxSpinnerModule } from 'ngx-spinner';
 import { SharedModule } from '../shared/shared.module';
+import { ExternalServiceDetailsComponent } from './external-service-details/external-service-details.component';
 
 //import { CeiboShare } from 'ng2-social-share';
 
@@ -36,6 +39,9 @@ import { SharedModule } from '../shared/shared.module';
         CircularsPageComponent,
         EventsDateComponent,
         NewsPagesComponent,
+        ExternalServiceDetailsComponent,
+        InternalContactUsComponent,
+        InternalPolicyComponent,
         //CeiboShare,
     ],
     imports: [

+ 0 - 0
src/app/Internal-Page/internal-policy/internal-policy.component.css


+ 29 - 0
src/app/Internal-Page/internal-policy/internal-policy.component.html

@@ -0,0 +1,29 @@
+
+<div class="hospitalContent-w">
+    <div class="container">
+      <div class="row">
+          <div class="containerContent-w">
+  
+              <ng-template [ngIf]="authSer.arabicTemplate" [ngIfElse]="englishTemplate">
+                <div class="row">
+                  <div class="col-12">
+                    <h2 class="text-center">{{data.name}}</h2>
+                    <p>{{data.description}}</p>
+                  </div>
+                </div>
+              </ng-template>
+  
+              <ng-template #englishTemplate>
+                <div class="row" style="direction:ltr">
+                  <div class="col-12">
+                    <h2 class="text-center">{{data.name_en}}</h2>
+                    <p>{{data.description_en}}</p>
+                  </div>
+                </div>
+              </ng-template>
+  
+          </div>
+      </div>
+    </div>
+  </div>
+  

+ 44 - 0
src/app/Internal-Page/internal-policy/internal-policy.component.ts

@@ -0,0 +1,44 @@
+import { NgxSpinnerService } from 'ngx-spinner';
+import { AuthServiceService } from './../../shared/auth-service.service';
+import { ActivatedRoute, Params } from '@angular/router';
+import { Component, OnInit } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+
+@Component({
+  selector: 'app-internal-policy',
+  templateUrl: './internal-policy.component.html',
+  styleUrls: ['./internal-policy.component.css']
+})
+export class InternalPolicyComponent implements OnInit {
+
+  constructor(private route: ActivatedRoute, 
+    private http: HttpClient,
+    private spinner: NgxSpinnerService,
+    private authSer:AuthServiceService) { }
+
+  policyId: number;
+  data = [];
+
+  ngOnInit() {
+
+    this.spinner.show();
+    this.authSer.homeActivate = false;
+    this.route.params.subscribe(
+      (params: Params) => {
+        this.policyId = params['policyId'];
+        this.data = [];
+        this.http.get(this.authSer.pathApi + '/get_footer/' + this.policyId).subscribe(
+          (responce) => {
+            this.data = responce['footer'];
+            console.log(this.data);
+            this.spinner.hide();
+          },
+          (error) => {
+            console.log(error);
+          }
+        );
+      }
+    );
+  }
+
+}

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

@@ -10,6 +10,9 @@ import { InternalPageComponent } from './internal-page/internal-page.component';
 
 import { HospitalContentComponent } from './hospital-content/hospital-content.component';
 import { LoginComponent } from './../login/login.component';
+import { ExternalServiceDetailsComponent } from './external-service-details/external-service-details.component';
+import { InternalContactUsComponent } from './internal-contact-us/internal-contact-us.component';
+import { InternalPolicyComponent } from './internal-policy/internal-policy.component';
 
 
 const internalPageRoutes: Routes = [
@@ -18,6 +21,9 @@ const internalPageRoutes: Routes = [
         {path:'circulars', component: CircularsPageComponent},
         {path: 'events', component: EventsDateComponent},
         {path: 'newpages', component: NewsPagesComponent},
+        {path: 'contactUs/:contactId', component: InternalContactUsComponent},
+        {path: 'policy/:policyId', component: InternalPolicyComponent},
+        {path: 'externalServiceDetails/:serviceId', component: ExternalServiceDetailsComponent},
         {path: 'news/:reportId', component: NewsPageComponent},
         {path: ':typePage', component: HospitalContentComponent},
     ]},

+ 0 - 20
src/app/app.module.ts

@@ -15,11 +15,8 @@ import { ResponceInterceptService } from './shared/responce-intercept.service';
 import { TokenInterceptorService } from './shared/token-interceptor.service';
 import { BrowserModule } from '@angular/platform-browser';
 
-
 import { LOCALE_ID, NgModule } from '@angular/core';
 
-
-
 import { QuillModule } from 'ngx-quill';
 
 import { MomentModule } from 'ngx-moment';
@@ -52,24 +49,10 @@ import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
 import { BootstrapModalModule } from 'ngx-modialog/plugins/bootstrap';
 import { JwSocialButtonsModule } from 'jw-angular-social-buttons';
 
-//import { CeiboShare } from 'ng2-social-share';
-
-
-//import { registerLocaleData } from '@angular/common';
-//import localeAr from '@angular/common/locales/ar-SA';
-//import localeDE from '@angular/common/locales/de';
-
 import { Ng2CarouselamosModule } from 'ng2-carouselamos';
 import { NumberDerictiveDirective } from './number-derictive.directive';
-//import { EnglishCharactersDirective } from './shared/english-characters.directive';
 import { OnlyNumberDirective } from './shared/only-number.directive';
 import {SharedModule} from './shared/shared.module';
-//registerLocaleData(localeAr, 'ar');
-
-
-
-//import { CeiboShare } from 'ng2-social-share';
-
 
 
 @NgModule({
@@ -81,10 +64,7 @@ import {SharedModule} from './shared/shared.module';
     RegesterComponent,
     ServicesComponent,
     PageNotFoundComponent,
-    //CeiboShare,
     NumberDerictiveDirective,
-    //EnglishCharactersDirective,
-    //OnlyNumberDirective,
   ],
   imports: [
     BrowserModule,

+ 5 - 1
src/app/dashboard/add-join-us/add-join-us.component.ts

@@ -198,6 +198,8 @@ export class AddJoinUsComponent implements OnInit {
             console.log(error);
             if(error.error['status'] == 'invalid date_of_employment_hij') {
               this.toastr.error('تاريخ التوظيف الهجري لا يجب ان يكون في الحاضر او اليوم');
+            } else if(error.error['status'] == 'active status for only 4 records') {
+              this.toastr.warning('لديك أربعه أشخاص في الحاله فعال بالفعل ، قم بعدم تفعيل أو مسح أحدهم ');
             } else {
               this.toastr.error('خطأ في السيرفير');
             }
@@ -221,7 +223,9 @@ export class AddJoinUsComponent implements OnInit {
             console.log(error.error['status']);
             if(error.error['status'] == 'invalid date_of_employment_hij') {
               this.toastr.error('تاريخ التوظيف الهجري لا يجب ان يكون في الحاضر او اليوم');
-            } else {
+            }else if(error.error['status'] == 'active status for only 4 records') {
+              this.toastr.warning('لديك أربعه أشخاص في الحاله فعال بالفعل ، قم بعدم تفعيل أو مسح أحدهم ');
+            }  else {
               this.toastr.error('خطأ في السيرفير');
             }
           }

+ 1 - 1
src/app/dashboard/advertisiment/add-advertisiment/add-adver/add-adver.component.ts

@@ -70,7 +70,7 @@ export class AddAdverComponent implements OnInit {
           );
 
         } else {
-          this.toastr.warning('Catch Error Go To Home !');
+          console.log('Catch Error Go To Home !');
         }
       }
     ); 

+ 1 - 1
src/app/dashboard/bar-events/add-bar-event/add-bar-event.component.ts

@@ -77,7 +77,7 @@ export class AddBarEventComponent implements OnInit {
           );
 
         } else {
-          this.toastr.warning('Catch Error Go To Home !');
+          console.log('Catch Error Go To Home !');
         }
       }
     );

+ 1 - 1
src/app/dashboard/contact-us/add-contact-us/add-contact-us.component.ts

@@ -57,7 +57,7 @@ export class AddContactUsComponent implements OnInit {
           );
 
         } else {
-          this.toastr.warning('Catch Error Go To Home !');
+          console.log('Catch Error Go To Home !');
         }
       }
     );

+ 3 - 1
src/app/dashboard/dashboard-content.ts

@@ -12,7 +12,9 @@ export class DashboardContent implements OnInit {
   constructor(private authSer: AuthServiceService) { }
   myInnerHeight = window.innerHeight;
   ngOnInit() {
-    this.authSer.checkExternalFooter = false;
+    
   }
 
+
+
 }

+ 1 - 1
src/app/dashboard/event-calendars/add-event-calendar/add-event-calendar.component.ts

@@ -64,7 +64,7 @@ export class AddEventCalendarComponent implements OnInit {
             );
 
           } else {
-            this.toastr.warning('Catch Error Go To Home !');
+            console.log('sdsd');
           }
         }
       );

+ 19 - 19
src/app/dashboard/event-calendars/event-calendars-list/event-calendars-list.component.ts

@@ -143,25 +143,25 @@ export class EventCalendarsListComponent implements OnInit {
 
 //change page
 onPageChange(pagenationNumber) {
-this.spinner.show();
-this.currentPage = pagenationNumber;
-this.eventCalendarsList = [];
-//console.log(pagenationNumber);
-//console.log(this.pageId);
-this.dashboardSer.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
-(responce) => {
-  console.log(responce);
-  this.eventCalendarsList = responce['event_calendars'];
-  this.count = responce['count'];
-  this.perPagePagenation = responce['per_page'];
-  console.log(this.eventCalendarsList);
-  this.spinner.hide();
-},
-(error) => {
-  console.log(error);
-  this.spinner.hide();
-}
-);
+  this.spinner.show();
+  this.currentPage = pagenationNumber;
+  this.eventCalendarsList = [];
+  //console.log(pagenationNumber);
+  //console.log(this.pageId);
+  this.dashboardSer.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
+  (responce) => {
+      console.log(responce);
+      this.eventCalendarsList = responce['event_calendars'];
+      this.count = responce['count'];
+      this.perPagePagenation = responce['per_page'];
+      console.log(this.eventCalendarsList);
+      this.spinner.hide();
+    },  
+    (error) => {
+      console.log(error);
+      this.spinner.hide();
+    }
+  );
 };
 
 

+ 0 - 1
src/app/dashboard/events/add-event/add-event.component.html

@@ -52,7 +52,6 @@
                     <option value="4">4</option>
                     <option value="5">5</option>
                     <option value="6">6</option>
-                    <option value="10000">المزيد</option>
                   </select>
                   <!-- <span *ngIf="!name.valid && name.touched"></span>  -->
                 </div>

+ 6 - 2
src/app/dashboard/events/add-event/add-event.component.ts

@@ -135,7 +135,9 @@ export class AddEventComponent implements OnInit {
           console.log(error.error['status']);
           if(error.error.status == 'invalid event_time') {
             this.toastr.warning('يجب ان يكون الحدث في وقت سابق !');
-          } else {
+          }else if(error.error['status'] == 'active status for only 4 records') {
+            this.toastr.warning('لديك أربعه أحداث في الحاله فعال بالفعل ، قم بعدم تفعيل أو مسح أحدهم ');
+          }else {
             this.toastr.error('حدث خطأ !');
           }
           console.log(error);
@@ -154,7 +156,9 @@ export class AddEventComponent implements OnInit {
           console.log(error.error['status']);
           if(error.error.status == 'invalid event_time') {
             this.toastr.warning('يجب ان يكون الحدث في وقت سابق !');
-          } else {
+          } else if(error.error['status'] == 'active status for only 4 records') {
+            this.toastr.warning('لديك أربعه أحداث في الحاله فعال بالفعل ، قم بعدم تفعيل أو مسح أحدهم ');
+          }else {
             this.toastr.error('حدث خطأ !');
           }
           console.log(error);

+ 2 - 0
src/app/dashboard/events/events.component.html

@@ -56,6 +56,7 @@
           <th>إسم المناسبه</th>
           <th>الترتيب</th>
           <th>النوع</th>
+          <th>الحاله</th>
           <th *ngIf="authSer.showEditBtn">تعديل</th>
         </tr>
       </thead>
@@ -72,6 +73,7 @@
             {{event.ranking == '10000' ? 'المزيد' : event.ranking}}
           </td>
           <td>{{event.type == '0' ? 'التعازي' : event.type == '1' ? 'التهاني' : 'No'}}</td>
+          <td>{{event.status == 1 ? 'فعال' : 'غير فعال'}}</td>
           <td *ngIf="authSer.showEditBtn"><button type="button" class="btn btn-outline-secondary" (click)="onEdit(event.id)"><i class="fas fa-edit"></i></button></td>
         </tr>
       </tbody>

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

@@ -77,7 +77,7 @@ export class AddExternalAchievementComponent implements OnInit {
             );
 
           } else {
-            this.toastr.warning('Catch Error Go To Home !');
+            console.log('Catch Error Go To Home !');
           }
         }
       );

+ 36 - 9
src/app/dashboard/external-services/add-external/add-external.component.html

@@ -8,7 +8,6 @@
             <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()"> الخدمات الخارجيه </li>
             <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typeLink}} </li>
           </ul>
-          <hr class="hr">
         </div>
     </div>
 
@@ -17,6 +16,7 @@
             <div class="col-12">
               <form (ngSubmit)="onSubmitted()" #f="ngForm">
                 <div class="row">
+
                   <div class="col-12 col-sm-12 col-md-12 col-lg-12" style="margin-bottom:30px">
                     <div class="form-group text-center imgContainer">
                         <img [src]="urlImg" class="imgProfile" height="200">
@@ -36,13 +36,7 @@
                       <label for="name_en" style="float: right; margin-right: 5px">الأسم باللغه الأنجليزيه  <span class="spanReqired-w">*</span></label>
                         <input type="text" class="form-control" id="name_en" placeholder="الاسم باللغه الانجليزيه" name="name_en" ngModel [ngModel]="external.name_en" #name="ngModel" required/>
                     </div>
-                  </div>
-                  <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" id="link" name="link" placeholder="الروابط" ngModel [ngModel]="external.link" #link="ngModel" required/>
-                    </div>
-                  </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>
@@ -53,7 +47,6 @@
                         <option value="4">4</option>
                         <option value="5">5</option>
                         <option value="6">6</option>
-                        <option value="10000">المزيد</option>
                       </select>
                     </div>
                   </div>
@@ -66,10 +59,44 @@
                     </select>
                   </div>
 
+                  <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>
+                      <select class="form-control" name="type" id="pagetype" [ngModel]="external.type" (input)="changeType($event)" required>
+                        <option value="internal">داخلي</option>
+                        <option value="external">خارجي</option>
+                      </select>
+                    </div>
+                  </div>
+
+                  <div class="col-12 col-sm-12 col-md-4 col-lg-4" *ngIf="external.type == 'external'">
+                    <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" id="link" name="link" placeholder="الروابط" ngModel [ngModel]="external.link" #link="ngModel" required/>
+                    </div>
+                  </div>
+
+                  <div class="col-12 col-sm-12 col-md-4 col-lg-6" *ngIf="external.type == 'internal'">
+                    <div class="form-group">
+                      <label for="description" style="float: right; margin-right: 5px">الوصف باللغه العربيه<span class="spanReqired-w">*</span></label>
+                      <quill-editor id="description" name="description" [ngModel]="external.description" required>
+                      </quill-editor>
+                    </div>
+                  </div>
+                  <div class="col-12 col-sm-12 col-md-4 col-lg-6" *ngIf="external.type == 'internal'">
+                    <div class="form-group">
+                      <label for="description_en" style="float: right; margin-right: 5px"> الوصف باللغه الانجليزيه<span class="spanReqired-w">*</span></label>
+                      <quill-editor id="description" name="description_en" [ngModel]="external.description_en" required>
+                      </quill-editor>
+                    </div>
+                  </div>
+
+
                   <div class="col-6">
                     <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>
+                  
                 </div>
               </form>
             </div>

+ 42 - 6
src/app/dashboard/external-services/add-external/add-external.component.ts

@@ -34,6 +34,9 @@ export class AddExternalComponent implements OnInit {
     link: '',
     status: '',
     ranking: '',
+    type: '',
+    description: '',
+    description_en: '',
   };
 
   constructor(private toastr: ToastrService, 
@@ -77,6 +80,9 @@ export class AddExternalComponent implements OnInit {
               this.external.link = responce['external_service'].link;
               this.external.status = responce['external_service'].status;
               this.external.ranking = responce['external_service'].ranking;
+              this.external.type = responce['external_service'].type;
+              this.external.description = responce['external_service'].description;
+              this.external.description_en = responce['external_service'].description_en;
               if(responce['external_service'].photo) {
                 this.checkValidImg = false;
                 this.urlImg = this.authService.pathImg + responce['external_service'].photo;
@@ -91,7 +97,8 @@ export class AddExternalComponent implements OnInit {
           this.typeLink = 'أنشاء جديد';
         }
       }
-    )
+    );
+
   };
 
 
@@ -115,12 +122,25 @@ export class AddExternalComponent implements OnInit {
   }
  }
 
+ changeType(event) {
+   console.log(event.target.value);
+   this.external.type = event.target.value;
+   if(event.target.value == 'internal') {
+     this.external.link = '';
+   } else if(event.target.value == 'external') {
+     this.external.description = '';
+     this.external.description_en = '';
+   } else {
+     console.log('no choice');
+   }
+ }
+
  //on submitted
  onSubmitted() {
 
   this.checkSaveClick = true;
   const formData = this.externalFormData.value;
-
+  console.log(formData);
   if(this.checkChangeImage){
     formData['photo'] = this.imageBase64;
     formData['photo_type'] = this.photoType[1];
@@ -150,7 +170,11 @@ export class AddExternalComponent implements OnInit {
           (error) => {
             console.log(error);
             this.checkSaveClick = false;
-            this.toastr.error('خطأ في التعديل !');
+            if(error.error['status'] == 'active status for only 6 records') {
+              this.toastr.warning('لقد تخطيت الحد الأقصي للخدمات ، قم بعدم تفعيل أو مسح أحدهم');
+            } else {
+              this.toastr.error('خطأ في السيرفر ، ستتم المعالجه لاحقاً !');
+            }
           }
         );
       } else if(this.serviceId == 2) {
@@ -164,7 +188,11 @@ export class AddExternalComponent implements OnInit {
           (error) => {
             console.log(error);
             this.checkSaveClick = false;
-            this.toastr.error('خطأ في التعديل !');
+            if(error.error['status'] == 'active status for only 6 records') {
+              this.toastr.warning('لقد تخطيت الحد الأقصي للخدمات ، قم بعدم تفعيل أو مسح أحدهم');
+            } else {
+              this.toastr.error('خطأ في السيرفر ، ستتم المعالجه لاحقاً !');
+            }
           }
         );
       }
@@ -187,8 +215,12 @@ export class AddExternalComponent implements OnInit {
           },
           (error) => {
             console.log(error);
-            this.toastr.error('خطأ في الحفظ !');
             this.checkSaveClick = false;
+            if(error.error['status'] == 'active status for only 6 records') {
+              this.toastr.warning('لقد تخطيت الحد الأقصي للخدمات ، قم بعدم تفعيل أو مسح أحدهم');
+            } else {
+              this.toastr.error('خطأ في السيرفر ، ستتم المعالجه لاحقاً !');
+            }
           }
         );
       } else if(this.serviceId == 2){
@@ -201,8 +233,12 @@ export class AddExternalComponent implements OnInit {
           },
           (error) => {
             console.log(error);
-            this.toastr.error('خطأ في الحفظ !');
             this.checkSaveClick = false;
+            if(error.error['status'] == 'active status for only 6 records') {
+              this.toastr.warning('لقد تخطيت الحد الأقصي للخدمات ، قم بعدم تفعيل أو مسح أحدهم');
+            } else {
+              this.toastr.error('خطأ في السيرفر ، ستتم المعالجه لاحقاً !');
+            }
           }
         );
       }

+ 37 - 11
src/app/dashboard/footer/add-footer/add-footer.component.html

@@ -37,17 +37,26 @@
                   <input type="text" class="form-control" id="name_en" placeholder="الأسم باللغه الأنجليزيه" name="name_en" ngModel [ngModel]="footer.name_en" #name="ngModel" required/>
                 </div>
               </div>
-              <div class="col-12 col-sm-12 col-md-4">
+
+              <div class="col-12 col-sm-12 col-md-4 col-lg-4">
+                <label for="status" style="float: right; margin-right: 5px">الحاله  <span class="spanReqired-w">*</span></label>
+                <select class="form-control" name="status" [ngModel]="footer.status" id="status" required>
+                  <option value="1">فعال</option>
+                  <option value="0">غير فعال</option>
+                </select>
+              </div>
+
+              <div class="col-12 col-sm-12 col-md-4" *ngIf="showEmailField">
                 <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" id="link" name="link" ngModel [ngModel]="footer.link" #link="ngModel" required/>
+                  <label for="email" style="float: right; margin-right: 5px">الإيميل  <span class="spanReqired-w">*</span></label>
+                  <input type="email" class="form-control" id="email" name="email" ngModel [ngModel]="footer.email" #link="ngModel" required/>
                 </div>
               </div>
 
               <div class="col-12 col-sm-12 col-md-4">
                 <div class="form-group">
                   <label for="type" style="float: right; margin-right: 5px">النوع</label>
-                  <select id="type" name="type" class="form-control" [ngModel]="footer.type" required>
+                  <select id="type" name="type" class="form-control" [ngModel]="footer.type" (input)="onChangeType($event)" required>
                     <option value="0">قسم الروابط</option>
                     <option value="1">قسم التواصل</option>
                     <option value="2">قسم الجوائز</option>
@@ -55,19 +64,36 @@
                 </div>
               </div>
 
+              <div class="col-12 col-sm-12 col-md-4" *ngIf="showLinkField">
+                <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" id="link" name="link" ngModel [ngModel]="footer.link" #link="ngModel" required/>
+                </div>
+              </div>
 
-              <div class="col-12 col-sm-12 col-md-4 col-lg-4">
-                <label for="status" style="float: right; margin-right: 5px">الحاله  <span class="spanReqired-w">*</span></label>
-                <select class="form-control" name="status" [ngModel]="footer.status" id="status" required>
-                  <option value="1">فعال</option>
-                  <option value="0">غير فعال</option>
-                </select>
+              <div class="col-12 col-sm-12 col-md-12" style="margin:20px 0" *ngIf="showDescriptionField">
+                <div class="form-group">
+                    <label for="description" style="float: right;margin-right: 5px"> التفاصيل باللغه العربيه <span class="spanReqired-w">*</span></label>
+                    <!-- <textarea cols="3" class="form-control" id="description" name="description" [ngModel]="new.description" required></textarea> -->
+                  <quill-editor id="description" name="description" [ngModel]="footer.description" required>
+                  </quill-editor>
+                </div>
+              </div>
+  
+              <div class="col-12 col-sm-12 col-md-12" style="margin:20px 0" *ngIf="showDescriptionField">
+                <div class="form-group">
+                    <label for="description_en" style="float: right;margin-right: 5px">  التفاصيل باللغه الإنجليزيه <span class="spanReqired-w">*</span></label>
+                    <!-- <textarea cols="3" class="form-control" id="description" name="description" [ngModel]="new.description" required></textarea> -->
+                  <quill-editor id="description_en" name="description_en" [ngModel]="footer.description_en" required>
+                  </quill-editor>
+                </div>
               </div>
 
-              <div class="col-6">
+              <div class="col-12">
                   <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid">حفظ</button>
                   <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>
               </div>
+              
             </div>
 
 

+ 74 - 2
src/app/dashboard/footer/add-footer/add-footer.component.ts

@@ -26,7 +26,14 @@ export class AddFooterComponent implements OnInit {
   typeLink: string = '';
   externalId: number;
   serviceId: number;
-
+  //to show emeil || description || link
+  showEmailField: boolean = false;
+  showLinkField: boolean = false;
+  showDescriptionField: boolean = false;
+  checkContactUs:boolean = false;
+  checkOtherField: boolean = false;
+  checkNotContactUs:boolean = false;
+  contactUsPage: boolean = false;
   serviceName: string = '';
 
   footer = {
@@ -34,7 +41,10 @@ export class AddFooterComponent implements OnInit {
     name_en: '',
     link: '',
     status: '',
-    type: ''
+    type: '',
+    email: '',
+    description: '',
+    description_en: '',
   };
 
   constructor(private toastr: ToastrService, 
@@ -82,9 +92,29 @@ export class AddFooterComponent implements OnInit {
               console.log(responce['footer']);
               this.footer.name = responce['footer'].name;
               this.footer.name_en = responce['footer'].name_en;
+              if(this.footer.name == 'تواصل معنا' || this.footer.name_en == 'contact us') {
+                this.showEmailField = true;
+                this.showDescriptionField = false;
+                this.showLinkField = false;
+                this.footer.description = '';
+                this.footer.description_en = '';
+                this.footer.link = '';
+                this.contactUsPage = true;
+              } else {
+                this.checkNotContactUs = true;
+                this.showDescriptionField = true;
+                this.showEmailField = false;
+                this.showLinkField = false;
+                this.footer.email = '';
+                this.footer.link = '';
+                
+              }
               this.footer.link = responce['footer'].link;
               this.footer.status = responce['footer'].status;
               this.footer.type = responce['footer'].type;
+              this.footer.email = responce['footer'].email;
+              this.footer.description = responce['footer'].description;
+              this.footer.description_en = responce['footer'].description_en;
               if(responce['footer'].photo) {
                 this.checkValidImg = false;
                 this.urlImg = this.authSer.pathImg + responce['footer'].photo;
@@ -125,9 +155,51 @@ export class AddFooterComponent implements OnInit {
   }
  }
 
+ onChangeType(event) {
+   console.log(event.target.value);
+   this.footer.type = event.target.value;
+   if(event.target.value == 0 && this.showEmailField == true) {
+    this.showDescriptionField = true;
+    this.showLinkField = false;
+    this.footer.link = '';
+    this.footer.description = '';
+    this.footer.description_en = '';
+   } else if(event.target.value == 0 && this.checkNotContactUs == true) {
+      this.showDescriptionField = true;
+      this.showLinkField = false;
+      this.showEmailField = false;
+      this.footer.link = '';
+      this.footer.email = '';
+   } else if(event.target.value == 1 || event.target.value == 2 || this.showDescriptionField) {
+    this.showLinkField = true;
+    this.showEmailField = false;
+    this.showDescriptionField = false;
+    this.footer.description = '';
+    this.footer.description_en = '';
+    this.footer.email = '';
+   } else {
+     if(this.contactUsPage) {
+      this.showDescriptionField = false;
+      this.showEmailField = true;
+      this.showLinkField = false;
+      this.footer.link = '';
+      this.footer.description = '';
+      this.footer.description_en = '';
+     } else {
+      this.showDescriptionField = true;
+      this.showEmailField = false;
+      this.showLinkField = false;
+      this.footer.email = '';
+      this.footer.link = '';
+     }
+   }
+ }
+
  //on submitted
  onSubmitted() {
   const formData = this.footerFormData.value;
+  console.log(formData);
+ 
   if(this.checkChangeImage){
     formData['photo'] = this.imageBase64;
     formData['photo_type'] = this.photoType[1];

+ 16 - 9
src/app/dashboard/header/header.component.ts

@@ -29,15 +29,22 @@ export class HeaderComponent implements OnInit {
     this.authSer.showHeaderDashBoard = false;
 
 
-    this.authSer.onGetFooterData('internal').subscribe(
-      (responce) => {
-        this.authSer.footerData = responce['footer'];
-        console.log(this.authSer.footerData);
-      },
-      (error) => {
-        console.log(error);
-      }
-    );
+    this.authSer.checkExternalFooter = false;
+
+    if(this.authSer.checkExternalFooter) {
+      alert('external');
+    } else {
+      this.authSer.onGetFooterData('internal').subscribe(
+        (responce) => {
+          this.authSer.footerData = responce['footer'];
+          console.log(this.authSer.footerData);
+        },
+        (error) => {
+          console.log(error);
+        }
+      );
+    }
+    
     
     // const m = moment().format('iYYYY/iM/iD');
     // console.log(m);

+ 1 - 1
src/app/dashboard/main-footer/footer.component.html

@@ -15,7 +15,7 @@
           <div class="linksSection-w text-center d-none d-sm-none d-md-block">
             <ul class="list-unstyled">
                 <li *ngFor="let section of authSer.footerData['links_section']">
-                  <a href="{{section.link}}" target="_blank">{{section.name}}</a>
+                  <a (click)="goPolicy(section)" target="_blank" style="cursor: pointer;">{{section.name}}</a>
                 </li>
             </ul>
           </div>

+ 20 - 2
src/app/dashboard/main-footer/footer.component.ts

@@ -1,5 +1,7 @@
+import { NgxSpinnerService } from 'ngx-spinner';
 import { AuthServiceService } from './../../shared/auth-service.service';
 import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
 
 @Component({
   selector: 'app-footer',
@@ -12,12 +14,14 @@ export class FooterComponent implements OnInit {
   awardsData = [];
   socialLinks = [];
 
-  constructor(private authSer: AuthServiceService) { }
+  constructor(private authSer: AuthServiceService, 
+    private spinner: NgxSpinnerService,
+    private router: Router) { }
 
   ngOnInit() {
     // this.authSer.onGetFooterData().subscribe(
     //   (responce) => {
-    //     console.log(responce);
+    //     console.log(responce);goPolicy
     //     this.sectionLinks = responce['footer']['links_section'];//
     //     this.awardsData = responce['footer']['awards_section'];//
     //     this.socialLinks = responce['footer']['socials_section'];
@@ -29,4 +33,18 @@ export class FooterComponent implements OnInit {
     // )
   }
 
+  goPolicy(sectionData) {
+    this.spinner.show();
+    console.log(sectionData);
+    if(sectionData.id == 20) {
+      this.router.navigate(['ExternalPage/contactUs/' + sectionData.id]);
+    } else if(sectionData.flag_page == 1) {
+      this.router.navigate(['ExternalPage/externalPolicy/' + sectionData.id]);
+    } else if(sectionData.id == 9) {
+      this.router.navigate(['InternalPage/contactUs/' + sectionData.id]);
+    } else if(sectionData.flag_page == 0) {
+      this.router.navigate(['InternalPage/policy/' + sectionData.id]);
+    }
+  }
+
 }

+ 1 - 1
src/app/dashboard/statistics/add-statistic/add-statistic.component.ts

@@ -78,7 +78,7 @@ export class AddStatisticComponent implements OnInit {
             );
 
           } else {
-            this.toastr.warning('Catch Error Go To Home !');
+            console.log('Catch Error Go To Home !');
           }
         }
       );

+ 1 - 1
src/app/dashboard/visiting-times/add-visiting-time/add-visiting-time.component.ts

@@ -61,7 +61,7 @@ export class AddVisitingTimeComponent implements OnInit {
             );
 
           } else {
-            this.toastr.warning('Catch Error Go To Home !');
+            console.log('Catch Error Go To Home !');
           }
         }
       );

+ 1 - 1
src/app/servicesItems/services.component.ts

@@ -52,7 +52,7 @@ export class ServicesComponent implements OnInit {
     this.userservice.getServicesData(this.idUser).subscribe(
     (responce) => {
       this.services = responce['services'];
-      console.log(this.services);
+      console.log('servicesss',this.services);
       this.spinner.hide();
     },
     (error) => {console.log(error)}

+ 18 - 20
src/styles.css

@@ -619,50 +619,40 @@ width: 100%;
   font-weight: bold;
 }
 
-/* .cal-month-view .cal-day-cell {
-  min-height: 50px !important;
-}
 
-.cal-month-view .cal-day-cell {
-  min-height: 50px !important;
-}
-
-.cal-month-view .cal-day-cell {
-  min-height: 50px !important;
-} */
 
-.cal-month-view .cal-days .cal-cell-row {
+.externalEventContent-w .cal-month-view .cal-days .cal-cell-row {
   height: 50px;
 }
   
-.cal-month-view .cal-day-cell {
+.externalEventContent-w .cal-month-view .cal-day-cell {
   min-height: 50px !important;
   border: 1px solid #e1e1e1;
 }
 
-.cal-month-view .cal-cell-top {
+.externalEventContent-w .cal-month-view .cal-cell-top {
   min-height: 50px !important;
 }
 
-.cal-events {
+.externalEventContent-w .cal-events {
   margin: 0 !important;
 }
 
-.cal-day-badge {
+.externalEventContent-w .cal-day-badge {
   margin-top: 0 !important;
   margin-left: 0 !important;
 }
 
-.cal-day-number {
+.externalEventContent-w .cal-day-number {
   font-size: 15px !important;
   color: #252525;
 }
 
-.cal-month-view .cal-day-cell.cal-out-month .cal-day-number {
+.externalEventContent-w .cal-month-view .cal-day-cell.cal-out-month .cal-day-number {
   opacity: 0.7 !important;
 }
 
-.cal-day-badge {
+.externalEventContent-w .cal-day-badge {
   padding: 2px 5px !important;
   font-size: 10px !important;
   text-align: initial !important;
@@ -736,12 +726,18 @@ width: 100%;
   width: 3rem !important;
 }
 
+.ngb-dp-month {
+  padding: 0 16px !important;
+}
+
 .btn-light {
   width: 3rem !important;
 }
   
 
-
+.form-group {
+  margin-top: 0 !important;
+}
 
 
 
@@ -1077,7 +1073,9 @@ height: 7px !important;
 }
 
 
-
+.externalEventContent-w .cal-month-view .cal-event {
+  display: none !important;
+}