merge master-newdesign with emp-profile

MOHEMM-Q3-DEV-LATEST
Mohamed Mekawy 6 years ago
commit 52d9e04dac

@ -1216,6 +1216,14 @@
"@types/cordova": "^0.0.34"
}
},
"@ionic-native/vibration": {
"version": "5.19.1",
"resolved": "https://registry.npmjs.org/@ionic-native/vibration/-/vibration-5.19.1.tgz",
"integrity": "sha512-f9fMtBRJmVLklRrnqcSqKktw6skdp+dDQpbBOq1m5VSQF7b6EKkCIUTN69EjeSn2z3AD0kSYn1hCGTp2q+cJIw==",
"requires": {
"@types/cordova": "^0.0.34"
}
},
"@ionic-native/zbar": {
"version": "5.19.1",
"resolved": "https://registry.npmjs.org/@ionic-native/zbar/-/zbar-5.19.1.tgz",
@ -4557,6 +4565,11 @@
"resolved": "https://registry.npmjs.org/cordova-plugin-themeablebrowser/-/cordova-plugin-themeablebrowser-0.2.18.tgz",
"integrity": "sha512-FdE1L3wItbTtUudysX/QxN6DTnfGPTMiS4Np/XKeSfYM0bU8sP6DhUIUp1vA8GAulihkEfbNIvy68oVkx2xtFQ=="
},
"cordova-plugin-vibration": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/cordova-plugin-vibration/-/cordova-plugin-vibration-3.1.1.tgz",
"integrity": "sha512-qgv67Rueo4Pydfant3TwnXeFiN9dl+6lKMM6h5jYg9XewiGAGOr8vfWsTvQssC3m3xMKGS1ap3xPNH+BzZ4RMA=="
},
"cordova-plugin-whitelist": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.4.tgz",
@ -9399,6 +9412,14 @@
"integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==",
"dev": true
},
"ng-circle-progress": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/ng-circle-progress/-/ng-circle-progress-1.5.1.tgz",
"integrity": "sha512-gJ0SdWc+TkXckfbhbvUY522yjya3qcc1a3lGvvVyLsUfSOgll8LQaZGDEko84d8dk8vYO83n0O5vP+e8bJTInQ==",
"requires": {
"tslib": "^1.9.0"
}
},
"ng2-file-upload": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/ng2-file-upload/-/ng2-file-upload-1.4.0.tgz",

@ -52,6 +52,7 @@
"@ionic-native/sqlite": "^5.18.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic-native/themeable-browser": "^5.18.0",
"@ionic-native/vibration": "^5.19.1",
"@ionic-native/zbar": "^5.10.0",
"@ionic/angular": "^4.1.0",
"@ng-bootstrap/ng-bootstrap": "^4.2.2",
@ -95,6 +96,7 @@
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "^2.4.3",
"cordova-plugin-themeablebrowser": "^0.2.18",
"cordova-plugin-vibration": "^3.1.1",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-sqlite-storage": "^3.4.0",
"cordova-support-google-services": "^1.3.2",
@ -102,6 +104,7 @@
"core-js": "^2.5.4",
"date-fns": "^1.30.1",
"mx.ferreyra.callnumber": "0.0.2",
"ng-circle-progress": "^1.5.1",
"ng2-file-upload": "^1.3.0",
"ng2-pdf-viewer": "^5.3.2",
"ngx-gauge": "^1.0.0-beta.10",
@ -112,6 +115,7 @@
"primeng": "^7.1.3",
"run": "1.4.0",
"rxjs": "~6.3.3",
"tslib": "^1.10.0",
"uk.co.workingedge.phonegap.plugin.launchnavigator": "^3.2.2",
"xlsx": "^0.14.3",
"zone.js": "~0.8.29"
@ -191,20 +195,8 @@
"cordova-plugin-fingerprint-aio": {
"FACEID_USAGE_DESCRIPTION": "User Authentication"
},
"cordova-plugin-firebasex": {
"FIREBASE_ANALYTICS_COLLECTION_ENABLED": "true",
"FIREBASE_PERFORMANCE_COLLECTION_ENABLED": "true",
"FIREBASE_CRASHLYTICS_COLLECTION_ENABLED": "true",
"ANDROID_ICON_ACCENT": "#FF00FFFF",
"ANDROID_PLAY_SERVICES_TAGMANAGER_VERSION": "17.0.0",
"ANDROID_FIREBASE_ANALYTICS_VERSION": "17.2.1",
"ANDROID_FIREBASE_MESSAGING_VERSION": "20.0.0",
"ANDROID_FIREBASE_CONFIG_VERSION": "19.0.3",
"ANDROID_FIREBASE_PERF_VERSION": "19.0.1",
"ANDROID_FIREBASE_AUTH_VERSION": "19.1.0",
"ANDROID_CRASHLYTICS_VERSION": "2.10.1",
"ANDROID_CRASHLYTICS_NDK_VERSION": "2.1.1"
}
"cordova-plugin-firebasex": {},
"cordova-plugin-vibration": {}
},
"platforms": [
"browser",
@ -212,4 +204,4 @@
"android"
]
}
}
}

@ -1,13 +1,13 @@
import { Component, OnInit } from "@angular/core";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { AccrualService } from "../services/accrual.service";
import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user";
import { Component, OnInit } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { AccrualService } from '../services/accrual.service';
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
@Component({
selector: "app-home",
templateUrl: "./home.component.html",
styleUrls: ["./home.component.scss"]
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {
Sdate: any;
@ -39,7 +39,7 @@ export class HomeComponent implements OnInit {
let day = today.getDate();
let month = today.getMonth() + 1;
let year = today.getFullYear();
let todayDate = month + "/" + day + "/" + year;
let todayDate = month + '/' + day + '/' + year;
let effectiveDate = todayDate;
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.emp_no,

@ -1,32 +1,33 @@
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
const routes: Routes = [
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
{
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule'},
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
{ path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' },
{ path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' },
{ path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' },
{ path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' },
{ path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' },
{ path: 'eit', loadChildren: './eit/eit.module#EITPageModule' },
{ path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' },
{ path: 'notification', loadChildren: './notification/notification.module#NotificationPageModule' },
{ path: 'my-specialist', loadChildren: './my-specialist/my-specialist.module#MySpecialistPageModule' },
{ path: 'my-subordinate', loadChildren: './my-subordinate/my-subordinate.module#MySubordinatePageModule' },
{ path: 'time-card', loadChildren: './time-card/time-card.module#TimeCardPageModule' },
{ path: 'payslip', loadChildren: './payslip/payslip.module#PayslipPageModule' }, { path: 'attendance-tracking', loadChildren: './attendance-tracking/attendance-tracking.module#AttendanceTrackingPageModule' }
const routes: Routes = [
{ path: '', redirectTo: 'authentication/login', pathMatch: 'full' },
{
path: 'authentication', loadChildren: './authentication/authentication.module#AuthenticationPageModule'},
{ path: 'home', loadChildren: './home/home.module#HomePageModule' },
{ path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' },
{ path: 'vacation-rule', loadChildren: './vacation-rule/vacation-rule.module#VacationRulePageModule' },
{ path: 'accrual-balances', loadChildren: './accrual-balances/accrual-balances.module#AccrualBalancesPageModule' },
{ path: 'my-team', loadChildren: './my-team/my-team.module#MyTeamPageModule' },
{ path: 'attendance', loadChildren: './attendance/attendance.module#AttendancePageModule' },
{ path: 'eit', loadChildren: './eit/eit.module#EITPageModule' },
{ path: 'absence', loadChildren: './absence/absence.module#AbsencePageModule' },
{ path: 'notification', loadChildren: './notification/notification.module#NotificationPageModule' },
{ path: 'my-specialist', loadChildren: './my-specialist/my-specialist.module#MySpecialistPageModule' },
{ path: 'my-subordinate', loadChildren: './my-subordinate/my-subordinate.module#MySubordinatePageModule' },
{ path: 'time-card', loadChildren: './time-card/time-card.module#TimeCardPageModule' },
{ path: 'payslip', loadChildren: './payslip/payslip.module#PayslipPageModule' }
];
@NgModule({
imports: [
/*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/
RouterModule.forRoot(routes),
],
exports: [RouterModule]
})
export class AppRoutingModule { }
];
@NgModule({
imports: [
/*RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules}),*/
RouterModule.forRoot(routes),
],
exports: [RouterModule]
})
export class AppRoutingModule { }

@ -5,18 +5,16 @@ import { HmgCommonModule } from './hmg-common/hmg-common.module';
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ZBar } from '@ionic-native/zbar/ngx';
import { Geolocation } from '@ionic-native/geolocation/ngx';
import {Camera,CameraOptions,PictureSourceType} from'@ionic-native/Camera/ngx';
import { FilePath } from "@ionic-native/file-path/ngx";
import { File } from "@ionic-native/file/ngx";
import { Base64 } from "@ionic-native/base64/ngx";
import {Camera, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx';
import { FilePath } from '@ionic-native/file-path/ngx';
import { File } from '@ionic-native/file/ngx';
import { Base64 } from '@ionic-native/base64/ngx';
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
@NgModule({
declarations: [AppComponent],
entryComponents: [],

@ -0,0 +1,38 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { AttendanceTrackingPage } from './attendance-tracking.page';
import {HomeComponent} from './home/home.component'
import { HmgCommonModule } from "./../hmg-common/hmg-common.module";
const routes: Routes = [
{
path: '',
component: AttendanceTrackingPage,
children:[
{
path: 'home',
component:HomeComponent
}
]
},
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
HmgCommonModule,
RouterModule.forChild(routes)
],
declarations: [AttendanceTrackingPage,HomeComponent]
})
export class AttendanceTrackingPageModule {}

@ -0,0 +1,3 @@
<ion-content>
<ion-router-outlet></ion-router-outlet>
</ion-content>

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AttendanceTrackingPage } from './attendance-tracking.page';
describe('AttendanceTrackingPage', () => {
let component: AttendanceTrackingPage;
let fixture: ComponentFixture<AttendanceTrackingPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AttendanceTrackingPage ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AttendanceTrackingPage);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-attendance-tracking',
templateUrl: './attendance-tracking.page.html',
styleUrls: ['./attendance-tracking.page.scss'],
})
export class AttendanceTrackingPage implements OnInit {
constructor() { }
ngOnInit() {
}
}

@ -0,0 +1,79 @@
<ion-header>
<ion-toolbar class="header-toolbar">
<ion-title color="light">Attendance Tracking </ion-title>
<ion-buttons slot="start">
<nav-buttons></nav-buttons>
</ion-buttons>
</ion-toolbar>
</ion-header>
<ion-content>
<div class="timer-chart">
<ion-label class="shift-title" style="font-weight: bold"> {{curentDate}}</ion-label><br/>
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','today-time-left')}}</ion-label>
<div class="fixed-shift-timer">
<circle-progress
[titleFontSize]= '3'
[percent]="percent"
[radius]="8"
[outerStrokeWidth]="0.25"
[innerStrokeWidth]="0.25"
[outerStrokeColor]="'#3cb9d5'"
[innerStrokeColor]="'rgba(0,0,0,0.3)'"
[animation]="true"
[animationDuration]="300"
[responsive]="true"
[space]="-0.25"
[startFromZero]="false"
[title]="displayTime"
titleFontWeight="bold"
[titleColor]="'#ffffff'"
[showUnits]="false"
[showSubtitle]="false"
[subtitleColor]="'#ffffff'"
[clockwise]="false"
[renderOnClick]="false">
</circle-progress>
</div>
</div>
<div *ngIf="attendanceTrackingList" class="tracking-content">
<div class="divstopBtn">
<button *ngIf="isCheckedIn"(click)="openDialog();" class="stopBtn" ion-button>
<ion-icon class="stopicon" name="pause"></ion-icon>
</button>
</div>
<ion-grid>
<ion-row class="rowBorder">
<ion-label class="shift-title">{{ts.trPK('attendance-tracking','shift-time')}}</ion-label>
<br /><br />
<ion-label class="shift-text shift-title">{{attendanceTrackingList.P_SHT_NAME}} </ion-label>
</ion-row>
<ion-row class="rowBorder">
<ion-col class="colBorder">
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','check-in')}}</ion-label>
<br /><br />
<ion-label class="shift-text shift-title">08:00</ion-label>
</ion-col>
<ion-col>
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','check-out')}}</ion-label>
<br /><br />
<ion-label class="shift-text shift-title">08:00 </ion-label>
</ion-col>
</ion-row>
<ion-row style="text-align: center">
<ion-col class="colBorder">
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','late-in')}}</ion-label>
<br /><br />
<ion-label class="shift-text shift-title">08:00 </ion-label>
</ion-col>
<ion-col>
<ion-label class="shift-title"> {{ts.trPK('attendance-tracking','regular')}}</ion-label>
<br /><br />
<ion-label class="shift-text shift-title">{{attendanceTrackingList.P_SCHEDULED_HOURS}} </ion-label>
</ion-col>
</ion-row>
</ion-grid>
</div>
</ion-content>

@ -0,0 +1,57 @@
.timer-chart{
padding-top:18px;
background: #094773;
// height: 50%;
text-align: center;
}
.tracking-content{
background: #053c63;
height: 50%;
}
.rowBorder{
text-align: center;
border-bottom: var(--lightblue) solid 1px;
}
.shift-text{
// text-align: center;
// width: 100%;
// color: white !important;
margin-bottom: 12px;
margin-top: -9px;
font-size: 30px;
}
.shift-title{
width: 100%;
text-align: center;
color: white !important;
}
.stopicon{
width: 50px;
height: 39px;
color: #053c63;
}
.divstopBtn{
text-align: center;
}
.stopBtn{
height: 70px;
width: 70px;
background-color: var(--lightblue) !important;
border-radius: 50%;
display: inline-block;
margin-top: -24px;
border: solid 3px #053c63;
}
.colBorder{
border-right: var(--lightblue) solid 1px;
}
.fixed-shift-timer{
margin-top: -50px;
margin-bottom: -30px;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HomeComponent } from './home.component';
describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HomeComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,134 @@
import { Component, OnInit, EventEmitter, Output } from '@angular/core';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import {AttendScanService} from '../../hmg-common/services/attend-services/attend-scan.service';
import { AttendanceTrackingResponse } from 'src/app/hmg-common/services/dashbored/attendance-tracking.response';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss'],
})
export class HomeComponent implements OnInit {
attendanceTrackingList: any = [];
curentDate: any;
direction: string;
isCheckOut = false;
public runTimer = false;
public hasStarted = false;
public hasFinished = false;
public remainingTime: any;
public scheduledTime: any;
public isCheckedIn = undefined;
public displayTime: any;
public percent: any;
constructor(
public cs: CommonService,
public db: DashboredService,
public ts: TranslatorService,
public attendScanService: AttendScanService
) { }
ngOnInit() {
this.showAttendanceTracking();
this.curentDate = new Date();
this.direction = TranslatorService.getCurrentLanguageName();
this.curentDate = this.getHeaderDate(this.curentDate);
}
initTimer() {
this.runTimer = false;
this.hasStarted = false;
this.hasFinished = false;
this.percent = 100 - ((this.remainingTime / this.scheduledTime) * 100);
this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
this.startTimer();
}
startTimer() {
this.runTimer = true;
this.hasStarted = true;
this.timerTick();
}
timerTick() {
setTimeout(() => {
if (!this.runTimer) { return; }
this.remainingTime--;
this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
if (this.remainingTime > 0) {
const newPercent: any = ((this.remainingTime / this.scheduledTime) * 100).toFixed(2);
this.percent = 100 - newPercent;
this.timerTick();
} else {
this.hasFinished = true;
}
}, 1000);
}
getSecondsAsDigitalClock(inputSeconds: number) {
const secNum = parseInt(inputSeconds.toString(), 10); // don't forget the second param
const hours = Math.floor(secNum / 3600);
const minutes = Math.floor((secNum - (hours * 3600)) / 60);
const seconds = secNum - (hours * 3600) - (minutes * 60);
let hoursString = '';
let minutesString = '';
let secondsString = '';
hoursString = (hours < 10) ? '0' + hours : hours.toString();
minutesString = (minutes < 10) ? '0' + minutes : minutes.toString();
secondsString = (seconds < 10) ? '0' + seconds : seconds.toString();
return hoursString + ':' + minutesString + ':' + secondsString;
}
convertInSeconds(time: any) {
const hours = parseInt(time[0], 10);
const minutes = parseInt(time[1], 10);
let seconds = parseInt(time[2], 10);
seconds = seconds + (hours * 60 * 60) + (minutes * 60);
return seconds;
}
convertAndAssignTime(data) {
console.log(data);
this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':'));
this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':'));
this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true;
this.initTimer();
console.log('remainingTime: ' + this.remainingTime);
console.log('scheduledTime: ' + this.scheduledTime);
console.log('isCheckedIn: ' + this.isCheckedIn);
}
showAttendanceTracking() {
this.db.getAttendanceTracking() .subscribe((result: AttendanceTrackingResponse) => {
if (this.cs.validResponse(result)) {
const key = 'GetAttendanceTrackingList';
this.convertAndAssignTime(result[key]);
this.attendanceTrackingList = result[key];
}
});
}
getHeaderDate(date: any) {
if (this.direction === 'en') {
return this.cs.getMonthName(date.getMonth() + 1) + ', ' + date.getDate() + ' ' + date.getFullYear();
} else {
return this.cs.getMonthNameAr(date.getMonth() + 1) + ', ' + date.getDate() + ' ' + date.getFullYear();
}
}
openDialog() {
this.cs.confirmAlertDialogAttendance(
() => {
this.attendScanService.getDeviceLocation();
}, this.ts.trPK('general', 'ok'),
() => {}, this.ts.trPK('general', 'cancel'),
this.ts.trPK('vacation-rule', 'confirmation'),
this.ts.trPK('attendance-tracking', 'confirm-alert3')
+ '<br/>' + '<br/>' + this.ts.trPK('attendance-tracking', 'confirm-alert1')
+ this.ts.trPK('attendance-tracking', 'confirm-alert2')
);
}
}

@ -21,7 +21,7 @@ import { SmsPageComponent } from './sms-page/sms-page.page';
import { CheckUserComponent } from './check-user/check-user.component';
import { ChangePasswordComponent } from './change-password/change-password.component';
import {ConfirmLoginComponent} from '../authentication/confirm-login/confirm-login.component'
import {WelcomeComponent} from '../authentication/welcome/welcome.component'
const routes: Routes = [
{
@ -51,6 +51,10 @@ const routes: Routes = [
{
path: 'confirmLogin',
component: ConfirmLoginComponent
},
{
path: 'welcom',
component: WelcomeComponent
}
]
}
@ -77,7 +81,8 @@ const routes: Routes = [
SmsPageComponent,
CheckUserComponent,
ChangePasswordComponent,
ConfirmLoginComponent
// ConfirmLoginComponent,
WelcomeComponent
],
providers:[
FingerprintAIO,

@ -12,23 +12,37 @@
<ion-content padding>
<ion-grid>
<ion-item>
<ion-row >
<ion-col [size]="4">
<img [src]="logo" class="logoHeader" />
</ion-col>
</ion-row>
<br/>
<br/>
<p class="headerTxt" color="light" > {{'changePassword,changePassword' | translate}}</p>
<ion-item class="item-input-login" >
<img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,currentPassword' | translate}}</ion-label> -->
<ion-input required type="password" placeholder="{{ts.trPK('changePassword','currentPassword')}}"[(ngModel)]="P_OLD_PASSWORD"></ion-input>
<ion-input class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','currentPassword')}}"[(ngModel)]="P_OLD_PASSWORD"></ion-input>
</ion-item>
<ion-item>
<p class="headerTxt" color="light" > {{'changePassword,newPassword' | translate}}</p>
<ion-item class="item-input-login" >
<img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,newPassword' | translate}}</ion-label> -->
<ion-input required type="password" placeholder="{{ts.trPK('changePassword','newPassword')}}"
<ion-input class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','newPassword')}}"
[(ngModel)]="P_NEW_PASSWORD">
</ion-input>
</ion-item>
<ion-item>
<img class="item-icon" src="assets/imgs/password.png" item-start />
<ion-item class="item-input-login" >
<img class="item-icon" src="assets/imgs/password.png" item-start />
<!-- <ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label> -->
<ion-input required type="password" placeholder="{{ts.trPK('changePassword','confirmPassword')}}"
<ion-input class="login-input" required type="password" placeholder="{{ts.trPK('changePassword','confirmPassword')}}"
[(ngModel)]="P_Confirm_NEW_PASSWORD">
</ion-input>
</ion-item>
@ -40,6 +54,6 @@
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button color="customnavy" ion-button (click)="submit()">{{ts.trPK('login','changepassword')}}</ion-button>
<ion-button class="button-login" ion-button (click)="submit()">{{ts.trPK('login','changepassword')}}</ion-button>
</div>
</ion-footer>

@ -0,0 +1,31 @@
.login-input {
border: none;
}
.item-input{
--min-height: 1.0cm !important;
--border-radius: 12px;
--ion-color-base: white !important;
// --background: color: var(--darkgray) !important;
// background: #7f8c8d !important;
border-radius: 33px;
--border: solid #9999992b !important;
border: solid #9999992b !important;
margin-bottom :12px;
margin-left: 12px;
margin-right: 12px;
}
.button-login{
--background: var(--newgreen) !important;
background: var(--newgreen) !important;
white-space: normal;
color: var(--light);
text-transform: capitalize;
min-height: 1.0cm;
--border-radius: 33px !important;
border-radius: 33px !important;
--min-height: 1.6cm !important;
width: 315px;
}

@ -24,7 +24,8 @@ export class ChangePasswordComponent implements OnInit {
public P_Confirm_NEW_PASSWORD : string;
public P_OLD_PASSWORD : string;
public P_USER_NAME : string;
public logo = "assets/icon/login/lock.png";
userData: any = {};
public isExpiredPwd: boolean = false;
constructor(

@ -8,10 +8,27 @@
</ion-header>
<ion-content padding>
<ion-grid>
<ion-item>
<ion-row >
<ion-col [size]="4">
<img [src]="logo" class="logoHeader" />
</ion-col>
</ion-row>
<br/>
<br/>
<ion-row>
<ion-col>
<p class="leftDiv">{{ts.trPK('login','check-user-text1')}}<span class="boldTxtNav">{{ts.trPK('login','check-user-text2')}}</span> {{ts.trPK('login','check-user-text3')}}</p>
</ion-col>
</ion-row>
<ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/username.png" item-start />
<ion-label>{{ts.trPK('login','username')}}</ion-label>
<ion-input required type="text" [(ngModel)]="P_USER_NAME">
<ion-label>{{ts.trPK('login','check-user-text1')}}</ion-label>
<ion-input class="login-input" required type="text" [(ngModel)]="P_USER_NAME">
</ion-input>
</ion-item>
</ion-grid>
@ -19,6 +36,6 @@
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button color="customnavy" ion-button (click)=" userCheck()">{{ts.trPK('login','changepassword')}}</ion-button>
<ion-button class="button-login" ion-button (click)=" userCheck()">{{ts.trPK('login','changepassword')}}</ion-button>
</div>
</ion-footer>

@ -4,4 +4,38 @@
.btnBack{
background: transparent;
}
}
///////////////////////////////////////////////////////////
.login-input {
border: none;
}
.item-input{
--min-height: 1.0cm !important;
--border-radius: 12px;
--ion-color-base: white !important;
// --background: color: var(--darkgray) !important;
// background: #7f8c8d !important;
border-radius: 33px;
--border: solid #9999992b !important;
border: solid #9999992b !important;
margin-bottom :12px;
margin-left: 12px;
margin-right: 12px;
}
.button-login{
--background: var(--newgreen) !important;
background: var(--newgreen) !important;
white-space: normal;
color: var(--light);
text-transform: capitalize;
min-height: 1.0cm;
--border-radius: 33px !important;
border-radius: 33px !important;
--min-height: 1.6cm !important;
width: 315px;
}
///////////////////////////////////////////

@ -21,7 +21,8 @@ import {LoginComponent} from 'src/app/authentication/login/login.component';
export class CheckUserComponent implements OnInit {
public P_USER_NAME : string;
private loginData = new LoginModel();
public logo = "assets/icon/login/lock.png";
@ViewChild(InternationalMobileComponent) internationlMobile: InternationalMobileComponent;
constructor(public cs: CommonService,
public authService: AuthenticationService,

@ -1,4 +1,4 @@
<ion-header>
<ion-header *ngIf="!accessFromOutSide">
<ion-toolbar class="header-toolbar">
<ion-buttons slot="start">
<ion-back-button color="light" class="btnBack" ></ion-back-button>
@ -9,20 +9,28 @@
<ion-content padding>
<ion-grid>
<ion-content [scrollEvents]="true"
[ngClass]="{'content-class':accessFromOutSide, 'ion-padding': !accessFromOutSide}" has-bouncing="false" forceOverscroll="false" scrollY="false" class="ion-no-padding">
<ion-grid class="ion-justify-content-center">
<ion-row class="ion-justify-content-center">
<ion-row *ngIf="!accessFromOutSide">
<ion-col [size]="4">
<img [src]="logo" class="logo" />
</ion-col>
</ion-row>
<ion-row class="description">
<ion-col size="12">
<ion-row class="description" *ngIf="!accessFromOutSide">
<ion-col size="12">
<!-- <type-writer *ngIf="onlySMSBox" [text]="'login,verify-login-with' | translate" class="description"
color="primary" fontSize="0.55cm" lineHeight="1cm" fontSize="0.55cm"></type-writer>
-->
<div *ngIf="onlySMSBox"><p>{{ts.trPK('login','verify-login-with')}}</p></div>
<ion-row>
<ion-col [size]="12">
<!-- <img [src]="logo" class="loginLogo" />
<h1 class="heading1">{{welcome}} </h1> -->
<!-- <p class="text1" style="margin-bottom: -8px;font-weight: bold;font-size: 22px;">{{ts.trPK('login','Verify-text')}} </p> -->
<p class="text1" style="font-size: 28px;margin-bottom: 0px" >{{empname}}</p>
</ion-col>
</ion-row> <div *ngIf="onlySMSBox"><p>{{ts.trPK('login','verify-login-with')}}</p></div>
<!-- <type-writer *ngIf="!onlySMSBox" [text]="'login, verify-fingerprint' | translate" class="description"
color="primary" fontSize="0.55cm" lineHeight="1cm" fontSize="0.55cm"></type-writer>
-->
@ -32,19 +40,32 @@
</ion-col>
</ion-row>
<page-trailer [small]="true"></page-trailer>
<ion-row [dir]="direction" class="zoomIn">
<ng-container *ngFor="let buttonsGroup of buttons">
<ion-row [ngClass]=" accessFromOutSide ? 'rowOutside' : ''" [dir]="direction" class="zoomIn">
<ng-container *ngFor="let buttonsGroup of buttons">
<ng-container *ngFor="let button of buttonsGroup">
<ion-col [size]="accessFromOutSide ? 12 : 6" *ngIf="button.visible">
<!-- <ng-container *ngFor="let buttonsGroup of buttons">
<ion-col *ngFor="let button of buttonsGroup" [size]="6">
<app-button (click)="confirm(button)" [title]="button.title | translate " [icon]="button.icon"
<ion-col [size]="accessFromOutSide ? 12 : 6" *ngIf="button.visible"> -->
<app-button (click)="checkAccess(button)" [title]="button.title | translate " [icon]="button.icon"
[settings]="button.settings" [strong]="button.txt" [class]="button.class" [disabled]="button.disabled"
*ngIf="button.visible">
*ngIf="button.visible"
[buttonClass]="button.buttonClass" [pClass]="button.pClass">
</app-button>
</ion-col>
</ng-container>
</ng-container>
</ion-row>
<page-trailer [small]="true"></page-trailer>
</ion-grid>
</ion-content>
</ion-content>

@ -0,0 +1,10 @@
.content-class {
height: 25vh;
}
.rowOutside{
// margin-top: -37px;
}

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import {ButtonSettings} from "src/app/hmg-common/ui/button/models/button-settingsl";
@ -27,6 +27,8 @@ import { SMSCheckResponse } from "src/app/hmg-common/services/authentication/mod
import { PushService } from 'src/app/hmg-common/services/push/push.service';
import { Platform } from '@ionic/angular';
import { CheckUserAuthenticationResponse } from 'src/app/hmg-common/services/authentication/models/check-user-auth.response';
import { LoginModel } from '../models/LoginModel';
@ -44,7 +46,7 @@ import { Platform } from '@ionic/angular';
export class ConfirmLoginComponent implements OnInit {
public logo = "assets/imgs/CS.png";
public logo = "assets/icon/login/password.png";
public buttons:any=[];
@ -52,7 +54,7 @@ export class ConfirmLoginComponent implements OnInit {
onlySMSBox: any = true;
loginData:any;
public loginData = new LoginModel();
selectedOption: any;
@ -62,7 +64,12 @@ export class ConfirmLoginComponent implements OnInit {
deviceToken:any;
@Input() accessFromOutSide = false;
@Input() visible = true;
username: any;
password:any;
loginType: any;
empname: string;
constructor(
@ -87,14 +94,15 @@ export class ConfirmLoginComponent implements OnInit {
) {
this.loginData= this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
console.log(this.loginData);
console.log("logindata: "+this.loginData);
this.deviceToken= this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false);
this.deviceToken= this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false);
console.log("deviceToken :"+this.deviceToken);
console.log("deviceToken :"+this.deviceToken);
//if device token undefind
@ -108,7 +116,9 @@ export class ConfirmLoginComponent implements OnInit {
this.lastLogin = this.cs.sharedService.getSharedData(AuthenticationService.LAST_LOGIN, false);
this.username = localStorage.getItem("user");
this.password = localStorage.getItem("password");
this.empname = localStorage.getItem("emp-name");
}
@ -121,8 +131,9 @@ export class ConfirmLoginComponent implements OnInit {
this.checkIfAvailable();
//**getSharedData of IMEI_USER_DATA and REGISTER_DATA_FOR_LOGIIN to set defult value **//
this.username = localStorage.getItem("user");
this.password = localStorage.getItem("password");
this.empname = localStorage.getItem("emp-name");
// this.setDefault();
@ -214,7 +225,10 @@ export class ConfirmLoginComponent implements OnInit {
disabled: this.isFaceorFinger === "finger" || this.isFaceorFinger === "biometric" ? false : true,
visible: this.onlySMSBox
visible: this.onlySMSBox,
buttonClass: 'buttonClassWhite',
pClass: 'pClassMyFileIconBlack',
class: 'nationalIdIcon',
},
@ -232,7 +246,10 @@ export class ConfirmLoginComponent implements OnInit {
disabled: this.isFaceorFinger === "face" ? false : true,
visible: this.onlySMSBox
visible: this.onlySMSBox,
buttonClass: 'buttonClassWhite',
pClass: 'pClassMyFileIconBlack',
class: 'nationalIdIcon',
},
@ -248,7 +265,10 @@ export class ConfirmLoginComponent implements OnInit {
value: 4,
visible: true
visible: true,
buttonClass: 'buttonClassWhite',
pClass: 'pClassMyFileIconBlack',
class: 'nationalIdIcon',
},
@ -264,7 +284,10 @@ export class ConfirmLoginComponent implements OnInit {
value: 1,
visible: true
visible: true,
buttonClass: 'buttonClassWhite',
pClass: 'pClassMyFileIconBlack',
class: 'nationalIdIcon',
}
@ -278,6 +301,7 @@ export class ConfirmLoginComponent implements OnInit {
confirm(el: any) {
console.log("confirm:"+ el );
this.selectedOption = this.selectedOption && !this.onlySMSBox ? this.selectedOption : el.value;
@ -286,13 +310,15 @@ export class ConfirmLoginComponent implements OnInit {
case 1:
console.log(el.value);
console.log(el.value);
localStorage.setItem("login-type",el.value);
console.log("login-type: "+ localStorage.getItem("login-type"))
this.loginWithSMS(el);
break;
case 2:
localStorage.setItem("login-type",el.value);
console.log(el.value);
@ -303,6 +329,7 @@ export class ConfirmLoginComponent implements OnInit {
break;
case 3:
localStorage.setItem("login-type",el.value);
console.log(el.value);
@ -316,6 +343,7 @@ export class ConfirmLoginComponent implements OnInit {
console.log(el.value);
localStorage.setItem("login-type",el.value);
this.loginWithWhatsapp(el);
@ -335,7 +363,7 @@ export class ConfirmLoginComponent implements OnInit {
AuthenticationService.LAST_LOGIN
);
}
@ -460,7 +488,7 @@ export class ConfirmLoginComponent implements OnInit {
this.cs.sharedService.setSharedData({
MobileNumber: this.loginData.mobileNumber,
MobileNumber: this.loginData.MobileNumber,
loginType: this.selectedOption
@ -651,7 +679,7 @@ export class ConfirmLoginComponent implements OnInit {
if ( result.Mohemm_GetPatientID_List[0].LoginType == 2 || result.Mohemm_GetPatientID_List[0].LoginType == 3) {
this.loginTokenID = result.LogInTokenID;
//send silent sms
this.checkSMS();
} else {
@ -712,11 +740,13 @@ export class ConfirmLoginComponent implements OnInit {
this.authService.setAuthenticatedUser(result).subscribe(() => {
console.log("insert");
localStorage.setItem("emp-name",result.MemberInformationList[0].EMPLOYEE_NAME);
console.log("empnmae: "+ localStorage.getItem("emp-name"));
if (this.platform.is("cordova")) {
this.insertMobileLogin();
}
this.cs.openHome();
@ -785,6 +815,77 @@ console.log("succssful insertMobileLoginInfo" );
}
//do silent login
private checkUserAuthentication() {
console.log("debug Here!!");
this.cs.startLoading();
const request = new LoginRequest();
request.P_USER_NAME = this.username;
request.P_LANGUAGE = "US";//this.language;
request.P_PASSWORD = this.password;
console.log(request);
this.authService
.login(request, () => {
console.log("error here");
//console.log(result.MessageStatus);
//this.sharedData.setSharedData(true, Password.IS_EXPIRED_PSW);
//this.userCheck();
}, this.ts.trPK("general", "ok"))
.subscribe((result: CheckUserAuthenticationResponse) => {
console.log("success");
this.cs.stopLoading();
if (this.cs.validResponse(result)) {
console.log("result.LogInTokenID "+ result.LogInTokenID);
console.log("this.loginData before "+ this.loginData);
this.loginData = new LoginModel();
console.log("this.loginData after "+ this.loginData);
this.loginData.LogInTokenID = result.LogInTokenID;
this.loginData.MobileNumber = result.MemberLoginList.P_MOBILE_NUMBER;
this.loginData.P_USER_NAME = this.username;
this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA);
this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA);
//this.remeberMyInfo();
//this.cs.openSMSPage(); phase#1 one type of OTP
// if(!this.welcomeBack){
//this.cs.openConfirmLoginPage();//phase#2 add 4 types for OTP
// }
this.confirm(this.loginType);
} else {
console.log("result.IsPasswordExpired");
console.log(result.IsPasswordExpired);
if (result.IsPasswordExpired) {
// alert("dont forget to handelpresentPasswordExpiredDialog() ");
// this.presentPasswordExpiredDialog(); *****
}
}
});
}
checkAccess(el:any){
let data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
this.loginType=el;
if(this.accessFromOutSide){
// alert("this.accessFromOutSide" + this.accessFromOutSide);
this.checkUserAuthentication();
}
else{
// alert("this.accessFromOutSide" + this.accessFromOutSide);
if(!data == undefined ){
// alert("data.LogInTokenID" + data.LogInTokenID);
this.confirm(this.loginType);
}
else{
this.checkUserAuthentication();
}
}
}//end checkAccess
}

@ -10,20 +10,30 @@
<ion-content padding>
<ion-grid>
<ion-item>
<ion-row>
<ion-col [size]="4">
<img [src]="logo" class="logoHeader" />
</ion-col>
</ion-row>
<br/>
<br/>
<ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/password.png" item-start />
<ion-label>{{'changePassword,newPassword' | translate}}</ion-label>
<ion-input required type="password"
<ion-input class="login-input" required type="password"
[(ngModel)]="P_NEW_PASSWORD">
</ion-input>
</ion-item>
<ion-item>
<ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/password.png" item-start />
<ion-label>{{'changePassword,confirmPassword' | translate}}</ion-label>
<ion-input required type="password"
<ion-input class="login-input" required type="password"
[(ngModel)]="P_Confirm_NEW_PASSWORD">
</ion-input>
</ion-item>
@ -35,6 +45,6 @@
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button color="customnavy" ion-button (click)=" forgotpassword()">{{ts.trPK('login','changepassword')}}</ion-button>
<ion-button class="button-login" ion-button (click)=" forgotpassword()">{{ts.trPK('login','changepassword')}}</ion-button>
</div>
</ion-footer>

@ -21,6 +21,8 @@ export class ForgotComponent implements OnInit {
public P_NEW_PASSWORD: string;
public P_Confirm_NEW_PASSWORD : string;
public P_USER_NAME : string;
public logo = "assets/icon/login/lock.png";
constructor(
public cs: CommonService,
public authService: AuthenticationService,

@ -1,28 +1,57 @@
<ion-content padding>
<ion-grid class="customGrid">
<ion-row>
<!-- <ion-row>
<ion-col class="colPad">
<img class="centerDiv" src="../assets/imgs/CS.png" />
<img class="centerDiv" src="../assets/imgs/header.png" />
</ion-col>
</ion-row> -->
<ion-row *ngIf="loginDiv">
<div class="content">
<div class="first-circle"></div>
<div class="middle-circle"></div>
<div class="last-circle"></div>
</div>
</ion-row>
<ion-row *ngIf="welcomeBack ">
<ion-col [size]="4">
<img [src]="logo" class="logo" />
<!-- <ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img> -->
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<ion-col *ngIf="loginDiv">
<P class="pageTitle text-caps">{{ts.trPK('login','login')}}</P>
</ion-col>
</ion-row>
</ion-grid>
<ion-item>
<div *ngIf="loginDiv">
<ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/username.png" item-start />
<ion-input required type="text" [(ngModel)]="username" placeholder="{{ts.trPK('login','username')}}">
<ion-input class="login-input" required type="text" [(ngModel)]="username" placeholder="{{ts.trPK('login','username')}}">
</ion-input>
</ion-item>
<ion-item>
<ion-item class="item-input-login">
<img class="item-icon" src="assets/imgs/password.png" item-start />
<ion-input required type="password" [(ngModel)]="password" placeholder="{{ts.trPK('login','password')}}">
<ion-input class="login-input" required type="password" [(ngModel)]="password" placeholder="{{ts.trPK('login','password')}}">
</ion-input>
<button ion-button clear class="forgetText" type="button" (click)="forgetPasswordPage()" item-right >
{{ts.trPK('login','forgot-password')}}
</button>
</ion-item>
<ion-item>
<ion-label>{{ts.trPK('login','remeber-me')}}</ion-label>
@ -39,13 +68,33 @@
<button disabled class="gridBtn arTxt" ion-button (click)="changeLanguage()" style="background: #dcdcdc !important;color: #ccc6c6 !important;margin: 1px;width: 49%">عربي</button>
</div>
</div>
<!-- div login-->
<!-- <div *ngIf="welcomeBack"> -->
<welcome-login (onLogin)="login()" (loginWithUser)="loginWithUser()" *ngIf="welcomeBack ">
</welcome-login>
<!-- </div> -->
</ion-content>
<ion-footer>
<ion-footer *ngIf="loginDiv">
<div class="centerDiv">
<ion-button color="customnavy" (click)="onLogin()">{{ts.trPK('login','login')}}</ion-button>
<ion-button class="button-login" (click)="onLogin()">{{ts.trPK('login','login')}}</ion-button>
</div>
<br />
<div class="centerDiv">
<!-- <div class="centerDiv">
<a (click)="forgetPasswordPage()">{{ts.trPK('login','forgot-password')}}</a>
</div>
</div> -->
<ion-row>
<ion-col class="colPad">
<img class="centerDiv logoFotor" src="../assets/imgs/CSLogo.png" />
</ion-col>
</ion-row>
</ion-footer>

@ -110,3 +110,121 @@ img.centerDiv {
}
.login-input {
border: none;
}
.item-input{
--min-height: 1.0cm !important;
--border-radius: 12px;
--ion-color-base: white !important;
// --background: color: var(--darkgray) !important;
// background: #7f8c8d !important;
border-radius: 33px;
--border: solid #9999992b !important;
border: solid #9999992b !important;
margin-bottom :12px;
margin-left: 12px;
margin-right: 12px;
}
.button-login{
--background: var(--newgreen) !important;
background: var(--newgreen) !important;
white-space: normal;
color: var(--light);
text-transform: capitalize;
min-height: 1.0cm;
--border-radius: 33px !important;
border-radius: 33px !important;
--min-height: 1.6cm !important;
width: 315px;
}
.content {
width: 500px;
margin-left: auto;
margin-right: auto;
}
.first-circle {
background: var(--newgreen) !important;
border-radius: 50%;
height: 292px;
width: 288px;
float: left;
margin-left: -55px;
margin-top: -140px;
}
.middle-circle {
position: relative;
background:var(--darkblue) !important;
border-radius: 50%;
height: 160px;
width: 170px;
margin: -115px 0px 0px 179px;
}
.last-circle {
position: inherit;
background: var(--lightblue) !important;
border-radius: 50%;
height: 166px;
width: 140px;
margin: -147px 0px 0px 274px;
}
.logoFotor {
width: 45px !important;
height: 45px !important;
}
.welcomeText{
justify-content: center;
align-items: center;
text-align: left;
font-size: 26px;
font-weight: bold;
color: #f2f2f2;
margin-top: 178px;
margin-left: 48px;
}
.forgetText{
background: transparent;
color: var(--darkblue) !important;
}
@media only screen and (max-width: 980px) {
.content{width:100%;}
}
.circle1{
width: 15%;
padding-top: 15%;
margin:0 42%;
background-color: black;
border-radius: 50%;
display:inline-block;
}
.circle2{
width: 15%;
padding-top: 15%;
margin-left: 20%;
background-color:darkred;
border-radius: 50%;
display:inline-block;
margin-top:20px;
}
.circle3{
width: 15%;
padding-top: 15%;
margin-left: 26%;
background-color:gold;
border-radius: 50%;
display:inline-block;
margin-top:20px;
margin-right: 15%;
}

@ -40,6 +40,12 @@ export class LoginComponent implements OnInit, OnDestroy {
private isMobileFingerPrint: boolean;
private FingerPrintPatientIdentificationID: string;
private loginData = new LoginModel();
private empname:any;
private logintype:any;
public loginDiv:boolean =true;
public welcomeBack:boolean =false;
public logo = "assets/icon/login/password.png";
constructor(
public cs: CommonService,
@ -58,11 +64,21 @@ export class LoginComponent implements OnInit, OnDestroy {
) { }
ngOnInit() {
this.username = localStorage.getItem("user");
this.password = localStorage.getItem("password");
let remember = localStorage.getItem("remember");
this.empname= localStorage.getItem("emp-name");
this.logintype= localStorage.getItem("login-type");
if (remember == "true") { this.remeberMe = true } else { this.remeberMe = false }
if(this.username || this.empname){
this.loginDiv=false;
this.welcomeBack=true;
}else{
this.loginDiv=true;
this.welcomeBack=false;
}
// alert("user>>" + this.username);
// alert("pass>>>" + this.password);
// alert("remember>>>" + this.remeberMe);
@ -93,22 +109,26 @@ export class LoginComponent implements OnInit, OnDestroy {
public addValue(e): void {
// console.log(e.currentTarget.checked);
this.remeberMe = e.currentTarget.checked;
this.remeberMe = true;//e.currentTarget.checked;
this.remeberMyInfo();
}
public remeberMyInfo() {
if (this.remeberMe) {
// if (this.remeberMe) {
if(this.username){localStorage.setItem("user", this.username);}
if(this.password){localStorage.setItem("password", this.password);}
localStorage.setItem("remember", "true");
} else {
localStorage.setItem("user", "");
localStorage.setItem("password", "");
localStorage.setItem("remember", "false");
}
// } else {
// localStorage.setItem("user", "");
// localStorage.setItem("password", "");
// localStorage.setItem("remember", "false");
// }
}
public onLogin() {
// console.log("onLogin");
// this.checkAppUpdated();
// this.checkUserAuthentication();
let deviceToken = localStorage.getItem('deviceToken');
if (deviceToken) {
console.log('login enabled first time: ' + deviceToken);
@ -153,6 +173,10 @@ export class LoginComponent implements OnInit, OnDestroy {
private checkUserAuthentication() {
console.log("debug Here!!");
console.log(this.username);
console.log(this.language);
console.log(this.password);
this.cs.startLoading();
const request = new LoginRequest();
request.P_USER_NAME = this.username;
@ -177,7 +201,9 @@ export class LoginComponent implements OnInit, OnDestroy {
this.cs.sharedService.setSharedData(this.loginData.P_USER_NAME, LoginRequest.SHARED_DATA);
this.remeberMyInfo();
//this.cs.openSMSPage(); phase#1 one type of OTP
// if(!this.welcomeBack){
this.cs.openConfirmLoginPage();//phase#2 add 4 types for OTP
// }
} else {
@ -262,4 +288,18 @@ export class LoginComponent implements OnInit, OnDestroy {
});
}
login() {
console.log("login emit");
console.log("login");
// this.checkUserAuthentication();
this.loginDiv=true;
this.welcomeBack=false;
}
loginWithUser() {
console.log("loginWithUser")
this.cs.openConfirmLoginPage();
}
}

@ -10,13 +10,19 @@
<ion-content padding>
<ion-grid>
<ion-row>
<ion-col class="colPad">
<ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img>
<ion-col [size]="4">
<img [src]="logo" class="logo" />
<!-- <ion-img class="centerDiv" src="../assets/imgs/CS.png"></ion-img> -->
</ion-col>
</ion-row>
<br/>
<br/>
<ion-row>
<ion-col>
<p class="centerDiv">{{'verificationcode,title' | translate}}<span class="boldTxtNav">{{'verificationcode,verificationcode' | translate}}</span> {{'verificationcode,by' | translate}}<span class="boldTxtNav">{{'verificationcode,sms' | translate}}</span>{{'verificationcode,instruct' | translate}}<span class="boldTxtNav">{{'general,submit' | translate}}</span></p>
<p class="headerTxt" > {{'verificationcode,verificationcode' | translate}}</p>
<br/>
<p class="leftDiv">{{'verificationcode,title' | translate}}<span class="boldTxtNav">{{'verificationcode,verificationcode' | translate}}</span> {{'verificationcode,by' | translate}}<span class="boldTxtNav">{{'verificationcode,sms' | translate}}</span>{{'verificationcode,instruct' | translate}}<span class="boldTxtNav">{{'general,submit' | translate}}</span></p>
</ion-col>
</ion-row>
</ion-grid>
@ -25,15 +31,34 @@
<div>
<h1 text-center>{{displayTime}}</h1>
<br/><br/>
<ion-item>
<!-- <ion-label>{{'verificationcode,verificationcode' | translate}}</ion-label> -->
<!-- <img class="item-icon" src="assets/imgs/password.png" item-start /> -->
<!-- <ion-item>
//<ion-label>{{'verificationcode,verificationcode' | translate}}</ion-label>
// <img class="item-icon" src="assets/imgs/password.png" item-start />
<ion-input required type="tel" maxlength="4" (keyup)="checkOTPLength()" placeholder="{{translate.trPK('verificationcode','verificationcode')}}" [(ngModel)]="activationCode"></ion-input>
</ion-item>
</div>
</ion-item> -->
<ion-row class="sms_code" dir="ltr">
<ion-col [size]="12">
<ion-input type="tel" [(ngModel)]="smc_code[0]" maxLength="1" size="1" min="0" max="9" pattern="[0-9]{1}"
inputmode="tel" (ionInput)="goToNextInput($event)" (ionChange)="onChange()" #ref autofocus="true">
</ion-input>
<ion-input type="tel" [(ngModel)]="smc_code[1]" maxLength="1" size="1" min="0" max="9" pattern="[0-9]{1}"
inputmode="tel" (ionInput)="goToNextInput($event)" (ionChange)="onChange()"></ion-input>
<ion-input type="tel" [(ngModel)]="smc_code[2]" maxLength="1" size="1" min="0" max="9" pattern="[0-9]{1}"
inputmode="tel" (ionInput)="goToNextInput($event)" (ionChange)="onChange()"></ion-input>
<ion-input type="tel" [(ngModel)]="smc_code[3]" maxLength="1" size="1" min="0" max="9" pattern="[0-9]{1}"
inputmode="tel" (ionInput)="goToNextInput($event)" (ionChange)="onChange()"></ion-input>
</ion-col>
</ion-row>
</div>
</ion-content>
<ion-footer>
<div class="centerDiv">
<ion-button color="customnavy" ion-button (click)="checkVerificationCode()">{{'general,submit' | translate}}</ion-button>
<ion-button class="button-login" ion-button (click)="checkVerificationCode()">{{'general,submit' | translate}}</ion-button>
</div>
</ion-footer>

@ -18,4 +18,51 @@ h1{
span{
font-weight: bold;
}
}
.button-login{
--background: var(--newgreen) !important;
background: var(--newgreen) !important;
white-space: normal;
color: var(--light);
text-transform: capitalize;
min-height: 1.0cm;
--border-radius: 33px !important;
border-radius: 33px !important;
--min-height: 1.6cm !important;
width: 315px;
}
.leftDiv {
margin: auto;
text-align: left;
display: block;
}
.sms_code{
margin: 0px;
text-align: center;
}
ion-input {
margin: 0 5px;
text-align: center;
line-height: 0;
font-size: 32px;
//border: solid 1px #ccc;
border: solid 0.01cm #000000;
//box-shadow: 0 0 5px #ccc inset;
outline: none;
width: 20%;
transition: all .2s ease-in-out;
border-radius: 3px;
display: inline-block;
&:focus {
border-color:var(--ion-color-secondary) !important;
box-shadow: 0 0 5px var(--ion-color-secondary) !important inset;
}
&::selection {
background: transparent;
}
}

@ -75,6 +75,12 @@ export class SmsPageComponent implements OnInit {
public loginTypeData:any;
public logo = "assets/icon/login/password.png";
public smc_code: any = [];
code: any;
constructor(
public navCtrl: NavController,
@ -131,7 +137,7 @@ export class SmsPageComponent implements OnInit {
this.loginTypeData= this.common.sharedService.getSharedData(SMSCheckRequest.SHARED_DATA, false);
console.log("loginType :"+this.loginTypeData.loginType);
// console.log("loginType :"+this.loginTypeData.loginType);
@ -258,16 +264,17 @@ export class SmsPageComponent implements OnInit {
}
checkVerificationCode() {
this.code=this.smc_code.join('');
if (this.count < 3) {
if (
this.activationCode == undefined ||
this.code == undefined ||
this.activationCode == null ||
this.code == null ||
this.activationCode == ""
this.code == ""
) {
@ -282,7 +289,7 @@ export class SmsPageComponent implements OnInit {
this.checkForgetPwdSMS();
} else {
console.log("checkSMS");
this.checkSMS();
}
@ -304,7 +311,7 @@ export class SmsPageComponent implements OnInit {
public checkSMS() {
// alert("checkSMS in page")
console.log("code" + this.code);
const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false);
const request = new SMSCheckRequest();
@ -313,7 +320,7 @@ export class SmsPageComponent implements OnInit {
request.LogInTokenID = data.LogInTokenID;
request.activationCode = this.activationCode;
request.activationCode = this.code; //code;this.activationCode;
request.P_USER_NAME = data.P_USER_NAME;
@ -336,15 +343,17 @@ export class SmsPageComponent implements OnInit {
this.authService.setAuthenticatedUser(result).subscribe(() => {
//call insert Mobile Login
console.log("insert");
localStorage.setItem("emp-name",result.MemberInformationList[0].EMPLOYEE_NAME);
console.log("empnmae: "+ localStorage.getItem("emp-name"));
if (this.platform.is("cordova")) {
// localStorage.setItem("full-name", result.P_USER_NAME);
this.insertMobileLogin();
}
this.common.openHome();
@ -417,7 +426,7 @@ console.log("successful insertMobileLogin" );
request.LogInTokenID = data.LogInTokenID;
request.activationCode = this.activationCode;
request.activationCode =this.code;// this.activationCode;
request.P_USER_NAME = data.P_USER_NAME;
@ -457,6 +466,53 @@ console.log("successful insertMobileLogin" );
});
}
onChange() {
const filtered = this.smc_code.filter(function (el) {
if (el) {
return el;
}
});
if (filtered.length === 4) {
//this.validate();
console.log("validate");
this.checkVerificationCode();
}
}
goToNextInput(e) {
// let value = e.target.value;
// if (value.length === 1) {
const key = e.which;
const t = e.target;
let sib = t.nextElementSibling;
if (key !== 9 && (key < 48 || key > 57)) {
if (key === 8 || key === 46) {
return true;
} else {
e.preventDefault();
return false;
}
}
if (key === 9) {
return true;
}
if (sib) {
//sib = document.querySelector('input');
if (e.target.value) {
sib.setFocus();
}
}
// } else {
// e.target.value = value.substring(0, value.length - 1);
// }
}
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { WelcomeComponent } from './welcome.component';
describe('WelcomeComponent', () => {
let component: WelcomeComponent;
let fixture: ComponentFixture<WelcomeComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ WelcomeComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(WelcomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,14 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-welcome',
templateUrl: './welcome.component.html',
styleUrls: ['./welcome.component.scss'],
})
export class WelcomeComponent implements OnInit {
constructor() { }
ngOnInit() {}
}

@ -20,7 +20,7 @@ export class HomeComponent implements OnInit {
constructor(private cs: CommonService, private ts: TranslatorService) {
this.menu = this.cs.sharedService.getSharedData('menuEntries', false);
this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
let title: string = this.ts.trPK('eit', 'my-requests');
const title: string = this.ts.trPK('eit', 'my-requests');
this.headerTitle = this.selMenu.List_Menu.MENU_NAME ? this.selMenu.List_Menu.MENU_NAME : title;
}
@ -29,12 +29,12 @@ export class HomeComponent implements OnInit {
openPage(page, index) {
// Reset the content nav to have just this page
// we wouldn't want the back button to show in this scenario
if (page.children.length == 0) {
if (page.children.length === 0) {
this.goToRequest(page);
} else {
if (this.selectedMenu == 0) {
if (this.selectedMenu === 0) {
this.selectedMenu = -1;
} else if (this.selectedMenu != -1) {
} else if (this.selectedMenu !== -1) {
this.selectedMenu = -1;
} else {
this.selectedMenu = index;
@ -47,12 +47,12 @@ export class HomeComponent implements OnInit {
selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
selMenu.GetMenuEntriesList = menuEntry;
this.cs.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
if (menuEntry.REQUEST_TYPE == 'ABSENCE') {
if (menuEntry.REQUEST_TYPE === 'ABSENCE') {
this.cs.openAbsencePage();
} else if (menuEntry.REQUEST_TYPE == 'EIT') {
} else if (menuEntry.REQUEST_TYPE === 'EIT') {
this.cs.openEitListPage();
}
if (menuEntry.REQUEST_TYPE =='PAYSLIP'){
if (menuEntry.REQUEST_TYPE === 'PAYSLIP'){
this.cs.openPayslipPage();
}
}

@ -0,0 +1,8 @@
import { FeedbackDirective } from './feedback.directive';
describe('FeedbackDirective', () => {
it('should create an instance', () => {
const directive = new FeedbackDirective();
expect(directive).toBeTruthy();
});
});

@ -0,0 +1,24 @@
import { Directive, ElementRef, HostListener } from '@angular/core';
import { TranslatorService } from '../../services/translator/translator.service';
import { CommonService } from '../../services/common/common.service';
import { FeedbackService } from './feedback.service';
@Directive({
selector: '[feedback]'
})
export class FeedbackDirective {
constructor(
private cs: CommonService,
private ts: TranslatorService,
private el: ElementRef,
private feedBackService: FeedbackService
) {
}
@HostListener('mousedown') onMouseEnter() {
this.feedBackService.vibrate();
}
}

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { FeedbackService } from './feedback.service';
describe('FeedbackService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: FeedbackService = TestBed.get(FeedbackService);
expect(service).toBeTruthy();
});
});

@ -0,0 +1,20 @@
import { Injectable } from '@angular/core';
import { Vibration } from '@ionic-native/vibration/ngx';
// import { SettingsService } from 'src/app/settings/service/settings.service';
@Injectable({
providedIn: 'root'
})
export class FeedbackService {
// constructor(private vibration: Vibration, private settings: SettingsService) {}
constructor(private vibration: Vibration) {}
public async vibrate() {
try {
const on = true;
if (on) {
this.vibration.vibrate(500);
}} catch (e) {
}
}
}

@ -43,19 +43,14 @@ import { NativeStorage } from '@ionic-native/native-storage/ngx';
import { ProgressLoadingService } from './ui/progressLoading/progress-loading.service';
import { BarChartComponent } from './ui/bar-chart/bar-chart.component';
import { DonutChartComponent } from './ui/donut-chart/donut-chart.component';
//import { UserLocalNotificationService } from './services/user-local-notification/user-local-notification.service';
//import { LocalNotifications } from '@ionic-native/local-notifications/ngx';
import { EmailComponent } from './ui/email/email.component';
import { Badge } from '@ionic-native/badge/ngx';
// import { Push } from '@ionic-native/push/ngx';
import { PushService } from './services/push/push.service';
import { LifeCycleService } from './services/life-cycle/life-cycle.service';
import { HmgBrowserService } from './services/hmg-browser/hmg-browser.service';
import { GuidService } from './services/guid/guid.service';
import { TabsBarComponent } from './ui/tabs-bar/tabs-bar.component';
import { PageTrailerComponent } from './ui/spacer/page-trailer/page-trailer.component';
//import { GeofencingService } from './services/geofencing/geofencing.service';
// import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx';
import { ButtonComponent } from './ui/button/button.component';
import { ToolbarButtonComponent } from './ui/toolbar-button/toolbar-button.component';
import { ListboxModule } from 'primeng/listbox';
@ -83,26 +78,31 @@ import { Diagnostic } from '@ionic-native/diagnostic/ngx';
import { DetailButtonComponent } from './ui/detail-button/detail-button.component';
import { RouterModule } from '@angular/router';
import { HeaderButtonComponent } from './ui/header-button/header-button.component';
//import { CallNumber } from '@ionic-native/call-number/ngx';
import { AppRate } from '@ionic-native/app-rate/ngx';
import { RatingService } from './services/rating/rating.service';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { RateService } from './services/rate/rate.service';
//import { PaymentComponent } from './ui/payment/payment.component';
//import { PaymentService } from './ui/payment/service/payment.service';
import { MenuService } from './services/menu/menuservice.service';
import { ReplacementListComponent } from '../vacation-rule/replacement-list/replacement-list.component';
import { FileSelectDirective } from 'ng2-file-upload';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import { PdfViewerModule } from 'ng2-pdf-viewer';
import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component';
import {Camera,CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx';
import {Camera, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx';
import {File} from '@ionic-native/file/ngx';
import {FileUploderProfileComponent} from './ui/file-uploder-profile/file-uploder-profile.component'
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
import { AccordinCustomComponent } from './ui/accordin-custom/accordin-custom.component';
import { AccordinTabCustomComponent} from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component'
import {DashboredService} from './services/dashbored/dashbored.service';
import {NgxGaugeModule} from 'ngx-gauge';
import {NgxGaugeModule} from 'ngx-gauge';
import { StatsButtonComponent } from './ui/stats-button/stats-button.component';
import { ServicesButtonComponent } from './ui/services-button/services-button.component';
import {ConfirmLoginComponent} from '../authentication/confirm-login/confirm-login.component'
import {WelcomeComponent} from './ui/welcome-login/welcome.component'
import {FabButtonComponent} from './ui/fab-button/fab-button.component'
import { AttendScanService } from './services/attend-services/attend-scan.service';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { NgCircleProgressModule } from 'ng-circle-progress';
@NgModule({
imports: [
CommonModule,
@ -113,9 +113,12 @@ import {DashboredService} from './services/dashbored/dashbored.service';
NgxChartsModule,
ListboxModule,
PdfViewerModule,
NgxGaugeModule
NgxGaugeModule,
NgCircleProgressModule.forRoot()
],
declarations: [
FabButtonComponent,
WelcomeComponent,
NumberRangeComponent,
SSpacerComponent,
MSpacerComponent,
@ -169,9 +172,14 @@ import {DashboredService} from './services/dashbored/dashbored.service';
WorkListAttachViewComponent,
FileUploderProfileComponent,
AccordinTabCustomComponent,
AccordinCustomComponent
AccordinCustomComponent,
StatsButtonComponent,
ServicesButtonComponent,
ConfirmLoginComponent
],
exports: [
FabButtonComponent,
WelcomeComponent,
NumberRangeComponent,
SSpacerComponent,
MSpacerComponent,
@ -216,16 +224,20 @@ import {DashboredService} from './services/dashbored/dashbored.service';
EmptyDataComponent,
DetailButtonComponent,
HeaderButtonComponent,
//PaymentComponent,
ReplacementListComponent,
FileSelectDirective,
WorkListAttachViewComponent,
FileUploderProfileComponent,
AccordinTabCustomComponent,
AccordinCustomComponent,
NgxGaugeModule
NgxGaugeModule,
StatsButtonComponent,
ServicesButtonComponent,
ConfirmLoginComponent,
NgCircleProgressModule
],
providers: [
AttendScanService,
DashboredService,
ConnectorService,
TranslatorService,
@ -240,14 +252,10 @@ import {DashboredService} from './services/dashbored/dashbored.service';
NativeStorage,
ProgressLoadingService,
PushService,
//UserLocalNotificationService,
//LocalNotifications,
Badge,
LifeCycleService,
HmgBrowserService,
GuidService,
// BackgroundGeolocation,
//GeofencingService,
Keyboard,
KeyboardService,
Diagnostic,
@ -256,16 +264,16 @@ import {DashboredService} from './services/dashbored/dashbored.service';
HMGPreloadingStrategy,
HMGPreloadingStrategyLoading,
Diagnostic,
// CallNumber,
AppRate,
RatingService,
InAppBrowser,
RateService,
Camera,
File,
//PaymentService,
MenuService,
OpenNativeSettings
OpenNativeSettings,
BarcodeScanner,
]
})
export class HmgCommonModule { }

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { AttendScanService } from './attend-scan.service';
describe('AttendScanService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: AttendScanService = TestBed.get(AttendScanService);
expect(service).toBeTruthy();
});
});

@ -0,0 +1,123 @@
import { Injectable } from '@angular/core';
// import { DevicePermissionsService } from '../device-permissions/device-permissions.service';
import { DomSanitizer } from '@angular/platform-browser';
import { SharedDataService } from '../shared-data-service/shared-data.service';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { AttendanceService } from 'src/app/home/services/attendance.services';
import { ZBar } from '@ionic-native/zbar/ngx';
import { Geolocation } from "@ionic-native/geolocation/ngx";
import { attendanceSwipeScannerRequest } from 'src/app/home/models/attendanceSwipe.Request';
import { AuthenticatedUser } from '../authentication/models/authenticated-user';
import { CommonService } from '../common/common.service';
import { TranslatorService } from '../translator/translator.service';
import { Response } from "src/app/hmg-common/services/models/response";
import { Camera, CameraOptions,PictureSourceType} from "@ionic-native/Camera/ngx";
import { DevicePermissionsService } from '../../services/device-permissions/device-permissions.service'
import { Device } from "@ionic-native/device/ngx";
@Injectable({
providedIn: 'root'
})
export class AttendScanService {
location: boolean;
camera: boolean;
lat: any;
longt: any;
deviceID: string;
scannedResult: any;
userData: any = {};
constructor(private device: Device,
private zbar: ZBar,
private geolocation: Geolocation,
private attendance_service: AttendanceService,
private barcodeScanner: BarcodeScanner,
private cameraController: Camera,
public sharedData: SharedDataService,
private sanitizer: DomSanitizer,
private permissions: DevicePermissionsService,
public common:CommonService,
public ts: TranslatorService,) {
this.userData =this.common.sharedService.getSharedData(AuthenticatedUser.SHARED_DATA,false);
}
public getDeviceLocation() {
let isVirtual = this.device.isVirtual;
if(isVirtual==true){
alert("emulater>>>>>>>"+isVirtual);
alert("You are using virtual device");
return false;
}
this.permissions.requestLocationAutherization().then(granted => {
this.location = granted as boolean;
if (this.location) {
this.geolocation
.getCurrentPosition({ maximumAge: 3000, timeout: 10000, enableHighAccuracy: true })
.then(resp => {
// console.log(resp.coords.latitude);
// console.log(resp.coords.longitude);
this.lat = resp.coords.latitude;
this.longt = resp.coords.longitude;
this.attendance();
})
.catch(error => {
console.log("Error getting location", error);
});
} else {
return false;
}
});
}
public attendance() {
this.permissions.requestCameraAutherization().then(granted => {
this.camera = granted as boolean;
if (this.camera) {
this.scanCode();
}
}
);
}
public scanCode() {
this.barcodeScanner.scan().then(barcodeData => {
console.log('Barcode data', barcodeData);
// let strResult = JSON.parse(barcodeData);
// console.log(strResult.QRValue);
this.scannedResult = barcodeData;
this.deviceID = this.device.uuid;
this.swipeAttendance();
}).catch(err => {
console.log('Error', err);
});
}
public swipeAttendance() {
let request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
request.Latitude = this.lat;
request.Longitude = this.longt;
request.QRValue = this.scannedResult.text;
request.UID = this.deviceID;
request.UserName = this.userData.EMPLOYEE_NUMBER;
console.log("request");
console.log(JSON.stringify(request));
this.attendance_service
.attendanceSwipeScanner(request, () => {
console.log("Error inside in swipe attendance");
})
.subscribe((result: Response) => {
if (this.common.validResponse(result)) {
console.log("response");
console.log(result);
this.common.presentAlert(this.ts.trPK("home", "swipeAlertSuccess"));
} else {
this.common.presentAlert(this.ts.trPK("home", "swipeAlertFailed"));
}
});
}
}

@ -16,5 +16,6 @@ export class SMSCheckResponse extends Response {
public CompanyImageDescription:string;
public CompanyImageURL:string;
public EMPLOYEE_MOBILE_NUMBER:string;
public EMPLOYEE_NAME:string;
}

@ -112,6 +112,64 @@ export class CommonService {
this.nav.pop();
}
public getMonthName(value: number): string {
switch (value) {
case 1:
return "January";
case 2:
return "February";
case 3:
return "March";
case 4:
return "April";
case 5:
return "May";
case 6:
return "June";
case 7:
return "July";
case 8:
return "August";
case 9:
return "September";
case 10:
return "October";
case 11:
return "November";
case 12:
return "December";
}
}
public getMonthNameAr(value: number): string {
switch (value) {
case 1:
return "يناير";
case 2:
return " فبراير";
case 3:
return "مارس";
case 4:
return "أبريل";
case 5:
return "مايو";
case 6:
return "يونيو";
case 7:
return "يوليو";
case 8:
return "أغسطس";
case 9:
return "سبتمبر";
case 10:
return " اكتوبر";
case 11:
return " نوفمبر";
case 12:
return "ديسمبر";
}
}
public round(value: number, decimal: number): string {
const valueStr = value.toString();
const dotIndex = valueStr.indexOf(".");
@ -453,6 +511,51 @@ export class CommonService {
}
async confirmAlertDialogAttendance(
onAccept: any,
acceptLabel: string,
onCancel: any,
cancelLabel: string,
title: string,
message: string
) {
this.clearAllAlerts();
const alert = await this.alertControllerIonic.create({
header: this.ts.trPK("general", "confirm"),
message: message,
buttons: [
{
text: cancelLabel,
role: "cancel",
cssClass: "checkOutCancelBtn",
handler: () => {
if (onCancel) {
onCancel();
}
this.alertControllerIonic.dismiss();
}
},
{
text: acceptLabel,
role: "Confirm",
cssClass: "checkOutOkBtn",
handler: () => {
if (onAccept) {
onAccept();
}
this.alertControllerIonic.dismiss();
}
}
]
});
// this.alerts.push(alert);
await alert.present();
}
public clearAllAlerts() {
// custom solutions because of async issue
const alerts = document.getElementsByTagName("ion-alert");
@ -969,6 +1072,10 @@ export class CommonService {
/*
open calls
*/
public openAttenTrackingpage(){
this.nav.navigateForward(["/attendance-tracking/home"]);
}
public openEitListPage() {
this.nav.navigateForward(["/eit/eit-list"]);
}

@ -1,9 +1,10 @@
export class AttendanceTrackingList{
public SCHEDULED_HOURS :string;
public SPENT_HOURS : string;
public REMAINING_HOURS : string;
public RETURN_STATUS : string;
public RETURN_MSG : string;
}
export class AttendanceTrackingList {
public P_REMAINING_HOURS: string;
public P_RETURN_MSG: string;
public P_RETURN_STATUS: string;
public P_SCHEDULED_HOURS: string;
public P_SHT_NAME: string;
public P_SPENT_HOURS: string;
}

@ -1,9 +1,5 @@
export class OpenMissingSwipesList{
public OPEN_MISSING_SWIPES :number;
public RETURN_STATUS : string;
public RETURN_MSG : string;
export class OpenMissingSwipesList {
public P_OPEN_MISSING_SWIPES: number;
public P_RETURN_STATUS: string;
public P_RETURN_MSG: string;
}

@ -1,8 +1,8 @@
import { Response } from "src/app/hmg-common/services/models/response";
import { Response } from 'src/app/hmg-common/services/models/response';
import { AttendanceTrackingList } from './AttensanceTrackingList';
export class AttendanceTrackingResponse extends Response{
public GetGetAttendanceTrackingList : AttendanceTrackingList[];
}
export class AttendanceTrackingResponse extends Response {
public GetGetAttendanceTrackingList: AttendanceTrackingList[];
}

@ -1,8 +1,8 @@
import { Injectable } from '@angular/core';
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service";
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
import { Observable } from 'rxjs';
import { Request } from "src/app/hmg-common/services/models/request";
import { Request } from 'src/app/hmg-common/services/models/request';
import { OrganizationSalariesResponse } from './organization-salaries.response';
import { OpenMissingSwipesResponse } from './open-missing-swipes.response';
import { PerformanceAppraisalResponse } from './performance-appraisal.response';
@ -19,10 +19,10 @@ import {GetOpenNotificationsResponse} from './models/GetOpenNotificationsRespons
providedIn: 'root'
})
export class DashboredService {
public static organizationSalariesUrl="Services/ERP.svc/REST/GET_ORGANIZATIONS_SALARIES"
public static openmissingswipesUrl="Services/ERP.svc/REST/GET_OPEN_MISSING_SWIPES"
public static performanceappraisalUrl="Services/ERP.svc/REST/GET_Performance_Appraisal"
public static attendancetrackingUrl="Services/ERP.svc/REST/GET_Attendance_Tracking"
public static organizationSalariesUrl = 'Services/ERP.svc/REST/GET_ORGANIZATIONS_SALARIES';
public static openMissingSwipesUrl = 'Services/ERP.svc/REST/GET_OPEN_MISSING_SWIPES';
public static performanceappraisalUrl = 'Services/ERP.svc/REST/GET_Performance_Appraisal';
public static attendancetrackingUrl = 'Services/ERP.svc/REST/GET_Attendance_Tracking';
public static getOpenPeriodDates = 'Services/ERP.svc/REST/GET_OPEN_PERIOD_DATES';
public static getOpenNotifications = 'Services/ERP.svc/REST/GET_OPEN_NOTIFICATIONS';
@ -34,7 +34,7 @@ export class DashboredService {
public authService: AuthenticationService,
) { }
public getOrganizationSalaries(onError ?:any ,oerrorLable ?:any):Observable<OrganizationSalariesResponse>{
public getOrganizationSalaries(onError ?: any ,oerrorLable ?: any): Observable<OrganizationSalariesResponse>{
const request = new Request();
this.authService.authenticateRequest(request);
return this.con.post(
@ -44,11 +44,11 @@ export class DashboredService {
oerrorLable
);}
public getOpenMissingSwipes(onError ?:any ,oerrorLable ?:any):Observable<OpenMissingSwipesResponse>{
public getOpenMissingSwipes(onError ?: any, oerrorLable ?: any): Observable<OpenMissingSwipesResponse> {
const request = new Request();
this.authService.authenticateRequest(request);
return this.con.post(
DashboredService.openmissingswipesUrl,
DashboredService.openMissingSwipesUrl,
request,
onError,
oerrorLable
@ -56,7 +56,7 @@ export class DashboredService {
}
public getPerformanceAppraisal(onError ?:any ,oerrorLable ?:any):Observable<PerformanceAppraisalResponse>{
public getPerformanceAppraisal(onError ?: any ,oerrorLable ?: any): Observable<PerformanceAppraisalResponse>{
const request = new Request();
this.authService.authenticateRequest(request);
return this.con.post(
@ -66,7 +66,7 @@ export class DashboredService {
oerrorLable
);
}
public getAttendanceTracking(onError ?:any ,oerrorLable ?:any):Observable<AttendanceTrackingResponse>{
public getAttendanceTracking(onError ?: any ,oerrorLable ?: any): Observable<AttendanceTrackingResponse>{
const request = new Request();
this.authService.authenticateRequest(request);
return this.con.post(
@ -86,11 +86,11 @@ public getAttendanceTracking(onError ?:any ,oerrorLable ?:any):Observable<Attend
this.authService.authenticateRequest(request);
return this.con.post(DashboredService.getOpenNotifications, request, onError, errorLabel);
}
public getSubordinatesLeaves( req:GetSubordinatesLeavesRequest,onError?: any, errorLabel?: string): Observable<GetSubordinatesLeavesResponse> {
public getSubordinatesLeaves( req: GetSubordinatesLeavesRequest,onError?: any, errorLabel?: string): Observable<GetSubordinatesLeavesResponse> {
this.authService.authenticateRequest(req);
return this.con.post(DashboredService.getSubordinatesLeaves, req, onError, errorLabel);
}
public getSubordinatesAttStatus( req:GetSubordinatesAttdStatusRequest, onError?: any, errorLabel?: string): Observable<GetSubordinatesAttdStatusResponse> {
public getSubordinatesAttStatus( req: GetSubordinatesAttdStatusRequest, onError?: any, errorLabel?: string): Observable<GetSubordinatesAttdStatusResponse> {
this.authService.authenticateRequest(req);
return this.con.post(DashboredService.getSubordinatesAttStatus, req, onError, errorLabel);
}

@ -1,11 +1,6 @@
export class GetOpenNotificationsList
{
public ITEM_TYPE: number;
public ITEM_TYPE_DISPLAY_NAME:number;
public OPEN_NTF_NUMBER:number;
}
export class GetOpenNotificationsList {
public ITEM_TYPE: number;
public ITEM_TYPE_DISPLAY_NAME: number;
public OPEN_NTF_NUMBER: number;
public P_OPEN_NTF_NUMBER: number;
}

@ -2,7 +2,7 @@
import { Response } from "src/app/hmg-common/services/models/response";
import { OpenMissingSwipesList } from './OpenMissingSwipesList';
export class OpenMissingSwipesResponse extends Response{
public GetGetOpenMissingSwipesList : OpenMissingSwipesList[];
}
export class OpenMissingSwipesResponse extends Response{
public GetGetOpenMissingSwipesList: OpenMissingSwipesList[];
}

@ -6,7 +6,7 @@
box-shadow: 0px 0px 8px 2px #d5d5d5ab;
background: white;
margin-bottom: 0.3cm;
border-color: #ececec;
// border-color: #ececec;
border-style: solid;
border-width: 0.02cm;
}

@ -13,6 +13,8 @@ export class ButtonComponent implements OnInit {
@Input() class: any = '';
@Input() icon: string;
@Input() title: string;
@Input() buttonClass: any = '';
@Input() pClass: any = '';
@Output() trigger = new EventEmitter();
@Input() settings: ButtonSettings;
public direction: string;

@ -0,0 +1,14 @@
<div [class]=" direction == 'rtl' ? ' wrapper wrapper_left' : 'wrapper wrapper_right '">
<div class="circle pulse"></div>
<div class="circle">
<ion-fab class="fab-i ">
<ion-fab-button class="cbookApointmentBtn" (click)="onClick()" >
<!-- <img style="width: 39%; margin-top: -29%;" src="assets/icon/booking.png" /> -->
<ion-icon class="iconFab" name="finger-print"></ion-icon>
<p class="fab-p">{{ 'attendance-tracking,title' | translate }} </p>
</ion-fab-button>
</ion-fab>
</div>
</div>

@ -0,0 +1,219 @@
////////////////////book btn/////////////////////
ion-fab-button{
--background: var(--darkblue)!important;
// background: url(/assets/icon/sliderBG.jpg);
background-size: cover;
background-position: top right;
border-radius: 50%;
height:112px;
width: 112px;
}
.cbookApointmentBtn{
// --background:transparent !important;
--background-focused: transparent;
--background-hover:transparent;
--background-activated: transparent;
--background: transparent;
}
.fab-p{
// position: absolute;
// bottom: 0;
// left: 0;
// right: 0;
// line-height: 0;
// margin: 12px;
// margin-bottom: 28%;
// margin-top: 27px;
position: absolute;
bottom: 0;
left: 0;
right: 0;
/* line-height: 0; */
margin: 12px;
margin-bottom: 14%;
white-space: pre-line;
font-size: 13px;
}
.fab-i{
top:0px;
left:0px;
}
button-inner{
--top: -11px !important;
}
.iconFab{
margin-top: -37px;
width: 100px;
height: 60px;
}
////////////////animation/////////////////////////
// .wrapper {
// position: fixed;
// width: 60px;
// height: 60px;
// margin: 0 auto;
// left: 65px;
// bottom: 84px;
// z-index: 100;
// }
// .wrapper1{
// left:inherit;
// right: 65px;
// }
// .wrapper .circle {
// width: 110px;
// height: 110px;
// position: absolute;
// top: 0;
// left: -40px;
// right: 0;
// bottom: 20px;
// border-radius: 50%;
// margin: auto;
// -webkit-transform: scale(1, 1);
// transform: scale(1, 1);
// }
.wrapper {
position: fixed;
width: 3cm;
height: 3cm;
/* margin: 0 auto; */
bottom: 2.1cm;
padding: 0;
z-index: 100;
}
.wrapper1{
left:inherit;
right: 65px;
}
.wrapper_left {
left: 4%;
}
.wrapper_right {
right: 4%;
}
.wrapper .circle {
width: 112px;
height: 112px;
position: absolute;
top: 118%;
left: -10%;
right: 0;
bottom: 20px;
border-radius: 50%;
margin: auto;
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
}
.wrapper .circle.pulse {
-webkit-animation-timing-function: ease;
animation-timing-function: ease;
-webkit-animation: pulse 2s infinite;
animation: pulse 2s infinite;
background-color: var(--ion-color-secondary-tint);
opacity: 0.7;
}
@-webkit-keyframes pulse {
0% {
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
}
25% {
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
}
50% {
-webkit-transform: scale(1.2, 1.2);
transform: scale(1.2, 1.2);
}
100% {
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
}
}
@keyframes pulse {
0% {
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
}
25% {
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
}
50% {
-webkit-transform: scale(1.2, 1.2);
transform: scale(1.2, 1.2);
}
100% {
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
}
}
@media only screen and (max-width: 350px) {
ion-fab-button{
--background: var(--ion-color-secondary);
height:90px;
width: 90px;
left: 0px;
}
.wrapper .circle {
width: 90px;
height: 90px;
position: absolute;
top: 0;
left: 0px;
right: 0;
bottom: 20px;
border-radius: 50%;
margin: auto;
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
}
}
.dashboard-container {
margin-bottom: 0.9cm;
}
.clicked {
}
.clicked:hover {
background-color: green;
}
.clicked:focus {
background-color: orange;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FabButtonComponent } from './fab-button.component';
describe('FabButtonComponent', () => {
let component: FabButtonComponent;
let fixture: ComponentFixture<FabButtonComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FabButtonComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FabButtonComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,24 @@
import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { TranslatorService } from '../../services/translator/translator.service';
@Component({
selector: 'fab-button',
templateUrl: './fab-button.component.html',
styleUrls: ['./fab-button.component.scss'],
})
export class FabButtonComponent implements OnInit {
@Output() trigger = new EventEmitter();
public direction: any;
constructor(
) { }
ngOnInit() {
this.direction = TranslatorService.getCurrentDirection();
}
public onClick() {
this.trigger.emit();
}
}

@ -1,3 +1,8 @@
.float-left{
float: left;
}
ion-menu-button {
font-size: 0.8cm;
color: white;
background: #22c6b3;
}

@ -0,0 +1,8 @@
<div feedback class="custom-button">
<div class="iconBox">
<img [src]="icon" class="icon">
</div>
<div class="titleBox">
<p class="pClass">{{title}}</p>
</div>
</div>

@ -0,0 +1,34 @@
.custom-button {
background: white;
margin-bottom: 0px;
border: 1px solid #ccc;
border-radius: 20px;
width: 100%;
max-width: 105px;
height: 100px;
padding: 10px;
min-width: 96px;
}
.iconBox {
display: block;
width: 100%;
position: static;
}
.iconBox img{
margin: 0px auto 10px;
display: block;
// max-width: 35%;
}
.titleBox {
display: block;
}
.pClass {
font-size: 12PX;
text-align: center;
margin-top: 10px;
color: black;
font-weight: bold;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ServicesButtonComponent } from './services-button.component';
describe('ServicesButtonComponent', () => {
let component: ServicesButtonComponent;
let fixture: ComponentFixture<ServicesButtonComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ServicesButtonComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ServicesButtonComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,28 @@
import { Component, OnInit, Input, Output, EventEmitter} from '@angular/core';
import { TranslatorService } from '../../services/translator/translator.service';
@Component({
selector: 'app-services-button',
templateUrl: './services-button.component.html',
styleUrls: ['./services-button.component.scss'],
})
export class ServicesButtonComponent implements OnInit {
@Input() class: any = '';
@Input() buttonClass: any = '';
@Input() icon: string;
@Input() title: string;
@Output() trigger = new EventEmitter();
@Input() focusicon: string;
@Input() disabled = false;
public direction: string;
public style: any;
constructor(
public ts: TranslatorService
) {}
ngOnInit() {}
public onClicked() {}
}

@ -0,0 +1,9 @@
<div feedback class="custom-button">
<div class="iconBox">
<img [src]="icon" class="icon">
</div>
<div class="titleBox">
<span>{{statsValue}}</span>
<p class="pClass">{{title}}</p>
</div>
</div>

@ -0,0 +1,42 @@
.custom-button {
background: white;
margin-bottom: 0px;
border: 1px solid #ccc;
border-radius: 20px;
width: 100%;
max-width: 105px;
height: 160px;
padding: 10px;
}
.iconBox {
display: block;
width: 100%;
position: static;
img {
display: block;
max-width: 45%;
padding-bottom: 5px;
padding-top: 5px;
}
}
.titleBox {
display: block;
span {
font-size: 30px;
font-weight: bold;
color: black;
text-align: left;
display: block;
}
}
.pClass {
color: black;
width: 85%;
margin-top: 5px;
font-weight: bold;
text-align: left;
display: block;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { StatsButtonComponent } from './stats-button.component';
describe('StatsButtonComponent', () => {
let component: StatsButtonComponent;
let fixture: ComponentFixture<StatsButtonComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ StatsButtonComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(StatsButtonComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,29 @@
import { Component, OnInit, Input, Output, EventEmitter} from '@angular/core';
import { TranslatorService } from '../../services/translator/translator.service';
@Component({
selector: 'app-stats-button',
templateUrl: './stats-button.component.html',
styleUrls: ['./stats-button.component.scss'],
})
export class StatsButtonComponent implements OnInit {
@Input() class: any = '';
@Input() buttonClass: any = '';
@Input() icon: string;
@Input() title: string;
@Input() statsValue: string;
@Output() trigger = new EventEmitter();
@Input() focusicon: string;
@Input() disabled = false;
public direction: string;
public style: any;
constructor(
public ts: TranslatorService
) {}
ngOnInit() {}
public onClicked() {}
}

@ -0,0 +1,69 @@
<ion-content has-bouncing="false" forceOverscroll="false" class="ion-no-padding">
<ion-grid padding>
<ion-row>
<ion-col [size]="12">
<!-- <img [src]="logo" class="loginLogo" />
<h1 class="heading1">{{welcome}} </h1> -->
<p class="text1" style="margin-bottom: -8px;font-weight: bold;font-size: 28px;">{{'home,welcome-back' | translate}} </p>
<p class="text1" style="font-size: 28px;margin-top: 0px;" >{{empname}}</p>
<p *ngIf="!empname" class="text1">{{welcome_txt}} </p>
<p class="text1">{{txt_account}} </p>
</ion-col>
</ion-row>
<ion-row class="row-border" *ngIf="empname && isLastLogin">
<ion-col size="6" style="padding: 5px 10px; border-right:1px solid #bbbbbb">
<p class="last-login" style="font-weight: bold">{{'login,last-login' | translate}} </p>
<!-- <p class="last-login small-font-size">{{user.EditedOn | date}}
{{lastLoginTime}}</p>-->
</ion-col>
<ion-col size="6" style="padding: 5px 10px;">
<p class="last-login" style="font-weight: bold" [ngClass]="{'fadein':empname && isLastLogin }">
{{'login,last-login-with' | translate}}
</p>
<p class="last-login">{{getLoginType(logintype)}}</p>
</ion-col>
</ion-row>
<ion-row class="ion-no-padding description" *ngIf="empname && isLastLogin">
<ion-col style="margin-top:-5px" class="ion-no-padding " [size]=6>
<app-confirm-login [accessFromOutSide]="true" *ngIf="empname"></app-confirm-login>
</ion-col>
<ion-col [size]=6>
<app-button (click)="loginwithuser()" [title]="button.title | translate " [icon]="button.icon"
[settings]="button.settings" [strong]="button.txt" [disabled]="button.disabled"
[buttonClass]="button.buttonClass" [pClass]="button.pClass" [class]="button.class">
</app-button>
</ion-col>
</ion-row>
</ion-grid>
</ion-content>
<ion-footer class="welcome-footer">
<ion-row class="ion-justify-content-center " *ngIf="empname">
<ion-col [size]="12">
<ion-button class="centerDiv button-login" expand="block" (click)="login()">
{{'login, another-acc' | translate}}
</ion-button>
</ion-col>
</ion-row>
<ng-template #userinfo_login>
<ion-row class="ion-justify-content-center bottom-buttons">
<ion-col [size]="12">
<ion-button class="gray-button" expand="block" (click)="login()">
{{'rate,yes' | translate}}
</ion-button>
<!-- <ion-button class="red-button" expand="block" (click)="register()">
{{'general,no' | translate}}
</ion-button> -->
</ion-col>
</ion-row>
</ng-template>
</ion-footer>

@ -0,0 +1,68 @@
.logo-en {
text-align: left;
}
.logo-ar {
text-align: right;
}
.welcome {
margin: 10px;
display: inline-block;
font-weight: bold;
font-size: 0.55cm;
}
.description {
margin-top: .5cm;
}
.last-login {
margin: 0;
font-size: 12px;
text-align: center;
}
.row-border {
margin-top: 20px;
border: 1px solid #bbbbbb;
border-radius: 10px;
padding: 5px;
background: #dddddd;
}
.fadein {
-webkit-animation-name: fadeIn;
animation-name: fadeIn;
}
.small-font-size {
font-size: 14px;
;
}
.bottom-buttons {
margin-bottom: 0;
}
@-webkit-keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.welcome-footer {
position: fixed;
bottom: 10px;
left: 0;
right: 0;
}
.text1 {
line-height: 1.5;
}

@ -0,0 +1,27 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { WelcomeComponent } from './welcome.component';
describe('WelcomeComponent', () => {
let component: WelcomeComponent;
let fixture: ComponentFixture<WelcomeComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ WelcomeComponent ],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(WelcomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -0,0 +1,182 @@
import {
Component,
OnInit,
Output,
EventEmitter,
AfterViewInit,
ViewChild,
OnDestroy
} from "@angular/core";
import { TranslatorService } from "../../services/translator/translator.service";
import { CommonService } from "../../services/common/common.service";
import { AuthenticationService } from "../../services/authentication/authentication.service";
import { ConfirmLoginComponent } from 'src/app/authentication/confirm-login/confirm-login.component';
import * as moment from 'moment'
import { ButtonSettings } from '../button/models/button-settingsl';
import { Events } from '@ionic/angular';
@Component({
selector: "welcome-login",
templateUrl: "./welcome.component.html",
styleUrls: ["./welcome.component.scss"]
})
export class WelcomeComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(ConfirmLoginComponent, {read: ConfirmLoginComponent }) confimLogin: ConfirmLoginComponent;
// @ViewChild(ConfirmLoginComponent, { static: false, read: ConfirmLoginComponent }) confimLogin: ConfirmLoginComponent;
public logo = "assets/imgs/bell.png";
public direction: any;
public user: any;
public count: number = 0;
public count2: number = 0;
public txt_account: any;
public isLastLogin: any;
public welcome: string;
public userName: string;
public lastLoginTime: any;
public welcome_txt: any;
// public loginTypeDef = {
// 1: this.ts.trPK("sms", "title"),
// 2: this.ts.trPK("sms", "fingerprint"),
// 3: this.ts.trPK("sms", "face-recognition"),
// 4: this.ts.trPK("sms", "whatsapp")
// };
public loginTypeDef = {
1: this.ts.trPK("sms", "title"),
2: this.ts.trPK("sms", "fingerprint"),
3: this.ts.trPK("sms", "face-recognition"),
4: this.ts.trPK("sms", "whatsapp")
};
@Output() onLogin = new EventEmitter();
@Output() loginWithUser = new EventEmitter();
public button =
{
title: "login, more-verify",
url: null,
icon: "assets/imgs/more.png",
settings: new ButtonSettings(true, true, true, true),
value: 2,
txt: 'More',
disabled: false,
buttonClass: 'buttonClassWhite',
pClass: 'pClassMyFileIconBlack',
class: 'nationalIdIcon',
visible: true
};
password: string;
empname: string;
logintype: any;
constructor(
public ts: TranslatorService,
public cs: CommonService,
public authservice: AuthenticationService,
public events: Events
) { }
ngOnInit() {
// retrive user info **
this.userName = localStorage.getItem("user");
this.password = localStorage.getItem("password");
let remember = localStorage.getItem("remember");
this.empname= localStorage.getItem("emp-name");
this.logintype= localStorage.getItem("login-type");
this.logintype = parseInt(this.logintype)
this.welcome_txt = this.ts.trPK("home", "welcome-txt");
this.txt_account = this.user
? this.ts.trPK("home", "account-info")
: "";
this.setWelcomeMessage();
this.setDescription();
//later to fix below code
if (this.user) {
// this.lastLoginTime = moment(this.cs.evaluteDateAsObject(this.user.EditedOn)).format("HH:mm");
}
}
ngOnDestroy(): void {
}
private setWelcomeMessage() {
console.log(this.userName + "this.userName");
if (this.userName) {
this.welcome = this.ts.trPK("home", "welcome-back");
console.log(this.welcome + "this.welcome");
this.welcome += " " + this.empname || '';
this.isLastLogin = true;
console.log(this.isLastLogin + "this.isLastLogin");
} else {
this.welcome = this.ts.trPK("home", "welcome-head");
}
}
private setDescription() {
this.txt_account = this.userName ?
this.ts.trPK("home", "account-info") :"";
}
ngAfterViewInit() {
console.log("this.confimLogin.buttons[0]" + this.confimLogin.buttons[0]);
setTimeout(() => {
if (this.userName && this.confimLogin.buttons[0]) {
console.log(this.userName );
console.log(this.confimLogin.buttons[0]);
this.confimLogin.buttons[0].forEach(element => {
if (this.logintype === element.value) {
console.log(this.logintype );
console.log(element.value);
console.log("this.logintype === element.value");
element.visible = true;
} else {
console.log("this.logintype != element.value");
element.visible = false;
}
});
}
}, 200);
}
public moreLoginOptions() {}
login() {
this.onLogin.emit();
}
loginwithuser() {
this.loginWithUser.emit();
}
// getDate(date: string) {
// return this.cs.getDateTimeISOFromString(date);
// }
getLoginType(type: any) {
return this.loginTypeDef[type];
}
convertTime(time) {
// alert(time)
return time;
}
}

@ -25,7 +25,7 @@ const routes: Routes = [
declarations: [
HomePage
],
providers:[
providers: [
BarcodeScanner
]
})

@ -1,117 +1,171 @@
<!-- <ion-header no-shadow no-border>
<ion-toolbar>
<ion-header>
<ion-toolbar class="header-toolbar-new">
<nav-buttons [enableMenu]="true" [enableBack]="false" [navigate]="false"></nav-buttons>
<ion-title>home </ion-title>
<ion-badge id="homeBadgeBtn" item-end>{{notBadge}}</ion-badge>
<ion-title>DASHBOARD</ion-title>
<div class="profile-image-container" (click)="openProfilePage()">
<img [src]="userImage"/>
</div>
</ion-toolbar>
</ion-header> -->
<ion-content class="colorBG">
<div class="header-div">
<button ion-button icon-only menuToggle class="menubutton" (click)="openMenu()">
<img class="menuImg" src="../assets/imgs/home/burgerMenu.png"/>
<ion-badge id="homeBadgeBtn" slot="end" color="danger">{{notBadge}}</ion-badge>
</button>
<!-- <button ion-button icon-only menuToggle class="menubuttonTrans" (click)="openMenu()">
<img class="transImg" src="../assets/imgs/home/arabicSwitch.png"/>
</button> -->
<div class="centerDiv homeBox" (click)="openPersonalInfo()">
<p class="TxtPlace">{{ts.trPK('home','hello')}}, {{userData.EMPLOYEE_DISPLAY_NAME}}</p>
<div class="profileDiv">
<!-- <ion-img class="profileImg" src="{{user_image}}"></ion-img> -->
<img class="profileImg" [src]="user_image">
</ion-header>
</div>
</div>
<div class="changeImgBtn">
<button ion-button icon-only menuToggle class="menubutton" (click)="changeImage()">
<ion-icon class="changeIcon" name="camera"></ion-icon></button>
<!-- <app-file-uploder-profile >
</app-file-uploder-profile>
-->
<!-- <file-uploader (fileSelected)="attachmentSelected($event)" [maxFileSize]="maxFileSize" [multiupload]="false"></file-uploader> -->
<ion-content class="main-dashboard-container">
<ion-grid class="main-container contentBg">
<ion-row class="slideFullWidth">
<ion-slides [options]="slideOptsOne" class="padding-slide slide">
<ion-slide *ngFor="let button of statsButtons; let i=index;">
<app-stats-button
[title]="button.title"
[statsValue]="button.statsValue"
[icon]="button.icon">
</app-stats-button>
</ion-slide>
</ion-slides>
</ion-row>
<ion-row *ngFor="let menuItem of menuEntries; let i=index">
</div>
</div>
<ion-row class="attendance-module" *ngIf="i == 1">
<ion-col [size]="8">
<h3>Monthly Attendance</h3>
<span>View your Monthly Time Sheet</span>
<ion-button>
View Detail
</ion-button>
</ion-col>
<ion-col [size]="4">
<img src="assets/icon/new-design/attendance_button_icon.png"/>
</ion-col>
</ion-row>
<ion-col [size]="12">
<ion-label>{{menuItem.PROMPT}}</ion-label>
</ion-col>
<ion-slides [options]="slideOptsTwo">
<ion-slide *ngFor="let subMenu of menuItem.children; let j=index">
<app-services-button
(click)="openPage(subMenu)"
[title]="subMenu.PROMPT"
icon="assets/icon/new-design/leave_balance.png">
</app-services-button>
</ion-slide>
</ion-slides>
</ion-row>
<div>
<div>
<p class="dash-header text-caps">{{ts.trPK('home','dashboard')}}</p>
</div>
<div>
<ion-grid class="cus-grid">
<ion-row>
<ion-col size="6" class="col-grid" *ngFor="let item of menuList; let i=index">
<button ion-button block class="serviceItem" (click)="getMeunDetails(i)">
<img class="serviceItemImg" src="../assets/imgs/{{item.MENU_TYPE}}.png"/>
<p> {{ item.MENU_NAME }} {{item.SUB_MENU_NAME}}</p>
</button>
</ion-col>
<ion-col size="6" class="col-grid">
<button ion-button block class="serviceItem" (click)="getDeviceLocation()">
<ion-img class="serviceItemImg" src="../assets/imgs/home/attendanceSwipe.png"></ion-img>
<p>{{ts.trPK('attendance','attendance')}}</p>
</button>
</ion-col>
<ion-col size="6" class="col-grid" >
<button ion-button block class="serviceItem" id="vacationRule" (click)="Vacation_Rule()">
<ion-img class="serviceItemImg" src="../assets/imgs/home/vacationRule.png"></ion-img>
<p>{{ts.trPK('vacation-rule','vacationRule')}}</p>
</button>
</ion-col>
<ion-col size="6" class="col-grid">
<button ion-button block class="serviceItem" id="accrualBalance" (click)="accrualBalance()">
<ion-img class="serviceItemImg" src="../assets/imgs/home/accrualBalances.png"></ion-img>
<p>{{ts.trPK('absenceList','accrualBalances')}}</p>
</button>
</ion-col>
<ion-col size="6" class="col-grid">
<button ion-button block class="serviceItem" (click)="Change_password()">
<ion-img class="serviceItemImg" src="../assets/imgs/home/changePasword.png"></ion-img>
<p>{{ts.trPK('changePassword','changePassword')}}</p>
</button>
<!-- <ion-row class="attendance-module">
<ion-col [size]="8">
<h3>Monthly Attendance</h3>
<span>View your Monthly Time Sheet</span>
<ion-button>
View Detail
</ion-button>
</ion-col>
<ion-col [size]="4">
<img src="assets/icon/new-design/attendance_button_icon.png"/>
</ion-col>
</ion-row> -->
<!-- <ion-row>
<ion-col [size]="12">
<ion-label>My Travelling</ion-label>
</ion-col>
<ion-col [size]="4">
<app-services-button
title="Ticket Request"
icon="assets/icon/new-design/ticket_request.png">
</app-services-button>
</ion-col>
<ion-col size="6" class="col-grid">
<button ion-button block class="serviceItem" (click)="openPayslip()">
<ion-img class="serviceItemImg" src="../assets/imgs/home/paySlip.png"></ion-img>
<p>{{ts.trPK('login','payslip')}}</p>
</button>
<ion-col [size]="4">
<app-services-button
title="Borrowing Passport"
icon="assets/icon/new-design/borrowing_passport.png">
</app-services-button>
</ion-col>
<!-- <ion-col size="6" class="col-grid">
<button ion-button block class="serviceItem" (click)="Change_password()">
<ion-img class="serviceItemImg" src="../assets/imgs/home/announcements.png"></ion-img>
<p>{{ts.trPK('login','announcement')}}</p>
</button>
<ion-col [size]="4">
<app-services-button
title="Vacations Rules"
icon="assets/icon/new-design/vacation_rules.png">
</app-services-button>
</ion-col>
<ion-col size="6" class="col-grid">
<button ion-button block class="serviceItem" (click)="Change_password()">
<ion-img class="serviceItemImg" src="../assets/imgs/home/timeAttendance.png"></ion-img>
<p>{{ts.trPK('home','timeAndAttendance')}}</p>
</button>
</ion-col> -->
<!-- <ion-col size="6" class="col-grid">
<button ion-button block class="serviceItem" (click)="openPayslip()">
<ion-img class="serviceItemImg" src="../assets/imgs/changepass.png"></ion-img>
<p>{{ts.trPK('payslip','title')}}</p>
</button>
</ion-col> -->
</ion-row>
</ion-row> -->
<!-- <ion-row>
<ion-col [size]="12">
<ion-label>Miscellaneous</ion-label>
</ion-col>
<ion-col [size]="4">
<app-services-button
title="Uniform Request"
icon="assets/icon/new-design/uniform_request.png">
</app-services-button>
</ion-col>
<ion-col [size]="4">
<app-services-button
title="ID Badge Request"
icon="assets/icon/new-design/id_badge_request.png">
</app-services-button>
</ion-col>
<ion-col [size]="4">
<app-services-button
title="Separation/ Resignation"
icon="assets/icon/new-design/separation_resignation.png">
</app-services-button>
</ion-col>
</ion-row> -->
<!-- <button class="menu-item" ion-item menuClose ion-item *ngFor="let item of menuList; let i=index" (click)="getMeunDetails(i)" >
<img width="30" src="../assets/imgs/arrownew.png" item-left class="flipImg">
{{ item.MENU_NAME }} {{item.SUB_MENU_NAME}}
</button> -->
<!--
<ion-row>
<ion-col [size]="4">
<app-services-button
title="Recreational Activities"
icon="assets/icon/new-design/recreational_activities.png">
</app-services-button>
</ion-col>
</ion-grid>
</div>
</div>
<ion-col [size]="4">
<app-services-button
title="Employee Certificate"
icon="assets/icon/new-design/employee_certificate.png">
</app-services-button>
</ion-col>
<ion-col [size]="4">
<app-services-button
title="IT Forms"
icon="assets/icon/new-design/it_forms.png">
</app-services-button>
</ion-col>
</ion-row> -->
</ion-grid>
<div class="fixed-shift-timer" *ngIf="isCheckedIn" (click)="openattentracking()">
<span class="subTitle">Time Left Today</span>
<circle-progress
[backgroundColor]= "'#094875'"
[percent]="percent"
[radius]="50"
[outerStrokeWidth]="2"
[innerStrokeWidth]="0"
[outerStrokeColor]="'#ffffff'"
[animation]="true"
[animationDuration]="300"
[responsive]="false"
[space]="-4"
[startFromZero]="false"
[title]="displayTime"
titleFontWeight="bold"
[titleColor]="'#ffffff'"
[showUnits]="false"
subtitle=""
[subtitleColor]="'#ffffff'"
[clockwise]="false"
[renderOnClick]="false">
</circle-progress>
</div>
<div class="fixed-shift-timer" *ngIf="isCheckedIn === false">
<fab-button (trigger)="attendance()"></fab-button>
<page-trailer [small] = "true"></page-trailer>
</div>
</ion-content>

@ -1,153 +1,145 @@
.button-menutoggle.button-menutoggle-md,button-menutoggle.button-menutoggle-ios,
.bar-buttons.bar-buttons-ios.button.button-ios.button-default.button-default-ios.button-menutoggle.button-menutoggle-ios{
box-shadow: none;
-webkit-box-shadow:none;
-moz-box-shadow: none;
background: transparent !important;
}
.colorBG{
--background: #f0efef;
}
ion-row {
margin-bottom: 15px;
margin-top: 10px;
}
.menubutton{
white-space: normal;
color: var(--light);
text-transform: capitalize;
min-height: 47px;
background: transparent;
font-size: 2rem;
position: absolute;
top: 40px;
}
.menubuttonTrans{
white-space: normal;
color: var(--light);
text-transform: capitalize;
min-height: 47px;
background: transparent;
font-size: 2rem;
position: absolute;
top: 40px;
left: 315px
}
#homeBadgeBtn{
position: absolute;
top: 2px;
width: 20px;
font-size: 10px;
height: 20px;
padding: 0px;
line-height: 2;
min-width: auto;
min-height: auto;
border-radius: 50%;
}
.homeBox{
}
.header-div{
background:var(--primary);
background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: -webkit-linear-gradient(45deg, (--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%);
background: linear-gradient(90deg, #85C48D 0%, #85C48D 13%, #2BB5C6 98%, #2BB5C6 100%);
color:var(--light);
text-transform: capitalize;
display: block;
.header-toolbar-new{
--background: #22c6b3;
}
.profile-image-container{
position: relative;
height: 210px;
margin-bottom:60px;
border-radius: 0px 0px 70px 70px;
}
.dash-header{
text-align: center;
margin: 16px 0 0 0;
}
.TxtPlace {
margin: 0;
padding: 50px 0 10px 0;
z-index: 999;
img {
width: 32px;
float: right;
margin-top: -42px;
border-radius: 20px;
height: 32px;
margin-right: 4px;
}
}
ion-title{
color: white;
position: absolute;
top: 0;
text-align: center;
width:100%;
}
.serviceItem {
// min-height: 160px !important;
// padding: 0;
// width: 95%;
// border: 0px solid #e4e5e7;
// background: white;
// color: var(--dark);
// border-radius: 7px;
min-height: 200px !important;
padding-top: 0;
width: 95%;
margin-left: 4px;
margin-bottom: 13px;
border: 0px solid #e4e5e7;
background: white;
color: var(--dark);
border-radius: 7px;
p{
margin-top: 0px; margin-bottom:0px;
font-weight: normal;
left: 15%;
right: 15%;
font-size: 0.42cm;
font-weight: bold;
height: 100%;
}
ion-label{
display: block;
color: black !important;
font-size: 14px;
min-height: 20px;
// white-space: normal;
text-align: center;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
font-weight: bold;
}
.main-dashboard-container{
position: relative;
width: 100%;
}
.header-md:after {
height: 0px !important;
display: none !important;
}
.contentBg:before {
position: absolute;
content: "";
background: #22c6b3;
height: 100px;
width: 100%;
left: 0;
top: 0px;
z-index: 1;
}
.main-container{
position: relative;
z-index: 2;
padding-right: 15px;
padding-left: 15px;
padding-bottom: 130px;
}
.attendance-module{
border-radius: 20px;
background-color: #094875;
padding: 10px;
color: white;
width: 100%;
h3{
font-size: 18px;
font-weight: bold;
margin: 0;
}
span {
display: block;
span{
font-size: 13px;
display: block;
}
.serviceItemImg {
min-width: 60px !important;
min-height: 70px !important;
width: 80px;
height: 80px;
margin: 10px auto;
background: transparent !important;
img{
display: block;
margin: 10px auto;
width: 80%;
}
}
.serviceItem.button,.serviceItem.button-md, .serviceItem.button-ios{
background: transparent !important;
color:var(--dark);
box-shadow: none;
-webkit-box-shadow:none;
-moz-box-shadow: none;
border: 2px solid var(--gray);
min-width: auto;
}
//test
.changeImgBtn{
margin: 0;
position: absolute;
top: 80%;
left: 53%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
//test
.changeIcon{
background: #c1c1c1;
width: 40px;
height: 39px;
border-radius: 50% !important;
position: relative;
left: 51px;
top:16px;
}
.menuImg{
max-width: 30px;
}
.transImg{
max-width: 45px;
}
ion-button{
border-radius: 10px;
padding: 10px;
background: #3CB9DF;
--background: transparent;
--box-shadow: none !important;
height: auto;
min-height: inherit;
margin-top: 10px;
font-size: 12px;
}
}
.swiper-container {
margin: 0 !important;
width: 100% !important;
}
.fixed-shift-timer{
position: fixed;
bottom: 20px;
right: 20px;
z-index: 2;
span.subTitle {
position: absolute;
left: 50%;
top: 62%;
transform: translate(-50%, -50%);
color: white;
width: 80%;
text-align: center;
font-size: 11px;
text-transform: uppercase;
}
}
// .attendance-timer {
// position: fixed;
// bottom: 20px;
// right: 20px;
// z-index: 2;
// height: 112px;
// width: 112px;
// background-color: #094875;
// border-radius: 50%;
// display: inline-block;
// img {
// position: absolute;
// left: 33%;
// top: 8%;
// width: 35%;
// }
// span {
// position: absolute;
// left: 50%;
// top: 70%;
// -webkit-transform: translate(-50%, -50%);
// transform: translate(-50%, -50%);
// color: white;
// width: 80%;
// text-align: center;
// font-size: 11px;
// text-transform: uppercase;
// }
// }

@ -1,28 +1,24 @@
import { EitService } from "./../eit/services/eit.service";
import { Component, OnInit } from "@angular/core";
import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service";
import { MenuController, Events, ActionSheetController } from "@ionic/angular";
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { AuthenticatedUser } from "src/app/hmg-common/services/authentication/models/authenticated-user";
import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service";
import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response";
import { CommonService } from "src/app/hmg-common/services/common/common.service";
import { Geolocation } from "@ionic-native/geolocation/ngx";
import { ZBar, ZBarOptions } from "@ionic-native/zbar/ngx";
import { EitService } from './../eit/services/eit.service';
import { Component, OnInit } from '@angular/core';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { MenuController, Events, ActionSheetController } from '@ionic/angular';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user';
import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service';
import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
import { Geolocation } from '@ionic-native/geolocation/ngx';
import { ZBar, ZBarOptions } from '@ionic-native/zbar/ngx';
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
import { Device } from "@ionic-native/device/ngx";
import { attendanceSwipeScannerRequest } from "./models/attendanceSwipe.Request";
import { Response } from "src/app/hmg-common/services/models/response";
import { AttendanceService } from "./services/attendance.services";
import { LoginRequest } from "../hmg-common/services/authentication/models/login.request";
import { Device } from '@ionic-native/device/ngx';
import { attendanceSwipeScannerRequest } from './models/attendanceSwipe.Request';
import { Response } from 'src/app/hmg-common/services/models/response';
import { AttendanceService } from './services/attendance.services';
import { LoginRequest } from '../hmg-common/services/authentication/models/login.request';
import {FileUploaderComponent} from '../hmg-common/ui/file-uploader/file-uploader.component'
import { Camera, CameraOptions,PictureSourceType} from "@ionic-native/Camera/ngx";
//import { FileChooser } from "@ionic-native/file-chooser/ngx";
import { File } from "@ionic-native/file/ngx";
import { Camera} from '@ionic-native/Camera/ngx';
import { File } from '@ionic-native/file/ngx';
import { DomSanitizer } from '@angular/platform-browser';
//import { FilePath } from "@ionic-native/file-path/ngx";
//import { Base64 } from "@ionic-native/base64/ngx";
import {FileUploderProfileComponent} from '../hmg-common/ui/file-uploder-profile/file-uploder-profile.component'
import { SharedDataService } from '../hmg-common/services/shared-data-service/shared-data.service';
import { DevicePermissionsService } from '../hmg-common/services/device-permissions/device-permissions.service';
import { DashboredService } from '../hmg-common/services/dashbored/dashbored.service';
@ -33,19 +29,19 @@ import { AttendanceTrackingResponse } from '../hmg-common/services/dashbored/att
import { OpenPeriodDatesResponse } from '../hmg-common/services/dashbored/models/openPeriodDatesResponse';
import {GetSubordinatesAttdStatusRequest} from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest';
import {GetSubordinatesLeavesRequest} from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest'
import {GetOpenNotificationsResponse}from '../hmg-common/services/dashbored/models/GetOpenNotificationsResponse'
import {GetSubordinatesAttdStatusResponse}from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse'
import {GetSubordinatesLeavesResponse}from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse'
import {GetOpenNotificationsResponse} from '../hmg-common/services/dashbored/models/GetOpenNotificationsResponse'
import {GetSubordinatesAttdStatusResponse} from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse'
import {GetSubordinatesLeavesResponse} from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse'
import { AccrualService } from '../accrual-balances/services/accrual.service';
@Component({
selector: "app-home",
templateUrl: "./home.page.html",
styleUrls: ["./home.page.scss"]
selector: 'app-home',
templateUrl: './home.page.html',
styleUrls: ['./home.page.scss']
})
export class HomePage implements OnInit {
userData: any = {};
user_image: any = "../assets/imgs/profile.png";
userImage: any = '../assets/imgs/profile.png';
menuList: any = [];
zbarOptions: any;
scannedResult: any;
@ -53,11 +49,75 @@ export class HomePage implements OnInit {
lat: any;
longt: any;
deviceID: string;
public maxFileSize =10 * 1024 * 1024;
public fileUploder :FileUploaderComponent;
// public fileUploderProfile:FileUploderProfileComponent
public maxFileSize = 10 * 1024 * 1024;
public fileUploder: FileUploaderComponent;
location: boolean;
camera: boolean
camera: boolean;
public statsButtons = [
{
title: 'Work List',
statsValue: 0,
icon: 'assets/icon/new-design/work_list.png'
},
{
title: 'Pending Request',
statsValue: 13,
icon: 'assets/icon/new-design/pending_request.png'
},
{
title: 'Missing Swipes',
statsValue: 0,
icon: 'assets/icon/new-design/missing_swipe.png'
},
{
title: 'Leave Balance',
statsValue: 0,
icon: 'assets/icon/new-design/leave_balance.png'
},
{
title: 'Ticket Balance',
statsValue: 0,
icon: 'assets/icon/new-design/ticket_balance.png'
}
];
// public employeeServicesButtons = [
// {
// title: 'Leave Management',
// icon: 'assets/icon/new-design/leave_management.png'
// },
// {
// title: 'Advance Payments',
// icon: 'assets/icon/new-design/advance_payments.png'
// },
// {
// title: 'Medical Insurance',
// icon: 'assets/icon/new-design/medical_insurance.png'
// },
// {
// title: 'Pay Slip',
// icon: 'assets/icon/new-design/pay_slip.png'
// }
// ];
public slideOptsOne = {
slidesPerView: 3.5,
spaceBetween: 10
};
public slideOptsTwo = {
slidesPerView: 3.2,
spaceBetween: 10
};
public runTimer = false;
public hasStarted = false;
public hasFinished = false;
public remainingTime: any;
public scheduledTime: any;
public isCheckedIn = undefined;
public displayTime: any;
public menuEntries: any;
public percent: any;
constructor(
public ts: TranslatorService,
public menu: MenuController,
@ -68,68 +128,98 @@ export class HomePage implements OnInit {
private device: Device,
private zbar: ZBar,
private geolocation: Geolocation,
private attendance_service: AttendanceService,
private attendanceService: AttendanceService,
private eitService: EitService,
private barcodeScanner: BarcodeScanner,
public actionSheetCtrl: ActionSheetController,
private cameraController: Camera,
public sharedData: SharedDataService,
private sanitizer: DomSanitizer,
//private transfer: Transfer,
private file: File,
//private filePath: FilePath
private file: File,
private permissions: DevicePermissionsService,
public DS :DashboredService
public DS: DashboredService,
public accrualService: AccrualService
) {
this.events.subscribe("img-change", displayImg => {
// this.user_image = "data:image/jpeg;base64"+displayImg;
// alert("home app: ");
this.user_image = this.sanitizer.bypassSecurityTrustUrl("data:Image/*;base64,"+displayImg);
console.log("html saved img: "+this.user_image);
this.events.subscribe('img-change', displayImg => {
this.userImage = this.sanitizer.bypassSecurityTrustUrl('data:Image/*;base64,' + displayImg);
console.log('html saved img: ' + this.userImage);
});
}
ngOnInit() {
this.getUserDetails();
this.getMenu();
this.setServicesPrivilage();
this.getCount();
// this.getCount();
// this.events.subscribe('getNotCount', badge => {
// this.notBadge = badge;
// });
}
this.events.subscribe("getNotCount", badge => {
this.notBadge = badge;
});
initTimer() {
this.runTimer = false;
this.hasStarted = false;
this.hasFinished = false;
this.percent = 100 - ((this.remainingTime / this.scheduledTime) * 100);
this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
this.startTimer();
}
startTimer() {
this.runTimer = true;
this.hasStarted = true;
this.timerTick();
}
timerTick() {
setTimeout(() => {
if (!this.runTimer) { return; }
this.remainingTime--;
this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
if (this.remainingTime > 0) {
const newPercent: any = ((this.remainingTime / this.scheduledTime) * 100).toFixed(2);
this.percent = 100 - newPercent;
this.timerTick();
} else {
this.hasFinished = true;
}
}, 1000);
}
getSecondsAsDigitalClock(inputSeconds: number) {
const secNum = parseInt(inputSeconds.toString(), 10); // don't forget the second param
const hours = Math.floor(secNum / 3600);
const minutes = Math.floor((secNum - (hours * 3600)) / 60);
const seconds = secNum - (hours * 3600) - (minutes * 60);
let hoursString = '';
let minutesString = '';
let secondsString = '';
hoursString = (hours < 10) ? '0' + hours : hours.toString();
minutesString = (minutes < 10) ? '0' + minutes : minutes.toString();
secondsString = (seconds < 10) ? '0' + seconds : seconds.toString();
return hoursString + ':' + minutesString + ':' + secondsString;
}
getDeviceLocation() {
let isVirtual = this.device.isVirtual;
if(isVirtual==true){
alert("emulater>>>>>>>"+isVirtual);
alert("You are using virtual device");
const isVirtual = this.device.isVirtual;
if (isVirtual === true){
alert('emulater>>>>>>>' + isVirtual);
alert('You are using virtual device');
return false;
}
this.permissions.requestLocationAutherization().then(granted => {
this.location = granted as boolean;
if (this.location) {
this.geolocation
.getCurrentPosition({ maximumAge: 3000, timeout: 10000, enableHighAccuracy: true })
.then(resp => {
// console.log(resp.coords.latitude);
// console.log(resp.coords.longitude);
this.lat = resp.coords.latitude;
this.longt = resp.coords.longitude;
this.attendance();
})
.catch(error => {
console.log("Error getting location", error);
console.log('Error getting location', error);
});
} else {
return false;
}
@ -137,15 +227,16 @@ export class HomePage implements OnInit {
}
setServicesPrivilage() {
for (let i = 0; i < AuthenticationService.servicePrivilage.length; i++)
if (AuthenticationService.servicePrivilage[i].Previlege == false) {
document.getElementById(AuthenticationService.servicePrivilage[i].ServiceName).setAttribute("disabled", "disabled");
document.getElementById(AuthenticationService.servicePrivilage[i].ServiceName).style.filter = "grayscale(1)"
for (const servicePrivilage of AuthenticationService.servicePrivilage) {
if (servicePrivilage.Previlege === false) {
document.getElementById(servicePrivilage.ServiceName).setAttribute('disabled', 'disabled');
document.getElementById(servicePrivilage.ServiceName).style.filter = 'grayscale(1)';
}
}
}
getCount() {
// getCount() {
// const req: any = {};
// this.menuService.getNotificationCount(req).subscribe((result: any) => {
// if (this.common.validResponse(result)) {
@ -157,323 +248,354 @@ export class HomePage implements OnInit {
// this.events.publish("getNotCount", this.notBadge);
// }
// });
}
// ionViewDidLoad() {
// this.geolocation
// .getCurrentPosition()
// .then(resp => {
// // resp.coords.latitude
// // resp.coords.longitude
// console.log(resp.coords.latitude);
// console.log(resp.coords.longitude);
// })
// .catch(error => {
// console.log("Error getting location", error);
// });
// this.geolocation.getCurrentPosition().then((resp) => {
// // resp.coords.latitude
// // resp.coords.longitude
// console.log(resp.coords.latitude);
// console.log(resp.coords.longitude);
// }).catch((error) => {
// console.log('Error getting location', error);
// });
// }
ionViewDidLoad() {
this.getUserDetails();
console.log("getUserDetails");
this.geolocation
.getCurrentPosition()
.then(resp => {
// resp.coords.latitude
// resp.coords.longitude
//console.log("Loc 1");
console.log(resp.coords.latitude);
console.log(resp.coords.longitude);
this.lat = resp.coords.latitude;
this.longt = resp.coords.longitude;
})
.catch(error => {
console.log("Error getting location", error);
console.log('Error getting location', error);
});
}
private openMenu() {
this.menu.toggle();
}
private getUserDetails() {
this.authService
.loadAuthenticatedUser()
.subscribe((user: AuthenticatedUser) => {
if (user) {
this.events.publish("setMenu");
this.events.publish('setMenu');
this.userData = user;
//set User Info
this.sharedData.setSharedData(this.userData, AuthenticatedUser.SHARED_DATA);
this.user_image = user.EMPLOYEE_IMAGE
? "data:image/png;base64," + user.EMPLOYEE_IMAGE
: this.user_image;
console.log(user);
this.userImage = user.EMPLOYEE_IMAGE ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE : this.userImage;
this.callDashboardServices();
} else {
console.log(user);
}
});
}
public Vacation_Rule() {
this.common.navigateForward("/vacation-rule/home");
}
private getMenu() {
this.menuService.getMenu().subscribe((result: MenuResponse) => {
this.handleMenuResult(result);
});
}
private handleMenuResult(result) {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.List_Menu)) {
console.log("list menu");
this.menuList = result.List_Menu;
}
callDashboardServices() {
this.getMenu();
this.setServicesPrivilage();
this.openNotificationsDashbored();
this.showOpenMissingSwipes();
this.showAttendanceTracking();
this.getAccrualBalance();
}
public Vacation_Rule() {
this.common.navigateForward('/vacation-rule/home');
}
private getMenu() {
this.menuService.getMenu().subscribe((result: MenuResponse) => {
this.handleMenuResult(result);
});
}
private handleMenuResult(result) {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.List_Menu)) {
console.log('list menu');
this.menuList = result.List_Menu;
this.getMenuDetails();
}
}
}
}
private accrualBalance() {
this.common.openAccuralPage();
}
private changeImage() {
this.common.openChangeImagePage();
}
private accrualBalance() {
this.common.openAccuralPage();
}
public getMeunDetails(index) {
let item = this.menuList[index];
let selMenu: MenuResponse = new MenuResponse();
selMenu.List_Menu = item;
selMenu.userid = this.userData.EMPLOYEE_NUMBER;
console.log("menu: "+selMenu.List_Menu);
this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
if (item.MENU_TYPE == "M") {
this.common.openMyTeamPage();
// this.navCtrl.push("MySubordinatePage");
} else if (item.MENU_TYPE == "S") {
this.common.sharedService.setSharedData(item, 'mySpecList');
this.common.openMySpecialistPage();
//this.navCtrl.push('MySpecialistPage',{"mySpecList":item});
} else {
private changeImage() {
this.common.openChangeImagePage();
}
public getMenuDetails() {
const item = this.menuList[0];
const selMenu: MenuResponse = new MenuResponse();
selMenu.List_Menu = item;
selMenu.userid = this.userData.EMPLOYEE_NUMBER;
console.log('menu: ' + selMenu.List_Menu);
this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
this.getMenuEntries(item);
// if (item.MENU_TYPE === 'M') {
// this.common.openMyTeamPage();
// // this.navCtrl.push("MySubordinatePage");
// } else if (item.MENU_TYPE === 'S') {
// this.common.sharedService.setSharedData(item, 'mySpecList');
// this.common.openMySpecialistPage();
// // this.navCtrl.push('MySpecialistPage',{"mySpecList":item});
// } else {
// this.getMenuEntries(item);
// }
}
}
getMenuEntries(item) {
let request: any = {};
let selEmpNo: string = null;
let nationality: string = null;
request.P_SELECTED_RESP_ID = -999;
if (item.MENU_TYPE == "S") {
request.P_SELECTED_RESP_ID = item.RESP_ID;
} else {
selEmpNo = this.common.sharedService.getSharedData(
LoginRequest.SHARED_DATA,
getMenuEntries(item) {
const request: any = {};
let selEmpNo: string = null;
let nationality: string = null;
request.P_SELECTED_RESP_ID = -999;
if (item.MENU_TYPE === 'S') {
request.P_SELECTED_RESP_ID = item.RESP_ID;
} else {
selEmpNo = this.common.sharedService.getSharedData(
LoginRequest.SHARED_DATA,
false
);
}
nationality = this.common.sharedService.getSharedData(
LoginRequest.NATIONALITY_CODE,
false
);
}
nationality = this.common.sharedService.getSharedData(
LoginRequest.NATIONALITY_CODE,
false
);
request.P_SELECTED_EMPLOYEE_NUMBER = selEmpNo;
request.P_MENU_TYPE = item.MENU_TYPE;
request.NationalityCode = nationality;
//set emp and resp id
console.log("set data");
this.common.sharedService.setSharedData(
selEmpNo,
MenuResponse.SHARED_SEL_EMP
);
this.common.sharedService.setSharedData(
request.P_SELECTED_RESP_ID,
MenuResponse.SHARED_SEL_RESP_ID
);
this.eitService
.getMenuEntries(request)
.subscribe((result: MenuResponse) => {
this.handleMenuEntiresResult(result);
});
}
request.P_SELECTED_EMPLOYEE_NUMBER = selEmpNo;
request.P_MENU_TYPE = item.MENU_TYPE;
request.NationalityCode = nationality;
// set emp and resp id
console.log('set data');
this.common.sharedService.setSharedData(
selEmpNo,
MenuResponse.SHARED_SEL_EMP
);
this.common.sharedService.setSharedData(
request.P_SELECTED_RESP_ID,
MenuResponse.SHARED_SEL_RESP_ID
);
sortMenuEntires(list) {
let tree = this.common.list_to_tree(list);
this.common.sharedService.setSharedData(tree, "menuEntries");
// this.common.navigateForward("/eit/homepage");
this.common.openEITPage();
}
this.eitService
.getMenuEntries(request)
.subscribe((result: MenuResponse) => {
this.handleMenuEntiresResult(result);
});
}
private handleMenuEntiresResult(result) {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetMenuEntriesList)) {
this.sortMenuEntires(result.GetMenuEntriesList);
}
sortMenuEntires(list) {
const tree = this.common.list_to_tree(list);
this.menuEntries = tree;
console.log(this.menuEntries);
this.common.sharedService.setSharedData(tree, 'menuEntries');
// this.common.navigateForward("/eit/homepage");
// this.common.openEITPage();
}
}
private Change_password() {
this.common.openChangePassword();
}
private openPayslip() {
this.common.openPayslipPage();
}
private attendance() {
// this.zbarOptions = {
// flash: "off",
// drawSight: false
// };
//console.log("your currnt location is");
//console.log("Loc");
this.permissions.requestCameraAutherization().then(granted => {
this.camera = granted as boolean;
if (this.camera) {
this.scanCode();
private handleMenuEntiresResult(result) {
if (this.common.validResponse(result)) {
if (this.common.hasData(result.GetMenuEntriesList)) {
this.sortMenuEntires(result.GetMenuEntriesList);
}
}
);
}
}
scanCode() {
// this.zbar
// .scan(this.zbarOptions)
// .then(result => {
// console.log(result); // Scanned code
// let strResult = JSON.parse(result);
// console.log(strResult.QRValue);
// this.scannedResult = result;
// this.deviceID = this.device.uuid;
// this.swipeAttendance();
// })
// .catch(error => {
// alert(error); // Error message
// });
this.barcodeScanner.scan().then(barcodeData => {
console.log('Barcode data', barcodeData);
// let strResult = JSON.parse(barcodeData);
// console.log(strResult.QRValue);
this.scannedResult = barcodeData;
this.deviceID = this.device.uuid;
this.swipeAttendance();
}).catch(err => {
console.log('Error', err);
});
}
parentFn($event: string) {
console.log($event); // this will output 'hello from child'
}
swipeAttendance() {
let request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
request.Latitude = this.lat;
request.Longitude = this.longt;
request.QRValue = this.scannedResult.text;
request.UID = this.deviceID;
request.UserName = this.userData.EMPLOYEE_NUMBER;
console.log("request");
console.log(JSON.stringify(request));
this.attendance_service
.attendanceSwipeScanner(request, () => {
console.log("Error inside in swipe attendance");
})
.subscribe((result: Response) => {
if (this.common.validResponse(result)) {
console.log("response");
console.log(result);
this.common.presentAlert(this.ts.trPK("home", "swipeAlertSuccess"));
} else {
this.common.presentAlert(this.ts.trPK("home", "swipeAlertFailed"));
}
});
}
openPersonalInfo() {
this.common.openProfile();
}
private Change_password() {
this.common.openChangePassword();
}
private openPayslip() {
this.common.openPayslipPage();
}
/*************************************Dashboards Services**********************************************************8 */
private attendance() {
this.permissions.requestCameraAutherization().then(granted => {
this.camera = granted as boolean;
if (this.camera) {
this.scanCode();
}
}
);
}
showOrganizationSalaries(){
this.DS.getOrganizationSalaries() .subscribe((result: OrganizationSalariesResponse ) => {
scanCode() {
this.barcodeScanner.scan().then(barcodeData => {
this.scannedResult = barcodeData;
this.deviceID = this.device.uuid;
this.swipeAttendance();
}).catch(err => {
console.log('Error', err);
});
}
});;
}
swipeAttendance() {
const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
request.Latitude = this.lat;
request.Longitude = this.longt;
request.QRValue = this.scannedResult.text;
request.UID = this.deviceID;
request.UserName = this.userData.EMPLOYEE_NUMBER;
console.log(JSON.stringify(request));
this.attendanceService
.attendanceSwipeScanner(request, () => {
console.log('Error inside in swipe attendance');
})
.subscribe((result: Response) => {
if (this.common.validResponse(result)) {
this.common.presentAlert(this.ts.trPK('home', 'swipeAlertSuccess'));
this.showAttendanceTracking();
} else {
this.common.presentAlert(this.ts.trPK('home', 'swipeAlertFailed'));
}
});
}
showOpenMissingSwipes(){
this.DS.getOpenMissingSwipes() .subscribe((result: OpenMissingSwipesResponse) => {
openPersonalInfo() {
this.common.openProfile();
}
});;
}
showPerformanceAppraisal(){
this.DS.getPerformanceAppraisal() .subscribe((result: PerformanceAppraisalResponse) => {
/*************************************Dashboards Services**********************************************************8 */
});
showOrganizationSalaries() {
this.DS.getOrganizationSalaries() .subscribe((result: OrganizationSalariesResponse ) => {
});
}
showOpenMissingSwipes() {
this.DS.getOpenMissingSwipes() .subscribe((result: OpenMissingSwipesResponse) => {
if (this.common.validResponse(result)) {
const key = 'GetOpenMissingSwipesList';
this.statsButtons[2].statsValue = result[key].P_OPEN_MISSING_SWIPES;
}
});
}
}
showPerformanceAppraisal() {
this.DS.getPerformanceAppraisal() .subscribe((result: PerformanceAppraisalResponse) => {
});
}
showAttendanceTracking(){
this.DS.getAttendanceTracking() .subscribe((result: AttendanceTrackingResponse) => {
convertInSeconds(time: any) {
const hours = parseInt(time[0], 10);
const minutes = parseInt(time[1], 10);
let seconds = parseInt(time[2], 10);
seconds = seconds + (hours * 60 * 60) + (minutes * 60);
return seconds;
}
});;
}
convertAndAssignTime(data) {
console.log(data);
this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':'));
this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':'));
this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true;
this.initTimer();
console.log('remainingTime: ' + this.remainingTime);
console.log('scheduledTime: ' + this.scheduledTime);
console.log('isCheckedIn: ' + this.isCheckedIn);
}
openPeriodDateDashbored(){
this.DS.getOpenPeriodDates( ()=> {console.log("Error ");} ).subscribe((result:OpenPeriodDatesResponse)=>{
showAttendanceTracking() {
this.DS.getAttendanceTracking() .subscribe((result: AttendanceTrackingResponse) => {
if (this.common.validResponse(result)) {
console.log("response");
const key = 'GetAttendanceTrackingList';
this.convertAndAssignTime(result[key]);
}
});
}
openNotificationsDashbored(){
this.DS.getOpenNotifications( ()=> {console.log("Error ");} ).subscribe((result:GetOpenNotificationsResponse)=>{
openPeriodDateDashbored() {
this.DS.getOpenPeriodDates( () => {console.log('Error '); } ).subscribe((result: OpenPeriodDatesResponse) => {
if (this.common.validResponse(result)) {
console.log("response");
console.log(result);
console.log('response');
}
});
}
openNotificationsDashbored() { // work list
this.DS.getOpenNotifications( () => { console.log('Error '); }).subscribe((result: GetOpenNotificationsResponse) => {
if (this.common.validResponse(result)) {
const key = 'P_OPEN_NTF_NUMBER';
this.statsButtons[0].statsValue = result[key];
}
});
}
getSubordinatesLeaves(){
let request:GetSubordinatesLeavesRequest=new GetSubordinatesLeavesRequest();
request.P_DATE_FROM="/Date(1578603600000+0300)/"; //test
request.P_DATE_TO="/Date(1576011600000+0300)/"; //test
this.DS.getSubordinatesLeaves( request,()=> {console.log("Error ");} ).subscribe((result:GetSubordinatesLeavesResponse)=>{
getSubordinatesLeaves() {
const request: GetSubordinatesLeavesRequest = new GetSubordinatesLeavesRequest();
request.P_DATE_FROM = '/Date(1578603600000+0300)/'; // test
request.P_DATE_TO = '/Date(1576011600000+0300)/'; // test
this.DS.getSubordinatesLeaves( request, () => {console.log('Error '); } ).subscribe((result: GetSubordinatesLeavesResponse) => {
if (this.common.validResponse(result)) {
console.log("response");
console.log('response');
console.log(result);
}
});
}
getSubordinatesAttStatus(){
let request: GetSubordinatesAttdStatusRequest = new GetSubordinatesAttdStatusRequest();
request.P_SCHEDULE_DATE_FROM="/Date(1578603600000+0300)/"; //test
request.P_SCHEDULE_DATE_TO="/Date(1576011600000+0300)/";//test
this.DS.getSubordinatesAttStatus( request,()=> {console.log("Error ");} ).subscribe((result:GetSubordinatesAttdStatusResponse)=>{
getSubordinatesAttStatus() {
const request: GetSubordinatesAttdStatusRequest = new GetSubordinatesAttdStatusRequest();
request.P_SCHEDULE_DATE_FROM = '/Date(1578603600000+0300)/'; // test
request.P_SCHEDULE_DATE_TO = '/Date(1576011600000+0300)/'; // test
this.DS.getSubordinatesAttStatus( request, () => {console.log('Error '); }).subscribe((result: GetSubordinatesAttdStatusResponse) => {
if (this.common.validResponse(result)) {
console.log("response");
console.log('response');
console.log(result);
}
});
}
openPage(subMenu) {
let selMenu: MenuResponse = new MenuResponse();
selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false);
selMenu.GetMenuEntriesList = subMenu;
this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA);
if (subMenu.REQUEST_TYPE === 'ABSENCE') {
this.common.openAbsencePage();
} else if (subMenu.REQUEST_TYPE === 'EIT') {
this.common.openEitListPage();
}
if (subMenu.REQUEST_TYPE === 'PAYSLIP') {
this.common.openPayslipPage();
}
}
getAccrualBalance() {
const today = new Date();
const day = today.getDate();
const month = today.getMonth() + 1;
const year = today.getFullYear();
const todayDate = month + '/' + day + '/' + year;
const effectiveDate = todayDate;
const request = {
P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER,
P_EFFECTIVE_DATE: effectiveDate
};
this.accrualService
.getAccrualBalances(request)
.subscribe((result: any) => {
if (this.common.validResponse(result)) {
let totalTicketsLeft = 0;
for (const accrualBalance of result.GetAccrualBalancesList) {
if (accrualBalance.ACCURAL_PLAN_NAME === 'HMG Annual Vacation Accrual Plan') {
this.statsButtons[3].statsValue = accrualBalance.ACCRUAL_NET_ENTITLEMENT;
} else {
totalTicketsLeft = totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT;
}
}
this.statsButtons[4].statsValue = totalTicketsLeft;
}
});
}
openattentracking() {
this.common.openAttenTrackingpage();
}
openProfilePage() {
this.common.openProfile();
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 999 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 984 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save