Hima 5 éve
szülő
commit
607e35e4a1
23 módosított fájl, 376 hozzáadás és 230 törlés
  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. 24 0
      src/app/dashboard/reivew-trainee-data/review-trainee-add/review-trainee-add.component.css
  15. 23 0
      src/app/dashboard/reivew-trainee-data/review-trainee-add/review-trainee-add.component.html
  16. 12 5
      src/app/dashboard/reivew-trainee-data/review-trainee-add/review-trainee-add.component.ts
  17. 7 2
      src/app/dashboard/reivew-trainee-data/review-trainee-data-list/review-trainee-data-list.component.html
  18. 159 126
      src/app/dashboard/reivew-trainee-data/review-trainee-data-list/review-trainee-data-list.component.ts
  19. 1 33
      src/app/dashboard/section-review-for-trainee/section-review-trainee-add/section-review-trainee-add.component.html
  20. 1 1
      src/app/dashboard/section-review-for-trainee/section-review-trainee-add/section-review-trainee-add.component.ts
  21. 1 1
      src/app/dashboard/section-review-for-trainee/section-review-trainee-list/section-review-trainee-list.component.html
  22. 7 2
      src/app/dashboard/supervisor/supervisor-list/supervisor-list.component.ts
  23. 1 1
      src/app/dashboard/users/form-user/form-user.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>

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 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>

+ 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);
+  }
     
 
 }

+ 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]),