Hima 5 years ago
parent
commit
caf48d0be6

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

@@ -38,6 +38,7 @@
                                 </div>
                             </div>
                         </div> 
+                        
                      </div>
                 </div>
             </div>
@@ -156,7 +157,7 @@
             <div class="secondServices-w">
                 <div class="container containerPaddingEdit-w" style="height:560px; overflow-y:auto">
                     <div class="row" style="padding:0 10px;">
-                        <div class="col-12 col-sm-12 col-md-6 col-lg-4 editRowPadding-w" *ngFor="let ser of internalService">
+                        <div class="col-12 col-sm-12 col-md-6 col-lg-4 editRowPadding-w"  *ngFor="let ser of internalServices">
                             <div class="contentSecondSer-w">
                                 <div class="headerSer-w">
                                     {{ser.name}}
@@ -241,7 +242,6 @@
 </ng-template>
 
 
-
  <ng-template #englishTemplate>
     <div class="container">
     <div class="contentPage-w">
@@ -394,7 +394,7 @@
             <div class="secondServices-w">
                 <div class="container" style="height:560px; overflow-y:auto; padding-left:5px">
                     <div class="row" style="padding:0 10px;">
-                        <div class="col-12 col-sm-6 col-md-4 editRowPadding-w" *ngFor="let ser of internalService">
+                        <div class="col-12 col-sm-6 col-md-4 editRowPadding-w" *ngFor="let ser of internalServices">
                             <div class="contentSecondSer-w" style="float:left;">
                                 <div class="headerSer-w">
                                     {{ser.name_en}}

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

@@ -44,7 +44,7 @@ export class InternalPageContentComponent implements OnInit {
     reportsData = [];
     externalServices = [];
     congratulations = [];
-    condolences = [];
+    condolences: any = [];
     internalServices = [];
     tabsData = [];
     achievements = [];
@@ -141,12 +141,13 @@ export class InternalPageContentComponent implements OnInit {
         this.showJoinData(this.joinUs[0]);
 
         this.condolences = responce['data'].condolences_events;
+        console.log('errorrrrrr loooooooooooooop => ', this.condolences);
         this.showTabData(this.condolences[0], 'sad');
 
         this.congratulations = responce['data'].congratulations_events;
         this.showTabData(this.congratulations[0], 'wedding');
 
-        this.internalService = responce['data'].internal_services;
+        this.internalServices = responce['data'].internal_services;
         console.log('internalService', this.internalService);
 
         this.tabsData = responce['data'].tabs;

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

@@ -11,7 +11,7 @@ import { TrainningServicesComponent } from './trainning-service/trainning-servic
 
 
 const routes: Routes = [
-  {path: '', redirectTo: '/ExternalPage', pathMatch: 'full'},
+  {path: '', redirectTo: '/InternalPage', 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]},

+ 2 - 24
src/app/auth-services/regester/regester.component.html

@@ -25,7 +25,7 @@
             </div>
           </div>
 
-          <div class="col-12 col-sm-12 col-md-6 col-lg-4" *ngIf="showTypeInput">
+          <!-- <div class="col-12 col-sm-12 col-md-6 col-lg-4" *ngIf="showTypeInput">
             <div class="form-group">
               <label style="float: right; margin-right:5px;margin-top:10px">الحاله <span class="spanReqired-w">*</span></label>
               <div class="custom-control custom-radio inlineBlock-w" style="padding: 2px 31px;background: #bd90592e;color: #a98559;border: 1px solid #b38553c2;">
@@ -37,9 +37,8 @@
                 <input type="radio" class="custom-control-input customStyleInput" id="defaultRadio" value="0" formControlName="type" name="type" (change)="checkTypeUser($event)">
                 <label class="custom-control-label" for="defaultRadio" style="cursor: pointer;">موظف</label>
               </div>
-
             </div>
-          </div>
+          </div> -->
 			
 			<div class="col-sm-12 col-md-12 col-lg-12">
 				<div class="row">
@@ -106,18 +105,6 @@
                     <option *ngFor="let day of days" [value]="day">{{day}}</option>
                   </select>
                 </div>
-                
-                <!-- <input type="date" max="{{min}}" id="birthdate" placeholder="تاريخ الميلاد" class="form-control" formControlName="birthday" />  -->
-                <!-- <app-end-higri-date *ngIf="higri_birth_date && typeMode"  (onDatePicked)="getDate($event, 'higri_birthDate')" [myEndDate]="higri_birth_date" [higriDisabled]="disabledVal"> </app-end-higri-date>
-                <app-end-higri-date *ngIf="!typeMode"  (onDatePicked)="getDate($event, 'higri_birthDate')"> </app-end-higri-date> -->
-                <!-- <input class="form-control"  
-                placeholder="yyyy-mm-dd"
-                formControlName="birthday" 
-                ngbDatepicker #d="ngbDatepicker" />
-                        
-                <div class="input-group-append">
-                    <button class="btn calendar higriButton" (click)="d.toggle()" type="button"><i class="fas fa-calendar-minus"></i></button>
-                </div> -->
               </div>
             </div>
 						 <div class="col-12 col-sm-12 col-md-6 col-lg-4">
@@ -243,15 +230,6 @@
                       <option *ngFor="let day of days" [value]="day">{{day}}</option>
                     </select>
                   </div>
-                  
-                  <!-- <input class="form-control"  
-                    placeholder="yyyy-mm-dd"
-                    formControlName="date_of_employment_hij" 
-                    ngbDatepicker #d="ngbDatepicker" />
-                            
-                <div class="input-group-append">
-                    <button class="btn calendar higriButton" (click)="d.toggle()" type="button"><i class="fas fa-calendar-minus"></i></button>
-                </div> -->
                 </div>
               </div>
             

+ 35 - 7
src/app/auth-services/regester/regester.component.ts

@@ -344,12 +344,10 @@ export class RegesterComponent implements OnInit {
               password_confirmation: new FormControl(null, [Validators.minLength(6)]),
               phone: new FormControl(null,Validators.required),
               gender: new FormControl(null, Validators.required),
-              //birthday: new FormControl(null, Validators.required),
               adminstration_id: new FormControl(null, Validators.required),
               department_id: new FormControl(null, Validators.required),
               nationality_id: new FormControl(null, Validators.required),
               date_of_employment_gre: new FormControl(null, Validators.required),
-              //date_of_employment_hij: new FormControl(null,Validators.required),
               job_title_id: new FormControl(null),
               specialization_id: new FormControl(null),
               functional_number: new FormControl(null, Validators.required),
@@ -375,7 +373,6 @@ export class RegesterComponent implements OnInit {
               position: responce['user'].position,
               phone: responce['user'].phone,
               gender: responce['user'].gender,
-              //birthday: responce['user'].birthday,
               adminstration_id: responce['user'].adminstration_id,
               department_id: responce['user'].department_id,
               nationality_id: responce['user'].nationality_id,
@@ -386,7 +383,6 @@ export class RegesterComponent implements OnInit {
               staff_id: responce['user'].staff_id,
               functional_number: responce['user'].functional_number,
               status: responce['user'].status,
-              //date_of_employment_hij: this.bindingDateSplit, //responce['user'].date_of_employment_hij//
             });
             console.log(this.bindingDateSplit);
 
@@ -493,7 +489,6 @@ export class RegesterComponent implements OnInit {
             password: new FormControl(null, [Validators.required, Validators.minLength(6)]),
             password_confirmation: new FormControl(null, [Validators.required, Validators.minLength(6)]),
             gender: new FormControl(null, Validators.required),
-            //birthday: new FormControl(null, Validators.required),
             nationality_id: new FormControl(null, Validators.required),
             phone: new FormControl(null, Validators.required),
           });
@@ -509,12 +504,10 @@ export class RegesterComponent implements OnInit {
             password_confirmation: new FormControl(null, [Validators.required, Validators.minLength(6)]),
             phone: new FormControl(null, Validators.required),
             gender: new FormControl(null, Validators.required),
-            //birthday: new FormControl(null, Validators.required),
             adminstration_id: new FormControl(null, Validators.required),
             department_id: new FormControl(null, Validators.required),
             nationality_id: new FormControl(null, Validators.required),
             date_of_employment_gre: new FormControl(null, Validators.required),
-            //date_of_employment_hij: new FormControl(null,Validators.required),
             job_title_id: new FormControl(null),
             specialization_id: new FormControl(null),
             functional_number: new FormControl(null, Validators.required),
@@ -578,6 +571,8 @@ export class RegesterComponent implements OnInit {
     onSubmittedForm() {
 
       this.changesSave = true;
+      this.saveDisabled = true;
+      
       const userDataRegester = this.regesterForm.value;
       let joinJobDate;
 
@@ -634,6 +629,9 @@ export class RegesterComponent implements OnInit {
                 } else if(error.error['error'].identity_number) {
                   this.toastr.warning('رقم الهويه تم التسجيل به من قبل !');
                   this.saveDisabled = false;
+                } else if(error.error['error'].phone) {
+                  this.toastr.warning(' رقم الهاتف يجب ان لايكون أقل من 6 ارقام ، ولا يكون مستخدم من قبل!');
+                  this.saveDisabled = false;
                 }
               }
             );
@@ -642,14 +640,19 @@ export class RegesterComponent implements OnInit {
           //edit profile employee submited 
           if(this.regesterForm.get('password').value != this.regesterForm.get('password_confirmation').value){
             this.toastr.warning(' من فضلك , تأكد أن كلمه المورو نفس تأكيد كلمه المرور!');
+            this.saveDisabled = false;
           }else if(this.regesterForm.get('identity_number').value.substring(0,1) != 1 && this.regesterForm.get('identity_type_id').value == 1){
             this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 1');
+            this.saveDisabled = false;
           } else if(this.regesterForm.get('identity_number').value.substring(0,1) != 2 && this.regesterForm.get('identity_type_id').value == 3){
             this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 2');
+            this.saveDisabled = false;
           } else if(this.birthDate.year > this.griDate.year) {
             this.toastr.warning('تارخ الميلاد أكبر من تاريخ التوظيف الميلادي !');
+            this.saveDisabled = false;
           } else if(this.regesterForm.get('phone').value.substring(0,2) != '05') {
             this.toastr.warning('رقم الجوال يجب أن يبدأ ب 05');
+            this.saveDisabled = false;
           } else {
             this.userService.onEditProfile(userDataRegester).subscribe(
               (responce) => {
@@ -661,8 +664,13 @@ export class RegesterComponent implements OnInit {
                 this.toastr.error('فشل التعديل');
                 if(error.error['error'].email) {
                   this.toastr.warning('الايميل تم التسجيل به من قبل !');
+                  this.saveDisabled = false;
                 } else if(error.error['error'].identity_number) {
                   this.toastr.warning('رقم الهويه تم التسجيل به من قبل !');
+                  this.saveDisabled = false;
+                } else if(error.error['error'].phone) {
+                  this.toastr.warning('  رقم الهاتف يجب ان لايكون أقل من 6 ارقام ، ولا يكون مستخدم من قبل !');
+                  this.saveDisabled = false;
                 }
               }
             );
@@ -679,12 +687,16 @@ export class RegesterComponent implements OnInit {
           //visitor added submited
           if(this.regesterForm.get('password').value != this.regesterForm.get('password_confirmation').value){
             this.toastr.warning('  من فضلك تأكد أن كلمه المرور نفس تأكيد كلمه المرور !');
+            this.saveDisabled = false;
           } else if(this.regesterForm.get('phone').value.substring(0,2) != '05') {
             this.toastr.warning('رقم الجوال يجب أن يبدأ ب 05');
+            this.saveDisabled = false;
           } else if(userDataRegester['identity_number'].substring(0,1) != 1 && this.regesterForm.get('identity_type_id').value == 1){
             this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 1');
+            this.saveDisabled = false;
           } else if(userDataRegester['identity_number'].substring(0,1) != 2 && this.regesterForm.get('identity_type_id').value == 3){
             this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 2');
+            this.saveDisabled = false;
           } else {
             this.authSer.signUp(userDataRegester).subscribe(
               (responce) => {
@@ -696,8 +708,13 @@ export class RegesterComponent implements OnInit {
                 console.log(error);
                 if(error.error['error'].email) {
                   this.toastr.warning('الايميل تم التسجيل به من قبل !');
+                  this.saveDisabled = false;
                 } else if(error.error['error'].identity_number) {
                   this.toastr.warning('رقم الهويه تم التسجيل به من قبل !');
+                  this.saveDisabled = false;
+                } else if(error.error['error'].phone) {
+                  this.toastr.warning('  رقم الهاتف يجب ان لايكون أقل من 6 ارقام ، ولا يكون مستخدم من قبل!');
+                  this.saveDisabled = false;
                 }
               }
             );
@@ -706,14 +723,19 @@ export class RegesterComponent implements OnInit {
           //employee added submited
           if(this.regesterForm.get('password').value != this.regesterForm.get('password_confirmation').value){
             this.toastr.warning('  من فضلك تأكد أن كلمه المرور نفس تأكيد كلمه المرور !');
+            this.saveDisabled = false;
           } else if(userDataRegester['identity_number'].substring(0,1) != 1 && this.regesterForm.get('identity_type_id').value == 1){
             this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 1');
+            this.saveDisabled = false;
           } else if(userDataRegester['identity_number'].substring(0,1) != 2 && this.regesterForm.get('identity_type_id').value == 3){
             this.toastr.warning('رقم الهويه يجب ان يبدأ ب رقم 2');
+            this.saveDisabled = false;
           } else if(this.birthDate.year > this.griDate.year) {
             this.toastr.warning('تارخ الميلاد أكبر من تاريخ التوظيف الميلادي !');
+            this.saveDisabled = false;
           } else if(this.regesterForm.get('phone').value.substring(0,2) != '05') {
             this.toastr.warning('رقم الجوال يجب أن يبدأ ب 05');
+            this.saveDisabled = false;
           } 
           else {
             this.authSer.signUp(userDataRegester).subscribe(
@@ -726,8 +748,14 @@ export class RegesterComponent implements OnInit {
                 console.log(error);
                 if(error.error['error'].email) {
                   this.toastr.warning('الايميل تم التسجيل به من قبل !');
+                  this.saveDisabled = false;
                 } else if(error.error['error'].identity_number) {
                   this.toastr.warning('رقم الهويه تم التسجيل به من قبل !');
+                  this.saveDisabled = false;
+                }
+                else if(error.error['error'].phone) {
+                  this.toastr.warning('  رقم الهاتف يجب ان لايكون أقل من 6 ارقام ، ولا يكون مستخدم من قبل!');
+                  this.saveDisabled = false;
                 }
               }
             );

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

@@ -92,7 +92,7 @@
                 <div class="form-group">
                   <label for="endDate" style="float:right" >تاريخ الإنتهاء<span class="spanReqired-w">*</span></label>
                   <div>
-                    <app-end-higri-date  (onDatePicked)="getDate($event, 'end')" [myEndDate]="bindingDateSplitEnd" [higriDisabled]="disabledVal"> </app-end-higri-date>
+                    <app-end-higri-date  (onDatePicked)="getDate($event, 'end')" [myEndDate]="bindingDateSplitEnd"> </app-end-higri-date>
                   </div>
                 </div>
               </div>