3 Commits 695612970d ... 607e35e4a1

Auteur SHA1 Bericht Datum
  Hima 607e35e4a1 dddd 5 jaren geleden
  Hima c1e081ccff ff 5 jaren geleden
  Amr 3ed4e82460 edits 5 jaren geleden
39 gewijzigde bestanden met toevoegingen van 468 en 283 verwijderingen
  1. 1 1
      src/app/External-Page/external-page-content/external-page-content.component.html
  2. 10 39
      src/app/dashboard/Registration-trainee-movement/registration-trainee-movement-add/registration-trainee-movement-add.component.html
  3. 11 3
      src/app/dashboard/Registration-trainee-movement/registration-trainee-movement-add/registration-trainee-movement-add.component.ts
  4. 5 2
      src/app/dashboard/Registration-trainee-movement/registration-trainee-movement-list/registration-trainee-movement-list.component.html
  5. 1 1
      src/app/dashboard/external-achievements/add-external-achievement/add-external-achievement.component.html
  6. 10 2
      src/app/dashboard/external-achievements/add-external-achievement/add-external-achievement.component.ts
  7. 9 9
      src/app/dashboard/external-services/add-external/add-external.component.ts
  8. 5 0
      src/app/dashboard/final-accreditation-of-trainees/final-accerditation-add/final-accerditation-add.component.css
  9. 25 0
      src/app/dashboard/final-accreditation-of-trainees/final-accerditation-add/final-accerditation-add.component.html
  10. 5 0
      src/app/dashboard/final-accreditation-of-trainees/final-accerditation-add/final-accerditation-add.component.ts
  11. 2 0
      src/app/dashboard/final-accreditation-of-trainees/final-accerditation-list/final-accerditation-list.component.html
  12. 5 1
      src/app/dashboard/final-trainee-report/final-trainee-report.component.html
  13. 51 1
      src/app/dashboard/final-trainee-report/final-trainee-report.component.ts
  14. 2 2
      src/app/dashboard/model-vehicle/model-vehicle-add/model-vehicle-add.component.html
  15. 8 14
      src/app/dashboard/model-vehicle/model-vehicle-list/model-vehicle-list.component.html
  16. 29 2
      src/app/dashboard/model-vehicle/model-vehicle-list/model-vehicle-list.component.ts
  17. 1 1
      src/app/dashboard/register-movement-vehicle/register-movement-vehicle-add/register-movement-vehicle-add.component.html
  18. 17 3
      src/app/dashboard/register-movement-vehicle/register-movement-vehicle-add/register-movement-vehicle-add.component.ts
  19. 3 3
      src/app/dashboard/register-movement-vehicle/register-movement-vehicle-list/register-movement-vehicle-list.component.html
  20. 4 4
      src/app/dashboard/registration-vehicle/registration-vehicle-add/registration-vehicle-add.component.html
  21. 4 4
      src/app/dashboard/registration-vehicle/registration-vehicle-list/registration-vehicle-list.component.html
  22. 24 0
      src/app/dashboard/reivew-trainee-data/review-trainee-add/review-trainee-add.component.css
  23. 23 0
      src/app/dashboard/reivew-trainee-data/review-trainee-add/review-trainee-add.component.html
  24. 12 5
      src/app/dashboard/reivew-trainee-data/review-trainee-add/review-trainee-add.component.ts
  25. 7 2
      src/app/dashboard/reivew-trainee-data/review-trainee-data-list/review-trainee-data-list.component.html
  26. 159 126
      src/app/dashboard/reivew-trainee-data/review-trainee-data-list/review-trainee-data-list.component.ts
  27. 4 4
      src/app/dashboard/reports-existing-vehicles/existing-report/existing-report.component.html
  28. 1 33
      src/app/dashboard/section-review-for-trainee/section-review-trainee-add/section-review-trainee-add.component.html
  29. 1 1
      src/app/dashboard/section-review-for-trainee/section-review-trainee-add/section-review-trainee-add.component.ts
  30. 1 1
      src/app/dashboard/section-review-for-trainee/section-review-trainee-list/section-review-trainee-list.component.html
  31. 7 2
      src/app/dashboard/supervisor/supervisor-list/supervisor-list.component.ts
  32. 1 1
      src/app/dashboard/users/form-user/form-user.component.ts
  33. 2 2
      src/app/dashboard/vehicle-maintenance/vehicle-maintenance-add/vehicle-maintenance-add.component.html
  34. 2 2
      src/app/dashboard/vehicle-maintenance/vehicle-maintenance-add/vehicle-maintenance-add.component.ts
  35. 6 4
      src/app/dashboard/vehicle-maintenance/vehicle-maintenance-list/vehicle-maintenance-list.component.html
  36. 3 3
      src/app/dashboard/vehicle-movement-report/vehicle-movement-report/vehicle-movement-report.component.html
  37. 1 1
      src/app/dashboard/vehicle/vehicle-add/vehicle-add.component.html
  38. 3 3
      src/app/dashboard/vehicle/vehicle-list/vehicle-list.component.html
  39. 3 1
      src/app/dashboard/vehicle/vehicle-list/vehicle-list.component.ts

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

@@ -162,7 +162,7 @@
                           <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>
+                              <h1> إحصائيات شهر  {{recordsOfMonth.statistics_month}} لعام {{recordsOfMonth.year}}</h1>
                               <span class="leftArrow-w" (click)="nextMonth()"><i class="fas fa-angle-left"></i></span>
                               <div class="body">
                                 <div class="spinnerContainer-w" *ngIf="showSmallSpinner">

+ 10 - 39
src/app/dashboard/Registration-trainee-movement/registration-trainee-movement-add/registration-trainee-movement-add.component.html

@@ -35,8 +35,6 @@
                     </div>
                   </div>
 
-                
-
                   <div class="col-12 col-sm-12 col-md-6 col-lg-4">
                     <div class="form-group">
                       <label for="identity" style="float:right"> الهويه <span class="spanReqired-w">*</span></label>
@@ -57,11 +55,11 @@
                   </div>
 
                   <div class="col-12 col-sm-12 col-md-6 col-lg-4">
-                      <div class="form-group">
-                        <label for="birthday" style="float:right">تاريخ الميلاد <span class="spanReqired-w">*</span></label>
-                        <input type="date" id="birthdate" placeholder="تاريخ الميلاد" class="form-control" ngModel name="birthday" [(ngModel)]="userData.birthday" [disabled]="disabledInput" required/> 
-                      </div>
+                    <div class="form-group">
+                      <label for="birthday" style="float:right">تاريخ الميلاد <span class="spanReqired-w">*</span></label>
+                      <input type="date" id="birthdate" placeholder="تاريخ الميلاد" class="form-control" ngModel name="birthday" [(ngModel)]="userData.birthday" [disabled]="disabledInput" required/> 
                     </div>
+                  </div>
 
                   <div class="col-12 col-sm-12 col-md-6 col-lg-4">
                     <div class="form-group">
@@ -109,14 +107,17 @@
                 <div class="wrapper">
                   
                   <div class="col-12">
-                    <h2 style="margin: 10px 0; font-size:19px;">حاله الطلب : <span>
+                    <h2 style="margin: 10px 0; font-size:19px;">حاله المتدرب : {{proper_department_status == 'stopped' ? 'إيقاف' : 
+                        proper_department_status == 'ended' ? 'إنهاء' : 
+                        proper_department_status == 'in_training' ? 'إستئناف التدريب' : ''}}</h2>
+                    <!-- <h2 style="margin: 10px 0; font-size:19px;">حاله الطلب : <span>
                       {{formData.status == 'pending' ? 'تحت الإجراء' 
                     : formData.status == 'accepted' ? 'مقبول' 
                     : formData.status == 'replayed_opinion' ? 'رأي القسم'
                     : formData.status == 'refused' ? 'مرفوض' 
                     : formData.status == 'canceled' ? 'ملغي'
                     : formData.status == 'asked_for_opinion' ? 'طلب رأي القسم' : 'لايوجد '}}
-                    </span></h2>
+                    </span></h2> -->
                   </div>
 
                   <div class="col-12 col-sm-12 col-md-4 col-lg-4">
@@ -199,35 +200,6 @@
                       <input type="text" id="field" placeholder="الجهه التابع لها المتدرب" class="form-control" name="organization_affiliated_with" ngModel [(ngModel)]="formData.organization_affiliated_with" [disabled]="disabledInput" required/>
                     </div>
                   </div>
-
-                <!-- <h2 class="departmentHeading-w">أختر الأقسام <span>(قم بإختيار قسم كحد أدني)</span></h2> -->
-                  <!-- <div class="col-12 col-sm-12 col-md-4 col-lg-4">
-                    <div class="form-group">
-                      <label for="department1" style="float:right;">القسم الأول</label>
-                      <select class="form-control selectStyle-w" id="department1" name="department1" (input)="changeDepartment($event , 1)" [(ngModel)]="formData.department1" [disabled]="disabledInput">
-                        <option *ngFor="let department of departments" [value]="department.id">{{department.name}}</option>
-                        <option [value]="2001">حذف</option>
-                      </select>
-                    </div>
-                  </div>
-                  <div class="col-12 col-sm-12 col-md-4 col-lg-4">
-                    <div class="form-group">
-                      <label for="department2" style="float:right;">القسم الثاني</label>
-                      <select class="form-control selectStyle-w" id="department2" name="department2" (input)="changeDepartment($event , 2)" [(ngModel)]="formData.department2" [disabled]="disabledInput">
-                        <option *ngFor="let department of departments" [value]="department.id">{{department.name}}</option>
-                        <option [value]="2002">حذف</option>
-                      </select>
-                    </div>
-                  </div>
-                  <div class="col-12 col-sm-12 col-md-4 col-lg-4">
-                    <div class="form-group">
-                      <label for="department3" style="float:right;">القسم الثالث</label>
-                      <select class="form-control selectStyle-w" id="department3" name="department3" (input)="changeDepartment($event , 3)" [(ngModel)]="formData.department3" [disabled]="disabledInput">
-                        <option *ngFor="let department of departments" [value]="department.id">{{department.name}}</option>
-                        <option [value]="2003">حذف</option>
-                      </select>
-                    </div>
-                  </div> -->
                 </div>
               </div>
             </div>
@@ -310,8 +282,7 @@
           </div>
         </form>
       </div>
-  
-  
+
     </div>
   </div>
   

+ 11 - 3
src/app/dashboard/Registration-trainee-movement/registration-trainee-movement-add/registration-trainee-movement-add.component.ts

@@ -87,6 +87,7 @@ export class RegistrationTraineeMovementAddComponent implements OnInit {
   identity_id: number = 0; //to determine te number of identity to validation
   identity_type: number;
   typeMode:boolean = false;
+  proper_department_status: string = '';
 
   files = [{
     title : '',
@@ -218,6 +219,7 @@ export class RegistrationTraineeMovementAddComponent implements OnInit {
           for(let i = 0; i < responce['data']['request'].departments.length; i++) {
             if(responce['data']['request'].departments[i].is_confirmed == 1) {
               this.actionForm.department_id = responce['data']['request'].departments[i].department_id;
+              this.proper_department_status = responce['data']['request'].departments[i].trainee_status;
             }
           }
 
@@ -251,19 +253,22 @@ export class RegistrationTraineeMovementAddComponent implements OnInit {
   traineeStatus(status: string) {
     console.log(status);
     if(status == 'ended') {
-      this.toastr.warning('تم الانهاء للمتدرب ، قم بتسجيل تققيم القسم للمتدرب');
+      this.toastr.warning('تم الانهاء للمتدرب ، قم بتسجيل تققيم القسم للمتدرب، ثم إضغط حفظ لإتمام العمليه بنجاح');
       this.actionForm.trainee_status = status;
+      this.proper_department_status = 'ended';
       this.endedShow = true;
       this.stoppedShow = false;
     } else if (status == 'stopped') {
-      this.toastr.error('تم الإيقاف للمتدرب');
+      this.toastr.error('تم الإيقاف للمتدرب ، من فضلك أدخل السبب ثم أضغط حفظ لإتمام العمليه بنجاح');
       this.actionForm.trainee_status = status;
       this.stoppedShow = true;
+      this.proper_department_status = 'stopped';
     } else if(status == 'in_training') {
-      this.toastr.success('تم الإستئناف للمتدرب');
+      this.toastr.success('تم الإستئناف للمتدرب ، ثوم إضغط حفظ لإتمام العمليه بنجاح ');
       this.actionForm.trainee_status = status;
       this.stoppedShow = false;
       this.endedShow = false;
+      this.proper_department_status = 'in_training';
     }
   }
 
@@ -376,6 +381,9 @@ plusImage() {
     if(this.actionForm.trainee_status == 'ended' && this.actionForm.trainee_evaluation == ''){
       this.toastr.warning('قم بتسجيل تقييم القسم للمتدرب !');
       this.checkSaveClick = false;
+    } else if(this.actionForm.trainee_status_description == ''){
+      this.toastr.warning('أدخل سبب الإيقاف !');
+      this.checkSaveClick = false;
     } else {
       this.http.post(this.authSer.pathApi + '/trace_trainee_movement', this.actionForm).subscribe(
         (responce) => {

+ 5 - 2
src/app/dashboard/Registration-trainee-movement/registration-trainee-movement-list/registration-trainee-movement-list.component.html

@@ -59,12 +59,15 @@
                 <td> {{data.specialization_name}}</td>
                 <td>{{data.specific_specialization}}</td>
                 <td> 
-                  {{data.status == 'pending' ? 'تحت الإجراء' 
+                  <!-- {{data.status == 'pending' ? 'تحت الإجراء' 
                   : data.status == 'accepted' ? 'مقبول' 
                   : data.status == 'replayed_opinion' ? 'رأي القسم'
                   : data.status == 'refused' ? 'مرفوض' 
                   : data.status == 'canceled' ? 'ملغي'
-                  : data.status == 'asked_for_opinion' ? 'طلب رأي القسم' : 'لايوجد '}}
+                  : data.status == 'asked_for_opinion' ? 'طلب رأي القسم' : 'لايوجد '}} -->
+                  {{data.trainee_status == 'stopped' ? 'إيقاف' : 
+                  data.trainee_status == 'ended' ? 'إنهاء' : 
+                  data.trainee_status == 'in_training' ? 'إستئناف التدريب' : ''}}
                 </td>
                 <td>{{data.university}}</td>
                 <td *ngIf="authSer.showEditBtn"><button type="button" class="btn btn-outline-secondary" (click)="onEdit(data.id)"><i class="fas fa-edit"></i></button></td>

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

@@ -84,7 +84,7 @@
               </div>
 
               <div class="col-6">
-                <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid">حفظ</button>
+                <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid || checkDisabledSave">حفظ</button>
                 <button type="button" class="btn btn-warning rightW" (click)="authSer.backFromEdit()">إلغاء</button>
               </div>
 

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

@@ -110,7 +110,11 @@ export class AddExternalAchievementComponent implements OnInit {
                 (error) => {
                   console.log(error);
                   this.checkDisabledSave = false;
-                  this.toastr.error(' خطأ في التعديل !');
+                  if(error.error['error'] == 'ranking number is already taken') {
+                    this.toastr.warning('لديك أربع إنجازات في الحاله فعال ، وتم حجز الترتيب رقم 3 لانجاز سابق !');
+                  } else {
+                    this.toastr.error(' خطأ في التعديل !');
+                  }
                 }
               );
             } else {
@@ -125,7 +129,11 @@ export class AddExternalAchievementComponent implements OnInit {
                 (error) => {
                   console.log(error);
                   this.checkDisabledSave = false;
-                  this.toastr.error('خطأ في الاضافه');
+                  if(error.error['error'] == 'ranking number is already taken') {
+                    this.toastr.warning('لديك أربع إنجازات في الحاله فعال ، وتم حجز الترتيب رقم 3 لانجاز سابق !');
+                  } else {
+                    this.toastr.error(' خطأ في التعديل !');
+                  }
                 }
               );
             }

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

@@ -169,10 +169,10 @@ export class AddExternalComponent implements OnInit {
           (error) => {
             console.log(error);
             this.checkSaveClick = false;
-            if(error.error['status'] == 'active status for only 6 records') {
-              this.toastr.warning('لقد تخطيت الحد الأقصي للخدمات ، قم بعدم تفعيل أو مسح أحدهم');
+            if(error.error['error'] == 'ranking number is already taken') {
+              this.toastr.warning('لقد تخطيت الحد الأقصي للخدمات الفعاله ، قم بعدم تفعيل أو مسح الخدمه التي لديها نفس الترتيب');
             } else {
-              this.toastr.error('خطأ في السيرفر ، ستتم المعالجه لاحقاً !');
+              this.toastr.error('خطأ في الحفظ ، ستتم المعالجه لاحقاً !');
             }
           }
         );
@@ -187,10 +187,10 @@ export class AddExternalComponent implements OnInit {
           (error) => {
             console.log(error);
             this.checkSaveClick = false;
-            if(error.error['status'] == 'active status for only 6 records') {
-              this.toastr.warning('لقد تخطيت الحد الأقصي للخدمات ، قم بعدم تفعيل أو مسح أحدهم');
+            if(error.error['error'] == 'ranking number is already taken') {
+              this.toastr.warning('لقد تخطيت الحد الأقصي للخدمات الفعاله ، قم بعدم تفعيل أو مسح الخدمه التي لديها نفس الترتيب');
             } else {
-              this.toastr.error('خطأ في السيرفر ، ستتم المعالجه لاحقاً !');
+              this.toastr.error('خطأ في الحفظ ، ستتم المعالجه لاحقاً !');
             }
           }
         );
@@ -215,7 +215,7 @@ export class AddExternalComponent implements OnInit {
           (error) => {
             console.log(error);
             this.checkSaveClick = false;
-            if(error.error['status'] == 'active status for only 6 records') {
+            if(error.error['error'] == 'ranking number is already taken') {
               this.toastr.warning('لقد تخطيت الحد الأقصي للخدمات ، قم بعدم تفعيل أو مسح أحدهم');
             } else {
               this.toastr.error('خطأ في السيرفر ، ستتم المعالجه لاحقاً !');
@@ -233,8 +233,8 @@ export class AddExternalComponent implements OnInit {
           (error) => {
             console.log(error);
             this.checkSaveClick = false;
-            if(error.error['status'] == 'active status for only 6 records') {
-              this.toastr.warning('لقد تخطيت الحد الأقصي للخدمات ، قم بعدم تفعيل أو مسح أحدهم');
+            if(error.error['error'] == 'ranking number is already taken') {
+              this.toastr.warning('لقد تخطيت الحد الأقصي للخدمات الفعاله ، قم بعدم تفعيل أو مسح الخدمه التي لديها نفس الترتيب');
             } else {
               this.toastr.error('خطأ في السيرفر ، ستتم المعالجه لاحقاً !');
             }

+ 5 - 0
src/app/dashboard/final-accreditation-of-trainees/final-accerditation-add/final-accerditation-add.component.css

@@ -261,6 +261,11 @@ select.ng-invalid{
     float: right;
 }
 
+.p {
+    text-align: right;
+    margin: 0 10px;
+}
+
 /* start media query style */
 
 @media(max-width: 767px){

+ 25 - 0
src/app/dashboard/final-accreditation-of-trainees/final-accerditation-add/final-accerditation-add.component.html

@@ -14,6 +14,17 @@
         <form (ngSubmit)="onSubmittedForm()" #f="ngForm">
           <div class="row">
             <div class="col-12">
+              <h2 class="title">معلومات الطلب</h2>
+              <div class="row">
+                <div class="wrapper" style="text-align:right">
+                  <p class="p">حاله الطلب :  {{ 
+                    formData.status == 'accepted' ? 'مقبول' 
+                    : formData.status == 'closed' ? 'مغلق' : 'N/A'}}</p>
+                    <p class="p" *ngIf="formData.status_description">  وصف الطلب : {{formData.status_description ? formData.status_description : 'لايوجد'}}</p>
+                </div>
+              </div>
+            </div>
+            <div class="col-12">
               <h2 class="title">المعلومات الشخصيه</h2>
               <div class="row">
                 <div class="wrapper">
@@ -195,6 +206,20 @@
                       </select>
                     </div>
                   </div>
+                  <div class="col-12 col-sm-12 col-md-4 col-lg-4">
+                    <div class="form-group">
+                      <label for="startData" style="float:right;">تاريخ بدايه التدريب</label>
+                      <input type="text" id="startData" class="form-control" name="start_date" ngModel [(ngModel)]="formData.start_date" [disabled]="disabledInput" required/>
+                    </div>
+                  </div>
+
+                  <div class="col-12 col-sm-12 col-md-4 col-lg-4">
+                    <div class="form-group">
+                      <label for="endDate" style="float:right;">تاريخ نهايه التدريب</label>
+                      <input type="text" id="endDate" class="form-control" name="end_date" ngModel [(ngModel)]="formData.end_date" [disabled]="disabledInput" required/>
+                    </div>
+                  </div>
+
                 </div>
               </div>
             </div>

+ 5 - 0
src/app/dashboard/final-accreditation-of-trainees/final-accerditation-add/final-accerditation-add.component.ts

@@ -61,6 +61,8 @@ export class FinalAccerditationAddComponent implements OnInit {
     status: '',
     organization_affiliated_with: '',
     department: '',
+    start_date: '',
+    end_date: ''
   }
 
   //user data object
@@ -183,6 +185,7 @@ export class FinalAccerditationAddComponent implements OnInit {
           console.log('get request by id', responce);
           this.formData.trainee = responce['data']['user'].id;
           this.formData.type = responce['data']['request'].type;
+          this.formData.status = responce['data']['request'].status;
           this.formData.specialization_name = responce['data']['request'].specialization_name;
           this.formData.specific_specialization = responce['data']['request'].specific_specialization;
           this.formData.level = responce['data']['request'].level;
@@ -193,6 +196,8 @@ export class FinalAccerditationAddComponent implements OnInit {
           this.formData.functional_number = responce['data']['request'].functional_number;
           this.formData.organization_affiliated_with = responce['data']['request'].organization_affiliated_with;
           this.formData.registration_number = responce['data']['request'].registration_number;
+          this.formData.start_date = responce['data']['request'].start_date;
+          this.formData.end_date = responce['data']['request'].end_date;
           this.userData.name = responce['data']['user'].name;
           this.userData.email = responce['data']['user'].email;
           this.userData.identity_number = responce['data']['user'].identity_number;

+ 2 - 0
src/app/dashboard/final-accreditation-of-trainees/final-accerditation-list/final-accerditation-list.component.html

@@ -53,6 +53,7 @@
               <tr>
                 <th> إسم المتدرب</th>
                 <th>إسم التخصص</th>
+                <th>إسم القسم</th>
                 <th>إسم التخصص الدقيق</th>
                 <th> الجامعه</th>
                 <th *ngIf="authSer.showEditBtn">تفاصيل المتدرب</th>
@@ -62,6 +63,7 @@
               <tr *ngFor="let data of dataList | paginate: { itemsPerPage: perPagePagenation, currentPage: currentPage, totalItems: count }; let i = index ">
                 <td>{{data.trainee_name}}</td>
                 <td> {{data.specialization_name}}</td>
+                <td>{{data.department_name ? data.department_name : '-'}}</td>
                 <td>{{data.specific_specialization}}</td>
                 <td>{{data.university}}</td>
                 <td *ngIf="authSer.showEditBtn"><button type="button" class="btn btn-outline-secondary" (click)="onEdit(data.id)"><i class="fas fa-edit"></i></button></td>

File diff suppressed because it is too large
+ 5 - 1
src/app/dashboard/final-trainee-report/final-trainee-report.component.html


+ 51 - 1
src/app/dashboard/final-trainee-report/final-trainee-report.component.ts

@@ -23,7 +23,57 @@ export class FinalTraineeReportComponent implements OnInit {
         <head>
           <title>الإعتماد النهائي للمتدرب</title>
           <style>
-          //........Customized style.......
+            //........Customized style.......
+            .row{
+              display: flex;
+              flex-wrap: wrap;
+              margin-right: -15px;
+              margin-left: -15px;
+            }
+            .col-6{
+              float: right;
+              flex: 0 0 50%;
+              max-width: 50%
+            }
+            .col-12{
+              flex-basis: 0;
+              flex-grow: 1;
+              max-width: 100%;
+            }
+            table {
+              font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+              border-collapse: collapse;
+              width: 100%;
+              direction: rtl;
+              text-align: center;
+              
+            }
+            
+            table td, table th {
+              border: 1px solid #ddd;
+              padding: 8px;
+            }
+            
+            table tr:nth-child(even){background-color: #f2f2f2;}
+            
+            table tr:hover {background-color: #ddd;}
+            
+            table th {
+              padding-top: 12px;
+              padding-bottom: 12px;
+              text-align: center;
+              background-color: #4CAF50;
+              color: white;
+            }
+            .rightLogo {
+              text-align: left;
+              direction: rtl;
+            }
+
+            .printSpan {
+              direction: ltr;
+              text-align: right;
+            }
           </style>
         </head>
     <body onload="window.print();window.close()">${printContents}</body>

+ 2 - 2
src/app/dashboard/model-vehicle/model-vehicle-add/model-vehicle-add.component.html

@@ -4,7 +4,7 @@
       <div class="col-12">
         <ul class="list-unstyled titileLi-w">
           <li class="headingText-w">خدمه الحركه  </li>
-          <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">  تسجبل موديلات المركبات</li>
+          <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">  تسجبل أنواع المركبات</li>
           <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typePage}} </li>
         </ul>
       </div>
@@ -19,7 +19,7 @@
             
             <div class="col-12 col-sm-12 col-md-4">
              <div class="form-group">
-               <label style="float: right; margin-right: 5px">النوع</label>
+               <label style="float: right; margin-right: 5px">الصنف</label>
                  <select class="form-control" name="vehicle_type_id" [ngModel]="formData.vehicle_type_id" required>
                    <option *ngFor="let type of vehicle_types" [value]="type.id">{{type.name}}</option>
                 </select>

+ 8 - 14
src/app/dashboard/model-vehicle/model-vehicle-list/model-vehicle-list.component.html

@@ -4,7 +4,7 @@
     <div class="col-12">
       <ul class="list-unstyled titileLi-w">
         <li class="headingText-w">خدمه المركبات  </li>
-        <li class="headingText-w activeLi-w" style="margin-right:5px"> تسجيل موديلات المركبات</li>
+        <li class="headingText-w activeLi-w" style="margin-right:5px"> تسجيل أنواع المركبات</li>
       </ul>
     </div>
   </div>
@@ -17,7 +17,7 @@
       </div>
       <div class="col-12 col-sm-12 col-md-6 col-lg-6">
         <div class="form-group">
-          <input type="text" placeholder="البحث (باسم الموديل)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
+          <input type="text" placeholder="البحث (باسم النوع)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
           <hr>
         </div>
       </div>
@@ -27,22 +27,22 @@
         <div class="col-12 col-sm-12 col-md-12 col-lg-12">
           <div class="form-group" style="float:right;">
             <span class="spanSelect-w" style="margin-right:10px;">
+                من العناصر يتم عرضها
               <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
                 <option value="5">5</option>
                 <option value="10">10</option>
                 <option value="15">15</option>
                 <option value="20">20</option>
               </select>
-              من العناصر يتم عرضها
             </span>
           </div>
           <div class="form-group" style="float: right; margin: 0 20px;">
             <span class="spanSelect-w" >
+              النوع
               <select [ngModel]="filtterStatus" style="width:134px;" class="form-control selectButton-w" (input)="onGetValueFiltter($event)">
                   <option value="all"> الكل </option>
                 <option *ngFor="let type of vehicle_types" [value]="type.id">{{type.name}}</option>
               </select>
-                 النوع
             </span>
           </div>
         </div>
@@ -58,27 +58,21 @@
               <input type="checkbox" class="custom-control-input" [(ngModel)]="selectedAll" (change)="selectAll();" id="customCheck" name="example1">
             </div>
           </th>
-          <th>نوع المركبة</th>
-          <th>إسم الموديل</th>
+          <th>صنف المركبة</th>
+          <th>إسم النوع</th>
           <th>الحاله</th>
           <th *ngIf="authSer.showEditBtn">تعديل</th>
         </tr>
       </thead>
       <tbody>
-        <tr *ngFor="let data of dataList | paginate: { itemsPerPage: perPagePagenation, currentPage: currentPage, totalItems: count }; let i = index ">
+        <tr *ngFor="let data of mergedData | paginate: { itemsPerPage: perPagePagenation, currentPage: currentPage, totalItems: count }; let i = index ">
           
           <td>
             <div class="custom-control custom-checkbox centerIneerItem">
               <input type="checkbox" class="custom-control-input" id="{{data.id}}" [(ngModel)]="data.selected" [value]='data' (change)="checkIfAllSelected();">
             </div>
           </td>
-          <td>
-            {{data.vehicle_type_id == '1' ? 'سيارات اسعاف' 
-            : data.vehicle_type_id == '2' ? 'سيارات وانيت' 
-            : data.vehicle_type_id == '5' ? 'سياره مرضي' 
-            : data.vehicle_type_id == '6' ? 'سياره إسعاف' 
-            : 'not found'}} 
-          </td>
+          <td>{{data.vehicle_type_name}}</td>
           <td>{{data.name}}</td>
           <td>{{data.status == '0' ? 'غير فعال' : data.status == '1' ? ' فعال' : 'not found'}}</td>
         <td *ngIf="authSer.showEditBtn"><button type="button" class="btn btn-outline-secondary" (click)="onEdit(data.id)"><i class="fas fa-edit"></i></button></td>

+ 29 - 2
src/app/dashboard/model-vehicle/model-vehicle-list/model-vehicle-list.component.ts

@@ -29,6 +29,8 @@ export class ModelVehicleListComponent implements OnInit {
   dataTableNumber: number = 5;
   pages = [];
   vehicle_types:any[] = [];
+  mergedData = []
+
 
   constructor(private route: ActivatedRoute,
     private userSer: UserService,
@@ -107,14 +109,36 @@ export class ModelVehicleListComponent implements OnInit {
         this.count = response['count'];
         this.perPagePagenation = response['per_page'];
         console.log('xxx', this.dataList)
+        this.mergeToGether()
+
       },
       (error) => {
         console.log(error);
       }
     )
-
+    
   }
 
+  mergeToGether() {
+
+    for (let i = 0, n = this.dataList.length ; i < n ; i++) {
+          for(let ii = 0, m = this.vehicle_types.length; ii < m ; ii++ ){
+            if (this.dataList[i].vehicle_type_id == this.vehicle_types[ii].id) {
+              this.mergedData.push({
+                id: this.dataList[i].id,
+                name: this.dataList[i].name,
+                status: this.dataList[i].status,
+                vehicle_type_id: this.dataList[i].vehicle_type_id,
+                vehicle_type_name: this.vehicle_types[ii].name
+                
+              })
+              console.log('done');
+            }
+          }
+    }
+    console.log(this.mergedData);
+    
+  }
     //make all checkbox of user checked
     selectAll() {
       for (var i = 0; i < this.dataList.length; i++) {
@@ -261,8 +285,11 @@ export class ModelVehicleListComponent implements OnInit {
                 );
               },
               (error) => {
-                console.log(error);
+                // console.log(error);
                 this.spinner.hide();
+                if(error.error.status == 'vehicle type id is already taken'){
+                  this.toastr.warning(' لا يمكن مسح  هذا النوع')
+                }
                 },
               )
           );

+ 1 - 1
src/app/dashboard/register-movement-vehicle/register-movement-vehicle-add/register-movement-vehicle-add.component.html

@@ -19,7 +19,7 @@
 
               <div class="col-12 col-sm-12 col-md-4">
                 <div class="form-group">
-                  <label for="vehicle_type_id" style="float: right; margin-right: 5px">نوع المركبه</label>
+                  <label for="vehicle_type_id" style="float: right; margin-right: 5px">صنف المركبه</label>
                   <select class="form-control" name="vehicle_type_id" (input)="onChangeVehicleType($event)" [disabled]="checkEdit" [(ngModel)]="formData.vehicle_type_id" required>
                     <option *ngFor="let type of vehicle_types" [value]="type.id">{{type.name}}</option>
                   </select>

+ 17 - 3
src/app/dashboard/register-movement-vehicle/register-movement-vehicle-add/register-movement-vehicle-add.component.ts

@@ -282,8 +282,15 @@ export class RegisterMovementVehicleAddComponent implements OnInit {
             },
             (error) => {
               console.log(error);
-              this.toastr.error('خطأ في الخادم ، حاول لاحقاً');
+             
               this.checkSaveclick = false;
+              console.log(error.error.error);
+              if(error.error.error == 'start_mileage_recording can not be greater than end_mileage_recording'){
+                this.toastr.warning('يجب ان يكون عدد كيلو متر البداية اقل من النهاية')
+              }else{
+                this.toastr.error('خطأ في الخادم ، حاول لاحقاً');
+              }
+
             }
           );
         }
@@ -313,9 +320,16 @@ export class RegisterMovementVehicleAddComponent implements OnInit {
               console.log(this.vehicleForm.value['phone'].length);
               if(this.vehicleForm.value['phone'].length < 10) {
                 this.toastr.warning('رقم الجوال يجب أن يكون مكون 10 أرقام')
-              } else {
-                this.toastr.error('خطأ في الخادم ، برجاء المحاوله لاحقا');
+                
+              }else if(error.error.error == 'start_mileage_recording can not be greater than end_mileage_recording'){
+                this.toastr.warning('يجب ان يكون عدد كيلو متر البداية اقل من النهاية')
+              }else{
+                this.toastr.error('خطأ في الخادم ، حاول لاحقاً');
               }
+
+          
+             
+              
             }
           );
         }

+ 3 - 3
src/app/dashboard/register-movement-vehicle/register-movement-vehicle-list/register-movement-vehicle-list.component.html

@@ -2,8 +2,8 @@
     <div class="row">
       <div class="col-12">
           <ul class="list-unstyled titileLi-w">
-            <li class="headingText-w">خدمه التدريب</li>
-            <li class="headingText-w activeLi-w" style="margin-right:5px">تسجيل حركه المتدرب</li>
+            <li class="headingText-w">خدمه الحركة</li>
+            <li class="headingText-w activeLi-w" style="margin-right:5px">تسجيل حركة المركبة</li>
           </ul>
       </div>
     </div>
@@ -50,7 +50,7 @@
               </th>
             <th> إسم الموظف</th>
             <th>الجوال</th>
-            <th> نوع المركبه</th>
+            <th> صنف المركبه</th>
             <th>رقم اللوحه</th>
             <th *ngIf="authSer.showEditBtn">تعديل</th>
           </tr>

+ 4 - 4
src/app/dashboard/registration-vehicle/registration-vehicle-add/registration-vehicle-add.component.html

@@ -4,7 +4,7 @@
       <div class="col-12">
         <ul class="list-unstyled titileLi-w">
           <li class="headingText-w">خدمه الحركه  </li>
-          <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">  تعريف أنواع المركبات</li>
+          <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">  تعريف أصناف المركبات</li>
           <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typePage}} </li>
         </ul>
       </div>
@@ -19,7 +19,7 @@
           
             <div class="col-12 col-sm-12 col-md-4">
               <div class="form-group">
-                <label for="vehicle_type_id" style="float: right; margin-right: 5px">نوع المركبه</label>
+                <label for="vehicle_type_id" style="float: right; margin-right: 5px">صنف المركبه</label>
                 <select class="form-control" name="vehicle_type_id" [ngModel]="formData.vehicle_type_id" (input)="onChangeVehicleType($event)" required>
                   <option *ngFor="let type of vehicle_types" [value]="type.id">{{type.name}}</option>
                 </select>
@@ -28,7 +28,7 @@
 
             <div class="col-12 col-sm-12 col-md-4">
               <div class="form-group">
-                <label for="vehicle_model_id" style="float: right; margin-right: 5px">إسم الموديل <span class="spanReqired-w">*</span></label>
+                <label for="vehicle_model_id" style="float: right; margin-right: 5px">إسم نوع <span class="spanReqired-w">*</span></label>
                 <select class="form-control" name="vehicle_model_id" [ngModel]="formData.vehicle_model_id" required>
                   <option *ngFor="let nameModel of modelNames" [value]="nameModel.id">{{nameModel.name}}</option>
                 </select>
@@ -37,7 +37,7 @@
             
             <div class="col-12 col-sm-12 col-md-4">
               <div class="form-group">
-                <label for="sub_name" style="float: right; margin-right: 5px"> إسم الموديل الفرعي</label>
+                <label for="sub_name" style="float: right; margin-right: 5px"> إسم نوع الفرعي</label>
                 <input type="text" class="form-control" id="sub_name" name="sub_name" placeholder="الأسم" ngModel [ngModel]="formData.sub_name" #name="ngModel"/>
               </div>
             </div>

+ 4 - 4
src/app/dashboard/registration-vehicle/registration-vehicle-list/registration-vehicle-list.component.html

@@ -27,22 +27,22 @@
       <div class="col-12 col-sm-12 col-md-12 col-lg-6">
         <div class="form-group" style="float: right;">
           <span class="spanSelect-w" style="margin-right:10px;">
+              من العناصر يتم عرضها
             <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
               <option value="5">5</option>
               <option value="10">10</option>
               <option value="15">15</option>
               <option value="20">20</option>
             </select>
-            من العناصر يتم عرضها
           </span>
         </div>
         <div class="form-group">
           <span class="spanSelect-w" style="float: right; margin: 0 20px;">
+              النوع
             <select [ngModel]="filtterStatus" style="width:134px;" class="form-control selectButton-w" (input)="onGetValueFiltter($event)">
                 <option  value="all">الكل</option>
               <option *ngFor="let type of vehicle_types" [value]="type.id">{{type.name}}</option>
             </select>
-                النوع
           </span>
         </div>
       </div>
@@ -56,8 +56,8 @@
               <input type="checkbox" class="custom-control-input" [(ngModel)]="selectedAll" (change)="selectAll();" id="customCheck" name="example1">
             </div>
           </th>
-          <th>نوع المركبه</th>
-          <th>إسم الموديل</th>
+          <th>صنف المركبه</th>
+          <th>إسم نوع</th>
           <th>رقم اللوحه</th>
           <th>اللون</th>
           <th>الحاله</th>

+ 24 - 0
src/app/dashboard/reivew-trainee-data/review-trainee-add/review-trainee-add.component.css

@@ -255,6 +255,30 @@ select.ng-invalid{
     color: green;
 }
 
+.department-opinion {
+    text-align: right;
+    font-size: 18px;
+    margin: 10px;
+}
+
+
+.saveHint {
+    width: 100%;
+    text-align: right;
+    display: block;
+}
+
+.department_detail {
+    color: #252525;
+    text-align: right;
+    margin: 20px;
+}
+
+.span-detail{
+    color: blue;
+    font-size: 15px;
+}
+
 /* start media query style */
 
 @media(max-width: 767px){

+ 23 - 0
src/app/dashboard/reivew-trainee-data/review-trainee-add/review-trainee-add.component.html

@@ -302,10 +302,33 @@
                   </div>
                 </div>
 
+                <div class="col-12" *ngIf="showSaveHint">
+                  <p class="saveHint">برجاء الضغط علي زر الحفظ لإتمام عمليه حفظ البيانات</p>
+                </div>
+
               </div>
             </div>
           </div>
 
+          <div class="col-12">
+            <h2 class="title">معلومات القسم المناسب</h2>
+            <div class="row">
+              <div class="wrapper">
+                <p class="department_detail">إسم القسم :  <span class="span-detail">{{proper_department_name}}</span></p>
+                <p class="department_detail">رأي القسم :  <span class="span-detail" [innerHTML]="department_opinion ? department_opinion : 'القسم لم يبدي رأيه إلي الأن'"></span></p>
+                <p class="department_detail">حاله المتدرب بالنسبه للقسم :  <span class="span-detail">
+                    {{department_status == 'pending' ? 'تحت الإجراء' 
+                          : department_status == 'accepted' ? 'مقبول' 
+                          : department_status == 'replayed_opinion' ? 'رأي القسم'
+                          : department_status == 'refused' ? 'مرفوض' 
+                          : department_status == 'canceled' ? 'ملغي'
+                          : department_status == 'asked_for_opinion' ? 'طلب رأي القسم'
+                          : 'لم يتم تسجيل حاله الطلب'}}
+                  </span>
+                </p>
+              </div>
+            </div>
+          </div>
 
             <div class="col-12">
               <button type="submit" class="btn btn-success rightW" [disabled]="!f.valid || checkSaveClick">حفظ</button>

+ 12 - 5
src/app/dashboard/reivew-trainee-data/review-trainee-add/review-trainee-add.component.ts

@@ -28,13 +28,18 @@ export class ReviewTraineeAddComponent implements OnInit {
   typeLink:string = '';
   userId: number;
   checkSaveClick:boolean = false; //to make save button is disabled when click save 
-  disabledInput: boolean = false; //to make button dsabled in create mode 
+  disabledInput: boolean = true; //to make button dsabled in create mode 
   showEditField: boolean = false; //to show the field in edit mode 
   showRefusedCause: boolean = false; //to show the cause of refused when ststus is refused
   editMode: boolean = false; //true in edit mode 
   showPersonalData: boolean = false;
+  showSaveHint:boolean = false;
   reportId: number;
   departmentNameOpinion: string = "";
+  department_opinion: string = "";
+  department_status: string = "";
+  proper_department_name: string = "";
+
   attachments_ids = []; //for edit mode;
 
   countries: any[] = [];
@@ -194,6 +199,9 @@ export class ReviewTraineeAddComponent implements OnInit {
               this.chosenDepartments[i] = responce['data']['request'].departments[i];
               if(this.chosenDepartments[i].is_confirmed == 1){
                 this.formData.department4 = responce['data']['request'].departments[i].department_id;
+                this.department_opinion = responce['data']['request'].departments[i].department_opinion;
+                this.department_status = responce['data']['request'].departments[i].trainee_status;
+                this.proper_department_name = responce['data']['request'].departments[i].department_name;
               }
               if(this.chosenDepartments[i].asked_for_opinion == '1') {
                 this.departmentNameOpinion = this.chosenDepartments[i].department_name;
@@ -260,23 +268,22 @@ export class ReviewTraineeAddComponent implements OnInit {
         this.formData.status = typeStatus;
         this.formData.status_description = '';
         this.toastr.success('تم تسجيل الحاله مقبول');
+        this.showSaveHint = true;
         this.showRefusedCause = false;
       } else if(typeStatus == 'refused') {
         statusData.status_description = this.formData.status_description;
         console.log( statusData.status_description);
         this.formData.status = typeStatus;
         this.toastr.error('تم تسجيل الحاله بالرفض ');
+        this.showSaveHint = true;
       } else if(typeStatus == 'asked_for_opinion') {
         this.formData.status = typeStatus;
         this.showRefusedCause = false;
+        this.showSaveHint = true;
         this.formData.status_description = '';
         this.toastr.warning('تم تسجيل الحاله طلب رأي ');
       }
 
-
-
-    
-
       console.log ('status data', statusData);
 
       this.http.post(this.authSer.pathApi + '/change_reuqest_status', statusData).subscribe(

+ 7 - 2
src/app/dashboard/reivew-trainee-data/review-trainee-data-list/review-trainee-data-list.component.html

@@ -26,7 +26,7 @@
       
   
       <div class="row">
-        <div class="col-12 col-sm-12 col-md-12 col-lg-6">
+        <div class="col-12 col-sm-12 col-md-12 col-lg-12">
           <div class="form-group">
             <span class="spanSelect-w">
               <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
@@ -50,13 +50,18 @@
                 <option value="replayed_opinion">رأي القسم</option>
               </select>
             </span>
+            <span class="spanSelect-w">
+              / بيانات القسم المراد عرضه 
+              <select [ngModel]="filtterDepartmentVal" class="form-control selectButton-w" (input)="onFiltterDepartment($event)">
+              </select>
+            </span>
           </div>
         </div>
         <div class="col-12 col-sm-12 col-md-12 col-lg-12"  style="margin-top:20px;">
           
         </div>
       </div>
-  
+
       <div class="row" *ngIf="dataList.length == 0">
         <div class="col-12">
           <h2>لايوجد بيانات لعرضها</h2>

+ 159 - 126
src/app/dashboard/reivew-trainee-data/review-trainee-data-list/review-trainee-data-list.component.ts

@@ -39,6 +39,7 @@ export class ReviewTraineeDataListComponent implements OnInit {
     dataTableNumber: number = 5;
     viewTableData: string = 'all';
     serviceName: string = '';
+    filtterDepartmentVal: string = 'all';
     pages = [];
 
   
@@ -113,24 +114,27 @@ export class ReviewTraineeDataListComponent implements OnInit {
     );
 
      //get list data 
-     this.dashBoardService.getListData(this.pageId, this.currentPage ,this.dataTableNumber).subscribe(
-      (responce) => {
-        console.log(responce);
-        this.dataList = responce['requests'];
+     this.getListData(this.currentPage, 
+      this.dataTableNumber , 
+      this.viewTableData, 
+      this.filtterDepartmentVal, 
+      '').subscribe(
+       (response) => {
+        console.log(response);
+        this.dataList = response['requests'];
         if(this.dataList.length == 0) {
           this.toastr.warning('القائمه فارغه من الطلبات ');
         }
-        this.count = responce['count'];
-        this.perPagePagenation = responce['per_page'];
+        this.count = response['count'];
+        this.perPagePagenation = response['per_page'];
         console.log('evennnnts', this.dataList);
         this.spinner.hide();
-      },
-      (error) => {
-        console.log(error);
-        this.spinner.hide();
-      }
-    );
-    
+       },
+       (error) => {
+         console.log('error list =>', error);
+         this.spinner.hide();
+       }
+     )  
   }
 
   //make all checkbox of user checked 
@@ -152,19 +156,27 @@ export class ReviewTraineeDataListComponent implements OnInit {
     console.log(data.target.value);
     const dataSearch = data.target.value;     
     this.currentPage = 1;
-    this.dashBoardService.getDataUSerSearchBar(dataSearch, this.pageId, this.currentPage, this.dataTableNumber).subscribe(
-      (responce) => {
-        console.log(responce);
-        this.dataList = responce['requests'];
-        this.count = responce['count'];
-        this.perPagePagenation = responce['per_page'];
-        console.log('filtter count', this.count);
-        console.log('filtter perPagePAgenation', this.perPagePagenation);
-      },
-      (error) => {
-        console.log(error)
-      }
-    );
+    this.filtterSearch(this.currentPage, 
+      this.dataTableNumber , 
+      this.viewTableData, 
+      this.filtterDepartmentVal, 
+      dataSearch).subscribe(
+        (response) => {
+          console.log(response);
+          this.dataList = response['requests'];
+          if(this.dataList.length == 0) {
+            this.toastr.warning('القائمه فارغه من الطلبات ');
+          }
+          this.count = response['count'];
+          this.perPagePagenation = response['per_page'];
+          console.log('evennnnts', this.dataList);
+          this.spinner.hide();
+         },
+         (error) => {
+           console.log('error list =>', error);
+           this.spinner.hide();
+         }
+      )
   };
 
   //change page 
@@ -172,22 +184,29 @@ export class ReviewTraineeDataListComponent implements OnInit {
     this.spinner.show();
     this.currentPage = pagenationNumber;
     this.dataList = [];
-    //console.log(pagenationNumber);
-    //console.log(this.pageId);
-    this.dashBoardService.getListData(this.pageId, pagenationNumber, this.dataTableNumber).subscribe(
-      (responce) => {
-        console.log(responce);
-        this.dataList = responce['requests'];
-        this.count = responce['count'];
-        this.perPagePagenation = responce['per_page'];
-        console.log(this.dataList);
-        this.spinner.hide();
-      },
-      (error) => {
-        console.log(error);
+    //get list data 
+    this.getListData(this.currentPage, 
+      this.dataTableNumber , 
+      this.viewTableData, 
+      this.filtterDepartmentVal, 
+      '').subscribe(
+       (response) => {
+        console.log(response);
+        this.dataList = response['requests'];
+        if(this.dataList.length == 0) {
+          this.toastr.warning('القائمه فارغه من الطلبات ');
+        }
+        this.count = response['count'];
+        this.perPagePagenation = response['per_page'];
+        console.log('evennnnts', this.dataList);
         this.spinner.hide();
-      }
-    );
+       },
+       (error) => {
+         console.log('error list =>', error);
+         this.spinner.hide();
+       }
+     )
+
   }
 
 //determine the list count from select element 
@@ -195,109 +214,123 @@ onGetValue(event) {
   this.spinner.show();
   this.dataList = [];
   this.dataTableNumber = event.target.value;
-  this.dashBoardService.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
-    (responce) => {
-      console.log(responce);
-      this.dataList = responce['requests'];
-      this.count = responce['count'];
-      this.perPagePagenation = responce['per_page'];
+   //get list data 
+   this.getListData(this.currentPage, 
+    this.dataTableNumber , 
+    this.viewTableData, 
+    this.filtterDepartmentVal, 
+    '').subscribe(
+     (response) => {
+      console.log(response);
+      this.dataList = response['requests'];
       if(this.dataList.length == 0) {
-        this.toastr.warning('لا يوجد بيانات لعرضها');
+        this.toastr.warning('القائمه فارغه من الطلبات ');
       }
+      this.count = response['count'];
+      this.perPagePagenation = response['per_page'];
+      console.log('evennnnts', this.dataList);
       this.spinner.hide();
-    },
-    (error) => {
-      console.log(error);
-      this.spinner.hide();
-    }
-  );
+     },
+     (error) => {
+       console.log('error list =>', error);
+       this.spinner.hide();
+     }
+   )
 };
 
 onFiltterChosen(event) {
   this.spinner.show();
   this.dataList = [];
   console.log(event.target.value);
-  console.log(this.authSer.pathApi + '/page_list/' +this.pageId + '/' + this.currentPage + '/' + this.dataTableNumber + '/' + event.target.value);
-  this.http.get(this.authSer.pathApi + '/page_list/' +this.pageId + '/' + this.currentPage + '/' + this.dataTableNumber + '/' + event.target.value).subscribe(
-    (responce) => {
-      console.log(responce);
-      console.log(responce);
-      this.dataList = responce['requests'];
+  this.viewTableData = event.target.value;
+  //get list data 
+  this.getListData(this.currentPage, 
+    this.dataTableNumber , 
+    this.viewTableData, 
+    this.filtterDepartmentVal, 
+    '').subscribe(
+     (response) => {
+      console.log(response);
+      this.dataList = response['requests'];
       if(this.dataList.length == 0) {
-        this.toastr.warning('لا يوجد بيانات لعرضها');
+        this.toastr.warning('القائمه فارغه من الطلبات ');
       }
-      this.count = responce['count'];
-      this.perPagePagenation = responce['per_page'];
+      this.count = response['count'];
+      this.perPagePagenation = response['per_page'];
+      console.log('evennnnts', this.dataList);
       this.spinner.hide();
-    },
-    (error) => {
-      console.log(error);
-    }
-  )
+     },
+     (error) => {
+       console.log('error list =>', error);
+       this.spinner.hide();
+     }
+   )
 }
-    
-// onDelete() {
-//   for(let i = 0; i < this.dataList.length; i++) {
-//     if(this.dataList[i].selected == true) {
-//       this.dataListIds.push(this.dataList[i].id);
-//     }
-//   }
 
-//   console.log(this.dataListIds);
 
-//   if(this.dataListIds.length > 0) {
-//     const dialogRef = this.modal.alert()
-//     .size('sm')
-//     .showClose(true)
-//     .title('تأكيد الحذف')
-//     .body(`
-//         <h4>هل ترغب في حذف العناصر المحدده ؟ </h4>
-//         `)
-//     .open();
-//     dialogRef.result
-//     .then( result =>  
-//       this.dashBoardService.deleteItem(this.dataListIds, this.pageId).subscribe(
-//         (responce) => {
-//           console.log(responce);
-//           this.toastr.success('تم الحذف');
-//           this.spinner.show();
-//           this.dataList = [];
-//           this.dashBoardService.getListData(this.pageId, this.currentPage, this.dataTableNumber).subscribe(
-//             (responce) => {
-//               console.log(responce);
-//               this.dataList = responce['requests'];
-//               this.count = responce['count'];
-//               this.perPagePagenation = responce['per_page'];
-//               this.spinner.hide();
-//             },
-//             (error) => {
-//               console.log(error);
-//               this.spinner.hide();
-//             }
-//           );
-//         },
-//         (error) => {
-//           this.toastr.success('يوجد خطأ إنتظر قليلا وأعد المحاوله ');
-//           console.log(error);
-//           this.spinner.hide();
-//         },
-//       )
-//     );
-//   } else {
-//     this.toastr.warning('لم يتم إختيار أي عنصر للمسح !');
-//   }
-// };
-  
-//add function
-onAdd() {
-  console.log('service/' + this.userLoginId + '/' + this.serviceId + '/reviewTraineeData/add');
-  this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/reviewTraineeData/add']);
+onFiltterDepartment(event) {
+  console.log(event.target.value);
+  this.filtterDepartmentVal = event.target.value;
+   //get list data 
+   this.getListData(this.currentPage, 
+    this.dataTableNumber , 
+    this.viewTableData, 
+    this.filtterDepartmentVal, 
+    '').subscribe(
+     (response) => {
+      console.log(response);
+      this.dataList = response['requests'];
+      if(this.dataList.length == 0) {
+        this.toastr.warning('القائمه فارغه من الطلبات ');
+      }
+      this.count = response['count'];
+      this.perPagePagenation = response['per_page'];
+      console.log('evennnnts', this.dataList);
+      this.spinner.hide();
+     },
+     (error) => {
+       console.log('error list =>', error);
+       this.spinner.hide();
+     }
+   )
 }
 
-//edit function
+  
+  //add function
+  onAdd() {
+    console.log('service/' + this.userLoginId + '/' + this.serviceId + '/reviewTraineeData/add');
+    this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/reviewTraineeData/add']);
+  }
+
+  //edit function
   onEdit(editNewID) {
-  this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'reviewTraineeData/edit/' + editNewID]);
-}
+    this.router.navigate(['service/' + this.userLoginId + '/' + this.serviceId + '/' + 'reviewTraineeData/edit/' + editNewID]);
+  }
+
+  //function get list 
+  getListData(currentPage: number, per_page: number, status: string, department: string, keySearch: string) {
+    return this.http.get(this.authSer.pathApi + '/training_requests_list/' 
+    + currentPage + '/' 
+    + per_page + '/' 
+    + status + '/' 
+    + department);
+  }
+
+  //filtter search function
+  filtterSearch(currentPage: number, per_page: number, status: string, department: string, keySearch: string) {
+    console.log(this.authSer.pathApi + '/training_requests_list/' 
+    + this.currentPage + '/' 
+    + this.dataTableNumber + '/' 
+    + this.viewTableData + '/' 
+    + this.filtterDepartmentVal + '/' + keySearch);
+
+    return this.http.get(this.authSer.pathApi + '/training_requests_list/' 
+    + currentPage + '/' 
+    + per_page + '/' 
+    + status + '/' 
+    + department + '/' 
+    + keySearch);
+  }
     
 
 }

+ 4 - 4
src/app/dashboard/reports-existing-vehicles/existing-report/existing-report.component.html

@@ -16,7 +16,7 @@
         <div class="row">
           <div class="col-12 col-sm-12 col-md-4">
             <div class="form-group">
-              <label style="float: right;margin-right: 5px">نوع المركبه</label>
+              <label style="float: right;margin-right: 5px">صنف المركبه</label>
               <select class="form-control" (input)="typeVehicle($event)">
                 <option>أختر نوع المركبه</option>
                 <option class="form-control" *ngFor="let type of vehicle_types" name="type" [value]="type.id">{{type.name}}</option>
@@ -25,7 +25,7 @@
           </div>
           <div class="col-12 col-sm-12 col-md-4" *ngIf="vehicleTypeId">
             <div class="form-group">
-              <label style="float: right;margin-right: 5px">نوع الموديل</label>
+              <label style="float: right;margin-right: 5px"> النوع</label>
               <select class="form-control" (input)="getReport($event)">
                 <option>أختر نوع الموديل</option>
                 <option value="all"> الكل</option>
@@ -51,8 +51,8 @@
             <table class="table table-bordered">
                 <thead class="headBackground-w">
                   <tr>
-                    <th>نوع المركيه</th>
-                    <th>موديل المركبه</th>
+                    <th>صنف المركيه</th>
+                    <th>نوع المركبه</th>
                     <th>رقم اللوحه</th>
                     <th>الحاله</th>
                     <th>رقم الهيكل</th>

+ 1 - 33
src/app/dashboard/section-review-for-trainee/section-review-trainee-add/section-review-trainee-add.component.html

@@ -195,34 +195,6 @@
                       <input type="text" id="field" placeholder="الجهه التابع لها المتدرب" class="form-control" name="organization_affiliated_with" ngModel [(ngModel)]="formData.organization_affiliated_with" [disabled]="disabledInput" required/>
                     </div>
                   </div>
-
-                  <!-- <div class="col-12 col-sm-12 col-md-4 col-lg-4">
-                    <div class="form-group">
-                      <label for="department1" style="float:right;">القسم الأول</label>
-                      <select class="form-control selectStyle-w" id="department1" name="department1" (input)="changeDepartment($event , 1)" [(ngModel)]="formData.department1" [disabled]="disabledInput">
-                        <option *ngFor="let department of departments" [value]="department.id">{{department.name}}</option>
-                        <option [value]="2001">حذف</option>
-                      </select>
-                    </div>
-                  </div>
-                  <div class="col-12 col-sm-12 col-md-4 col-lg-4">
-                    <div class="form-group">
-                      <label for="department2" style="float:right;">القسم الثاني</label>
-                      <select class="form-control selectStyle-w" id="department2" name="department2" (input)="changeDepartment($event , 2)" [(ngModel)]="formData.department2" [disabled]="disabledInput">
-                        <option *ngFor="let department of departments" [value]="department.id">{{department.name}}</option>
-                        <option [value]="2002">حذف</option>
-                      </select>
-                    </div>
-                  </div>
-                  <div class="col-12 col-sm-12 col-md-4 col-lg-4">
-                    <div class="form-group">
-                      <label for="department3" style="float:right;">القسم الثالث</label>
-                      <select class="form-control selectStyle-w" id="department3" name="department3" (input)="changeDepartment($event , 3)" [(ngModel)]="formData.department3" [disabled]="disabledInput">
-                        <option *ngFor="let department of departments" [value]="department.id">{{department.name}}</option>
-                        <option [value]="2003">حذف</option>
-                      </select>
-                    </div>
-                  </div> -->
                 </div>
               </div>
             </div>
@@ -236,11 +208,7 @@
                 </div>
 
                 <div class="wrapper" *ngIf="files.length > 0">
-                  
-                  <!-- <div class="col-12">
-                    <button type="button" class="btn btn-default" (click)="plusImage()" style="margin:20px 0; float:right;">إضافه مرفق</button>
-                  </div> -->
-
+              
                   <table class="table table-bordered">
                     <thead class="headBackground-w">
                       <tr>

+ 1 - 1
src/app/dashboard/section-review-for-trainee/section-review-trainee-add/section-review-trainee-add.component.ts

@@ -289,7 +289,7 @@ export class SectionReviewTraineeAddComponent implements OnInit {
   //when click in start trianning
   beginTrainning() {
     this.actionConfirmedForm.in_training = 1;
-    this.toastr.success('لقد تم تسجيل البدأ ');
+    this.toastr.success('لقد تم تسجيل البدأ ، من فضلك أضغط حفظ لإكمال العمليه ');
   }
 
 

+ 1 - 1
src/app/dashboard/section-review-for-trainee/section-review-trainee-list/section-review-trainee-list.component.html

@@ -26,6 +26,7 @@
 
           <div class="form-group" style="float:right; margin:0 10px;">
             <span class="spanSelect-w">
+                / حاله الطلب 
               <select [ngModel]="defaultValueFiltter" class="form-control selectButton-w" (input)="onFiltterChosen($event)" style="width:200px;">
                 <option value="all">الكل</option>
                 <option value="asked_for_opinion">طلبات مطلوب الرأي بها</option>
@@ -33,7 +34,6 @@
                 <option value="stopped">الطلبات الموقوفه</option>
                 <option value="ended">الطلبات المنتهيه</option>
               </select>
-              حاله الطلب
             </span>
           </div>
 

+ 7 - 2
src/app/dashboard/supervisor/supervisor-list/supervisor-list.component.ts

@@ -239,12 +239,17 @@ export class SupervisorListComponent implements OnInit {
                   },
                   (error) => {
                     console.log(error);
+                    
                   }
                 )
               },
               (error) => {
-                console.log(error);
-                this.toastr.error('حدث خطأ رجاء الانتظار وحاول ثانيه');
+                console.log(error.error.error);
+                if(error['error'].error == 'department already has trainees') {
+                  this.toastr.warning('القسم به متدربين لايمكن حذفه !');
+                } else {
+                  this.toastr.error('حدث خطأ رجاء الانتظار وحاول ثانيه');
+                }
                 this.spinner.hide();
               }
           )

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

@@ -227,7 +227,7 @@ export class FormUserComponent implements OnInit {
               
               this.urlImg = responce['user'].photo ? this.authSer.pathImg + responce['user'].photo : this.urlImg;
               console.log(this.urlImg);
-              const date = responce['user'].date_of_employment_hij.split('-');
+              const date = responce['user'].date_of_employment_hij ? responce['user'].date_of_employment_hij.split('-') : '';
             
               this.bindingDateSplit = {
                 'year': parseInt(date[0]),

+ 2 - 2
src/app/dashboard/vehicle-maintenance/vehicle-maintenance-add/vehicle-maintenance-add.component.html

@@ -21,7 +21,7 @@
 
             <div class="col-12 col-sm-12 col-md-4">
               <div class="form-group">
-                <label for="vehicle_type_id" style="float: right; margin-right: 5px">نوع المركبه</label>
+                <label for="vehicle_type_id" style="float: right; margin-right: 5px">صنف المركبه</label>
                 <select class="form-control" name="vehicle_type_id" (input)="onChangeVehicleType($event)" [disabled]="checkEdit" [ngModel]="formData.vehicle_type_id" required>
                   <option *ngFor="let type of vehicle_types" [value]="type.id">{{type.name}}</option>
                 </select>
@@ -69,7 +69,7 @@
               </div>
             </div>
 
-            <div class="col-12 col-sm-12 col-md-4" *ngIf="typeMode">
+            <div class="col-12 col-sm-12 col-md-4">
               <div class="form-group">
                 <label for="maintenance_notes" style="float: right;margin-right: 5px">هل تمت الصيانه ؟ <span class="spanReqired-w">*</span></label>
                 ,<select name="is_maintained" class="form-control" ngModel [ngModel]="formData.is_maintained" required>

+ 2 - 2
src/app/dashboard/vehicle-maintenance/vehicle-maintenance-add/vehicle-maintenance-add.component.ts

@@ -238,7 +238,7 @@ export class VehicleMaintenanceAddComponent implements OnInit {
 
     delete this.vehicleForm.value['vehicle_type_id'];
 
-    console.log(this.vehicleForm.value);
+    console.log(this.formData);
 
     const startDateData = this.startDate.split('-');
     const endDateData = this.endDate.split('-');
@@ -254,7 +254,7 @@ export class VehicleMaintenanceAddComponent implements OnInit {
         this.toastr.warning(' يوم تاريخ الإنتهاء يجب أن يكون أكبر من يوم تاريخ الإبتداء!');
         this.checkSaveclick = false;
       } else {
-        this.dashBoardSer.editItem(this.maintenanceVehicleId,this.vehicleForm.value, 'vehicleMaintenance').subscribe(
+        this.dashBoardSer.editItem(this.maintenanceVehicleId,this.formData, 'vehicleMaintenance').subscribe(
           (responce) => {
             console.log(responce);
             this.toastr.success('تم التعديل بنجاح');

+ 6 - 4
src/app/dashboard/vehicle-maintenance/vehicle-maintenance-list/vehicle-maintenance-list.component.html

@@ -27,22 +27,22 @@
       <div class="col-12 col-sm-12 col-md-12">
         <div class="form-group" style="float: right;">
           <span class="spanSelect-w">
+            من العناصر يتم عرضها
             <select [ngModel]="dataTableNumber" class="form-control selectButton-w" (input)="onGetValue($event)">
               <option value="5">5</option>
               <option value="10">10</option>
               <option value="15">15</option>
               <option value="20">20</option>
             </select>
-            من العناصر يتم عرضها
           </span>
         </div>
         <div class="form-group" style="float: right; margin: 0 20px;">
-          <span class="spanSelect-w" >
+            <span class="spanSelect-w" >
+                النوع
             <select [ngModel]="filtterStatus" style="width:134px;" class="form-control selectButton-w" (input)="onGetValueFiltter($event)">
                 <option value="all"> الكل </option>
               <option *ngFor="let type of vehicle_types" [value]="type.id">{{type.name}}</option>
             </select>
-              النوع
           </span>
         </div>
       </div>
@@ -56,8 +56,9 @@
                   <input type="checkbox" class="custom-control-input" [(ngModel)]="selectedAll" (change)="selectAll();" id="customCheck" name="example1">
                 </div>
             </th>
-          <th> نوع المركبه</th>
+          <th> صنف المركبه</th>
           <th>رقم اللوحه</th>
+          <th>هل تمت الصيانة</th>
           <th *ngIf="authSer.showEditBtn">تعديل</th>
         </tr>
       </thead>
@@ -71,6 +72,7 @@
           </td>
           <td>{{data.vehicle_type_name}}</td>
           <td>{{data.vehicle_plate_number}}</td>
+          <td>{{data.is_maintained == 0 ? 'لا' : 'نعم'}}</td>
           <td *ngIf="authSer.showEditBtn"><button type="button" class="btn btn-outline-secondary" (click)="onEdit(data.id)"><i class="fas fa-edit"></i></button></td>
         </tr>
       </tbody>

+ 3 - 3
src/app/dashboard/vehicle-movement-report/vehicle-movement-report/vehicle-movement-report.component.html

@@ -26,11 +26,11 @@
             <div class="col-12">
               <div class="row v3" style="margin: 20px" >
                   <div class="col-4 pull-right d3">
-                      <span class="title"> نوع المركيه:</span>
+                      <span class="title"> صنف المركيه:</span>
                       <span class="result">{{ vehicleData[0].vehicle_type_name }}</span>
                   </div>
                   <div class="col-4 d3">
-                      <span  class="title"> موديل المركبه:</span>
+                      <span  class="title"> نوع المركبه:</span>
                       <span class="result">{{ vehicleData[0].vehicle_model_name }}</span>
                   </div>
                   <div class="col-4 d3">
@@ -75,7 +75,7 @@
                 </tbody>
               </table> 
 
-              <h2 style="float:right; font-size: 18px; margin: 20px 10px;">تقرير الصيانه</h2>
+              <!-- <h2 style="float:right; font-size: 18px; margin: 20px 10px;">تقرير الصيانه</h2> -->
               <table class="table table-bordered" *ngIf='showTableData2'>
                   <thead class="headBackground-w">
                     <tr>

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

@@ -4,7 +4,7 @@
       <div class="col-12">
         <ul class="list-unstyled titileLi-w">
           <li class="headingText-w">خدمه الحركه  </li>
-          <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">  تعريف أنواع المركبات</li>
+          <li class="headingText-w" style="cursor:pointer" (click)="authSer.perviousLocation()">  تعريف أصناف المركبات</li>
           <li class="headingText-w activeLi-w" style="margin-right:5px"> {{typePage}} </li>
         </ul>
       </div>

+ 3 - 3
src/app/dashboard/vehicle/vehicle-list/vehicle-list.component.html

@@ -4,7 +4,7 @@
     <div class="col-12">
       <ul class="list-unstyled titileLi-w">
         <li class="headingText-w">خدمه المركبات  </li>
-        <li class="headingText-w activeLi-w" style="margin-right:5px"> تعريف أنواع المركبات</li>
+        <li class="headingText-w activeLi-w" style="margin-right:5px"> تعريف أصناف المركبات</li>
       </ul>
     </div>
   </div>
@@ -17,7 +17,7 @@
       </div>
       <div class="col-12 col-sm-12 col-md-6 col-lg-6">
         <div class="form-group">
-          <input type="text" placeholder="البحث (نوع المركبة)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
+          <input type="text" placeholder="البحث (صنف المركبة)" class="form-control inputSearchTable-w" style="margin-top:13px;" (input)="filtterFunc($event)"/>
           <hr>
         </div>
       </div>
@@ -50,7 +50,7 @@
               <input type="checkbox" class="custom-control-input" [(ngModel)]="selectedAll" (change)="selectAll();" id="customCheck" name="example1">
             </div>
           </th>
-          <th>إسم النوع</th>
+          <th>إسم الصنف</th>
           <th>الحاله</th>
           <th *ngIf="authSer.showEditBtn">تعديل</th>
         </tr>

+ 3 - 1
src/app/dashboard/vehicle/vehicle-list/vehicle-list.component.ts

@@ -228,8 +228,10 @@ export class VehicleListComponent implements OnInit {
               );
             },
             (error) => {
-              console.log(error);
               this.spinner.hide();
+              if(error.error.status == 'vehicle type id is already taken'){
+                this.toastr.warning(' لا يمكن مسح  هذا الصنف')
+              }
               },
             )
         );