4 Commits 20439e55ee ... 39046635af

Author SHA1 Message Date
  amr 39046635af add-new-report 5 years ago
  amr 11566e3ac0 Merge branch 'ibrahimBranch2' into amr 5 years ago
  Hima b31d5cdc8c sdds 5 years ago
  Hima 37e4a29adc dd 5 years ago

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

@@ -17,8 +17,8 @@ export class ExternalPageHeaderComponent implements OnInit {
     currentDate: any = Date.now();//ararbic date 
     currentEnglishDate: any = Date.now(); //english date
 
-    dataLoginUser: any;
 
+    dataLoginUser:any;
 
   ngOnInit() {
 
@@ -29,8 +29,8 @@ export class ExternalPageHeaderComponent implements OnInit {
     this.currentDate = this.authSer.writeHijri(new Date(this.currentDate), 'ar', 'header');
     
     if(!this.authSer.isAuthenticated()) {
-      console.log('user data ', this.authSer.returnUserData());
-      this.dataLoginUser = JSON.parse(localStorage.getItem('userData'));
+      console.log('user data external header', this.authSer.returnUserData());
+      this.dataLoginUser = this.authSer.returnUserData();
     }
 
     console.log(this.dataLoginUser);

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

@@ -23,11 +23,7 @@ export class InternalPageHeaderComponent implements OnInit {
       spinner.show();
      }
   
-     dataLoginUser = {
-      name: '',
-      photo: '',
-      id: '',
-    }
+  dataLoginUser:any;
     
   currentDate: any = Date.now();
 
@@ -40,11 +36,9 @@ export class InternalPageHeaderComponent implements OnInit {
    
      this.authSer.footerData = [];
      
-     if(!this.authSer.isAuthenticated()) {
-      const userLoginData = JSON.parse(localStorage.getItem('userData'));
-      this.dataLoginUser.name = userLoginData ? userLoginData.name : '';
-      this.dataLoginUser.photo = userLoginData ? userLoginData.photo : '';
-      this.dataLoginUser.id = userLoginData ? userLoginData.id : null;
+    if(!this.authSer.isAuthenticated()) {
+      console.log('user data internal header', this.authSer.returnUserData());
+      this.dataLoginUser = this.authSer.returnUserData();
     }
 
     this.authSer.onGetFooterData('internal').subscribe(

+ 1 - 1
src/app/app-routing.module.ts

@@ -12,7 +12,7 @@ import { TrainningServicesComponent } from './trainning-service/trainning-servic
 
 
 const routes: Routes = [
-  {path: '', redirectTo: '/InternalPage', pathMatch: 'full'},
+  {path: '', redirectTo: '/ExternalPage', pathMatch: 'full'},
   {path: 'auth', loadChildren:'./auth-services/auth-services.module#AuthServicesModule'},
   {path: 'InternalPage' , loadChildren: './Internal-Page/internal-page.module#InternalPageModule', canLoad: [AuthGuard]},
   {path: 'ExternalPage', loadChildren: './External-Page/external-page.module#ExternalPageModule', canLoad: [AuthGuard]},

+ 3 - 3
src/app/app.component.html

@@ -8,9 +8,9 @@
 
  <app-header></app-header>
 
-    <div class="routerLinkContainer-w" [style.min-height.px]="myInnerHeight">
-        <router-outlet></router-outlet>
-    </div>
+<div class="routerLinkContainer-w" [style.min-height.px]="myInnerHeight">
+    <router-outlet></router-outlet>
+</div>
 
 <app-footer></app-footer>
 

+ 5 - 5
src/app/app.component.ts

@@ -13,13 +13,13 @@ import { Component, OnInit } from '@angular/core';
 export class AppComponent implements OnInit {
 
   myInnerHeight = window.innerHeight;
-
-constructor(private spinner: NgxSpinnerService) {
+  dataLoginUser: any;
+  
+constructor(private spinner: NgxSpinnerService, 
+  private authSer: AuthServiceService) {
   this.spinner.show();
 }
-  ngOnInit() {
-
-  }
+  ngOnInit() {}
 
  
 }

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

@@ -54,8 +54,8 @@
                   </div>
                   <div class="col-12 col-md-4">
                     <div class="form-group">
-                      <label for="phone" style="float:right">الهاتف<span class="spanReqired-w">*</span></label>
-                      <input type="phone" class="form-control" id="phone" [ngModel]="reportAuthor.phone" [ngModelOptions]="{standalone: true}" [disabled]="true"/>
+                      <label for="phone" style="float:right">رقم الجوال<span class="spanReqired-w">*</span></label>
+                      <input type="phone" class="form-control" id="phone" [ngModel]="reportAuthor.phone" [ngModelOptions]="{standalone: true}"/>
                     </div>
                   </div>
                 </div>
@@ -82,8 +82,8 @@
                     </div>
                     <div class="col-12 col-sm-12 col-md-4 col-lg-4">
                       <div class="form-group">
-                        <label for="phoneNum"  style="float: right;margin-right: 5px"> الهاتف </label>
-                        <input type="number" placeholNeedder=" الهاتف" class="form-control" name="phoneNum" [ngModel]="dataForm.phoneNum" [disabled]="true" required/>
+                        <label for="phoneNum"  style="float: right;margin-right: 5px"> رقم الجوال </label>
+                        <input type="number" placeholNeedder=" " class="form-control" name="phoneNum" [ngModel]="dataForm.phoneNum"  required/>
                       </div>  
                   </div>
                     <div class="col-12 col-sm-12 col-md-4 col-lg-4">
@@ -195,7 +195,7 @@
                       <thead class="headBackground-w">
                         <tr>
                           <th> إسم المرفق</th>
-                          <th>رفع املف ( بصيغه pdf )</th>
+                          <th>رفع الملف ( بصيغه pdf )</th>
                           <!-- <th>عرض الملف</th> -->
                           <th>حذف</th>
                         </tr>

+ 17 - 16
src/app/dashboard/create-report/add-new-report/add-new-report.component.ts

@@ -112,7 +112,8 @@ export class AddNewReportComponent implements OnInit {
     this.currentDate = this.authService.writeHijri(new Date(this.currentDate), 'en', 'system');
 
 
-
+  
+    
     
 
     const nowHigriDate = this.currentDate.split(' ');
@@ -127,13 +128,13 @@ export class AddNewReportComponent implements OnInit {
         nowHigriDate[0] = i + 1;
       }
     }
-
+    
     this.bindingDateSplitStart = {
       year:parseInt(nowHigriDate[2]),
       month: parseInt(nowHigriDate[0]),
       day: parseInt(nowHigriDate[1]),
     }
-
+    this.bindingDateSplitStart.day -= 1;
     console.log('hhhhhhhhhhhhhhhhhhhh', this.bindingDateSplitStart);
 
 
@@ -275,19 +276,19 @@ export class AddNewReportComponent implements OnInit {
         this.dataForm.user_id = this.reportAuthor.id
       } 
     console.log(this.dataForm);
-   this.http.post(this.authService.pathApi + '/add_communication' , this.dataForm )
-      .subscribe(
-         res => {
-           console.log(res);
-           this.checked = false;
-           this.toastr.success('تم حفظ البلاغ ');
-           this.router.navigate(['/service/' + this.userId + '/' +  this.serviceId + '/followCommunicationList/58']);
-          },
-          err => {
-           console.log(err)
-           this.toastr.error('حدث خطأ في الاتصال ');
-          }
-       );
+  //  this.http.post(this.authService.pathApi + '/add_communication' , this.dataForm )
+  //     .subscribe(
+  //        res => {
+  //          console.log(res);
+  //          this.checked = false;
+  //          this.toastr.success('تم حفظ البلاغ ');
+  //          this.router.navigate(['/service/' + this.userId + '/' +  this.serviceId + '/followCommunicationList/58']);
+  //         },
+  //         err => {
+  //          console.log(err)
+  //          this.toastr.error('حدث خطأ في الاتصال ');
+  //         }
+  //      );
     }else{
       console.log('i cant send the request');
     }

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

@@ -1,6 +1,6 @@
 <div class="headerDashBoard" *ngIf="authSer.showDashboardHeader">   
     <!-- top Header content -->
-    <div class="header" *ngIf="authSer.showHeaderDashBoard">
+    <div class="header">
       <div class="container">
         <div class="row">
           <div class="col-6 col-sm-6 col-md-6 col-lg-6">

+ 4 - 5
src/app/dashboard/header/header.component.ts

@@ -25,15 +25,14 @@ export class HeaderComponent implements OnInit {
   ngOnInit() {
 
     this.authSer.showHeaderLogin = false;
-    this.authSer.showHeaderDashBoard = true;
-    this.authSer.showDashboardHeader = true;
+    this.authSer.showHeaderDashBoard = false;
+    this.authSer.showDashboardHeader = false;
 
     this.authSer.checkExternalFooter = false;
 
     if(!this.authSer.isAuthenticated()) {
-      console.log('user data ', this.authSer.returnUserData());
-      this.dataLoginUser = JSON.parse(localStorage.getItem('userData'));
-      console.log('data loginnnnn', this.dataLoginUser);
+      console.log('user data internal header', this.authSer.returnUserData());
+      this.dataLoginUser = this.authSer.returnUserData();
     }
 
 

+ 2 - 1
src/app/shared/auth-service.service.ts

@@ -93,7 +93,8 @@ export class AuthServiceService {
 
   //return user data 
   returnUserData() {
-    return JSON.parse(localStorage.getItem('userObject'));
+    this.dataLoginUser = JSON.parse(localStorage.getItem('userObject'));
+    return this.dataLoginUser;
   }
 
 

+ 2 - 0
src/app/shared/user.service.ts

@@ -16,6 +16,8 @@ export class UserService {
       private spinner: NgxSpinnerService) { }
 
 
+
+
   //get profile data
   getUserDataProfile() {
     this.http.get(this.authService.pathApi + '/profile').subscribe(