Hima il y a 5 ans
Parent
commit
eb4cb72a5a

+ 24 - 24
src/app/auth-services/login/login.component.html

@@ -1,32 +1,32 @@
   <div class="login-dashBoard" [style.min-height.px]="screenHeight">
     <div class="container">
-        <div class="formContent-w">
-            <h2>تسجيل الدخول</h2>
-            <p>مرحباً ، قم بتسجيل الدخول الان</p>
-            <div class="container">
-              <div class="row">
-                <div class="col-12">
-                  <form (ngSubmit)="onSubmitedForm()" #f="ngForm">
-                    <div class="form-group">
-                      <label for="email">رقم الهويه</label>
-                      <input type="phone" id="email" class="form-control" placeholder="رقم الهويه" name="identity_number" appEnglishCharacters ngModel required  #identity_number="ngModel" />
-                      <span class="help-block" *ngIf="!identity_number.valid && identity_number.touched">من فضلك ، ادخل رقم الهويه صحيح</span>
-                    </div>
-                    <div class="form-group">
-                        <label for="password"> كلمه المرور</label>
-                        <input type="password" id="password" class="form-control" placeholder="كلمه المرور"  name="password" ngModel required #password="ngModel"/>
-                        <span class="help-block" *ngIf="!password.valid && password.touched">من فضلك ، قم بادخال كود صحيح</span>
-                    </div>
-                    <div class="form-group">
-                      <a (click)="registerFun()" class="signUp-w" style="float: left; margin-left:10px; cursor: pointer">إنشاء حساب جديد</a>
-                      <a routerLink="/page-not-found" class="forgetPassword-w" style="margin-right: 10px">نسيت كلمه المرور ؟</a>
-                    </div>
-                    <button class="btn btn-success form-control" type="submit" [disabled]="!f.valid || saveDisabled">الدخول</button>
-                  </form>
-                </div>
+      <div class="formContent-w">
+        <h2>تسجيل الدخول</h2>
+        <p>مرحباً ، قم بتسجيل الدخول الان</p>
+          <div class="container">
+            <div class="row">
+              <div class="col-12">
+                <form (ngSubmit)="onSubmitedForm()" #f="ngForm">
+                  <div class="form-group">
+                    <label for="email">رقم الهويه</label>
+                    <input type="phone" id="email" class="form-control" placeholder="رقم الهويه" name="identity_number" ngModel required  #identity_number="ngModel" />
+                    <span class="help-block" *ngIf="!identity_number.valid && identity_number.touched">من فضلك ، ادخل رقم الهويه صحيح</span>
+                  </div>
+                  <div class="form-group">
+                      <label for="password"> كلمه المرور</label>
+                      <input type="password" id="password" class="form-control" placeholder="كلمه المرور"  name="password" ngModel required #password="ngModel"/>
+                      <span class="help-block" *ngIf="!password.valid && password.touched">من فضلك ، قم بادخال كود صحيح</span>
+                  </div>
+                  <div class="form-group">
+                    <a (click)="registerFun()" class="signUp-w" style="float: left; margin-left:10px; cursor: pointer">إنشاء حساب جديد</a>
+                    <a routerLink="/page-not-found" class="forgetPassword-w" style="margin-right: 10px">نسيت كلمه المرور ؟</a>
+                  </div>
+                  <button class="btn btn-success form-control" type="submit" [disabled]="!f.valid || saveDisabled">الدخول</button>
+                </form>
               </div>
             </div>
           </div>
+        </div>
     </div>
   </div>
 

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

@@ -74,20 +74,34 @@
               </div>
 
               <div class="col-12 col-sm-12 col-md-4 col-lg-4">
-                <label for="date" style="float: right; margin-right: 5px">التاريخ</label>
+                <label for="date" style="float: right; margin-right: 5px">تاريخ الإبتداء</label>
                 <div *ngIf='bindingDateSplit && typeMode'>
                   <app-higri-date (onDatePicked)="getDate($event)" [myDate]="bindingDateSplit"></app-higri-date>
                 </div>
                 <div *ngIf='!typeMode'>
-                  <app-higri-date (onDatePicked)="getDate($event)" ></app-higri-date>
+                  <app-higri-date (onDatePicked)="getDate($event, 'start')" ></app-higri-date>
                 </div>
               </div>
 
               <div class="col-12 col-sm-12 col-md-4 col-lg-4">
-                <label for="time" style="float: right; margin-right: 5px">الوقت <span class="spanReqired-w">*</span></label>
+                <label for="time" style="float: right; margin-right: 5px">وقت الإبتداء <span class="spanReqired-w">*</span></label>
                 <input type="time" class="form-control" [(ngModel)]="event.time" id="time" name="time" required/>
               </div>
 
+              <div class="col-12 col-sm-12 col-md-6 col-lg-4" style="margin-top: 20px">
+                <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>
+                  </div>
+                </div>
+              </div>
+
+              <div class="col-12 col-sm-12 col-md-4 col-lg-4" style="margin-top: 20px">
+                <label for="endTime" style="float: right; margin-right: 5px">وقت الإنتهاء <span class="spanReqired-w">*</span></label>
+                <input type="time" class="form-control" [(ngModel)]="event.endTime" id="endTime" name="endTime" required/>
+              </div>
+
               <div class="col-12">
                   <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid || checkSaveClick">حفظ</button>
                   <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>

+ 44 - 13
src/app/dashboard/events/add-event/add-event.component.ts

@@ -24,6 +24,7 @@ export class AddEventComponent implements OnInit {
   bindingDateSplit;
   higriDateVal:string;
   checkSaveClick:boolean = false;
+  bindingDateSplitEnd: any;
 
   event = {
     employee_name: '',
@@ -34,6 +35,7 @@ export class AddEventComponent implements OnInit {
     type: '',
     status: '',
     time: '',
+    endTime: '',
   }
 
   constructor(private dashboard: DashboardService,
@@ -86,6 +88,12 @@ export class AddEventComponent implements OnInit {
                 'day': parseInt(higriDate[2])
               };
 
+              this.bindingDateSplitEnd = {
+                year: parseInt(eventData.created_date.split('-')[0]),
+                month: parseInt(eventData.created_date.split('-')[1]),
+                day: parseInt(eventData.created_date.split('-')[2]),
+              }
+
               console.log('hhhhhhhhhhhhhhh' , this.bindingDateSplit);
               this.spineer.hide();
             },
@@ -101,28 +109,43 @@ export class AddEventComponent implements OnInit {
   }
 
     //get value date from child component 
-    public getDate(date: any):void {
+    public getDate(date: any, type: string):void {
       console.log( date);
-      this.higriDateVal = date.year + '-' + date.month + '-' + date.day;
-      console.log('higrii date', this.higriDateVal);
+      if(type == 'start'){
+        this.higriDateVal = date.year + '-' + date.month + '-' + date.day;
+        console.log('higrii date', this.higriDateVal);
+      } else if(type == 'end') {
+        this.bindingDateSplitEnd = date.year + '-' + date.month + '-' + date.day;
+        console.log('end higrii date', this.bindingDateSplitEnd);
+      } else {
+        console.log('no date !');
+      }
+
     }
   
 
   //submitted form
   onSubmitted() {
-    this.checkSaveClick = true;
-    console.log(this.eventForm.value);
-    console.log(this.eventForm.value.time);
-    this.eventForm.value['date'] = this.higriDateVal;
-    if(this.event.time) {
-      this.eventForm.value.event_time = this.eventForm.value.date + ' ' + this.event.time;
+
+    //this.checkSaveClick = true;
+    if(this.higriDateVal) {
+      this.eventForm.value['event_time'] = this.higriDateVal + ' ' + this.event.time;
+      delete this.eventForm.value.time;
     }
-    console.log(this.eventForm.value.event_time);
-    delete this.eventForm.value.time;
-    delete this.eventForm.value.date;
+
+    if(this.bindingDateSplitEnd) {
+      this.eventForm.value['event_end_time'] = this.bindingDateSplitEnd + ' ' + this.event.endTime;
+      delete this.eventForm.value.endTime;
+    }
+
 
     console.log(this.eventForm.value); 
     if(this.typeMode) {
+      if(!this.higriDateVal){
+        this.toastr.warning('من فضلك أدخل تاريخ الإبتداء !');
+      } else if(!this.bindingDateSplitEnd) {
+        this.toastr.warning('من فضلك أدخل تاريخ الإنتهاء !');
+      } else {
         this.dashboard.editItem( this.eventId ,this.eventForm.value , "events").subscribe(
           (responce) => {
             console.log(responce);
@@ -143,7 +166,14 @@ export class AddEventComponent implements OnInit {
             this.checkSaveClick = false;
           }
         );
+      }
+        
     } else {
+      if(!this.higriDateVal){
+        this.toastr.warning('من فضلك أدخل تاريخ الإبتداء !');
+      } else if(!this.bindingDateSplitEnd) {
+        this.toastr.warning('من فضلك أدخل تاريخ الإنتهاء !');
+      } else {
         this.dashboard.addItem(this.eventForm.value, "events").subscribe(
           (responce) => {
             console.log(responce);
@@ -163,7 +193,8 @@ export class AddEventComponent implements OnInit {
             console.log(error);
             this.checkSaveClick = false;
           }
-        ); 
+        );
+      } 
     }
   }
 

+ 1 - 1
src/app/dashboard/users/form-user/form-user.component.html

@@ -145,7 +145,7 @@
             <div class="col-12 col-sm-12 col-md-4 col-lg-4" *ngIf="signupForm.controls.type.value == '0' ">
               <div class="form-group">
                 <label for="date_employment" style="float:right">تاريخ التوظيف الميلادي <span class="spanReqired-w">*</span></label>
-                <input type="date" class="form-control"  id="date_employment" formControlName="date_of_employment_gre" #gerDate (change)="changeEployeeGre()" />
+                <input type="date" class="form-control"  id="date_employment" formControlName="date_of_employment_gre" #gerDate (change)="changeEployeeGre()" max="2020-12-31"/>
               </div>
             </div>
 

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

@@ -239,5 +239,4 @@ export class AuthServiceService {
     }) );
   }
 
-
 }