Commit 27a0901f by Adarsh K

adarsh 25-03-2019

parents c4deda19 f8e31d4e
...@@ -759,6 +759,22 @@ ...@@ -759,6 +759,22 @@
} }
} }
}, },
"@ngx-translate/core": {
"version": "11.0.1",
"resolved": "https://registry.npmjs.org/@ngx-translate/core/-/core-11.0.1.tgz",
"integrity": "sha512-nBCa1ZD9fAUY/3eskP3Lql2fNg8OMrYIej1/5GRsfcutx9tG/5fZLCv9m6UCw1aS+u4uK/vXjv1ctG/FdMvaWg==",
"requires": {
"tslib": "^1.9.0"
}
},
"@ngx-translate/http-loader": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@ngx-translate/http-loader/-/http-loader-4.0.0.tgz",
"integrity": "sha512-x8LumqydWD7eX9yQTAVeoCM9gFUIGVTUjZqbxdAUavAA3qVnk9wCQux7iHLPXpydl8vyQmLoPQR+fFU+DUDOMA==",
"requires": {
"tslib": "^1.9.0"
}
},
"@schematics/angular": { "@schematics/angular": {
"version": "7.1.4", "version": "7.1.4",
"resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-7.1.4.tgz", "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-7.1.4.tgz",
...@@ -3738,8 +3754,7 @@ ...@@ -3738,8 +3754,7 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
...@@ -3760,14 +3775,12 @@ ...@@ -3760,14 +3775,12 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
...@@ -3782,20 +3795,17 @@ ...@@ -3782,20 +3795,17 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
...@@ -3912,8 +3922,7 @@ ...@@ -3912,8 +3922,7 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
...@@ -3925,7 +3934,6 @@ ...@@ -3925,7 +3934,6 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
...@@ -3940,7 +3948,6 @@ ...@@ -3940,7 +3948,6 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
...@@ -3948,14 +3955,12 @@ ...@@ -3948,14 +3955,12 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
...@@ -3974,7 +3979,6 @@ ...@@ -3974,7 +3979,6 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
...@@ -4055,8 +4059,7 @@ ...@@ -4055,8 +4059,7 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
...@@ -4068,7 +4071,6 @@ ...@@ -4068,7 +4071,6 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
...@@ -4154,8 +4156,7 @@ ...@@ -4154,8 +4156,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
...@@ -4191,7 +4192,6 @@ ...@@ -4191,7 +4192,6 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
...@@ -4211,7 +4211,6 @@ ...@@ -4211,7 +4211,6 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
...@@ -4255,14 +4254,12 @@ ...@@ -4255,14 +4254,12 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
} }
} }
}, },
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
"@angular/platform-browser": "~7.1.0", "@angular/platform-browser": "~7.1.0",
"@angular/platform-browser-dynamic": "~7.1.0", "@angular/platform-browser-dynamic": "~7.1.0",
"@angular/router": "~7.1.0", "@angular/router": "~7.1.0",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"bootstrap": "^4.3.1", "bootstrap": "^4.3.1",
"core-js": "^2.5.4", "core-js": "^2.5.4",
"jquery": "^3.3.1", "jquery": "^3.3.1",
......
<html>
<head>
<style>
.input_container{
width:100%;
}
</style>
</head>
<body>
<div class="input_container">
<input class="" placeholder="sample">
<div class="message">
Sample message
</div>
</div>
</body>
</html>
\ No newline at end of file
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { InvalidComponent } from './start/invalid/invalid.component'; const routes: Routes = [{
path: '',
const routes: Routes = [ redirectTo: 'start/login',
{ pathMatch: 'full'
path: '', },
redirectTo: 'start/login', {
pathMatch: 'full' path: '404',
}, redirectTo: 'start/invalid',
{ pathMatch: 'full'
path: '404', }
redirectTo: 'start/invalid',
pathMatch: 'full'
}
// {path: '**', redirectTo: '/start/login'}
]; ];
@NgModule({ @NgModule({
......
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
import { SubjectService } from './providers/subject.service';
import { WebService } from './providers/web.service';
import * as $ from 'jquery';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
...@@ -7,4 +11,43 @@ import { Component } from '@angular/core'; ...@@ -7,4 +11,43 @@ import { Component } from '@angular/core';
}) })
export class AppComponent { export class AppComponent {
title = 'forex'; title = 'forex';
lang = 'en';
constructor(translate: TranslateService, public subjectService: SubjectService, public service: WebService){
this.subjectService.getLangData().subscribe(langData => {
console.log(langData);
this.lang = this.service.getLocalStorageItem('lang');
console.log(this.lang);
if (this.lang) {
translate.setDefaultLang(this.lang);
translate.use(this.lang);
}
});
const lang = this.service.getLocalStorageItem('lang');
console.log(lang);
if(lang !== undefined){
this.lang = lang;
}
if(this.lang === 'ar') {
$('body').addClass('ar');
} else {
$('body').removeClass('ar');
}
this.lang = 'en';
translate.setDefaultLang(this.lang);
// the lang to use, if the lang isn't available, it will use the current loader to get them
translate.use(this.lang);
// the lang to use, if the lang isn't available, it will use the current loader to get them
}
} }
...@@ -2,17 +2,19 @@ import { BrowserModule } from '@angular/platform-browser'; ...@@ -2,17 +2,19 @@ import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { HttpClientModule } from '@angular/common/http'; import { HttpClientModule,HttpClient } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { TranslateModule, TranslateLoader} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
/* CUSTOM-MODULES */ /* CUSTOM-MODULES */
import {CheckerModule} from './checker/checker.module'; import {makerModule} from './maker/maker.module';
import {ForexModule} from './forex/forex.module'; import {ForexModule} from './forex/forex.module';
import {DeliveryModule} from './delivery/delivery.module'; import {DeliveryModule} from './delivery/delivery.module';
import {StartModule} from './start/start.module'; import {StartModule} from './start/start.module';
import {checkerModule} from './checker/checker.module';
/* Custom Services */ /* Custom Services */
...@@ -21,7 +23,9 @@ import { AuthGuard } from './providers/auth.guard'; ...@@ -21,7 +23,9 @@ import { AuthGuard } from './providers/auth.guard';
import { WebService } from './providers/web.service'; import { WebService } from './providers/web.service';
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
...@@ -32,13 +36,21 @@ import { WebService } from './providers/web.service'; ...@@ -32,13 +36,21 @@ import { WebService } from './providers/web.service';
imports: [ imports: [
BrowserModule, BrowserModule,
AppRoutingModule, AppRoutingModule,
CheckerModule, makerModule,
ForexModule, ForexModule,
DeliveryModule, DeliveryModule,
ReactiveFormsModule, ReactiveFormsModule,
FormsModule, FormsModule,
HttpClientModule, HttpClientModule,
StartModule StartModule,
checkerModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
})
], ],
providers: [AuthGuard, AuthService, WebService], providers: [AuthGuard, AuthService, WebService],
bootstrap: [AppComponent] bootstrap: [AppComponent]
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
<div class="login_inner"> <div class="login_inner">
<img src="assets/images/asset_logo.png"> <img src="assets/images/asset_logo.png">
<hr> <hr>
<h6>Change PIN</h6> <h6> {{'changepin.Change PIN' | translate}}</h6>
<div class="login_inner_content"> <div class="login_inner_content">
<br> <br>
<div class="login_row"> <div class="login_row">
<p>Old PIN</p> <p> {{'changepin.Old PIN' | translate}}</p>
<div class="login_pin"> <div class="login_pin">
<input class="log_pin" type="password" maxlength="1" #old1 (keyup)="processKeyUp($event, old2)"> <input class="log_pin" type="password" maxlength="1" #old1 (keyup)="processKeyUp($event, old2)">
<input class="log_pin" type="password" maxlength="1" #old2 (keydown.backspace)="processBack($event, old1)" (keyup)="processKeyUp($event, old3)"> <input class="log_pin" type="password" maxlength="1" #old2 (keydown.backspace)="processBack($event, old1)" (keyup)="processKeyUp($event, old3)">
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</div> </div>
</div> </div>
<div class="login_row"> <div class="login_row">
<p>New PIN</p> <p>{{'changepin.New PIN' | translate}}</p>
<div class="login_pin"> <div class="login_pin">
<input class="log_pin" type="password" maxlength="1" #new1 (keyup)="processKeyUp($event, new2)"> <input class="log_pin" type="password" maxlength="1" #new1 (keyup)="processKeyUp($event, new2)">
<input class="log_pin" type="password" maxlength="1" #new2 (keydown.backspace)="processBack($event, new1)" (keyup)="processKeyUp($event, new3)"> <input class="log_pin" type="password" maxlength="1" #new2 (keydown.backspace)="processBack($event, new1)" (keyup)="processKeyUp($event, new3)">
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div class="s_validation">{{error_msg.password}} </div> <div class="s_validation">{{error_msg.password}} </div>
</div> </div>
<div class="login_row"> <div class="login_row">
<p>Confirm PIN</p> <p> {{'changepin.Confirm PIN' | translate}}</p>
<div class="login_pin"> <div class="login_pin">
<input class="log_pin" type="password" maxlength="1" #conf1 (keyup)="processKeyUp($event, conf2)"> <input class="log_pin" type="password" maxlength="1" #conf1 (keyup)="processKeyUp($event, conf2)">
<input class="log_pin" type="password" maxlength="1" #conf2 (keydown.backspace)="processBack($event, conf1)" (keyup)="processKeyUp($event, conf3)"> <input class="log_pin" type="password" maxlength="1" #conf2 (keydown.backspace)="processBack($event, conf1)" (keyup)="processKeyUp($event, conf3)">
...@@ -58,19 +58,19 @@ ...@@ -58,19 +58,19 @@
</div> </div>
<div class="alert alert-danger alert-dismissible" *ngIf="resetError"> <div class="alert alert-danger alert-dismissible" *ngIf="resetError">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{resetMsg}} <strong>{{'changepin.Warning!' | translate}} </strong> {{resetMsg}}
</div> </div>
<div class="alert alert-success alert-dismissible" *ngIf="!resetError && !error && loginSubmit"> <div class="alert alert-success alert-dismissible" *ngIf="!resetError && !error && loginSubmit">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Password Updated Successfully <strong> {{'changepin.Success!' | translate}}</strong> {{'changepin.Password Updated Successfully' | translate}}
</div> </div>
<div class="login_btn_bay"> <div class="login_btn_bay">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<button class="cancel_btn" (click)="cancelClick()">Cancel</button> <button class="cancel_btn" (click)="cancelClick()"> {{'changepin.Cancel' | translate}}</button>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<button class="login_btn" (click)="saveClick()">Save</button> <button class="login_btn" (click)="saveClick()"> {{'changepin.Save' | translate}}</button>
</div> </div>
</div> </div>
</div> </div>
......
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { moduleRouting } from './checker.routing'; import { checkerRouting } from './checker.routing';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { TranslateModule} from '@ngx-translate/core';
//IMPORTED-PAGE-COMPONENTS //IMPORTED-PAGE-COMPONENTS
import { IndexComponent } from './index/index.component'; import { IndexComponent } from './index/index.component';
import { AddproviderComponent} from './addprovider/addprovider.component';
import { EditproviderComponent } from './editprovider/editprovider.component';
import { ManageproviderComponent } from './manageprovider/manageprovider.component'; import { ManageproviderComponent } from './manageprovider/manageprovider.component';
import { HomeComponent } from './home/home.component'; import { HomeComponent } from './home/home.component';
import { ForexproviderComponent } from './forexprovider/forexprovider.component'; import { ForexproviderComponent } from './forexprovider/forexprovider.component';
import { ChangepinComponent } from './changepin/changepin.component'; import { ChangepinComponent } from './changepin/changepin.component';
import { CurrencyAddComponent } from './currency-add/currency-add.component';
import { AddforexComponent } from './addforex/addforex.component';
import { EditforexComponent } from './editforex/editforex.component';
import { CurrencyEditComponent } from './currency-edit/currency-edit.component';
import { CurrencyListComponent } from './currency-list/currency-list.component';
@NgModule({ @NgModule({
// tslint:disable-next-line:max-line-length // tslint:disable-next-line:max-line-length
declarations: [IndexComponent, AddproviderComponent, EditproviderComponent, ManageproviderComponent, HomeComponent, ForexproviderComponent, ChangepinComponent, CurrencyAddComponent, AddforexComponent, EditforexComponent, CurrencyEditComponent, CurrencyListComponent], declarations: [IndexComponent, ManageproviderComponent, HomeComponent, ForexproviderComponent, ChangepinComponent],
imports: [ imports: [
CommonModule, CommonModule,
moduleRouting, checkerRouting,
FormsModule, FormsModule,
ReactiveFormsModule ReactiveFormsModule,
TranslateModule
] ]
}) })
export class CheckerModule { } export class checkerModule { }
...@@ -11,38 +11,24 @@ import { RoleGuard } from './../providers/role-guard.service'; ...@@ -11,38 +11,24 @@ import { RoleGuard } from './../providers/role-guard.service';
//IMPORTED-PAGE-COMPONENTS //IMPORTED-PAGE-COMPONENTS
import { IndexComponent } from './index/index.component'; import { IndexComponent } from './index/index.component';
import { AddproviderComponent} from './addprovider/addprovider.component';
import { EditproviderComponent } from './editprovider/editprovider.component';
import { ManageproviderComponent } from './manageprovider/manageprovider.component'; import { ManageproviderComponent } from './manageprovider/manageprovider.component';
import { ForexproviderComponent } from './forexprovider/forexprovider.component'; import { ForexproviderComponent } from './forexprovider/forexprovider.component';
import { HomeComponent } from './home/home.component'; import { HomeComponent } from './home/home.component';
import { ChangepinComponent } from './changepin/changepin.component'; import { ChangepinComponent } from './changepin/changepin.component';
import { CurrencyAddComponent } from './currency-add/currency-add.component';
import { AuthGuard } from './../providers/auth.guard'; import { AuthGuard } from './../providers/auth.guard';
import { AddforexComponent } from './addforex/addforex.component';
import { EditforexComponent } from './editforex/editforex.component';
import { CurrencyEditComponent } from './currency-edit/currency-edit.component';
import { CurrencyListComponent } from './currency-list/currency-list.component';
const ModuleRoutes: Routes = [ const checkerRoutes: Routes = [
{ path: 'checker', component: IndexComponent, canActivate: [AuthGuard], { path: 'checker', component: IndexComponent, canActivate: [AuthGuard],
children: [ children: [
{ path: 'provider_delivery', component: AddproviderComponent },
{ path: 'delivery_edit/:id', component: EditproviderComponent },
{ path: 'delivery', component: ManageproviderComponent }, { path: 'delivery', component: ManageproviderComponent },
{ path: 'forex', component: ForexproviderComponent }, { path: 'forex', component: ForexproviderComponent },
{ path: 'provider_forex', component: AddforexComponent },
{ path: 'forex_edit/:id', component: EditforexComponent },
{ path: 'home', component: HomeComponent }, { path: 'home', component: HomeComponent },
{ path: 'changepin', component: ChangepinComponent }, { path: 'changepin', component: ChangepinComponent }
{ path: 'currency_add', component: CurrencyAddComponent}, ], data: {role: 5}
{ path: 'currency_edit/:id', component: CurrencyEditComponent},
{ path: 'currency_list', component: CurrencyListComponent}
], data: {role: 1}
} }
]; ];
export const moduleRouting: ModuleWithProviders = RouterModule.forChild(ModuleRoutes) export const checkerRouting: ModuleWithProviders = RouterModule.forChild(checkerRoutes)
...@@ -4,46 +4,44 @@ ...@@ -4,46 +4,44 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Forex Provider</h4> <h4>{{'forexprovider.Forex Provider' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('checker/home')"> <button class="logout" (click)="goToPage('checker/home')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button> {{'forexprovider.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'forexprovider.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('checker/changepin')">Change PIN</span> <span (click)="goToPage('checker/changepin')"> {{'forexprovider.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Manage Forex Provider</h3> <h3>{{'forexprovider.Manage Forex Provider' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="table-responsive"> <div class="table-responsive">
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseMsg}} <strong> {{'forexprovider.Warning!' | translate}}</strong> {{responseMsg}}
</div> </div>
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Forex provider removed successfully <strong> {{'forexprovider.Success!' | translate}}</strong> {{'forexprovider.Forex provider removed successfully' | translate}}
</div> </div>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>Provider Name</th> <th> {{'forexprovider.Provider Name' | translate}}</th>
<th>Location</th> <th> {{'forexprovider.Location' | translate}}</th>
<th>CR Manager</th> <th> {{'forexprovider.CR Manager' | translate}}</th>
<th>CR ID</th> <th> {{'forexprovider.CR ID' | translate}}</th>
<th>Contact Name</th> <th> {{'forexprovider.Contact Name' | translate}}</th>
<th>Phone</th> <th> {{'forexprovider.Phone' | translate}}</th>
<th>Email ID</th> <th> {{'forexprovider.Email ID' | translate}}</th>
<th class="textRight"> <th> {{'forexprovider.Action' | translate}}</th>
<button class="add" (click)="goToPage('checker/provider_forex')">+</button>
</th>
</tr> </tr>
</thead> </thead>
<tbody *ngIf="providerList; else noProvider"> <tbody *ngIf="providerList; else noProvider">
...@@ -55,9 +53,9 @@ ...@@ -55,9 +53,9 @@
<td>{{provider.contact | titlecase}}</td> <td>{{provider.contact | titlecase}}</td>
<td>{{provider.phone}}</td> <td>{{provider.phone}}</td>
<td>{{provider.email_id}}</td> <td>{{provider.email_id}}</td>
<td class="textRight pl0 pr0"> <td *ngIf="provider.status != 0">{{get_status(provider.status)}}</td>
<button class="edit_btn"(click)="editClick(provider.id)"></button> <td class="textRight pl0 pr0" *ngIf="provider.status == 0">
<button class="delete_btn" (click)="deleteClick(provider.id)"></button> <button class="edit_btn" data-toggle="modal" data-target="#forexapproved" (click)="providerDetails(provider.id)"></button>
</td> </td>
</tr> </tr>
</tbody> </tbody>
...@@ -66,4 +64,80 @@ ...@@ -66,4 +64,80 @@
</div> </div>
</div> </div>
</div> </div>
</section> </section>
\ No newline at end of file
<div class="modal" id="forexapproved" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="max-width: 700px !important;">
<div class="modal-content">
<div class="forex_modal_wrapper">
<div class="forex_modal_header">
<h5 class="floatLeft">Forex Provider Approve</h5>
<button type="button" class="close floatRight" data-dismiss="modal">&times;</button>
<div class="clear"></div>
</div>
<div class="forex_inner_wrapper" *ngIf="provider">
<div class="row">
<div class="col">
<div class="row">
<div class="col">Provider Name:</div>
<div class="col">{{provider.name}}</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col">Location:</div>
<div class="col">{{provider.location}}</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="row">
<div class="col">CR ID:</div>
<div class="col">{{provider.cr_id}}</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col">CR Manager:</div>
<div class="col">{{provider.cr_manager}}</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="row">
<div class="col">Email ID:</div>
<div class="col">{{provider.email_id}}</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col">Phone:</div>
<div class="col">{{provider.phone}}</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="row">
<div class="col">Delivery Provider:</div>
<div class="col">{{deli_provider}}</div>
</div>
</div>
<div class="col"></div>
</div>
</div>
<div class="forex_modal_footer_btn_bay textRight">
<button class="okay_btn" data-dismiss="modal" (click)="providerState(2, provider.users_id)">Reject</button>
<button class="cancel_btn" data-dismiss="modal" (click)="providerState(1, provider.users_id)">Approve</button>
</div>
</div>
</div>
</div>
</div>
...@@ -203,4 +203,8 @@ ...@@ -203,4 +203,8 @@
} }
}
.forex_modal_content{
background: #fff;
} }
\ No newline at end of file
...@@ -11,11 +11,13 @@ import { ValidationService } from './../../providers/validation.service'; ...@@ -11,11 +11,13 @@ import { ValidationService } from './../../providers/validation.service';
export class ForexproviderComponent implements OnInit { export class ForexproviderComponent implements OnInit {
providerList: any[]; providerList: any[];
fname: any; fname: any;
lang = 'ar'; lang = 'en';
responseMsg: any; responseMsg: any;
error: boolean; error: boolean;
success: boolean; success: boolean;
loader: boolean; loader: boolean;
provider: any;
deli_provider: any;
constructor(private router: Router, private route: ActivatedRoute, public vs: ValidationService, public service: WebService) { constructor(private router: Router, private route: ActivatedRoute, public vs: ValidationService, public service: WebService) {
this.responseMsg = ''; this.responseMsg = '';
...@@ -30,7 +32,7 @@ export class ForexproviderComponent implements OnInit { ...@@ -30,7 +32,7 @@ export class ForexproviderComponent implements OnInit {
getProvider() { getProvider() {
this.loader = true; this.loader = true;
this.fname = 'providers'; this.fname = 'all_providers';
const post_data = {'type': 2}; const post_data = {'type': 2};
this.service.post_data(this.fname, post_data).subscribe(response => { this.service.post_data(this.fname, post_data).subscribe(response => {
this.loader = false; this.loader = false;
...@@ -87,7 +89,7 @@ export class ForexproviderComponent implements OnInit { ...@@ -87,7 +89,7 @@ export class ForexproviderComponent implements OnInit {
} }
editClick(id: number) { editClick(id: number) {
this.router.navigate(['checker/forex_edit/' + id]); this.router.navigate(['maker/forex_edit/' + id]);
} }
goToPage(path, data = null) { goToPage(path, data = null) {
...@@ -100,4 +102,87 @@ export class ForexproviderComponent implements OnInit { ...@@ -100,4 +102,87 @@ export class ForexproviderComponent implements OnInit {
this.service.logout(); this.service.logout();
} }
get_status(status: number) {
let state = '';
switch (status) {
case 0:
state = 'Pending';
break;
case 1:
state = 'Approved';
break;
case 2:
state = 'Reject';
break;
default:
break;
}
return state;
}
providerDetails(id: any) {
this.loader = true;
this.fname = 'providers_details';
const post_data = {'provider_id': id};
this.service.post_data(this.fname, post_data).subscribe(response => {
this.loader = false;
console.log(response);
if (response.code === 1) {
this.provider = response.responseResult;
this.getProvider_name(this.provider.deli_provider_id);
} else {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
}
}, (error) => {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang]['ER08'];
});
const This = this;
setTimeout(function() {
This.responseMsg = '';
}, 3000);
}
getProvider_name(id: number) {
this.fname = 'provider_name';
const post_data = {'provider_id': id};
this.service.post_data(this.fname, post_data).subscribe(response => {
console.log(response);
if (response.code === 1) {
const resData = response.responseResult;
this.deli_provider = resData.name;
console.log(this.deli_provider);
} else {
}
}, (error) => {
});
}
providerState(state: number, id: number) {
this.loader = true;
this.fname = 'provider_approve';
const post_data = {'user_id': id, 'status': state};
this.service.post_data(this.fname, post_data).subscribe(response => {
this.loader = false;
console.log(response);
if (response.code === 1) {
this.provider = response.responseResult;
this.getProvider();
} else {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
}
}, (error) => {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang]['ER08'];
});
const This = this;
setTimeout(function() {
This.responseMsg = '';
}, 3000);
}
} }
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Forex Delivery Service Provider</h4> <h4>{{'home.Forex Delivery Service Provider' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('checker/currency_list')"> <!-- <button class="logout" (click)="goToPage('maker/currency_list')">
<img src="assets/images/asset_currency.png"> <img src="assets/images/asset_currency.png">
Currency</button> {{'home.Currency' | translate}}</button> -->
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'home.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
</div> </div>
</div> </div>
...@@ -20,13 +20,13 @@ ...@@ -20,13 +20,13 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="forex_inner" (click)="clickForex()"> <div class="forex_inner" (click)="clickForex()">
<img src="assets/images/asset_forex.png"> <img src="assets/images/asset_forex.png">
<h5>Manage Forex Provider</h5> <h5>{{'home.Manage Forex Provider' | translate}}</h5>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="forex_inner" (click)="clickDelivery()"> <div class="forex_inner" (click)="clickDelivery()">
<img src="assets/images/asset_manage.png"> <img src="assets/images/asset_manage.png">
<h5>Manage Delivery Provider</h5> <h5> {{'home.Manage Delivery Provider' | translate}}</h5>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -4,46 +4,44 @@ ...@@ -4,46 +4,44 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Forex Delivery Service Provider</h4> <h4> {{'manageprovider.Forex Delivery Service Provider' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('checker/home')"> <button class="logout" (click)="goToPage('checker/home')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button> {{'manageprovider.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'manageprovider.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('checker/changepin')">Change PIN</span> <span (click)="goToPage('checker/changepin')"> {{'manageprovider.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Manage Delivery Service Provider</h3> <h3> {{'manageprovider.Manage Delivery Service Provider' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="table-responsive"> <div class="table-responsive">
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseMsg}} <strong> {{'manageprovider.Warning!' | translate}}</strong> {{responseMsg}}
</div> </div>
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Delivery provider removed successfully <strong> {{'manageprovider.Success!' | translate}}</strong>{{'manageprovider.Delivery provider removed successfully' | translate}}
</div> </div>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>Provider Name</th> <th>{{'manageprovider.Provider Name' | translate}}</th>
<th>Location</th> <th> {{'manageprovider.Location' | translate}}</th>
<th>CR Manager</th> <th> {{'manageprovider.CR Manager' | translate}}</th>
<th>CR ID</th> <th> {{'manageprovider.CR ID' | translate}}</th>
<th>Contact Name</th> <th> {{'manageprovider.Contact Name' | translate}}</th>
<th>Phone</th> <th> {{'manageprovider.Phone' | translate}}</th>
<th>Email ID</th> <th> {{'manageprovider.Email ID' | translate}}</th>
<th class="textRight"> <th> {{'forexprovider.Action' | translate}}</th>
<button class="add" (click)="goToPage('checker/provider_delivery')">+</button>
</th>
</tr> </tr>
</thead> </thead>
<tbody *ngIf="providerList; else noProvider"> <tbody *ngIf="providerList; else noProvider">
...@@ -55,9 +53,9 @@ ...@@ -55,9 +53,9 @@
<td>{{provider.contact | titlecase}}</td> <td>{{provider.contact | titlecase}}</td>
<td>{{provider.phone}}</td> <td>{{provider.phone}}</td>
<td>{{provider.email_id}}</td> <td>{{provider.email_id}}</td>
<td class="textRight pl0 pr0"> <td *ngIf="provider.status != 0">{{get_status(provider.status)}}</td>
<button class="edit_btn"(click)="editClick(provider.id)"></button> <td class="textRight pl0 pr0" *ngIf="provider.status == 0">
<button class="delete_btn" (click)="deleteClick(provider.id)"></button> <button class="edit_btn" data-toggle="modal" data-target="#forexapproved" (click)="providerDetails(provider.id)"></button>
</td> </td>
</tr> </tr>
</tbody> </tbody>
...@@ -66,4 +64,70 @@ ...@@ -66,4 +64,70 @@
</div> </div>
</div> </div>
</div> </div>
</section> </section>
\ No newline at end of file
<div class="modal" id="forexapproved" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="max-width: 700px !important;">
<div class="modal-content">
<div class="forex_modal_wrapper">
<div class="forex_modal_header">
<h5 class="floatLeft">Forex Provider Approve</h5>
<button type="button" class="close floatRight" data-dismiss="modal">&times;</button>
<div class="clear"></div>
</div>
<div class="forex_inner_wrapper" *ngIf="provider">
<div class="row">
<div class="col">
<div class="row">
<div class="col">Provider Name:</div>
<div class="col">{{provider.name}}</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col">Location:</div>
<div class="col">{{provider.location}}</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="row">
<div class="col">CR ID:</div>
<div class="col">{{provider.cr_id}}</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col">CR Manager:</div>
<div class="col">{{provider.cr_manager}}</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="row">
<div class="col">Email ID:</div>
<div class="col">{{provider.email_id}}</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col">Phone:</div>
<div class="col">{{provider.phone}}</div>
</div>
</div>
</div>
</div>
<div class="forex_modal_footer_btn_bay textRight">
<button class="okay_btn" data-dismiss="modal" (click)="providerState(2, provider.users_id)">Reject</button>
<button class="cancel_btn" data-dismiss="modal" (click)="providerState(1, provider.users_id)">Approve</button>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
...@@ -11,11 +11,12 @@ import { ValidationService } from './../../providers/validation.service'; ...@@ -11,11 +11,12 @@ import { ValidationService } from './../../providers/validation.service';
export class ManageproviderComponent implements OnInit { export class ManageproviderComponent implements OnInit {
providerList: any[]; providerList: any[];
fname: any; fname: any;
lang = 'ar'; lang = 'en';
responseMsg: any; responseMsg: any;
error: boolean; error: boolean;
success: boolean; success: boolean;
loader: boolean; loader: boolean;
provider: any;
constructor(private router: Router, private route: ActivatedRoute, public vs: ValidationService, public service: WebService) { constructor(private router: Router, private route: ActivatedRoute, public vs: ValidationService, public service: WebService) {
this.responseMsg = ''; this.responseMsg = '';
...@@ -30,7 +31,7 @@ export class ManageproviderComponent implements OnInit { ...@@ -30,7 +31,7 @@ export class ManageproviderComponent implements OnInit {
getProvider() { getProvider() {
this.loader = true; this.loader = true;
this.fname = 'providers'; this.fname = 'all_providers';
const post_data = {'type': 3}; const post_data = {'type': 3};
this.service.post_data(this.fname, post_data).subscribe(response => { this.service.post_data(this.fname, post_data).subscribe(response => {
this.loader = false; this.loader = false;
...@@ -93,11 +94,78 @@ export class ManageproviderComponent implements OnInit { ...@@ -93,11 +94,78 @@ export class ManageproviderComponent implements OnInit {
} }
editClick(id: number) { editClick(id: number) {
this.router.navigate(['checker/delivery_edit/' + id]); this.router.navigate(['maker/delivery_edit/' + id]);
} }
logout() { logout() {
this.service.logout(); this.service.logout();
} }
get_status(status: number) {
let state = '';
switch (status) {
case 0:
state = 'Pending';
break;
case 1:
state = 'Approved';
break;
case 2:
state = 'Reject';
break;
default:
break;
}
return state;
}
providerState(state: number, id: number) {
this.loader = true;
this.fname = 'provider_approve';
const post_data = {'user_id': id, 'status': state};
this.service.post_data(this.fname, post_data).subscribe(response => {
this.loader = false;
console.log(response);
if (response.code === 1) {
this.provider = response.responseResult;
this.getProvider();
} else {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
}
}, (error) => {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang]['ER08'];
});
const This = this;
setTimeout(function() {
This.responseMsg = '';
}, 3000);
}
providerDetails(id: any) {
this.loader = true;
this.fname = 'providers_details';
const post_data = {'provider_id': id};
this.service.post_data(this.fname, post_data).subscribe(response => {
this.loader = false;
console.log(response);
if (response.code === 1) {
this.provider = response.responseResult;
} else {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
}
}, (error) => {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang]['ER08'];
});
const This = this;
setTimeout(function() {
This.responseMsg = '';
}, 3000);
}
} }
...@@ -5,39 +5,39 @@ ...@@ -5,39 +5,39 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Driver Management</h4> <h4> {{'adddriver.Driver Management' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('delivery')"> <button class="logout" (click)="goToPage('delivery')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button> {{'adddriver.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'adddriver.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('delivery/changepin')">Change PIN</span> <span (click)="goToPage('delivery/changepin')"> {{'adddriver.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Edit Driver</h3> <h3> {{'adddriver.Add Delivery Driver' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Provider created successfully. <strong> {{'adddriver.Success!' | translate}}</strong> {{'adddriver.Driver created successfully' | translate}}
</div> </div>
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseError}} <strong>{{'adddriver.Warning!' | translate}}</strong> {{responseError}}
</div> </div>
<form [formGroup]="providerForm" (ngSubmit)="regProcess()" autocomplete="off"> <form [formGroup]="providerForm" (ngSubmit)="regProcess()" autocomplete="off">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Provider Name</p> <p> {{'adddriver.Provider Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="name"> <input class="provider_input" placeholder="" type="text" formControlName="name" tabindex="1">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['name'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['name'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['name'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['name'].hasError('required')">{{error_msg.required}} </div>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Pin</p> <p>{{'adddriver.Pin' | translate}}</p>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
...@@ -55,22 +55,30 @@ ...@@ -55,22 +55,30 @@
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <!--div class="provider_data_content">
<p>Confirm Pin</p> <p> {{'adddriver.Confirm Pin' | translate}}</p>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin m0" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin m0" placeholder="" type="password" maxlength="1" value="0" readonly>
</div-->
<div class="provider_data_content">
<p> {{'adddriver.Postal Code' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="postal" tabindex="2">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['postal'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['postal'].hasError('required')">{{error_msg.required}} </div>
</div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Location</p> <p> {{'adddriver.Location' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="location"> <input class="provider_input" placeholder="" type="text" formControlName="location" tabindex="3">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['location'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['location'].hasError('required')">{{error_msg.required}} </div>
...@@ -78,20 +86,23 @@ ...@@ -78,20 +86,23 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>National ID</p> <p> {{'adddriver.National ID' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="cr_id"> <input class="provider_input" placeholder="" type="text" formControlName="national_id" tabindex="4">
</div>
<div class="s_error" *ngIf="!providerForm.controls['national_id'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['national_id'].hasError('required')">{{error_msg.required}} </div>
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['cr_id'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['national_id'].valid && providerForm.controls['national_id'].touched">
<div class="s_validation" *ngIf="providerForm.controls['cr_id'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['national_id'].hasError('pattern')">{{error_msg.national_id}}</div>
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Manager ID</p> <p> {{'adddriver.Manager ID' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="cr_manager"> <input class="provider_input" placeholder="" type="text" formControlName="manager_id" tabindex="5">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['cr_manager'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['manager_id'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['cr_manager'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['manager_id'].hasError('required')">{{error_msg.required}} </div>
</div> </div>
</div> </div>
</div> </div>
...@@ -109,16 +120,16 @@ ...@@ -109,16 +120,16 @@
</div> --> </div> -->
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Phone</p> <p> {{'adddriver.Phone' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="phone"> <input class="provider_input" placeholder="" type="number" formControlName="phone" tabindex="6">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched">
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('pattern')">{{error_msg.phone}}</div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('pattern')">{{error_msg.phone}}</div>
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched && !providerForm.controls['phone'].hasError('pattern')"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched && !providerForm.controls['phone'].hasError('pattern')">
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('maxlength')">{{error_msg.maxLength}} 15</div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('maxlength')">{{error_msg.maxLength}} 10</div>
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('minlength')">{{error_msg.minLength}} 8</div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('minlength')">{{error_msg.minLength}} 10</div>
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('required')">{{error_msg.required}} </div>
...@@ -126,8 +137,8 @@ ...@@ -126,8 +137,8 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Email id</p> <p> {{'adddriver.Email id' | translate}}</p>
<input class="provider_input" placeholder="" type="mail" formControlName="email_id"> <input class="provider_input" placeholder="" type="mail" formControlName="email_id" tabindex="7">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched"> <div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched">
<div class="s_validation" *ngIf="providerForm.controls['email_id'].hasError('pattern')">{{error_msg.email}} </div> <div class="s_validation" *ngIf="providerForm.controls['email_id'].hasError('pattern')">{{error_msg.email}} </div>
...@@ -140,6 +151,41 @@ ...@@ -140,6 +151,41 @@
<div class="col"></div> <div class="col"></div>
</div> </div>
<hr/>
<h6>Forex Amount Manage</h6><br/>
<div class="row">
<!-- <div class="col">
<div class="provider_data_content">
<p>Contact</p>
<input class="provider_input" placeholder="" type="text" formControlName="contact">
</div>
<div class="s_error" *ngIf="!providerForm.controls['contact'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['contact'].hasError('required')">{{error_msg.required}} </div>
</div>
</div> -->
<div class="col">
<div class="provider_data_content">
<p> {{'adddriver.Maximum Amount' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="max_amount" tabindex="8">
</div>
<div class="s_error" *ngIf="!providerForm.controls['max_amount'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['max_amount'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
<div class="col">
<div class="provider_data_content">
<p> {{'adddriver.Maximum Limit' | translate}}</p>
<input class="provider_input" placeholder="" type="mail" formControlName="max_limit" tabindex="9">
</div>
<div class="s_error" *ngIf="!providerForm.controls['max_limit'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['max_limit'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
<div class="col"></div>
</div>
<!-- <div class="row"> <!-- <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
...@@ -175,7 +221,7 @@ ...@@ -175,7 +221,7 @@
<!-- <div class="row"> <!-- <div class="row">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay p0"> <div class="add_provider_btn_bay p0">
<button class="edit_btn floatRight" (click)="goToPage('checker/editprovider')">Edit</button> <button class="edit_btn floatRight" (click)="goToPage('maker/editprovider')">Edit</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
...@@ -183,8 +229,8 @@ ...@@ -183,8 +229,8 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay"> <div class="add_provider_btn_bay">
<button class="save_btn floatRight">Save</button> <button class="save_btn floatRight"> {{'adddriver.Save' | translate}}</button>
<button class="cancel_btn floatRight" (click)="cancelClick()">Cancel</button> <button class="cancel_btn floatRight" (click)="cancelClick()"> {{'adddriver.Cancel' | translate}}</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
......
...@@ -11,7 +11,8 @@ import { FormControl, FormGroup, FormBuilder, Validators, ValidationErrors } fro ...@@ -11,7 +11,8 @@ import { FormControl, FormGroup, FormBuilder, Validators, ValidationErrors } fro
}) })
export class AddDriverComponent implements OnInit { export class AddDriverComponent implements OnInit {
providerForm: FormGroup; providerForm: FormGroup;
mobnumPattern = '^((\\+?)|0)?[0-9]{8,15}$'; mobnumPattern = '^((\\+?)|0)?[0-9]{9,10}$';
crId = '^((\\+?)|0)?[0-9]{10}$';
emailPattern = '^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$'; emailPattern = '^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$';
providerSubmit: boolean; providerSubmit: boolean;
lang = 'en'; lang = 'en';
...@@ -44,13 +45,16 @@ export class AddDriverComponent implements OnInit { ...@@ -44,13 +45,16 @@ export class AddDriverComponent implements OnInit {
this.getProfile(); this.getProfile();
this.providerForm = this.formBuilder.group({ this.providerForm = this.formBuilder.group({
'name': ['', Validators.compose([Validators.required])], 'name': ['', Validators.compose([Validators.required])],
'cr_manager': ['', Validators.compose([Validators.required])], 'postal': ['', Validators.compose([Validators.required])],
'cr_id': ['', Validators.compose([Validators.required])], 'manager_id': ['', Validators.compose([Validators.required])],
'national_id': ['', Validators.compose([Validators.required, Validators.pattern(this.crId)])],
'location': ['', Validators.compose([Validators.required])], 'location': ['', Validators.compose([Validators.required])],
'email_id': ['', Validators.compose([Validators.required, Validators.maxLength(50), Validators.pattern(this.emailPattern)])], 'email_id': ['', Validators.compose([Validators.required, Validators.maxLength(50), Validators.pattern(this.emailPattern)])],
// tslint:disable-next-line:max-line-length // tslint:disable-next-line:max-line-length
'phone': ['', Validators.compose([Validators.required, Validators.minLength(8), Validators.maxLength(15), Validators.pattern(this.mobnumPattern)])], 'phone': ['', Validators.compose([Validators.required, Validators.minLength(8), Validators.maxLength(15), Validators.pattern(this.mobnumPattern)])],
'type': [4], 'type': [4],
'max_amount': ['', Validators.compose([Validators.required])],
'max_limit': ['', Validators.compose([Validators.required])],
'deli_provider_id': ['', Validators.compose([Validators.required])], 'deli_provider_id': ['', Validators.compose([Validators.required])],
'password': [''], 'password': [''],
}); });
...@@ -74,7 +78,7 @@ export class AddDriverComponent implements OnInit { ...@@ -74,7 +78,7 @@ export class AddDriverComponent implements OnInit {
if (this.providerForm.valid) { if (this.providerForm.valid) {
this.loader = true; this.loader = true;
const providerObj = this.providerForm.value; const providerObj = this.providerForm.value;
this.funcName = 'provider_create'; this.funcName = 'driver_create';
this.service.post_data(this.funcName, providerObj).subscribe(response => { this.service.post_data(this.funcName, providerObj).subscribe(response => {
this.loader = false; this.loader = false;
console.log(response); console.log(response);
...@@ -82,6 +86,7 @@ export class AddDriverComponent implements OnInit { ...@@ -82,6 +86,7 @@ export class AddDriverComponent implements OnInit {
this.success = true; this.success = true;
this.providerSubmit = false; this.providerSubmit = false;
this.providerForm.reset(); this.providerForm.reset();
this.providerForm.controls['type'].setValue(4);
} else { } else {
this.error = true; this.error = true;
this.responseError = this.vs.errorCode[this.lang][response.errorCode]; this.responseError = this.vs.errorCode[this.lang][response.errorCode];
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
<div class="login_inner"> <div class="login_inner">
<img src="assets/images/asset_logo.png"> <img src="assets/images/asset_logo.png">
<hr> <hr>
<h6>Change PIN</h6> <h6> {{'changepin.Change PIN' | translate}}</h6>
<div class="login_inner_content"> <div class="login_inner_content">
<br> <br>
<div class="login_row"> <div class="login_row">
<p>Old PIN</p> <p>{{'changepin.Old PIN' | translate}}</p>
<div class="login_pin"> <div class="login_pin">
<input class="log_pin" type="password" maxlength="1" #old1 (keyup)="processKeyUp($event, old2)"> <input class="log_pin" type="password" maxlength="1" #old1 (keyup)="processKeyUp($event, old2)">
<input class="log_pin" type="password" maxlength="1" #old2 (keydown.backspace)="processBack($event, old1)" (keyup)="processKeyUp($event, old3)"> <input class="log_pin" type="password" maxlength="1" #old2 (keydown.backspace)="processBack($event, old1)" (keyup)="processKeyUp($event, old3)">
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</div> </div>
</div> </div>
<div class="login_row"> <div class="login_row">
<p>New PIN</p> <p>{{'changepin.New PIN' | translate}}</p>
<div class="login_pin"> <div class="login_pin">
<input class="log_pin" type="password" maxlength="1" #new1 (keyup)="processKeyUp($event, new2)"> <input class="log_pin" type="password" maxlength="1" #new1 (keyup)="processKeyUp($event, new2)">
<input class="log_pin" type="password" maxlength="1" #new2 (keydown.backspace)="processBack($event, new1)" (keyup)="processKeyUp($event, new3)"> <input class="log_pin" type="password" maxlength="1" #new2 (keydown.backspace)="processBack($event, new1)" (keyup)="processKeyUp($event, new3)">
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<div class="s_validation">{{error_msg.password}} </div> <div class="s_validation">{{error_msg.password}} </div>
</div> </div>
<div class="login_row"> <div class="login_row">
<p>Confirm PIN</p> <p> {{'changepin.Confirm PIN' | translate}}</p>
<div class="login_pin"> <div class="login_pin">
<input class="log_pin" type="password" maxlength="1" #conf1 (keyup)="processKeyUp($event, conf2)"> <input class="log_pin" type="password" maxlength="1" #conf1 (keyup)="processKeyUp($event, conf2)">
<input class="log_pin" type="password" maxlength="1" #conf2 (keydown.backspace)="processBack($event, conf1)" (keyup)="processKeyUp($event, conf3)"> <input class="log_pin" type="password" maxlength="1" #conf2 (keydown.backspace)="processBack($event, conf1)" (keyup)="processKeyUp($event, conf3)">
...@@ -58,21 +58,21 @@ ...@@ -58,21 +58,21 @@
</div> </div>
<div class="alert alert-danger alert-dismissible" *ngIf="resetError"> <div class="alert alert-danger alert-dismissible" *ngIf="resetError">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{resetMsg}} <strong> {{'changepin.Warning!' | translate}}</strong> {{resetMsg}}
</div> </div>
<div class="alert alert-success alert-dismissible" *ngIf="!resetError && !error && loginSubmit"> <div class="alert alert-success alert-dismissible" *ngIf="!resetError && !error && loginSubmit">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Password Updated Successfully <strong> {{'changepin.Success!' | translate}}</strong> Password Updated Successfully {{'changepin.Save' | translate}}
</div> </div>
<!-- <div *ngIf="!resetError && !error && loginSubmit" class="s_validation">Passwod Updated Successfully</div> --> <!-- <div *ngIf="!resetError && !error && loginSubmit" class="s_validation">Passwod Updated Successfully</div> -->
<div class="login_btn_bay"> <div class="login_btn_bay">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<button class="cancel_btn" (click)="cancelClick()">Cancel</button> <button class="cancel_btn" (click)="cancelClick()"> {{'changepin.Cancel' | translate}}</button>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<button class="login_btn" (click)="saveClick()">Save</button> <button class="login_btn" (click)="saveClick()">{{'changepin.Save' | translate}}</button>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -2,6 +2,7 @@ import { NgModule } from '@angular/core'; ...@@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { moduleRouting } from './delivery.routing'; import { moduleRouting } from './delivery.routing';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { TranslateModule} from '@ngx-translate/core';
/* CUSTOM-COMPONENTS */ /* CUSTOM-COMPONENTS */
...@@ -20,7 +21,8 @@ import { EditDriverComponent } from './edit-driver/edit-driver.component'; ...@@ -20,7 +21,8 @@ import { EditDriverComponent } from './edit-driver/edit-driver.component';
CommonModule, CommonModule,
moduleRouting, moduleRouting,
FormsModule, FormsModule,
ReactiveFormsModule ReactiveFormsModule,
TranslateModule
] ]
}) })
export class DeliveryModule { } export class DeliveryModule { }
...@@ -4,70 +4,80 @@ ...@@ -4,70 +4,80 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Forex Delivery Driver</h4> <h4> {{'editdriver.Forex Delivery Driver' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('delivery')"> <button class="logout" (click)="goToPage('delivery')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button> {{'editdriver.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'editdriver.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('checker/changepin')">Change PIN</span> <span (click)="goToPage('maker/changepin')"> {{'editdriver.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Edit Forex Delivery Driver</h3> <h3> {{'editdriver.Edit Forex Delivery Driver' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Forex Delivery Driver updated successfully. <strong> {{'editdriver.Success!' | translate}}</strong> {{'editdriver.Forex Delivery Driver updated successfully' | translate}}
</div> </div>
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseMsg}} <strong> {{'editdriver.Warning!' | translate}}</strong> {{responseMsg}}
</div> </div>
<form [formGroup]="providerForm" (ngSubmit)="editProcess()" autocomplete="off"> <form [formGroup]="providerForm" (ngSubmit)="editProcess()" autocomplete="off">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content" *ngIf="provider"> <div class="provider_data_content" *ngIf="provider">
<p>Provider Name</p> <p> {{'editdriver.Provider Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" disabled [value]="provider.name"> <input class="provider_input" placeholder="" type="text" disabled [value]="provider.name">
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Location</p> <p>{{'editdriver.Location' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="location"> <input class="provider_input" placeholder="" type="text" formControlName="location">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['location'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['location'].hasError('required')">{{error_msg.required}} </div>
</div> </div>
</div> </div>
<div class="col">
<div class="provider_data_content">
<p> {{'adddriver.Postal Code' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="postal">
</div>
<div class="s_error" *ngIf="!providerForm.controls['postal'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['postal'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
<div class="col">
<div class="provider_data_content" *ngIf="provider">
<p>National ID</p>
<input class="provider_input" placeholder="" type="text" disabled [value]="provider.cr_id">
</div>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content" *ngIf="provider">
<p> {{'editdriver.National ID' | translate}}</p>
<input class="provider_input" placeholder="" type="text" disabled [value]="provider.national_id">
</div>
</div>
<div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Manager ID</p> <p> {{'editdriver.Manager ID' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="cr_manager"> <input class="provider_input" placeholder="" type="text" formControlName="manager_id">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['cr_manager'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['manager_id'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['cr_manager'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['manager_id'].hasError('required')">{{error_msg.required}} </div>
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Phone</p> <p> {{'editdriver.Phone' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="phone"> <input class="provider_input" placeholder="" type="number" formControlName="phone">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched">
...@@ -81,10 +91,12 @@ ...@@ -81,10 +91,12 @@
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('required')">{{error_msg.required}} </div>
</div> </div>
</div> </div>
</div>
<div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Email id</p> <p> {{'editdriver.Email id' | translate}}</p>
<input class="provider_input" placeholder="" type="mail" formControlName="email_id"> <input class="provider_input" placeholder="" type="mail" formControlName="email_id">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched"> <div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched">
...@@ -95,13 +107,50 @@ ...@@ -95,13 +107,50 @@
<div class="s_validation" *ngIf="providerForm.controls['email_id'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['email_id'].hasError('required')">{{error_msg.required}} </div>
</div> </div>
</div> </div>
<div class="col"></div>
<div class="col"></div>
</div> </div>
<hr/>
<h6>Forex Amount Manage</h6><br/>
<div class="row">
<!-- <div class="col">
<div class="provider_data_content">
<p>Contact</p>
<input class="provider_input" placeholder="" type="text" formControlName="contact">
</div>
<div class="s_error" *ngIf="!providerForm.controls['contact'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['contact'].hasError('required')">{{error_msg.required}} </div>
</div>
</div> -->
<div class="col">
<div class="provider_data_content">
<p> {{'adddriver.Maximum Amount' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="max_amount">
</div>
<div class="s_error" *ngIf="!providerForm.controls['max_amount'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['max_amount'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
<div class="col">
<div class="provider_data_content">
<p> {{'adddriver.Maximum Limit' | translate}}</p>
<input class="provider_input" placeholder="" type="mail" formControlName="max_limit">
</div>
<div class="s_error" *ngIf="!providerForm.controls['max_limit'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['max_limit'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
<div class="col"></div>
</div>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay"> <div class="add_provider_btn_bay">
<button class="save_btn floatRight">Save</button> <button class="save_btn floatRight"> {{'editdriver.Save' | translate}}</button>
<button class="cancel_btn floatRight" (click)="cancelClick()">Cancel</button> <button class="cancel_btn floatRight" (click)="cancelClick()"> {{'editdriver.Cancel' | translate}}</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
......
...@@ -48,32 +48,39 @@ export class EditDriverComponent implements OnInit { ...@@ -48,32 +48,39 @@ export class EditDriverComponent implements OnInit {
this.getProvider(id); this.getProvider(id);
console.log(id); console.log(id);
this.providerForm = this.formBuilder.group({ this.providerForm = this.formBuilder.group({
'cr_manager': ['', Validators.compose([Validators.required])], 'manager_id': ['', Validators.compose([Validators.required])],
'location': ['', Validators.compose([Validators.required])], 'location': ['', Validators.compose([Validators.required])],
'email_id': ['', Validators.compose([Validators.required, Validators.maxLength(50), Validators.pattern(this.emailPattern)])], 'email_id': ['', Validators.compose([Validators.required, Validators.maxLength(50), Validators.pattern(this.emailPattern)])],
// tslint:disable-next-line:max-line-length // tslint:disable-next-line:max-line-length
'phone': ['', Validators.compose([Validators.required, Validators.minLength(8), Validators.maxLength(15), Validators.pattern(this.mobnumPattern)])], 'phone': ['', Validators.compose([Validators.required, Validators.minLength(8), Validators.maxLength(15), Validators.pattern(this.mobnumPattern)])],
'type': [4], 'type': [4],
'provider_id': [id], 'driver_id': [id],
'national_id': [''],
'postal': ['', Validators.compose([Validators.required])],
'max_amount': ['', Validators.compose([Validators.required])],
'max_limit': ['', Validators.compose([Validators.required])],
'deli_provider_id': ['', Validators.compose([Validators.required])] 'deli_provider_id': ['', Validators.compose([Validators.required])]
}); });
} }
getProvider(id: any) { getProvider(id: any) {
this.loader = true; this.loader = true;
this.funcName = 'providers_details'; this.funcName = 'driver_details';
const post_data = {'provider_id': id}; const post_data = {'driver_id': id};
this.service.post_data(this.funcName, post_data).subscribe(response => { this.service.post_data(this.funcName, post_data).subscribe(response => {
this.loader = false; this.loader = false;
console.log(response); console.log(response);
if (response.code === 1) { if (response.code === 1) {
this.provider = response.responseResult; this.provider = response.responseResult;
this.providerForm.patchValue({ this.providerForm.patchValue({
cr_manager: this.provider.cr_manager, manager_id: this.provider.manager_id,
contact: this.provider.contact, postal: this.provider.postal,
location: this.provider.location, location: this.provider.location,
email_id: this.provider.email_id, email_id: this.provider.email_id,
phone: this.provider.phone phone: this.provider.phone,
max_amount: this.provider.max_amount,
max_limit: this.provider.max_limit,
national_id: this.provider.national_id
}); });
} else { } else {
this.error = true; this.error = true;
...@@ -109,7 +116,7 @@ export class EditDriverComponent implements OnInit { ...@@ -109,7 +116,7 @@ export class EditDriverComponent implements OnInit {
if (this.providerForm.valid) { if (this.providerForm.valid) {
this.loader = true; this.loader = true;
const providerObj = this.providerForm.value; const providerObj = this.providerForm.value;
this.funcName = 'provider_edit'; this.funcName = 'driver_edit';
this.service.post_data(this.funcName, providerObj).subscribe(response => { this.service.post_data(this.funcName, providerObj).subscribe(response => {
this.loader = false; this.loader = false;
console.log(response); console.log(response);
......
...@@ -4,43 +4,43 @@ ...@@ -4,43 +4,43 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Forex Delivery Service Provider</h4> <h4> {{'editprovider.Forex Delivery Service Provider' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('delivery')"> <button class="logout" (click)="goToPage('delivery')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button> {{'editprovider.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'editprovider.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('forex/changepin')">Change PIN</span> <span (click)="goToPage('forex/changepin')"> {{'editprovider.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Edit Delivery Service Provider</h3> <h3> {{'editprovider.Edit Delivery Service Provider' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Provider updated successfully. <strong> {{'editprovider.Success!' | translate}}</strong> {{'editprovider.Provider updated successfully' | translate}}
</div> </div>
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseMsg}} <strong> {{'editprovider.Warning!' | translate}}</strong> {{responseMsg}}
</div> </div>
<form [formGroup]="providerForm" (ngSubmit)="editProcess()" autocomplete="off"> <form [formGroup]="providerForm" (ngSubmit)="editProcess()" autocomplete="off">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content" *ngIf="provider"> <div class="provider_data_content" *ngIf="provider">
<p>Provider Name</p> <p> {{'editprovider.Provider Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" disabled [value]="provider.name"> <input class="provider_input" placeholder="" type="text" disabled [value]="provider.name">
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Location</p> <p> {{'editprovider.Location' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="location"> <input class="provider_input" placeholder="" type="text" formControlName="location">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit">
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<div class="col"> <div class="col">
<div class="provider_data_content" *ngIf="provider"> <div class="provider_data_content" *ngIf="provider">
<p>CR ID</p> <p> {{'editprovider.CR ID' | translate}}</p>
<input class="provider_input" placeholder="" type="text" disabled [value]="provider.cr_id"> <input class="provider_input" placeholder="" type="text" disabled [value]="provider.cr_id">
</div> </div>
</div> </div>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>CR Manager</p> <p> {{'editprovider.CR Manager' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="cr_manager"> <input class="provider_input" placeholder="" type="text" formControlName="cr_manager">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['cr_manager'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['cr_manager'].valid && providerSubmit">
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Contact Name</p> <p> {{'editprovider.Contact Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="contact"> <input class="provider_input" placeholder="" type="text" formControlName="contact">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['contact'].valid"> <div class="s_error" *ngIf="!providerForm.controls['contact'].valid">
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Phone</p> <p> {{'editprovider.Phone' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="phone"> <input class="provider_input" placeholder="" type="number" formControlName="phone">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched">
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Email id</p> <p> {{'editprovider.Email id' | translate}}</p>
<input class="provider_input" placeholder="" type="mail" formControlName="email_id"> <input class="provider_input" placeholder="" type="mail" formControlName="email_id">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched"> <div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched">
...@@ -126,8 +126,8 @@ ...@@ -126,8 +126,8 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay"> <div class="add_provider_btn_bay">
<button class="save_btn floatRight">Save</button> <button class="save_btn floatRight"> {{'editprovider.Save' | translate}}</button>
<button class="cancel_btn floatRight" (click)="cancelClick()">Cancel</button> <button class="cancel_btn floatRight" (click)="cancelClick()"> {{'editprovider.Cancel' | translate}}</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
......
<div class="delivery_provider_content"> <div class="delivery_provider_content">
<router-outlet></router-outlet> <router-outlet></router-outlet>
</div> </div>
...@@ -4,42 +4,45 @@ ...@@ -4,42 +4,45 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Driver Management</h4> <h4> {{'listdriver.Driver Management' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('delivery')"> <button class="logout" (click)="goToPage('delivery')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button> {{'listdriver.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'listdriver.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('checker/changepin')">Change PIN</span> <span (click)="goToPage('maker/changepin')"> {{'listdriver.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Driver List</h3> <h3> {{'listdriver.Driver List' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="table-responsive"> <div class="table-responsive">
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseMsg}} <strong> {{'listdriver.Warning!' | translate}}</strong> {{responseMsg}}
</div> </div>
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Forex provider removed successfully <strong> {{'listdriver.Success!' | translate}}</strong> {{'listdriver.Forex provider removed successfully' | translate}}
</div> </div>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>Provider Name</th> <th> {{'listdriver.Provider Name' | translate}}</th>
<th>Location</th> <th> {{'listdriver.Location' | translate}}</th>
<th>Manager ID</th> <th> {{'listdriver.Postal Code' | translate}}</th>
<th>National ID</th> <th> {{'listdriver.Manager ID' | translate}}</th>
<th>Phone</th> <th> {{'listdriver.National ID' | translate}}</th>
<th>Email ID</th> <th> {{'listdriver.Phone' | translate}}</th>
<th> {{'listdriver.Email ID' | translate}}</th>
<th> {{'listdriver.Max Amount' | translate}}</th>
<th> {{'listdriver.Max Limit' | translate}}</th>
<th class="textRight"> <th class="textRight">
<button class="add" (click)="goToPage('delivery/driveradd')">+</button> <button class="add" (click)="goToPage('delivery/driveradd')">+</button>
</th> </th>
...@@ -49,10 +52,13 @@ ...@@ -49,10 +52,13 @@
<tr *ngFor="let provider of providerList;"> <tr *ngFor="let provider of providerList;">
<td>{{provider.name | titlecase}}</td> <td>{{provider.name | titlecase}}</td>
<td>{{provider.location | titlecase}}</td> <td>{{provider.location | titlecase}}</td>
<td>{{provider.cr_manager | titlecase}}</td> <td>{{provider.postal}}</td>
<td>{{provider.cr_id}}</td> <td>{{provider.manager_id | titlecase}}</td>
<td>{{provider.national_id}}</td>
<td>{{provider.phone}}</td> <td>{{provider.phone}}</td>
<td>{{provider.email_id}}</td> <td>{{provider.email_id}}</td>
<td>{{provider.max_amount}}</td>
<td>{{provider.max_limit}}</td>
<td class="textRight pl0 pr0"> <td class="textRight pl0 pr0">
<button class="edit_btn"(click)="editClick(provider.id)"></button> <button class="edit_btn"(click)="editClick(provider.id)"></button>
<button class="delete_btn" (click)="deleteClick(provider.id)"></button> <button class="delete_btn" (click)="deleteClick(provider.id)"></button>
......
...@@ -11,7 +11,7 @@ import { ValidationService } from './../../providers/validation.service'; ...@@ -11,7 +11,7 @@ import { ValidationService } from './../../providers/validation.service';
export class ListDriverComponent implements OnInit { export class ListDriverComponent implements OnInit {
providerList: any[]; providerList: any[];
fname: any; fname: any;
lang = 'ar'; lang = 'en';
responseMsg: any; responseMsg: any;
error: boolean; error: boolean;
success: boolean; success: boolean;
......
...@@ -4,63 +4,66 @@ ...@@ -4,63 +4,66 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Forex Transaction List</h4> <h4> {{'transaction.Forex Transaction List' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('delivery/driverlist')"> <button class="logout" (click)="goToPage('delivery/driverlist')">
<img src="assets/images/asset_driver.png"> <img src="assets/images/asset_driver.png">
Driver Management</button> {{'transaction.Driver Management' | translate}}</button>
<button class="logout" (click)="goToPage('delivery/editprovider')"> <button class="logout" (click)="goToPage('delivery/editprovider')">
<img src="assets/images/asset_settings.png"> <img src="assets/images/asset_settings.png">
Settings</button> {{'transaction.Settings' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'transaction.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('delivery/changepin')">Change PIN</span> <span (click)="goToPage('delivery/changepin')"> {{'transaction.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Manage Transaction</h3> <h3> {{'transaction.Manage Transaction' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseMsg}} <strong> {{'transaction.Warning' | translate}}</strong> {{responseMsg}}
</div> </div>
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Forex provider removed successfully <strong> {{'transaction.Success' | translate}}</strong> {{'transaction.Forex provider removed successfully' | translate}}
</div> </div>
<div class="table-responsive"> <div class="table-responsive">
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>User Info</th> <th> {{'transaction.User Info' | translate}}</th>
<th>Phone</th> <th> {{'transaction.Provider' | translate}}</th>
<th>Location</th> <th> {{'transaction.Phone' | translate}}</th>
<th>Currency</th> <th> {{'transaction.Location' | translate}}</th>
<th>Amount</th> <th> {{'transaction.Currency' | translate}}</th>
<th>Forex Amount</th> <th> {{'transaction.Amount' | translate}}</th>
<th>Date</th> <th>{{'transaction.Forex Amount' | translate}}</th>
<th>Driver</th> <th> {{'transaction.Date' | translate}}</th>
<th>Status</th> <th> {{'transaction.Driver' | translate}}</th>
<th class="textRight"></th> <th> {{'transaction.Status' | translate}}</th>
<th class="textRight"> {{'forexprovider.Action' | translate}}</th>
</tr> </tr>
</thead> </thead>
<tbody *ngIf="transactionList"> <tbody *ngIf="transactionList">
<tr *ngFor="let tansaction of transactionList; let i = index"> <tr *ngFor="let tansaction of transactionList; let i = index">
<td>{{getCustomer(tansaction.user_info,'name') | titlecase}}</td> <td>{{getCustomer(tansaction.user_info,'name')}}</td>
<td>{{getCustomer(tansaction.user_info,'phone') | titlecase}}</td> <td>{{getCustomer(tansaction.provider,'name')}}</td>
<td>{{getCustomer(tansaction.user_info,'location') | titlecase}}</td> <td>{{getCustomer(tansaction.user_info,'phone')}}</td>
<td>{{getCustomer(tansaction.user_info,'location')}}</td>
<td>{{tansaction.currency}}</td> <td>{{tansaction.currency}}</td>
<td>SAR {{tansaction.amount}}</td> <td>SAR {{tansaction.amount}}</td>
<td>{{tansaction.symbol + tansaction.convert_price}}</td> <td>{{tansaction.symbol + tansaction.convert_price}}</td>
<td>&nbsp;</td> <td>{{tansaction.book_date}}</td>
<td>{{getCustomer(tansaction.driver_info,'name') | titlecase}}</td> <td *ngIf="tansaction.driver_info">{{getCustomer(tansaction.driver_info,'name')}}</td>
<td *ngIf="!tansaction.driver_info"><span style="color: blue" data-toggle="modal" data-target="#edit" (click)="assignClick(i)" *ngIf="tansaction.status == 1">Assign</span></td>
<td>{{get_status(tansaction.status)}}</td> <td>{{get_status(tansaction.status)}}</td>
<td><button class="edit_btn" data-toggle="modal" data-target="#edit" (click)="assignClick(i)" *ngIf="tansaction.status !=3 && tansaction.status !=0"></button></td> <td><button class="edit_btn" data-toggle="modal" data-target="#edit" (click)="assignClick(i)" *ngIf="tansaction.status ==1"></button></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -83,39 +86,39 @@ ...@@ -83,39 +86,39 @@
<div class="forex_modal_wrapper"> <div class="forex_modal_wrapper">
<div class="alert alert-danger alert-dismissible" *ngIf="assignError"> <div class="alert alert-danger alert-dismissible" *ngIf="assignError">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> Assign Driver failed <strong>{{'transaction.Warning!' | translate}}</strong> {{'transaction. Assign Driver failed' | translate}}
</div> </div>
<div class="forex_modal_header"> <div class="forex_modal_header">
<h5 class="floatLeft">Assign Driver</h5> <h5 class="floatLeft"> {{'transaction.Assign Driver' | translate}}</h5>
<button type="button" class="close floatRight" data-dismiss="modal">&times;</button> <button type="button" class="close floatRight" data-dismiss="modal">&times;</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="forex_inner_wrapper" *ngIf="selectedData"> <div class="forex_inner_wrapper" *ngIf="selectedData">
<div class="row"> <div class="row">
<div class="col"><p>User</p></div> <div class="col"><p> {{'transaction.User' | translate}}</p></div>
<div class="col"><p>{{getCustomer(selectedData.user_info,'name') | titlecase}}</p></div> <div class="col"><p>{{getCustomer(selectedData.user_info,'name') | titlecase}}</p></div>
</div> </div>
<div class="row"> <div class="row">
<div class="col"><p>Location</p></div> <div class="col"><p> {{'transaction.Location' | translate}}</p></div>
<div class="col"><p>{{getCustomer(selectedData.user_info,'location')}}</p></div> <div class="col"><p>{{getCustomer(selectedData.user_info,'location')}}</p></div>
</div> </div>
<div class="row"> <div class="row">
<div class="col"><p>Amount</p></div> <div class="col"><p> {{'transaction.Amount' | translate}}</p></div>
<div class="col"><p>{{selectedData.symbol + selectedData.convert_price}}</p></div> <div class="col"><p>{{selectedData.symbol + selectedData.convert_price}}</p></div>
</div> </div>
<div class="row" *ngIf="driverList"> <div class="row" *ngIf="driverList">
<div class="col-md-12"> <div class="col-md-12">
<p>Driver</p> <p> {{'transaction.Driver' | translate}}</p>
<select class="provider_input" (change)="selectDriver($event.target.value)"> <select class="provider_input" (change)="selectDriver($event.target.value)" #driver>
<option disabled hidden>Assign Driver</option> <option disabled hidden value=""> {{'transaction.Assign Driver' | translate}}</option>
<option *ngFor="let provider of driverList" [value]="provider.id">{{provider.name}}</option> <option *ngFor="let provider of driverList" [value]="provider.id">{{provider.name}}</option>
</select> </select>
</div> </div>
</div> </div>
</div> </div>
<div class="forex_modal_footer_btn_bay textRight"> <div class="forex_modal_footer_btn_bay textRight">
<button class="okay_btn" (click)="driverAssign()" [disabled]="driverStatus" data-dismiss="modal">Assign</button> <button class="okay_btn" (click)="driverAssign()" [disabled]="driverStatus" data-dismiss="modal"> {{'transaction.Assign' | translate}}</button>
<button class="cancel_btn" data-dismiss="modal">Cancel</button> <button class="cancel_btn" data-dismiss="modal"> {{'transaction.Cancel' | translate}}</button>
</div> </div>
</div> </div>
</div> </div>
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from '@angular/router';
import { WebService } from './../../providers/web.service'; import { WebService } from './../../providers/web.service';
import { ValidationService } from './../../providers/validation.service'; import { ValidationService } from './../../providers/validation.service';
@Component({ @Component({
selector: 'app-transaction', selector: 'app-transaction',
templateUrl: './transaction.component.html', templateUrl: './transaction.component.html',
...@@ -11,7 +12,7 @@ import { ValidationService } from './../../providers/validation.service'; ...@@ -11,7 +12,7 @@ import { ValidationService } from './../../providers/validation.service';
export class TransactionComponent implements OnInit { export class TransactionComponent implements OnInit {
transactionList: any[]; transactionList: any[];
fname: any; fname: any;
lang = 'ar'; lang = 'en';
responseMsg: any; responseMsg: any;
error: boolean; error: boolean;
success: boolean; success: boolean;
...@@ -24,6 +25,7 @@ export class TransactionComponent implements OnInit { ...@@ -24,6 +25,7 @@ export class TransactionComponent implements OnInit {
driverStatus: boolean; driverStatus: boolean;
driverId: any; driverId: any;
assignError: boolean; assignError: boolean;
@ViewChild('driver') driver: ElementRef;
constructor(private router: Router, private route: ActivatedRoute, public vs: ValidationService, public service: WebService) { constructor(private router: Router, private route: ActivatedRoute, public vs: ValidationService, public service: WebService) {
this.responseMsg = ''; this.responseMsg = '';
...@@ -40,10 +42,10 @@ export class TransactionComponent implements OnInit { ...@@ -40,10 +42,10 @@ export class TransactionComponent implements OnInit {
this.getProvider(); this.getProvider();
} }
providerDriver(provider_id: any) { providerDriver(amount: any, postal: any) {
this.loader = true; this.loader = true;
this.fname = 'get_drivers'; this.fname = 'get_available_drivers';
const post_data = {'provider_id': provider_id}; const post_data = {'provider_id': this.userDetails.id, 'amount': amount, 'postal': postal};
this.service.post_data(this.fname, post_data).subscribe(response => { this.service.post_data(this.fname, post_data).subscribe(response => {
this.loader = false; this.loader = false;
console.log(response); console.log(response);
...@@ -99,7 +101,7 @@ export class TransactionComponent implements OnInit { ...@@ -99,7 +101,7 @@ export class TransactionComponent implements OnInit {
if (response.code === 1) { if (response.code === 1) {
this.userDetails = response.responseResult; this.userDetails = response.responseResult;
this.getTransaction(this.userDetails.id, 1); this.getTransaction(this.userDetails.id, 1);
this.providerDriver(this.userDetails.id); // this.providerDriver(this.userDetails.id);
} else { } else {
this.error = true; this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode]; this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
...@@ -119,10 +121,13 @@ export class TransactionComponent implements OnInit { ...@@ -119,10 +121,13 @@ export class TransactionComponent implements OnInit {
return 'Requested'; return 'Requested';
break; break;
case 2: case 2:
return 'Processing'; return 'Delivered to Driver';
break; break;
case 3: case 3:
return 'Completed'; return 'Delivered to Customer';
break;
case 4:
return 'Refund';
break; break;
default: default:
break; break;
...@@ -144,6 +149,9 @@ export class TransactionComponent implements OnInit { ...@@ -144,6 +149,9 @@ export class TransactionComponent implements OnInit {
assignClick(index: any) { assignClick(index: any) {
this.selectedData = this.transactionList[index]; this.selectedData = this.transactionList[index];
const user_info = JSON.parse(this.selectedData.user_info);
console.log(user_info.PinCode);
this.providerDriver(this.selectedData.convert_price, user_info.PinCode);
console.log(this.selectedData); console.log(this.selectedData);
} }
...@@ -175,6 +183,7 @@ export class TransactionComponent implements OnInit { ...@@ -175,6 +183,7 @@ export class TransactionComponent implements OnInit {
setTimeout(function() { setTimeout(function() {
This.responseMsg = ''; This.responseMsg = '';
}, 3000); }, 3000);
this.driver.nativeElement.value = '';
} }
logout() { logout() {
......
...@@ -4,36 +4,37 @@ ...@@ -4,36 +4,37 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Forex Currency Rate</h4> <h4>{{'currency.Forex Currency Rate' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('forex')"> <button class="logout" (click)="goToPage('forex')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button> {{'currency.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'currency.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Currency & Rates</h3> <h3>{{'currency.Currency & Rates' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseMsg}} <strong>{{'currency.Warning' | translate}}!</strong> {{responseMsg}}
</div> </div>
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Currency assigned successfully <strong>{{'currency.Success' | translate}}!</strong>{{'currency.Currency assigned successfully' | translate}}
</div> </div>
<form [formGroup]="currencyForm" novalidate (ngSubmit)="currency_assign()">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<p>Currency</p> <p>{{'currency.Currency' | translate}}</p>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
...@@ -45,8 +46,8 @@ ...@@ -45,8 +46,8 @@
</div> </div>
</div> </div>
<div class="col-md-4 textCenter"> <div class="col-md-4 textCenter">
<button class="add_btn" (click)="currency_push()">Add<img src="assets/images/right.png"></button><br> <button class="add_btn" (click)="currency_push()">{{'currency.Add' | translate}}<img src="assets/images/right.png"></button><br>
<button class="add_btn" (click)="currency_pop()"><img src="assets/images/left.png">Remove</button> <button class="add_btn" (click)="currency_pop()"><img src="assets/images/left.png">{{'currency.Remove' | translate}}</button>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="currency_div"> <div class="currency_div">
...@@ -57,12 +58,13 @@ ...@@ -57,12 +58,13 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-2"></div> <div class="col-md-2"></div>
<div class="col-md-4"> <div class="col-md-4">
<form [formGroup]="currencyForm" novalidate (ngSubmit)="currency_assign()">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<p>Rates</p> <p>{{'currency.Save' | translate}}Rates</p>
</div> </div>
</div> </div>
...@@ -89,18 +91,19 @@ ...@@ -89,18 +91,19 @@
<input class="" type="number"> <input class="" type="number">
</div> </div>
</div> --> </div> -->
</form>
</div> </div>
</div> </div>
<div class="row" *ngIf="selectedList.length > 0"> <div class="row" *ngIf="selectedList.length > 0">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay textCenter"> <div class="add_provider_btn_bay textCenter">
<button class="save_btn ">Save</button> <button class="save_btn ">{{'currency.Save' | translate}}</button>
<button class="cancel_btn" (click)="cancelClick()" type="button">Cancel</button> <button class="cancel_btn" (click)="cancelClick()" type="button">{{'currency.Cancel' | translate}}</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
</div> </div>
</form>
</div> </div>
</div> </div>
......
...@@ -14,7 +14,7 @@ export class CurrencyComponent implements OnInit { ...@@ -14,7 +14,7 @@ export class CurrencyComponent implements OnInit {
currencyList: any[]; currencyList: any[];
avaliableList: any[]; avaliableList: any[];
fname: any; fname: any;
lang = 'ar'; lang = 'en';
responseMsg: any; responseMsg: any;
error: boolean; error: boolean;
success: boolean; success: boolean;
......
...@@ -4,43 +4,43 @@ ...@@ -4,43 +4,43 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Forex Provider</h4> <h4>{{'editprovider.Forex Provider' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('forex')"> <button class="logout" (click)="goToPage('forex')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button> {{'editprovider.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'editprovider.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('forex/changepin')">Change PIN</span> <span (click)="goToPage('forex/changepin')">{{'editprovider.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Edit Forex Provider</h3> <h3>{{'editprovider.Edit Forex Provider' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Provider updated successfully. <strong>{{'editprovider.Success' | translate}}!</strong> {{'editprovider.Provider updated successfully' | translate}}.
</div> </div>
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseMsg}} <strong>{{'editprovider.Warning' | translate}}!</strong> {{responseMsg}}
</div> </div>
<form [formGroup]="providerForm" (ngSubmit)="editProcess()" autocomplete="off"> <form [formGroup]="providerForm" (ngSubmit)="editProcess()" autocomplete="off">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content" *ngIf="provider"> <div class="provider_data_content" *ngIf="provider">
<p>Provider Name</p> <p>{{'editprovider.Provider Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" disabled [value]="provider.name"> <input class="provider_input" placeholder="" type="text" disabled [value]="provider.name">
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Location</p> <p>{{'editprovider.Location' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="location"> <input class="provider_input" placeholder="" type="text" formControlName="location">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit">
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<div class="col"> <div class="col">
<div class="provider_data_content" *ngIf="provider"> <div class="provider_data_content" *ngIf="provider">
<p>CR ID</p> <p>{{'editprovider.CR ID' | translate}}</p>
<input class="provider_input" placeholder="" type="text" disabled [value]="provider.cr_id"> <input class="provider_input" placeholder="" type="text" disabled [value]="provider.cr_id">
</div> </div>
</div> </div>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>CR Manager</p> <p>{{'editprovider.CR Manager' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="cr_manager"> <input class="provider_input" placeholder="" type="text" formControlName="cr_manager">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['cr_manager'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['cr_manager'].valid && providerSubmit">
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Contact Name</p> <p>{{'editprovider.Contact Name' | translate}} </p>
<input class="provider_input" placeholder="" type="text" formControlName="contact"> <input class="provider_input" placeholder="" type="text" formControlName="contact">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['contact'].valid"> <div class="s_error" *ngIf="!providerForm.controls['contact'].valid">
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Phone</p> <p>{{'editprovider.Phone' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="phone"> <input class="provider_input" placeholder="" type="number" formControlName="phone">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched">
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Email id</p> <p>{{'editprovider.Email id' | translate}}</p>
<input class="provider_input" placeholder="" type="mail" formControlName="email_id"> <input class="provider_input" placeholder="" type="mail" formControlName="email_id">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched"> <div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched">
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Status</p> <p>{{'editprovider.Status' | translate}}</p>
<select class="provider_input" formControlName="online_status"> <select class="provider_input" formControlName="online_status">
<option value="1">Online</option> <option value="1">Online</option>
<option value="0">Offline</option> <option value="0">Offline</option>
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Delivery Provider</p> <p>{{'editprovider.Delivery Provider' | translate}}</p>
<select class="provider_input" formControlName="deli_provider_id"> <select class="provider_input" formControlName="deli_provider_id">
<option *ngFor="let provider of providerList" [value]="provider.id">{{provider.name}}</option> <option *ngFor="let provider of providerList" [value]="provider.id">{{provider.name}}</option>
</select> </select>
...@@ -143,8 +143,8 @@ ...@@ -143,8 +143,8 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay"> <div class="add_provider_btn_bay">
<button class="save_btn floatRight">Save</button> <button class="save_btn floatRight">{{'editprovider.Save' | translate}}</button>
<button class="cancel_btn floatRight" (click)="cancelClick()">Cancel</button> <button class="cancel_btn floatRight" (click)="cancelClick()">{{'editprovider.Cancel' | translate}}</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
......
...@@ -12,7 +12,7 @@ import { FormControl, FormGroup, FormBuilder, Validators, ValidationErrors } fro ...@@ -12,7 +12,7 @@ import { FormControl, FormGroup, FormBuilder, Validators, ValidationErrors } fro
export class EditproviderComponent implements OnInit { export class EditproviderComponent implements OnInit {
provider: any; provider: any;
funcName: any; funcName: any;
lang = 'ar'; lang = 'en';
responseMsg: any; responseMsg: any;
error: boolean; error: boolean;
success: boolean; success: boolean;
......
...@@ -2,6 +2,8 @@ import { NgModule } from '@angular/core'; ...@@ -2,6 +2,8 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { moduleRouting } from './forex.routing'; import { moduleRouting } from './forex.routing';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { TranslateModule} from '@ngx-translate/core';
// IMPORTED-PAGE-COMPONENTS // IMPORTED-PAGE-COMPONENTS
...@@ -10,16 +12,17 @@ import { ChangepinComponent } from './changepin/changepin.component'; ...@@ -10,16 +12,17 @@ import { ChangepinComponent } from './changepin/changepin.component';
import { EditproviderComponent } from './editprovider/editprovider.component'; import { EditproviderComponent } from './editprovider/editprovider.component';
import { TransactionComponent } from './transaction/transaction.component'; import { TransactionComponent } from './transaction/transaction.component';
import { CurrencyComponent } from './currency/currency.component'; import { CurrencyComponent } from './currency/currency.component';
import { ServiceComponent } from './service/service.component';
@NgModule({ @NgModule({
// tslint:disable-next-line:max-line-length // tslint:disable-next-line:max-line-length
declarations: [IndexComponent, ChangepinComponent, EditproviderComponent, TransactionComponent, CurrencyComponent], declarations: [IndexComponent, ChangepinComponent, EditproviderComponent, TransactionComponent, CurrencyComponent, ServiceComponent],
imports: [ imports: [
CommonModule, CommonModule,
moduleRouting, moduleRouting,
FormsModule, FormsModule,
ReactiveFormsModule ReactiveFormsModule,
TranslateModule
] ]
}) })
export class ForexModule { } export class ForexModule { }
...@@ -12,6 +12,7 @@ import { IndexComponent } from './index/index.component'; ...@@ -12,6 +12,7 @@ import { IndexComponent } from './index/index.component';
import { ChangepinComponent } from './changepin/changepin.component'; import { ChangepinComponent } from './changepin/changepin.component';
import { EditproviderComponent } from './editprovider/editprovider.component'; import { EditproviderComponent } from './editprovider/editprovider.component';
import { TransactionComponent } from './transaction/transaction.component'; import { TransactionComponent } from './transaction/transaction.component';
import { ServiceComponent } from './service/service.component';
import { CurrencyComponent } from './currency/currency.component'; import { CurrencyComponent } from './currency/currency.component';
import { AuthGuard } from './../providers/auth.guard'; import { AuthGuard } from './../providers/auth.guard';
...@@ -21,6 +22,7 @@ const ModuleRoutes: Routes = [{ ...@@ -21,6 +22,7 @@ const ModuleRoutes: Routes = [{
{path: 'changepin', component: ChangepinComponent}, {path: 'changepin', component: ChangepinComponent},
{path: 'editprovider', component: EditproviderComponent}, {path: 'editprovider', component: EditproviderComponent},
{path: 'currency', component: CurrencyComponent }, {path: 'currency', component: CurrencyComponent },
{path: 'config', component: ServiceComponent },
{path: '', component: TransactionComponent } {path: '', component: TransactionComponent }
], data: {role: 2} ], data: {role: 2}
} }
......
<div class="custom_loader_wrapper" *ngIf="loader">
<div class="custom_loader_ring"></div>
</div>
<header class="provider_header">
<div class="row">
<div class="col-md-6">
<h4>{{'service.Configuration' | translate}}</h4>
</div>
<div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('maker/home')">
<img src="assets/images/asset_home.png">
{{'service.Home' | translate}}</button>
<button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png">
{{'service.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png">
<span (click)="goToPage('forex/changepin')">{{'service.Change PIN' | translate}}</span>
</div>
</div>
</header>
<section>
<div class="provider_content">
<h3> {{'service.Service Charge Management' | translate}}</h3>
<div class="provider_inner_content">
<div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong> {{'service.Success!' | translate}}</strong> {{'service.Configuration saved successfully' | translate}}
</div>
<div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong> {{'service.Warning!' | translate}}</strong> {{responseError}}
</div>
<form [formGroup]="configForm" (ngSubmit)="configProcess()" autocomplete="off">
<div class="row">
<div class="col">
<div class="provider_data_content">
<p> {{'service.Tax' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="tax">
</div>
<div class="s_error" *ngIf="!configForm.controls['tax'].valid && configSubmit">
<div class="s_validation" *ngIf="configForm.controls['tax'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
<div class="col">
<div class="provider_data_content">
<p> {{'service.Hand Delivery' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="hand">
</div>
<div class="s_error" *ngIf="!configForm.controls['hand'].valid && configSubmit">
<div class="s_validation" *ngIf="configForm.controls['hand'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
<div class="col">
<div class="provider_data_content">
<p> {{'service.Airport Delivery' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="airport">
</div>
<div class="s_error" *ngIf="!configForm.controls['airport'].valid && configSubmit">
<div class="s_validation" *ngIf="configForm.controls['airport'].hasError('required')">{{error_msg.required}} </div>
</div>
<div class="s_error" *ngIf="!configForm.controls['airport'].valid && configSubmit">
<div class="s_validation" *ngIf="configForm.controls['airport'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="provider_data_content">
<p> {{'service.Cancellation Time' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="cancel_time">
</div>
<div class="s_error" *ngIf="!configForm.controls['cancel_time'].valid && configSubmit">
<div class="s_validation" *ngIf="configForm.controls['cancel_time'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
<div class="col">
<div class="provider_data_content">
<p> {{'service.Waiting Time' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="waiting_time">
</div>
<div class="s_error" *ngIf="!configForm.controls['waiting_time'].valid && configSubmit">
<div class="s_validation" *ngIf="configForm.controls['waiting_time'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
<div class="col"></div>
</div>
<!-- <div class="row">
<div class="col">
<div class="add_provider_btn_bay p0">
<button class="edit_btn floatRight" (click)="goToPage('maker/editprovider')">Edit</button>
<div class="clear"></div>
</div>
</div>
</div> -->
<div class="row">
<div class="col">
<div class="add_provider_btn_bay">
<button class="save_btn floatRight"> {{'service.Save' | translate}}</button>
<button class="cancel_btn floatRight" (click)="cancelClick()"> {{'service.Cancel' | translate}}</button>
<div class="clear"></div>
</div>
</div>
</div>
</form>
</div>
</div>
</section>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ServiceComponent } from './service.component';
describe('ServiceComponent', () => {
let component: ServiceComponent;
let fixture: ComponentFixture<ServiceComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ServiceComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ServiceComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { WebService } from './../../providers/web.service';
import { ValidationService } from './../../providers/validation.service';
import { FormControl, FormGroup, FormBuilder, Validators, ValidationErrors } from '@angular/forms';
import { ImageStorage } from '../../../environments/server.config';
@Component({
selector: 'app-service',
templateUrl: './service.component.html',
styleUrls: ['./service.component.scss']
})
export class ServiceComponent implements OnInit {
configForm: FormGroup;
numeric = '^[0-9]*$';
configSubmit: boolean;
lang = 'en';
error_msg: any[];
funcName: any;
loader: boolean;
responseError: any;
error: boolean;
success: boolean;
file: File;
config: any;
image_url: any;
loginDetails: any;
userDetails: any;
constructor(private router: Router,
private route: ActivatedRoute,
public vs: ValidationService,
public service: WebService,
private formBuilder: FormBuilder
) {
this.loader = false;
this.error = false;
this.success = false;
this.configSubmit = false;
this.error_msg = this.vs.errorList[this.lang];
this.loginDetails = JSON.parse(this.service.getLocalStorageItem('userData'));
}
ngOnInit() {
this.configForm = this.formBuilder.group({
'tax': ['', Validators.compose([Validators.required, Validators.pattern('^[0-9]*$')])],
'hand': ['', Validators.compose([Validators.required, Validators.pattern('^[0-9]*$')])],
'provider_id': [''],
'airport': ['', Validators.compose([Validators.required, Validators.pattern('^[0-9]*$')])],
'cancel_time': ['', Validators.compose([Validators.required, Validators.pattern('^[0-9]*$')])],
'waiting_time': ['', Validators.compose([Validators.required, Validators.pattern('^[0-9]*$')])],
'type': [0]
});
this.getProvider();
}
getProvider() {
this.funcName = 'get_user_details';
const post_data = {'user_id': this.loginDetails.user_id};
this.service.post_data(this.funcName, post_data).subscribe(response => {
if (response.code === 1) {
this.userDetails = response.responseResult;
this.getConfig(this.userDetails.id);
this.configForm.patchValue({'provider_id': this.userDetails.id});
// this.providerDriver(this.userDetails.id);
} else {
this.error = true;
this.responseError = this.vs.errorCode[this.lang][response.errorCode];
}
}, (error) => {
this.error = true;
this.responseError = this.vs.errorCode[this.lang]['ER08'];
});
}
configProcess() {
const This = this;
this.error = false;
this.success = false;
console.log(this.configForm.value);
this.configSubmit = true;
if (this.configForm.valid) {
this.loader = true;
const post_data = this.configForm.value;
this.funcName = 'config_save';
this.service.post_data(this.funcName, post_data).subscribe(response => {
this.loader = false;
console.log(response);
if (response.code === 1) {
this.success = true;
this.configSubmit = false;
this.configForm.patchValue({'type': 0});
} else {
this.error = true;
this.responseError = this.vs.errorCode[this.lang][response.errorCode];
}
}, (error) => {
this.error = false;
this.responseError = this.vs.errorCode[this.lang]['ER08'];
});
}
console.log('tested');
}
getConfig(id) {
this.loader = true;
this.funcName = 'config_details';
const post_data = {'provider_id': id};
this.service.post_data(this.funcName, post_data).subscribe(response => {
this.loader = false;
console.log(response);
if (response.code === 1) {
this.config = response.responseResult;
this.configForm.patchValue({
tax: this.config.tax,
hand: this.config.hand,
airport: this.config.airport,
cancel_time: this.config.cancel_time,
waiting_time: this.config.waiting_time
});
} else {
this.error = true;
this.configForm.patchValue({'type': 1});
this.responseError = this.vs.errorCode[this.lang][response.errorCode];
}
}, (error) => {
this.error = true;
this.responseError = this.vs.errorCode[this.lang]['ER08'];
});
const This = this;
setTimeout(function() {
This.responseError = '';
}, 3000);
}
getImage() {
return ImageStorage + this.image_url;
}
cancelClick() {
this.router.navigate(['/forex']);
}
logout() {
this.service.logout();
}
}
...@@ -4,52 +4,57 @@ ...@@ -4,52 +4,57 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Forex Transaction List</h4> <h4>{{'transaction.Forex Transaction List' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('forex/config')">
<img src="assets/images/asset_settings.png">
{{'transaction.Config' | translate}}</button>
<button class="logout" (click)="goToPage('forex/currency')"> <button class="logout" (click)="goToPage('forex/currency')">
<img src="assets/images/asset_currency.png"> <img src="assets/images/asset_currency.png">
Currency</button> {{'transaction.Currency' | translate}}</button>
<button class="logout" (click)="goToPage('forex/editprovider')"> <button class="logout" (click)="goToPage('forex/editprovider')">
<img src="assets/images/asset_settings.png"> <img src="assets/images/asset_settings.png">
Settings</button> {{'transaction.Settings' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'transaction.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('forex/changepin')">Change PIN</span> <span (click)="goToPage('forex/changepin')">{{'transaction.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Manage Transaction</h3> <h3>{{'transaction.Manage Transaction' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseMsg}} <strong>{{'transaction.Warning' | translate}}!</strong> {{responseMsg}}
</div> </div>
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Forex provider removed successfully <strong>{{'transaction.Success' | translate}}!</strong> {{'transaction.Forex provider removed successfully' | translate}}
</div> </div>
<div class="table-responsive"> <div class="table-responsive">
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>User Info</th> <th>{{'transaction.User Info' | translate}}</th>
<th>Phone</th> <th>{{'transaction.Date' | translate}}</th>
<th>Location</th> <th>{{'transaction.Phone' | translate}}</th>
<th>Currency</th> <th>{{'transaction.Location' | translate}}</th>
<th>Amount</th> <th>{{'transaction.Currency' | translate}}</th>
<th>Forex Amount</th> <th>{{'transaction.Amount' | translate}}</th>
<th>Driver</th> <th>{{'transaction.Forex Amount' | translate}}</th>
<th>Status</th> <th>{{'transaction.Driver' | translate}}</th>
<th>{{'transaction.Status' | translate}}</th>
</tr> </tr>
</thead> </thead>
<tbody *ngIf="transactionList"> <tbody *ngIf="transactionList">
<tr *ngFor="let tansaction of transactionList"> <tr *ngFor="let tansaction of transactionList">
<td>{{getCustomer(tansaction.user_info,'name') | titlecase}}</td> <td>{{getCustomer(tansaction.user_info,'name') | titlecase}}</td>
<td>{{tansaction.book_date}}</td>
<td>{{getCustomer(tansaction.user_info,'phone') | titlecase}}</td> <td>{{getCustomer(tansaction.user_info,'phone') | titlecase}}</td>
<td>{{getCustomer(tansaction.user_info,'location') | titlecase}}</td> <td>{{getCustomer(tansaction.user_info,'location') | titlecase}}</td>
<td>{{tansaction.currency}}</td> <td>{{tansaction.currency}}</td>
......
...@@ -11,7 +11,7 @@ import { ValidationService } from './../../providers/validation.service'; ...@@ -11,7 +11,7 @@ import { ValidationService } from './../../providers/validation.service';
export class TransactionComponent implements OnInit { export class TransactionComponent implements OnInit {
transactionList: any[]; transactionList: any[];
fname: any; fname: any;
lang = 'ar'; lang = 'en';
responseMsg: any; responseMsg: any;
error: boolean; error: boolean;
success: boolean; success: boolean;
...@@ -89,10 +89,13 @@ export class TransactionComponent implements OnInit { ...@@ -89,10 +89,13 @@ export class TransactionComponent implements OnInit {
return 'Requested'; return 'Requested';
break; break;
case 2: case 2:
return 'Processing'; return 'Delivered to Driver';
break; break;
case 3: case 3:
return 'Completed'; return 'Delivered to Customer';
break;
case 4:
return 'Refund';
break; break;
default: default:
break; break;
......
...@@ -5,39 +5,40 @@ ...@@ -5,39 +5,40 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Forex Delivery Service Provider</h4> <h4> {{'addforex.Forex Delivery Service Provider' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('checker/home')"> <button class="logout" (click)="goToPage('maker/home')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button> {{'addforex.Home' | translate}}
</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'addforex.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('delivery/changepin')">Change PIN</span> <span (click)="goToPage('delivery/changepin')"> {{'addforex.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Add Delivery Provider</h3> <h3> {{'addforex.Add Delivery Provider' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Provider created successfully. <strong>{{'addforex.Success!' | translate}}</strong> {{'addforex.Provider created successfully' | translate}}
</div> </div>
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseError}} <strong>{{'addforex.Warning!' | translate}}</strong> {{responseError}}
</div> </div>
<form [formGroup]="providerForm" (ngSubmit)="regProcess()" autocomplete="off"> <form [formGroup]="providerForm" (ngSubmit)="regProcess()" autocomplete="off">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Provider Name</p> <p> {{'addforex.Provider Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="name"> <input class="provider_input" placeholder="" type="text" formControlName="name" tabindex="1">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['name'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['name'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['name'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['name'].hasError('required')">{{error_msg.required}} </div>
...@@ -45,7 +46,7 @@ ...@@ -45,7 +46,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Pin</p> <p> {{'addforex.Pin' | translate}}</p>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
...@@ -55,73 +56,75 @@ ...@@ -55,73 +56,75 @@
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <!-- <div class="provider_data_content">
<p>Confirm Pin</p> <p> {{'addforex.Confirm Pin' | translate}}</p>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin m0" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin m0" placeholder="" type="password" maxlength="1" value="0" readonly>
</div> </div> -->
</div>
</div>
<div class="row">
<div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Location</p> <p> {{'addforex.Location' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="location"> <input class="provider_input" placeholder="" type="text" formControlName="location" tabindex="2">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['location'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['location'].hasError('required')">{{error_msg.required}} </div>
</div> </div>
</div> </div>
</div>
<div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>CR ID</p> <p> {{'addforex.CR ID' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="cr_id"> <input class="provider_input" placeholder="" type="text" formControlName="cr_id" tabindex="3">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['cr_id'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['cr_id'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['cr_id'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['cr_id'].hasError('required')">{{error_msg.required}} </div>
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['cr_id'].valid && providerForm.controls['cr_id'].touched">
<div class="s_validation" *ngIf="providerForm.controls['cr_id'].hasError('pattern')">{{error_msg.crId}}</div>
</div>
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>CR Manager</p> <p> {{'addforex.CR Manager' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="cr_manager"> <input class="provider_input" placeholder="" type="text" formControlName="cr_manager" tabindex="4">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['cr_manager'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['cr_manager'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['cr_manager'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['cr_manager'].hasError('required')">{{error_msg.required}} </div>
</div> </div>
</div> </div>
<div class="col">
<div class="provider_data_content">
<p> {{'addforex.Contact Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="contact" tabindex="5">
</div>
<div class="s_error" *ngIf="!providerForm.controls['contact'].valid">
<div class="s_validation" *ngIf="providerForm.controls['contact'].hasError('pattern')">{{error_msg.pattern}}</div>
</div>
<div class="s_error" *ngIf="!providerForm.controls['contact'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['contact'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col">
<div class="provider_data_content">
<p>Contact Name</p>
<input class="provider_input" placeholder="" type="text" formControlName="contact">
</div>
<div class="s_error" *ngIf="!providerForm.controls['contact'].valid">
<div class="s_validation" *ngIf="providerForm.controls['contact'].hasError('pattern')">{{error_msg.pattern}}</div>
</div>
<div class="s_error" *ngIf="!providerForm.controls['contact'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['contact'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Phone</p> <p> {{'addforex.Phone' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="phone"> <input class="provider_input" placeholder="" type="number" formControlName="phone" tabindex="6">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched">
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('pattern')">{{error_msg.phone}}</div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('pattern')">{{error_msg.phone}}</div>
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched && !providerForm.controls['phone'].hasError('pattern')"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched && !providerForm.controls['phone'].hasError('pattern')">
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('maxlength')">{{error_msg.maxLength}} 15</div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('maxlength')">{{error_msg.maxLength}} 10</div>
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('minlength')">{{error_msg.minLength}} 8</div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('minlength')">{{error_msg.minLength}} 10</div>
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('required')">{{error_msg.required}} </div>
...@@ -129,8 +132,8 @@ ...@@ -129,8 +132,8 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Email id</p> <p> {{'addforex.Email id' | translate}}</p>
<input class="provider_input" placeholder="" type="mail" formControlName="email_id"> <input class="provider_input" placeholder="" type="mail" formControlName="email_id" tabindex="7">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched"> <div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched">
<div class="s_validation" *ngIf="providerForm.controls['email_id'].hasError('pattern')">{{error_msg.email}} </div> <div class="s_validation" *ngIf="providerForm.controls['email_id'].hasError('pattern')">{{error_msg.email}} </div>
...@@ -140,14 +143,26 @@ ...@@ -140,14 +143,26 @@
<div class="s_validation" *ngIf="providerForm.controls['email_id'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['email_id'].hasError('required')">{{error_msg.required}} </div>
</div> </div>
</div> </div>
<div class="col">
<div class="provider_data_content">
<p> {{'addforex.Delivery Provider' | translate}}</p>
<select class="provider_input" formControlName="deli_provider_id" tabindex="8">
<option disabled hidden> {{'addforex.Status' | translate}}</option>
<option *ngFor="let provider of providerList" [value]="provider.id">{{provider.name}}</option>
</select>
</div>
<div class="s_error" *ngIf="!providerForm.controls['deli_provider_id'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['deli_provider_id'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Status</p> <p> {{'addforex.Status' | translate}}</p>
<select class="provider_input" formControlName="online_status"> <select class="provider_input" formControlName="online_status" tabindex="9">
<option disabled hidden>Status</option> <option disabled hidden>{{'addforex.Status' | translate}}</option>
<option value="1">Online</option> <option value="1">Online</option>
<option value="0">Offline</option> <option value="0">Offline</option>
</select> </select>
...@@ -157,18 +172,7 @@ ...@@ -157,18 +172,7 @@
</div> </div>
</div> </div>
<div class="col"> <div class="col"></div>
<div class="provider_data_content">
<p>Delivery Provider</p>
<select class="provider_input" formControlName="deli_provider_id">
<option disabled hidden>Status</option>
<option *ngFor="let provider of providerList" [value]="provider.id">{{provider.name}}</option>
</select>
</div>
<div class="s_error" *ngIf="!providerForm.controls['deli_provider_id'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['deli_provider_id'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
<div class="col"></div> <div class="col"></div>
</div> </div>
...@@ -177,7 +181,7 @@ ...@@ -177,7 +181,7 @@
<!-- <div class="row"> <!-- <div class="row">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay p0"> <div class="add_provider_btn_bay p0">
<button class="edit_btn floatRight" (click)="goToPage('checker/editprovider')">Edit</button> <button class="edit_btn floatRight" (click)="goToPage('maker/editprovider')">Edit</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
...@@ -185,8 +189,8 @@ ...@@ -185,8 +189,8 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay"> <div class="add_provider_btn_bay">
<button class="save_btn floatRight">Save</button> <button class="save_btn floatRight"> {{'addforex.Save' | translate}}</button>
<button class="cancel_btn floatRight" (click)="cancelClick()">Cancel</button> <button class="cancel_btn floatRight" (click)="cancelClick()"> {{'addforex.Cancel' | translate}}</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
......
...@@ -11,10 +11,11 @@ import { FormControl, FormGroup, FormBuilder, Validators, ValidationErrors } fro ...@@ -11,10 +11,11 @@ import { FormControl, FormGroup, FormBuilder, Validators, ValidationErrors } fro
}) })
export class AddforexComponent implements OnInit { export class AddforexComponent implements OnInit {
providerForm: FormGroup; providerForm: FormGroup;
mobnumPattern = '^((\\+?)|0)?[0-9]{8,15}$'; mobnumPattern = '^((\\+?)|0)?[0-9]{9,10}$';
emailPattern = '^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$'; emailPattern = '^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$';
contactPattern = '[a-zA-Z ]*'; contactPattern = '[a-zA-Z ]*';
providerSubmit: boolean; providerSubmit: boolean;
crId = '^((\\+?)|0)?[0-9]{10}$';
lang = 'en'; lang = 'en';
error_msg: any[]; error_msg: any[];
funcName: any; funcName: any;
...@@ -43,7 +44,7 @@ export class AddforexComponent implements OnInit { ...@@ -43,7 +44,7 @@ export class AddforexComponent implements OnInit {
this.providerForm = this.formBuilder.group({ this.providerForm = this.formBuilder.group({
'name': ['', Validators.compose([Validators.required])], 'name': ['', Validators.compose([Validators.required])],
'cr_manager': ['', Validators.compose([Validators.required])], 'cr_manager': ['', Validators.compose([Validators.required])],
'cr_id': ['', Validators.compose([Validators.required])], 'cr_id': ['', Validators.compose([Validators.required, Validators.pattern(this.crId)])],
'contact': ['', Validators.compose([Validators.required, Validators.pattern('^[a-zA-Z \-\']+')])], 'contact': ['', Validators.compose([Validators.required, Validators.pattern('^[a-zA-Z \-\']+')])],
'location': ['', Validators.compose([Validators.required])], 'location': ['', Validators.compose([Validators.required])],
'email_id': ['', Validators.compose([Validators.required, Validators.maxLength(50), Validators.pattern(this.emailPattern)])], 'email_id': ['', Validators.compose([Validators.required, Validators.maxLength(50), Validators.pattern(this.emailPattern)])],
...@@ -82,6 +83,7 @@ export class AddforexComponent implements OnInit { ...@@ -82,6 +83,7 @@ export class AddforexComponent implements OnInit {
this.success = true; this.success = true;
this.providerSubmit = false; this.providerSubmit = false;
this.providerForm.reset(); this.providerForm.reset();
this.providerForm.controls['type'].setValue(2);
} else { } else {
this.error = true; this.error = true;
this.responseError = this.vs.errorCode[this.lang][response.errorCode]; this.responseError = this.vs.errorCode[this.lang][response.errorCode];
...@@ -101,7 +103,7 @@ export class AddforexComponent implements OnInit { ...@@ -101,7 +103,7 @@ export class AddforexComponent implements OnInit {
} }
cancelClick() { cancelClick() {
this.router.navigate(['/checker/forex']); this.router.navigate(['/maker/forex']);
} }
getProvider() { getProvider() {
......
...@@ -5,38 +5,39 @@ ...@@ -5,38 +5,39 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Forex Delivery Service Provider</h4> <h4> {{'addprovider.Forex Delivery Service Provider' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('checker/home')"> <button class="logout" (click)="goToPage('maker/home')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button>
{{'addprovider.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'addprovider.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('delivery/changepin')">Change PIN</span> <span (click)="goToPage('delivery/changepin')"> {{'addprovider.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Add Delivery Provider</h3> <h3> {{'addprovider.Add Delivery Provider' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Provider created successfully. <strong> {{'addprovider.Success!' | translate}}</strong> {{'addprovider.Provider created successfully' | translate}}
</div> </div>
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseError}} <strong> {{'addprovider.Warning!' | translate}}</strong> {{responseError}}
</div> </div>
<form [formGroup]="providerForm" (ngSubmit)="regProcess()" autocomplete="off"> <form [formGroup]="providerForm" (ngSubmit)="regProcess()" autocomplete="off">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Provider Name</p> <p> {{'addprovider.Provider Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="name"> <input class="provider_input" placeholder="" type="text" formControlName="name">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['name'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['name'].valid && providerSubmit">
...@@ -45,7 +46,7 @@ ...@@ -45,7 +46,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Pin</p> <p> {{'addprovider.Pin' | translate}}</p>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
...@@ -55,21 +56,21 @@ ...@@ -55,21 +56,21 @@
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <!-- <div class="provider_data_content">
<p>Confirm Pin</p> <p> {{'addprovider.Confirm Pin' | translate}}</p>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin" placeholder="" type="password" maxlength="1" value="0" readonly>
<input class="provider_pin m0" placeholder="" type="password" maxlength="1" value="0" readonly> <input class="provider_pin m0" placeholder="" type="password" maxlength="1" value="0" readonly>
</div> </div> -->
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Location</p> <p> {{'addprovider.Location' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="location"> <input class="provider_input" placeholder="" type="text" formControlName="location">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit">
...@@ -78,16 +79,19 @@ ...@@ -78,16 +79,19 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>CR ID</p> <p> {{'addprovider.CR ID' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="cr_id"> <input class="provider_input" placeholder="" type="number" formControlName="cr_id">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['cr_id'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['cr_id'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['cr_id'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['cr_id'].hasError('required')">{{error_msg.required}} </div>
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['cr_id'].valid && providerForm.controls['cr_id'].touched">
<div class="s_validation" *ngIf="providerForm.controls['cr_id'].hasError('pattern')">{{error_msg.crId}}</div>
</div>
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>CR Manager</p> <p> {{'addprovider.CR Manager' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="cr_manager"> <input class="provider_input" placeholder="" type="text" formControlName="cr_manager">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['cr_manager'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['cr_manager'].valid && providerSubmit">
...@@ -98,7 +102,7 @@ ...@@ -98,7 +102,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Contact Name</p> <p> {{'addprovider.Contact Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="contact"> <input class="provider_input" placeholder="" type="text" formControlName="contact">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['contact'].valid"> <div class="s_error" *ngIf="!providerForm.controls['contact'].valid">
...@@ -110,16 +114,15 @@ ...@@ -110,16 +114,15 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Phone</p> <p> {{'addprovider.Phone' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="phone"> <input class="provider_input" placeholder="" type="number" formControlName="phone">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched">
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('pattern')">{{error_msg.phone}}</div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('pattern')">{{error_msg.phone}}</div>
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched && !providerForm.controls['phone'].hasError('pattern')"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched && !providerForm.controls['phone'].hasError('pattern')">
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('maxlength')">{{error_msg.maxLength}} 10</div>
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('maxlength')">{{error_msg.maxLength}} 15</div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('minlength')">{{error_msg.minLength}} 10</div>
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('minlength')">{{error_msg.minLength}} 8</div>
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('required')">{{error_msg.required}} </div>
...@@ -127,7 +130,7 @@ ...@@ -127,7 +130,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Email id</p> <p> {{'addprovider.Email id' | translate}}</p>
<input class="provider_input" placeholder="" type="mail" formControlName="email_id"> <input class="provider_input" placeholder="" type="mail" formControlName="email_id">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched"> <div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched">
...@@ -142,7 +145,7 @@ ...@@ -142,7 +145,7 @@
<!-- <div class="row"> <!-- <div class="row">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay p0"> <div class="add_provider_btn_bay p0">
<button class="edit_btn floatRight" (click)="goToPage('checker/editprovider')">Edit</button> <button class="edit_btn floatRight" (click)="goToPage('maker/editprovider')">Edit</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
...@@ -150,8 +153,8 @@ ...@@ -150,8 +153,8 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay"> <div class="add_provider_btn_bay">
<button class="save_btn floatRight">Save</button> <button class="save_btn floatRight"> {{'addprovider.Save' | translate}}</button>
<button class="cancel_btn floatRight" (click)="cancelClick()">Cancel</button> <button class="cancel_btn floatRight" (click)="cancelClick()"> {{'addprovider.Cancel' | translate}}</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
......
...@@ -11,7 +11,8 @@ import { FormControl, FormGroup, FormBuilder, Validators, ValidationErrors } fro ...@@ -11,7 +11,8 @@ import { FormControl, FormGroup, FormBuilder, Validators, ValidationErrors } fro
}) })
export class AddproviderComponent implements OnInit { export class AddproviderComponent implements OnInit {
providerForm: FormGroup; providerForm: FormGroup;
mobnumPattern = '^((\\+?)|0)?[0-9]{8,15}$'; mobnumPattern = '^((\\+?)|0)?[0-9]{9,10}$';
crId = '^((\\+?)|0)?[0-9]{10}$';
emailPattern = '^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$'; emailPattern = '^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$';
providerSubmit: boolean; providerSubmit: boolean;
lang = 'en'; lang = 'en';
...@@ -40,7 +41,7 @@ export class AddproviderComponent implements OnInit { ...@@ -40,7 +41,7 @@ export class AddproviderComponent implements OnInit {
this.providerForm = this.formBuilder.group({ this.providerForm = this.formBuilder.group({
'name': ['', Validators.compose([Validators.required])], 'name': ['', Validators.compose([Validators.required])],
'cr_manager': ['', Validators.compose([Validators.required])], 'cr_manager': ['', Validators.compose([Validators.required])],
'cr_id': ['', Validators.compose([Validators.required])], 'cr_id': ['', Validators.compose([Validators.required, Validators.pattern(this.crId)])],
'contact': ['', Validators.compose([Validators.required, Validators.pattern('^[a-zA-Z \-\']+')])], 'contact': ['', Validators.compose([Validators.required, Validators.pattern('^[a-zA-Z \-\']+')])],
'location': ['', Validators.compose([Validators.required])], 'location': ['', Validators.compose([Validators.required])],
'email_id': ['', Validators.compose([Validators.required, Validators.maxLength(50), Validators.pattern(this.emailPattern)])], 'email_id': ['', Validators.compose([Validators.required, Validators.maxLength(50), Validators.pattern(this.emailPattern)])],
...@@ -77,6 +78,7 @@ export class AddproviderComponent implements OnInit { ...@@ -77,6 +78,7 @@ export class AddproviderComponent implements OnInit {
this.success = true; this.success = true;
this.providerSubmit = false; this.providerSubmit = false;
this.providerForm.reset(); this.providerForm.reset();
this.providerForm.controls['type'].setValue(3);
} else { } else {
this.error = true; this.error = true;
this.responseError = this.vs.errorCode[this.lang][response.errorCode]; this.responseError = this.vs.errorCode[this.lang][response.errorCode];
...@@ -96,7 +98,7 @@ export class AddproviderComponent implements OnInit { ...@@ -96,7 +98,7 @@ export class AddproviderComponent implements OnInit {
} }
cancelClick() { cancelClick() {
this.router.navigate(['/checker/delivery']); this.router.navigate(['/maker/delivery']);
} }
logout() { logout() {
......
<div class="login_wrapper">
<div class="container">
<div class="row">
<div class="login_inner">
<img src="assets/images/asset_logo.png">
<hr>
<h6> {{'changepin.Change PIN' | translate}}</h6>
<div class="login_inner_content">
<br>
<div class="login_row">
<p> {{'changepin.Old PIN' | translate}}</p>
<div class="login_pin">
<input class="log_pin" type="password" maxlength="1" #old1 (keyup)="processKeyUp($event, old2)">
<input class="log_pin" type="password" maxlength="1" #old2 (keydown.backspace)="processBack($event, old1)" (keyup)="processKeyUp($event, old3)">
<input class="log_pin" type="password" maxlength="1" #old3 (keydown.backspace)="processBack($event, old2)" (keyup)="processKeyUp($event, old4)">
<input class="log_pin" type="password" maxlength="1" #old4 (keydown.backspace)="processBack($event, old3)" (keyup)="processKeyUp($event, old5)">
<input class="log_pin" type="password" maxlength="1" #old5 (keydown.backspace)="processBack($event, old4)" (keyup)="processKeyUp($event, old6)">
<input class="log_pin m0" type="password" maxlength="1" #old6 (keydown.backspace)="processBack($event, old5)">
</div>
<div class="s_error" *ngIf="passwordErr">
<div class="s_validation">{{error_msg.password}} </div>
</div>
</div>
<div class="login_row">
<p>{{'changepin.New PIN' | translate}}</p>
<div class="login_pin">
<input class="log_pin" type="password" maxlength="1" #new1 (keyup)="processKeyUp($event, new2)">
<input class="log_pin" type="password" maxlength="1" #new2 (keydown.backspace)="processBack($event, new1)" (keyup)="processKeyUp($event, new3)">
<input class="log_pin" type="password" maxlength="1" #new3 (keydown.backspace)="processBack($event, new2)" (keyup)="processKeyUp($event, new4)">
<input class="log_pin" type="password" maxlength="1" #new4 (keydown.backspace)="processBack($event, new3)" (keyup)="processKeyUp($event, new5)">
<input class="log_pin" type="password" maxlength="1" #new5 (keydown.backspace)="processBack($event, new4)" (keyup)="processKeyUp($event, new6)">
<input class="log_pin m0" type="password" maxlength="1" #new6 (keydown.backspace)="processBack($event, new5)">
</div>
</div>
<div class="s_error" *ngIf="newpasswordErr">
<div class="s_validation">{{error_msg.password}} </div>
</div>
<div class="login_row">
<p> {{'changepin.Confirm PIN' | translate}}</p>
<div class="login_pin">
<input class="log_pin" type="password" maxlength="1" #conf1 (keyup)="processKeyUp($event, conf2)">
<input class="log_pin" type="password" maxlength="1" #conf2 (keydown.backspace)="processBack($event, conf1)" (keyup)="processKeyUp($event, conf3)">
<input class="log_pin" type="password" maxlength="1" #conf3 (keydown.backspace)="processBack($event, conf2)" (keyup)="processKeyUp($event, conf4)">
<input class="log_pin" type="password" maxlength="1" #conf4 (keydown.backspace)="processBack($event, conf3)" (keyup)="processKeyUp($event, conf5)">
<input class="log_pin" type="password" maxlength="1" #conf5 (keydown.backspace)="processBack($event, conf4)" (keyup)="processKeyUp($event, conf6)">
<input class="log_pin m0" type="password" maxlength="1" #conf6 (keydown.backspace)="processBack($event, conf5)">
</div>
</div>
<div class="s_error" *ngIf="confpasswordErr">
<div class="s_validation">{{error_msg.password}} </div>
</div>
<div class="s_error" *ngIf="notMatchErr">
<div class="s_validation">{{error_msg.confirm}} </div>
</div>
</div>
</div>
</div>
<div class="alert alert-danger alert-dismissible" *ngIf="resetError">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>{{'changepin.Warning!' | translate}} </strong> {{resetMsg}}
</div>
<div class="alert alert-success alert-dismissible" *ngIf="!resetError && !error && loginSubmit">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong> {{'changepin.Success!' | translate}}</strong> {{'changepin.Password Updated Successfully' | translate}}
</div>
<div class="login_btn_bay">
<div class="row">
<div class="col-md-6">
<button class="cancel_btn" (click)="cancelClick()"> {{'changepin.Cancel' | translate}}</button>
</div>
<div class="col-md-6">
<button class="login_btn" (click)="saveClick()"> {{'changepin.Save' | translate}}</button>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
.login_wrapper{
width:100%;
.login_inner{
text-align: center;
width:100%;
padding-top:1%;
img{
margin-bottom:0px;
width:150px;
}
hr{
border:5px solid #f69d1b;
width: 65%;
margin: 0 auto;
}
h6{
border-bottom: 2px solid #b6b6b6;
padding-bottom: 10px;
font-weight: 600;
width: 65%;
padding-top: 2%;
margin: 0 auto;
}
.login_inner_content{
padding-top:10px;
width:325px;
margin: 0 auto;
.login_row{
margin-bottom:0px;
input{
width:100%;
height:50px;
border:none;
font-weight: 600;
font-size: 18px;
border-bottom: 2px solid #636363;
&::placeholder{
color: #454545;
font-weight: 600;
}
&:focus{
outline: none;
}
}
p{
font-weight: 600;
font-size: 18px;
color: #454545;
text-align: left;
margin:0px;
}
.login_pin{
width:100%;
text-align: left;
padding-top: 15px;
padding-bottom: 10%;
.log_pin{
border:1px solid #d8d8d8;
display: inline-block;
width:30px;
border-radius:8px;
color: #cc3d3f;
font-size: 60px !important;
height: 60px;
text-align: center;
margin-right:8.5%;
&::placeholder{
color: #cc3d3f;
font-size:40px !important;
}
}
}
}
}
}
.login_btn_bay{
width: 65%;
margin: 0 auto;
padding-top:2%;
.login_btn{
background: #cd3d3d;
color: #fff;
border-radius:10px;
height:40px;
border:none;
width: 100%;
&:hover{
outline: none;
}
&:focus{
outline:none;
}
}
.cancel_btn{
background: #1a5c7c;
color: #fff;
border-radius:10px;
height:40px;
border:none;
width: 100%;
&:hover{
outline: none;
}
&:focus{
outline:none;
}
}
}
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ChangepinComponent } from './changepin.component';
describe('ChangepinComponent', () => {
let component: ChangepinComponent;
let fixture: ComponentFixture<ChangepinComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ChangepinComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ChangepinComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { ValidationService } from './../../providers/validation.service';
import { SubjectService } from './../../providers/subject.service';
import { WebService } from './../../providers/web.service';
import {Location} from '@angular/common';
@Component({
selector: 'app-changepin',
templateUrl: './changepin.component.html',
styleUrls: ['./changepin.component.scss']
})
export class ChangepinComponent implements OnInit {
@ViewChild('old1') old1: ElementRef;
@ViewChild('old2') old2: ElementRef;
@ViewChild('old3') old3: ElementRef;
@ViewChild('old4') old4: ElementRef;
@ViewChild('old5') old5: ElementRef;
@ViewChild('old6') old6: ElementRef;
@ViewChild('new1') new1: ElementRef;
@ViewChild('new2') new2: ElementRef;
@ViewChild('new3') new3: ElementRef;
@ViewChild('new4') new4: ElementRef;
@ViewChild('new5') new5: ElementRef;
@ViewChild('new6') new6: ElementRef;
@ViewChild('conf1') conf1: ElementRef;
@ViewChild('conf2') conf2: ElementRef;
@ViewChild('conf3') conf3: ElementRef;
@ViewChild('conf4') conf4: ElementRef;
@ViewChild('conf5') conf5: ElementRef;
@ViewChild('conf6') conf6: ElementRef;
error_msg: any[];
lang = 'en';
model: any;
passwordErr: boolean;
newpasswordErr: boolean;
confpasswordErr: boolean;
notMatchErr: boolean;
password: any;
fname: any;
loginSubmit: boolean;
resetError: boolean;
resetMsg: any;
loginDetails: any;
error: boolean;
constructor(
private router: Router,
private route: ActivatedRoute,
public vs: ValidationService,
public service: WebService,
public subjectService: SubjectService,
public location: Location
) {
this.loginDetails = JSON.parse(this.service.getLocalStorageItem('userData'));
this.error = false;
this.passwordErr = false;
this.newpasswordErr = false;
this.confpasswordErr = false;
this.notMatchErr = false;
this.error_msg = this.vs.errorList[this.lang];
}
ngOnInit() {
}
processKeyUp(e: any, el: any) {
el.value = '';
console.log(e);
if ((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 96 && e.keyCode <= 105)) {
e.target.value = e.key;
el.focus();
} else {
if (e.keyCode !== 8) {
e.target.value = '';
}
}
}
processBack (e: any, el: any) {
if (e.keyCode === 8) {
e.target.value = '';
el.focus();
}
}
saveClick() {
this.loginSubmit = true;
this.passwordErr = false;
this.newpasswordErr = false;
this.confpasswordErr = false;
this.notMatchErr = false;
this.resetError = false;
this.error = false;
const password = [];
const newpassword = [];
const confirm = [];
password[0] = this.old1.nativeElement.value;
password[1] = this.old2.nativeElement.value;
password[2] = this.old3.nativeElement.value;
password[3] = this.old4.nativeElement.value;
password[4] = this.old5.nativeElement.value;
password[5] = this.old6.nativeElement.value;
newpassword[0] = this.new1.nativeElement.value;
newpassword[1] = this.new2.nativeElement.value;
newpassword[2] = this.new3.nativeElement.value;
newpassword[3] = this.new4.nativeElement.value;
newpassword[4] = this.new5.nativeElement.value;
newpassword[5] = this.new6.nativeElement.value;
confirm[0] = this.conf1.nativeElement.value;
confirm[1] = this.conf2.nativeElement.value;
confirm[2] = this.conf3.nativeElement.value;
confirm[3] = this.conf4.nativeElement.value;
confirm[4] = this.conf5.nativeElement.value;
confirm[5] = this.conf6.nativeElement.value;
const oldpass = password.join('');
const newpass = newpassword.join('');
const confirmpass = confirm.join('');
if (oldpass === '') {
this.passwordErr = true;
this.error = true;
} else {
for (const i in password) {
if (password[i] === '') {
this.passwordErr = true;
this.error = true;
}
}
}
if (newpass === '') {
this.newpasswordErr = true;
this.error = true;
} else {
for (const i in newpassword) {
if (newpassword[i] === '') {
this.newpasswordErr = true;
this.error = true;
}
}
}
if (confirmpass === '') {
this.confpasswordErr = true;
this.error = true;
} else {
for (const i in confirm) {
if (confirm[i] === '') {
this.confpasswordErr = true;
this.error = true;
}
}
}
console.log(this.error);
if (this.error === false) {
if (newpass !== confirmpass) {
this.notMatchErr = true;
this.error = true;
}
}
this.fname = 'reset_pin';
const post_data = {'user_id': this.loginDetails.user_id, 'password': oldpass, 'new_password': newpass};
this.service.post_data(this.fname, post_data).subscribe(response => {
console.log(response);
if (response.code === 1) {
const responseData = response.responseResult;
this.reset();
} else {
this.resetError = true;
this.resetMsg = this.vs.errorCode[this.lang][response.errorCode];
console.log(this.resetMsg);
}
}, (error) => {
this.resetError = true;
this.resetMsg = this.vs.errorCode[this.lang]['ER08'];
console.log(this.resetMsg);
});
}
reset() {
this.conf1.nativeElement.value = '';
this.conf2.nativeElement.value = '';
this.conf3.nativeElement.value = '';
this.conf4.nativeElement.value = '';
this.conf5.nativeElement.value = '';
this.conf6.nativeElement.value = '';
this.new1.nativeElement.value = '';
this.new2.nativeElement.value = '';
this.new3.nativeElement.value = '';
this.new4.nativeElement.value = '';
this.new5.nativeElement.value = '';
this.new6.nativeElement.value = '';
this.old1.nativeElement.value = '';
this.old2.nativeElement.value = '';
this.old3.nativeElement.value = '';
this.old4.nativeElement.value = '';
this.old5.nativeElement.value = '';
this.old6.nativeElement.value = '';
}
cancelClick() {
this.location.back();
}
}
...@@ -5,38 +5,38 @@ ...@@ -5,38 +5,38 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Currency Management</h4> <h4> {{'currencyadd.Currency Management' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('checker/home')"> <button class="logout" (click)="goToPage('maker/home')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button> {{'currencyadd.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'currencyadd.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('delivery/changepin')">Change PIN</span> <span (click)="goToPage('delivery/changepin')"> {{'currencyadd.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Add Currency</h3> <h3> {{'currencyadd.Add Currency' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Currency added successfully. <strong> {{'currencyadd.Success!' | translate}}</strong> Currency added successfully
</div> </div>
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseError}} <strong> {{'currencyadd.Warning!' | translate}}</strong> {{responseError}}
</div> </div>
<form [formGroup]="currencyForm" (ngSubmit)="currencyProcess()" autocomplete="off"> <form [formGroup]="currencyForm" (ngSubmit)="currencyProcess()" autocomplete="off">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Name</p> <p> {{'currencyadd.Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="name"> <input class="provider_input" placeholder="" type="text" formControlName="name">
</div> </div>
<div class="s_error" *ngIf="!currencyForm.controls['name'].valid && currencySubmit"> <div class="s_error" *ngIf="!currencyForm.controls['name'].valid && currencySubmit">
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Symbol</p> <p> {{'currencyadd.Symbol' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="symbol"> <input class="provider_input" placeholder="" type="text" formControlName="symbol">
</div> </div>
<div class="s_error" *ngIf="!currencyForm.controls['symbol'].valid && currencySubmit"> <div class="s_error" *ngIf="!currencyForm.controls['symbol'].valid && currencySubmit">
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Flag</p> <p> {{'currencyadd.Flag' | translate}}</p>
<input class="borderNone" placeholder="" type="file" formControlName="flag" (change)="onFileChange($event)"> <input class="borderNone" placeholder="" type="file" formControlName="flag" (change)="onFileChange($event)">
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Rate</p> <p> {{'currencyadd.Rate' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="rate"> <input class="provider_input" placeholder="" type="number" formControlName="rate">
</div> </div>
<div class="s_error" *ngIf="!currencyForm.controls['rate'].valid && currencySubmit"> <div class="s_error" *ngIf="!currencyForm.controls['rate'].valid && currencySubmit">
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Forex Amount Start From</p> <p> {{'currencyadd.Forex Multiple' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="start_from"> <input class="provider_input" placeholder="" type="number" formControlName="start_from">
</div> </div>
<div class="s_error" *ngIf="!currencyForm.controls['start_from'].valid && currencySubmit"> <div class="s_error" *ngIf="!currencyForm.controls['start_from'].valid && currencySubmit">
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<!-- <div class="row"> <!-- <div class="row">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay p0"> <div class="add_provider_btn_bay p0">
<button class="edit_btn floatRight" (click)="goToPage('checker/editprovider')">Edit</button> <button class="edit_btn floatRight" (click)="goToPage('maker/editprovider')">Edit</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
...@@ -99,8 +99,8 @@ ...@@ -99,8 +99,8 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay"> <div class="add_provider_btn_bay">
<button class="save_btn floatRight">Save</button> <button class="save_btn floatRight"> {{'currencyadd.Save' | translate}}</button>
<button class="cancel_btn floatRight" (click)="cancelClick()">Cancel</button> <button class="cancel_btn floatRight" (click)="cancelClick()"> {{'currencyadd.Cancel' | translate}}</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
......
...@@ -96,7 +96,7 @@ currencyProcess() { ...@@ -96,7 +96,7 @@ currencyProcess() {
} }
cancelClick() { cancelClick() {
this.router.navigate(['/checker/currency_list']); this.router.navigate(['/maker/currency_list']);
} }
goToPage(path: any, data = null) { goToPage(path: any, data = null) {
......
...@@ -5,38 +5,38 @@ ...@@ -5,38 +5,38 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Currency Management</h4> <h4>{{'currencyedit.Currency Management' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('checker/home')"> <button class="logout" (click)="goToPage('maker/home')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button> {{'currencyedit.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'currencyedit.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('delivery/changepin')">Change PIN</span> <span (click)="goToPage('maker/changepin')">{{'currencyedit.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Edit Currency</h3> <h3> {{'currencyedit.Edit Currency' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Currency added successfully. <strong> {{'currencyedit.Success!' | translate}}</strong> {{'currencyedit.Currency updated successfully' | translate}}
</div> </div>
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseError}} <strong> {{'currencyedit.Warning!' | translate}}</strong> {{responseError}}
</div> </div>
<form [formGroup]="currencyForm" (ngSubmit)="currencyProcess()" autocomplete="off"> <form [formGroup]="currencyForm" (ngSubmit)="currencyProcess()" autocomplete="off">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Name</p> <p> {{'currencyedit.Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="name"> <input class="provider_input" placeholder="" type="text" formControlName="name">
</div> </div>
<div class="s_error" *ngIf="!currencyForm.controls['name'].valid && currencySubmit"> <div class="s_error" *ngIf="!currencyForm.controls['name'].valid && currencySubmit">
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Symbol</p> <p> {{'currencyedit.Symbol' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="symbol"> <input class="provider_input" placeholder="" type="text" formControlName="symbol">
</div> </div>
<div class="s_error" *ngIf="!currencyForm.controls['symbol'].valid && currencySubmit"> <div class="s_error" *ngIf="!currencyForm.controls['symbol'].valid && currencySubmit">
...@@ -55,10 +55,10 @@ ...@@ -55,10 +55,10 @@
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Flag</p> <p> {{'currencyedit.Flag' | translate}}</p>
<img [src]="getImage()" *ngIf="image_url" /> <img [src]="getImage()" *ngIf="image_url" />
<div class="provider_choose_btn"> <div class="provider_choose_btn">
Choose Flag {{'currencyedit.Choose Flag' | translate}}
<input class="" placeholder="" type="file" formControlName="flag" (change)="onFileChange($event)"> <input class="" placeholder="" type="file" formControlName="flag" (change)="onFileChange($event)">
</div> </div>
</div> </div>
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Rate</p> <p> {{'currencyedit.Rate' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="rate"> <input class="provider_input" placeholder="" type="number" formControlName="rate">
</div> </div>
<div class="s_error" *ngIf="!currencyForm.controls['rate'].valid && currencySubmit"> <div class="s_error" *ngIf="!currencyForm.controls['rate'].valid && currencySubmit">
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Forex Amount Start From</p> <p> {{'currencyedit.Forex Amount Start From' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="start_from"> <input class="provider_input" placeholder="" type="number" formControlName="start_from">
</div> </div>
<div class="s_error" *ngIf="!currencyForm.controls['start_from'].valid && currencySubmit"> <div class="s_error" *ngIf="!currencyForm.controls['start_from'].valid && currencySubmit">
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
<!-- <div class="row"> <!-- <div class="row">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay p0"> <div class="add_provider_btn_bay p0">
<button class="edit_btn floatRight" (click)="goToPage('checker/editprovider')">Edit</button> <button class="edit_btn floatRight" (click)="goToPage('maker/editprovider')">Edit</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
...@@ -100,8 +100,8 @@ ...@@ -100,8 +100,8 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay"> <div class="add_provider_btn_bay">
<button class="save_btn floatRight">Save</button> <button class="save_btn floatRight"> {{'currencyedit.Save' | translate}}</button>
<button class="cancel_btn floatRight" (click)="cancelClick()">Cancel</button> <button class="cancel_btn floatRight" (click)="cancelClick()"> {{'currencyedit.Cancel' | translate}}</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
......
.provider_header{
background: #1a5c7c;
padding: 4px;
h4{
margin:0px;
color: #fff;
padding: 20px;
font-weight: 400;
font-size:20px;
}
span{
position: absolute;
bottom:-30px;
right:15px;
font-size: 14px;
cursor: pointer;
z-index: 999;
}
}
.provider_content{
width:100%;
position: relative;
h3{
margin:0px;
padding:0px;
border-bottom: 1px solid #494949;
color: #464646;
font-size: 20px;
font-weight: 400;
padding: 15px;
}
.provider_inner_content{
width:100%;
padding-top: 40px;
padding-left: 20px;
padding-right: 20px;
.row{
padding-bottom: 30px;
.provider_data_content{
width:90%;
margin:0 auto;
p{
color: #464646;
margin:0px;
padding-bottom: 10px;
font-weight: 500;
}
.provider_input{
border:1px solid #b4b4b4;
height:40px;
padding-left: 10px;
padding-right: 10px;
width: 100%;
&:focus{
outline: none;
}
}
img{
display: inline-block;
width: 40px;
height: 40px;
border-radius: 50%;
border:2px solid #b4b4b4;
object-fit: cover;
margin-right: 10px;
}
.provider_choose_btn{
width:150px;
display: inline-block;
background: #1a5c7c;
position: relative;
color: #fff;
height:40px;
border-radius: 20px;
text-align: center;
padding:8px;
input{
position: absolute;
top:0px;
bottom:0px;
left:0px;
right:0px;
border: 1px solid #b4b4b4;
opacity: 0;
}
}
// .provider_choose_btn{
// width: 130px;
// background: #1a5c7c;
// color: #fff;
// position: relative;
// height: 40px;
// text-align: center;
// padding: 7px;
// border-radius: 20px;
// cursor: pointer;
// input{
// position: absolute;
// top:0px;
// left:0px;
// right:0px;
// bottom: 0px;
// opacity: 0;
// }
// }
.provider_pin{
border:1px solid #b4b4b4;
height:40px;
width: calc(100% - 90%);
margin-right: calc(100% - 92%);
text-align: center;
display: inline-block;
border-radius: 10px;
&:focus{
outline: none;
}
}
}
.edit_btn{
background: #d9d9d9;
color: #1a5d7a;
border-radius:20px;
height:40px;
padding-left: 4%;
padding-right:4%;
font-weight: 500;
margin:1%;
border:none;
&:hover{
outline: none;
}
&:focus{
outline:none;
}
}
}
.add_provider_btn_bay{
width:100%;
padding-top:5%;
text-align: right;
.save_btn{
background: #cd3d3d;
color: #fff;
border-radius:20px;
height:40px;
border:none;
padding-left:4%;
padding-right:4%;
margin:1%;
&:hover{
outline: none;
}
&:focus{
outline:none;
}
}
.cancel_btn{
background: #1a5c7c;
color: #fff;
border-radius:20px;
height:40px;
padding-left:4%;
padding-right:4%;
border:none;
margin:1%;
&:hover{
outline: none;
}
&:focus{
outline:none;
}
}
}
}
}
\ No newline at end of file
...@@ -141,7 +141,7 @@ export class CurrencyEditComponent implements OnInit { ...@@ -141,7 +141,7 @@ export class CurrencyEditComponent implements OnInit {
} }
cancelClick() { cancelClick() {
this.router.navigate(['/checker/currency_list']); this.router.navigate(['/maker/currency_list']);
} }
logout() { logout() {
......
...@@ -4,42 +4,43 @@ ...@@ -4,42 +4,43 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Manage Currency</h4> <h4> {{'currencylist.Manage Currency' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('checker/home')"> <button class="logout" (click)="goToPage('maker/home')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button> {{'currencylist.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'currencylist.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('checker/changepin')">Change PIN</span> <span (click)="goToPage('maker/changepin')"> {{'currencylist.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Currency List</h3> <h3> {{'currencylist.Currency List' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="table-responsive"> <div class="table-responsive">
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseMsg}} <strong> {{'currencylist.Warning!' | translate}}</strong> {{responseMsg}}
</div> </div>
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Currency removed successfully <strong> {{'currencylist.Success!' | translate}}</strong> {{'currencylist.Currency removed successfully' | translate}}
</div> </div>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>Name</th> <th> {{'currencylist.Name' | translate}}</th>
<th>Symbol</th> <th> {{'currencylist.Symbol' | translate}}</th>
<th>Rate</th> <th> {{'currencylist.Rate' | translate}}</th>
<th>Forex Start from</th> <th> {{'currencylist.Forex Multiple' | translate}}</th>
<th>{{'currencylist.Flag' | translate}}</th>
<th class="textRight"> <th class="textRight">
<button class="add" (click)="goToPage('checker/currency_add')">+</button> <button class="add" (click)="goToPage('maker/currency_add')">+</button>
</th> </th>
</tr> </tr>
</thead> </thead>
...@@ -49,6 +50,9 @@ ...@@ -49,6 +50,9 @@
<td>{{currency.symbol}}</td> <td>{{currency.symbol}}</td>
<td>{{currency.rate}}</td> <td>{{currency.rate}}</td>
<td>{{currency.start_from}}</td> <td>{{currency.start_from}}</td>
<td>
<img [src]="getImage(currency.flag)" onerror="this.src= 'assets/images/asset_denied.png'">
</td>
<td class="textRight"> <td class="textRight">
<button class="edit_btn"(click)="editClick(currency.id)"></button> <button class="edit_btn"(click)="editClick(currency.id)"></button>
<button class="delete_btn" (click)="deleteClick(currency.id)"></button> <button class="delete_btn" (click)="deleteClick(currency.id)"></button>
......
...@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; ...@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router'; import { Router, ActivatedRoute } from '@angular/router';
import { WebService } from './../../providers/web.service'; import { WebService } from './../../providers/web.service';
import { ValidationService } from './../../providers/validation.service'; import { ValidationService } from './../../providers/validation.service';
import { ImageStorage } from '../../../environments/server.config';
@Component({ @Component({
...@@ -12,7 +13,7 @@ import { ValidationService } from './../../providers/validation.service'; ...@@ -12,7 +13,7 @@ import { ValidationService } from './../../providers/validation.service';
export class CurrencyListComponent implements OnInit { export class CurrencyListComponent implements OnInit {
currencyList: any[]; currencyList: any[];
fname: any; fname: any;
lang = 'ar'; lang = 'en';
responseMsg: any; responseMsg: any;
error: boolean; error: boolean;
success: boolean; success: boolean;
...@@ -87,7 +88,7 @@ export class CurrencyListComponent implements OnInit { ...@@ -87,7 +88,7 @@ export class CurrencyListComponent implements OnInit {
} }
editClick(id: number) { editClick(id: number) {
this.router.navigate(['checker/currency_edit/' + id]); this.router.navigate(['maker/currency_edit/' + id]);
} }
goToPage(path, data = null) { goToPage(path, data = null) {
...@@ -100,4 +101,8 @@ export class CurrencyListComponent implements OnInit { ...@@ -100,4 +101,8 @@ export class CurrencyListComponent implements OnInit {
this.service.logout(); this.service.logout();
} }
getImage(image_url) {
return ImageStorage + image_url;
}
} }
...@@ -4,43 +4,43 @@ ...@@ -4,43 +4,43 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Forex Provider</h4> <h4> {{'editforex.Forex Provider' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('checker/home')"> <button class="logout" (click)="goToPage('maker/home')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button> {{'editforex.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'editforex.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('checker/changepin')">Change PIN</span> <span (click)="goToPage('maker/changepin')"> {{'editforex.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Edit Forex Provider</h3> <h3> {{'editforex.Edit Forex Provider' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Provider updated successfully. <strong> {{'editforex.Success!' | translate}}</strong> {{'editforex.Provider updated successfully' | translate}}
</div> </div>
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseMsg}} <strong> {{'editforex.Warning!' | translate}}</strong> {{responseMsg}}
</div> </div>
<form [formGroup]="providerForm" (ngSubmit)="editProcess()" autocomplete="off"> <form [formGroup]="providerForm" (ngSubmit)="editProcess()" autocomplete="off">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content" *ngIf="provider"> <div class="provider_data_content" *ngIf="provider">
<p>Provider Name</p> <p> {{'editforex.Provider Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" disabled [value]="provider.name"> <input class="provider_input" placeholder="" type="text" disabled [value]="provider.name">
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Location</p> <p> {{'editforex.Location' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="location"> <input class="provider_input" placeholder="" type="text" formControlName="location">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit">
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<div class="col"> <div class="col">
<div class="provider_data_content" *ngIf="provider"> <div class="provider_data_content" *ngIf="provider">
<p>CR ID</p> <p> {{'editforex.CR ID' | translate}}</p>
<input class="provider_input" placeholder="" type="text" disabled [value]="provider.cr_id"> <input class="provider_input" placeholder="" type="text" disabled [value]="provider.cr_id">
</div> </div>
</div> </div>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>CR Manager</p> <p>{{'editforex.CR Manager' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="cr_manager"> <input class="provider_input" placeholder="" type="text" formControlName="cr_manager">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['cr_manager'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['cr_manager'].valid && providerSubmit">
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Contact Name</p> <p> {{'editforex.Contact Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="contact"> <input class="provider_input" placeholder="" type="text" formControlName="contact">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['contact'].valid"> <div class="s_error" *ngIf="!providerForm.controls['contact'].valid">
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Phone</p> <p> {{'editforex.Phone' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="phone"> <input class="provider_input" placeholder="" type="number" formControlName="phone">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched">
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Email id</p> <p> {{'editforex.Email id' | translate}}</p>
<input class="provider_input" placeholder="" type="mail" formControlName="email_id"> <input class="provider_input" placeholder="" type="mail" formControlName="email_id">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched"> <div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched">
...@@ -111,10 +111,10 @@ ...@@ -111,10 +111,10 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Status</p> <p> {{'editforex.Status' | translate}}</p>
<select class="provider_input" formControlName="online_status"> <select class="provider_input" formControlName="online_status">
<option value="1">Online</option> <option value="1"> Online</option>
<option value="0">Offline</option> <option value="0"> Offline</option>
</select> </select>
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['online_status'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['online_status'].valid && providerSubmit">
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Delivery Provider</p> <p> {{'editforex.Delivery Provider' | translate}}</p>
<select class="provider_input" formControlName="deli_provider_id"> <select class="provider_input" formControlName="deli_provider_id">
<option *ngFor="let provider of providerList" [value]="provider.id">{{provider.name}}</option> <option *ngFor="let provider of providerList" [value]="provider.id">{{provider.name}}</option>
</select> </select>
...@@ -140,11 +140,12 @@ ...@@ -140,11 +140,12 @@
</div> </div>
</div> --> </div> -->
</div> </div>
<div class="row"> <div class="row" *ngIf="provider">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay"> <div class="add_provider_btn_bay">
<button class="save_btn floatRight">Save</button> <button class="save_btn floatRight" *ngIf="provider.status!=2"> {{'editforex.Save' | translate}}</button>
<button class="cancel_btn floatRight" (click)="cancelClick()">Cancel</button> <button class="save_btn floatRight" *ngIf="provider.status==2"> {{'editforex.Request For Approve' | translate}}</button>
<button class="cancel_btn floatRight" (click)="cancelClick()"> {{'editforex.Cancel' | translate}}</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
......
...@@ -54,9 +54,11 @@ export class EditforexComponent implements OnInit { ...@@ -54,9 +54,11 @@ export class EditforexComponent implements OnInit {
// tslint:disable-next-line:max-line-length // tslint:disable-next-line:max-line-length
'phone': ['', Validators.compose([Validators.required, Validators.minLength(8), Validators.maxLength(15), Validators.pattern(this.mobnumPattern)])], 'phone': ['', Validators.compose([Validators.required, Validators.minLength(8), Validators.maxLength(15), Validators.pattern(this.mobnumPattern)])],
'type': [2], 'type': [2],
'users_id': [''],
'provider_id': [id], 'provider_id': [id],
'online_status': ['', Validators.compose([Validators.required])], 'online_status': ['', Validators.compose([Validators.required])],
'deli_provider_id': ['', Validators.compose([Validators.required])], 'deli_provider_id': ['', Validators.compose([Validators.required])],
'status': [''],
}); });
} }
...@@ -92,6 +94,7 @@ export class EditforexComponent implements OnInit { ...@@ -92,6 +94,7 @@ export class EditforexComponent implements OnInit {
console.log(response); console.log(response);
if (response.code === 1) { if (response.code === 1) {
this.provider = response.responseResult; this.provider = response.responseResult;
console.log(this.provider);
this.providerForm.patchValue({ this.providerForm.patchValue({
cr_manager: this.provider.cr_manager, cr_manager: this.provider.cr_manager,
contact: this.provider.contact, contact: this.provider.contact,
...@@ -100,6 +103,8 @@ export class EditforexComponent implements OnInit { ...@@ -100,6 +103,8 @@ export class EditforexComponent implements OnInit {
phone: this.provider.phone, phone: this.provider.phone,
online_status: this.provider.online_status, online_status: this.provider.online_status,
deli_provider_id: this.provider.deli_provider_id, deli_provider_id: this.provider.deli_provider_id,
status: this.provider.status,
users_id: this.provider.users_id
}); });
} else { } else {
this.error = true; this.error = true;
...@@ -117,7 +122,7 @@ export class EditforexComponent implements OnInit { ...@@ -117,7 +122,7 @@ export class EditforexComponent implements OnInit {
} }
cancelClick() { cancelClick() {
this.router.navigate(['/checker/forex']); this.router.navigate(['/maker/forex']);
} }
editProcess() { editProcess() {
...@@ -136,6 +141,7 @@ export class EditforexComponent implements OnInit { ...@@ -136,6 +141,7 @@ export class EditforexComponent implements OnInit {
if (response.code === 1) { if (response.code === 1) {
this.success = true; this.success = true;
this.providerSubmit = false; this.providerSubmit = false;
this.getProvider(providerObj.provider_id);
} else { } else {
this.error = true; this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode]; this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
......
...@@ -4,43 +4,43 @@ ...@@ -4,43 +4,43 @@
<header class="provider_header"> <header class="provider_header">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h4>Forex Delivery Service Provider</h4> <h4> {{'editprovider.Forex Delivery Service Provider' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('checker/home')"> <button class="logout" (click)="goToPage('maker/home')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
Home</button> {{'editprovider.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png"> <img src="assets/images/asset_logout.png">
Logout</button> {{'editprovider.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png"> <img src="assets/images/asset_logo1.png">
<span (click)="goToPage('checker/changepin')">Change PIN</span> <span (click)="goToPage('maker/changepin')"> {{'editprovider.Change PIN' | translate}}</span>
</div> </div>
</div> </div>
</header> </header>
<section> <section>
<div class="provider_content"> <div class="provider_content">
<h3>Edit Delivery Service Provider</h3> <h3> {{'editprovider.Edit Delivery Service Provider' | translate}}</h3>
<div class="provider_inner_content"> <div class="provider_inner_content">
<div class="alert alert-success alert-dismissible" *ngIf="success"> <div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Success!</strong> Provider updated successfully. <strong> {{'editprovider.Success!' | translate}}</strong> {{'editprovider.Provider updated successfully' | translate}}
</div> </div>
<div class="alert alert-danger alert-dismissible" *ngIf="error"> <div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a> <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Warning!</strong> {{responseMsg}} <strong> {{'editprovider.Warning!' | translate}}</strong> {{responseMsg}}
</div> </div>
<form [formGroup]="providerForm" (ngSubmit)="editProcess()" autocomplete="off"> <form [formGroup]="providerForm" (ngSubmit)="editProcess()" autocomplete="off">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content" *ngIf="provider"> <div class="provider_data_content" *ngIf="provider">
<p>Provider Name</p> <p> {{'editprovider.Provider Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" disabled [value]="provider.name"> <input class="provider_input" placeholder="" type="text" disabled [value]="provider.name">
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Location</p> <p> {{'editprovider.Location' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="location"> <input class="provider_input" placeholder="" type="text" formControlName="location">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['location'].valid && providerSubmit">
...@@ -50,15 +50,15 @@ ...@@ -50,15 +50,15 @@
<div class="col"> <div class="col">
<div class="provider_data_content" *ngIf="provider"> <div class="provider_data_content" *ngIf="provider">
<p>CR ID</p> <p> {{'editprovider.CR ID' | translate}}</p>
<input class="provider_input" placeholder="" type="text" disabled [value]="provider.cr_id"> <input class="provider_input" placeholder="" type="text" disabled [value]="provider.cr_id" maxlength="10">
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>CR Manager</p> <p> {{'editprovider.CR Manager' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="cr_manager"> <input class="provider_input" placeholder="" type="text" formControlName="cr_manager">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['cr_manager'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['cr_manager'].valid && providerSubmit">
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Contact Name</p> <p> {{'editprovider.Contact Name' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="contact"> <input class="provider_input" placeholder="" type="text" formControlName="contact">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['contact'].valid"> <div class="s_error" *ngIf="!providerForm.controls['contact'].valid">
...@@ -79,16 +79,16 @@ ...@@ -79,16 +79,16 @@
</div> </div>
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Phone</p> <p> {{'editprovider.Phone' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="phone"> <input class="provider_input" placeholder="" type="number" formControlName="phone" maxlength="10">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched">
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('pattern')">{{error_msg.phone}}</div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('pattern')">{{error_msg.phone}}</div>
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched && !providerForm.controls['phone'].hasError('pattern')"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerForm.controls['phone'].touched && !providerForm.controls['phone'].hasError('pattern')">
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('maxlength')">{{error_msg.maxLength}} 15</div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('maxlength')">{{error_msg.maxLength}} 10</div>
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('minlength')">{{error_msg.minLength}} 8</div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('minlength')">{{error_msg.minLength}} 10</div>
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerSubmit"> <div class="s_error" *ngIf="!providerForm.controls['phone'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['phone'].hasError('required')">{{error_msg.required}} </div>
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>Email id</p> <p> {{'editprovider.Email id' | translate}}</p>
<input class="provider_input" placeholder="" type="mail" formControlName="email_id"> <input class="provider_input" placeholder="" type="mail" formControlName="email_id">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched"> <div class="s_error" *ngIf="!providerForm.controls['email_id'].valid && providerForm.controls['email_id'].touched">
...@@ -127,10 +127,11 @@ ...@@ -127,10 +127,11 @@
</div> --> </div> -->
</div> </div>
<div class="row"> <div class="row">
<div class="col"> <div class="col" *ngIf="provider">
<div class="add_provider_btn_bay"> <div class="add_provider_btn_bay">
<button class="save_btn floatRight">Save</button> <button class="save_btn floatRight" *ngIf="provider.status!=2"> {{'editforex.Save' | translate}}</button>
<button class="cancel_btn floatRight" (click)="cancelClick()">Cancel</button> <button class="save_btn floatRight" *ngIf="provider.status==2"> {{'editforex.Request For Approve' | translate}}</button>
<button class="cancel_btn floatRight" (click)="cancelClick()"> {{'editprovider.Cancel' | translate}}</button>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</div> </div>
......
...@@ -18,7 +18,7 @@ export class EditproviderComponent implements OnInit { ...@@ -18,7 +18,7 @@ export class EditproviderComponent implements OnInit {
success: boolean; success: boolean;
loader: boolean; loader: boolean;
providerForm: FormGroup; providerForm: FormGroup;
mobnumPattern = '^((\\+?)|0)?[0-9]{8,15}$'; mobnumPattern = '^((\\+?)|0)?[0-9]{9,10}$';
emailPattern = '^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$'; emailPattern = '^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$';
providerSubmit: boolean; providerSubmit: boolean;
error_msg: any[]; error_msg: any[];
...@@ -52,7 +52,9 @@ export class EditproviderComponent implements OnInit { ...@@ -52,7 +52,9 @@ export class EditproviderComponent implements OnInit {
// tslint:disable-next-line:max-line-length // tslint:disable-next-line:max-line-length
'phone': ['', Validators.compose([Validators.required, Validators.minLength(8), Validators.maxLength(15), Validators.pattern(this.mobnumPattern)])], 'phone': ['', Validators.compose([Validators.required, Validators.minLength(8), Validators.maxLength(15), Validators.pattern(this.mobnumPattern)])],
'type': [3], 'type': [3],
'provider_id': [id] 'users_id': [''],
'provider_id': [id],
'status': [''],
}); });
} }
...@@ -70,7 +72,9 @@ export class EditproviderComponent implements OnInit { ...@@ -70,7 +72,9 @@ export class EditproviderComponent implements OnInit {
contact: this.provider.contact, contact: this.provider.contact,
location: this.provider.location, location: this.provider.location,
email_id: this.provider.email_id, email_id: this.provider.email_id,
phone: this.provider.phone phone: this.provider.phone,
status: this.provider.status,
users_id: this.provider.users_id
}); });
} else { } else {
this.error = true; this.error = true;
...@@ -94,7 +98,7 @@ export class EditproviderComponent implements OnInit { ...@@ -94,7 +98,7 @@ export class EditproviderComponent implements OnInit {
} }
cancelClick() { cancelClick() {
this.router.navigate(['/checker/delivery']); this.router.navigate(['/maker/delivery']);
} }
editProcess() { editProcess() {
...@@ -113,6 +117,7 @@ export class EditproviderComponent implements OnInit { ...@@ -113,6 +117,7 @@ export class EditproviderComponent implements OnInit {
if (response.code === 1) { if (response.code === 1) {
this.success = true; this.success = true;
this.providerSubmit = false; this.providerSubmit = false;
this.getProvider(providerObj.provider_id);
} else { } else {
this.error = true; this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode]; this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
...@@ -121,10 +126,24 @@ export class EditproviderComponent implements OnInit { ...@@ -121,10 +126,24 @@ export class EditproviderComponent implements OnInit {
this.error = false; this.error = false;
this.responseMsg = this.vs.errorCode[this.lang]['ER08']; this.responseMsg = this.vs.errorCode[this.lang]['ER08'];
}); });
} else {
this.getErrors(this.providerForm);
} }
console.log('tested'); console.log('tested');
} }
getErrors(FormAttr) {
Object.keys(FormAttr.controls).forEach(key => {
console.log(key);
const controlErrors: ValidationErrors = FormAttr.get(key).errors;
if (controlErrors != null) {
Object.keys(controlErrors).forEach(keyError => {
console.log('Key control: ' + key + ', keyError: ' + keyError + ', err value: ', controlErrors[keyError]);
});
}
});
}
logout() { logout() {
this.service.logout(); this.service.logout();
} }
......
<div class="custom_loader_wrapper" *ngIf="loader">
<div class="custom_loader_ring"></div>
</div>
<header class="provider_header">
<div class="row">
<div class="col-md-6">
<h4>{{'forexprovider.Forex Provider' | translate}}</h4>
</div>
<div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('maker/home')">
<img src="assets/images/asset_home.png">
{{'forexprovider.Home' | translate}}</button>
<button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png">
{{'forexprovider.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png">
<span (click)="goToPage('maker/changepin')"> {{'forexprovider.Change PIN' | translate}}</span>
</div>
</div>
</header>
<section>
<div class="provider_content">
<h3>{{'forexprovider.Manage Forex Provider' | translate}}</h3>
<div class="provider_inner_content">
<div class="table-responsive">
<div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong> {{'forexprovider.Warning!' | translate}}</strong> {{responseMsg}}
</div>
<div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong> {{'forexprovider.Success!' | translate}}</strong> {{'forexprovider.Forex provider removed successfully' | translate}}
</div>
<table class="table">
<thead>
<tr>
<th> {{'forexprovider.Provider Name' | translate}}</th>
<th> {{'forexprovider.Location' | translate}}</th>
<th> {{'forexprovider.CR Manager' | translate}}</th>
<th> {{'forexprovider.CR ID' | translate}}</th>
<th> {{'forexprovider.Contact Name' | translate}}</th>
<th> {{'forexprovider.Phone' | translate}}</th>
<th> {{'forexprovider.Email ID' | translate}}</th>
<th> {{'forexprovider.Status' | translate}}</th>
<th class="textRight">
<button class="add" (click)="goToPage('maker/provider_forex')">+</button>
</th>
</tr>
</thead>
<tbody *ngIf="providerList; else noProvider">
<tr *ngFor="let provider of providerList;">
<td>{{provider.name | titlecase}}</td>
<td>{{provider.location | titlecase}}</td>
<td>{{provider.cr_manager | titlecase}}</td>
<td>{{provider.cr_id}}</td>
<td>{{provider.contact | titlecase}}</td>
<td>{{provider.phone}}</td>
<td>{{provider.email_id}}</td>
<td>{{get_status(provider.status)}}</td>
<td class="textRight pl0 pr0">
<button class="edit_btn"(click)="editClick(provider.id)"></button>
<button class="delete_btn" (click)="deleteClick(provider.id)"></button>
</td>
</tr>
</tbody>
</table>
<ng-template #noProvider></ng-template>
</div>
</div>
</div>
</section>
\ No newline at end of file
.provider_header{
background: #1a5c7c;
padding: 4px;
h4{
margin:0px;
color: #fff;
padding: 20px;
font-weight: 400;
font-size:20px;
}
span{
position: absolute;
bottom:-30px;
right:15px;
font-size: 14px;
cursor: pointer;
z-index: 999;
}
}
.provider_content{
width:100%;
position: relative;
h3{
margin:0px;
padding:0px;
border-bottom: 1px solid #494949;
color: #464646;
font-size: 20px;
font-weight: 400;
padding: 15px;
}
.provider_inner_content{
width:100%;
padding-top: 40px;
padding-left: 20px;
padding-right: 20px;
.row{
padding-bottom: 30px;
.provider_data_content{
width:90%;
margin:0 auto;
.edit_delivery{
color: #195c77;
text-decoration: underline;
cursor: pointer;
font-weight: 500;
position: relative;
top:30px;
}
p{
color: #464646;
margin:0px;
padding-bottom: 10px;
font-weight: 500;
}
.provider_input{
border:1px solid #b4b4b4;
height:40px;
padding-left: 10px;
padding-right: 10px;
width: 100%;
&:focus{
outline: none;
}
}
.provider_pin{
border:1px solid #b4b4b4;
height:40px;
width: calc(100% - 90%);
margin-right: calc(100% - 92%);
text-align: center;
display: inline-block;
border-radius: 10px;
&:focus{
outline: none;
}
}
}
.edit_btn{
background: #d9d9d9;
color: #1a5d7a;
border-radius:20px;
height:40px;
padding-left: 4%;
padding-right:4%;
font-weight: 500;
margin:1%;
border:none;
&:hover{
outline: none;
}
&:focus{
outline:none;
}
}
}
.add_provider_btn_bay{
width:100%;
padding-top:5%;
text-align: right;
.save_btn{
background: #cd3d3d;
color: #fff;
border-radius:20px;
height:40px;
border:none;
padding-left:4%;
padding-right:4%;
margin:1%;
&:hover{
outline: none;
}
&:focus{
outline:none;
}
}
.cancel_btn{
background: #1a5c7c;
color: #fff;
border-radius:20px;
height:40px;
padding-left:4%;
padding-right:4%;
border:none;
margin:1%;
&:hover{
outline: none;
}
&:focus{
outline:none;
}
}
}
table{
thead{
background: #1ca8cb;
tr{
th{
color: #fff;
padding-left: 25px;
font-weight: 500;
.add{
width:30px;
height:30px;
background: #1a5b77;
color: #fff;
border:1px solid #fff;
border-radius: 50%;
font-size: 18px;
cursor: pointer;
&:focus{
outline: none;
}
}
}
}
}
tbody{
tr{
border-bottom: 2px solid #fff;
td{
.edit_btn{
width:25px;
height:25px;
border:none;
background:url('/assets/images/asset_edit.png');
background-position: center;
background-size: 18px;
background-repeat: no-repeat;
margin: 2px;
&:focus{
outline:none;
}
}
.delete_btn{
width:25px;
height:25px;
border:none;
background:url('/assets/images/asset_delete.png');
background-position: center;
background-size: 20px;
background-repeat: no-repeat;
margin: 2px;
&:focus{
outline:none;
}
}
}
&:nth-child(even) {background: #f3f3f3}
&:nth-child(odd) {background: #f9f9f9}
}
}
}
}
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ForexproviderComponent } from './forexprovider.component';
describe('ForexproviderComponent', () => {
let component: ForexproviderComponent;
let fixture: ComponentFixture<ForexproviderComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ForexproviderComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ForexproviderComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { WebService } from './../../providers/web.service';
import { ValidationService } from './../../providers/validation.service';
@Component({
selector: 'app-forexprovider',
templateUrl: './forexprovider.component.html',
styleUrls: ['./forexprovider.component.scss']
})
export class ForexproviderComponent implements OnInit {
providerList: any[];
fname: any;
lang = 'en';
responseMsg: any;
error: boolean;
success: boolean;
loader: boolean;
constructor(private router: Router, private route: ActivatedRoute, public vs: ValidationService, public service: WebService) {
this.responseMsg = '';
this.error = false;
this.success = false;
this.loader = false;
}
ngOnInit() {
this.getProvider();
}
getProvider() {
this.loader = true;
this.fname = 'all_providers';
const post_data = {'type': 2};
this.service.post_data(this.fname, post_data).subscribe(response => {
this.loader = false;
console.log(response);
if (response.code === 1) {
this.providerList = response.responseResult;
} else {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
}
}, (error) => {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang]['ER08'];
});
const This = this;
setTimeout(function() {
This.responseMsg = '';
}, 3000);
}
reset() {
this.error = false;
this.success = false;
}
deleteClick(provider_id: any) {
this.reset();
const res = confirm('Do you want to remove this user ?');
if (res === true) {
this.loader = true;
this.fname = 'provider_delete';
const post_data = {'provider_id': provider_id};
this.service.post_data(this.fname, post_data).subscribe(response => {
this.loader = false;
console.log(response);
if (response.code === 1) {
this.success = true;
console.log(this.success);
this.getProvider();
} else {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
}
}, (error) => {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang]['ER08'];
});
}
/* const This = this;
setTimeout(function() {
This.responseMsg = '';
}, 3000); */
}
editClick(id: number) {
this.router.navigate(['maker/forex_edit/' + id]);
}
goToPage(path, data = null) {
console.log(data);
this.router.navigateByUrl(path, {queryParams: data});
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
logout() {
this.service.logout();
}
get_status(status: number) {
let state = '';
switch (status) {
case 0:
state = 'Pending';
break;
case 1:
state = 'Approved';
break;
case 2:
state = 'Reject';
break;
default:
break;
}
return state;
}
}
<header class="provider_header">
<div class="row">
<div class="col-md-6">
<h4>{{'home.Forex Delivery Service Provider' | translate}}</h4>
</div>
<div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('maker/currency_list')">
<img src="assets/images/asset_currency.png">
{{'home.Currency' | translate}}</button>
<button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png">
{{'home.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png">
</div>
</div>
</header>
<section>
<div class="forex_wrapper">
<div class="row">
<div class="col-md-6">
<div class="forex_inner" (click)="clickForex()">
<img src="assets/images/asset_forex.png">
<h5>{{'home.Manage Forex Provider' | translate}}</h5>
</div>
</div>
<div class="col-md-6">
<div class="forex_inner" (click)="clickDelivery()">
<img src="assets/images/asset_manage.png">
<h5> {{'home.Manage Delivery Provider' | translate}}</h5>
</div>
</div>
</div>
</div>
</section>
.provider_header{
background: #1a5c7c;
padding: 4px;
h4{
margin:0px;
color: #fff;
padding: 20px;
font-weight: 400;
font-size:20px;
}
span{
position: absolute;
bottom:-30px;
right:15px;
font-size: 14px;
cursor: pointer;
z-index: 999;
}
}
.forex_wrapper{
.forex_inner{
cursor: pointer;
text-align: center;
height: calc(100vh - 100px);
padding-top: 35%;
h5{
color: #464646;
font-weight: 500;
}
}
}
\ No newline at end of file
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 ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { Router,ActivatedRoute } from '@angular/router';
import { WebService } from './../../providers/web.service';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {
constructor(private router: Router, private route: ActivatedRoute, public service: WebService) { }
ngOnInit() {
}
goToPage(path: any, data = null) {
console.log(data);
this.router.navigateByUrl(path, {queryParams: data});
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
clickForex() {
this.router.navigate(['/maker/forex']);
}
clickDelivery() {
this.router.navigate(['/maker/delivery']);
}
logout() {
this.service.logout();
}
}
<div class="delivery_provider_content">
<router-outlet></router-outlet>
</div>
.delivery_provider_content{
width:80%;
margin:0 auto;
position: relative;
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IndexComponent } from './index.component';
describe('IndexComponent', () => {
let component: IndexComponent;
let fixture: ComponentFixture<IndexComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ IndexComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(IndexComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { Router,ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-index',
templateUrl: './index.component.html',
styleUrls: ['./index.component.scss']
})
export class IndexComponent implements OnInit {
constructor(private router: Router,private route: ActivatedRoute) { }
ngOnInit() {
}
goToPage(path,data=null){
console.log(data)
this.router.navigateByUrl(path,{queryParams:data});
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
}
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { moduleRouting } from './maker.routing';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { TranslateModule} from '@ngx-translate/core';
//IMPORTED-PAGE-COMPONENTS
import { IndexComponent } from './index/index.component';
import { AddproviderComponent} from './addprovider/addprovider.component';
import { EditproviderComponent } from './editprovider/editprovider.component';
import { ManageproviderComponent } from './manageprovider/manageprovider.component';
import { HomeComponent } from './home/home.component';
import { ForexproviderComponent } from './forexprovider/forexprovider.component';
import { ChangepinComponent } from './changepin/changepin.component';
import { CurrencyAddComponent } from './currency-add/currency-add.component';
import { AddforexComponent } from './addforex/addforex.component';
import { EditforexComponent } from './editforex/editforex.component';
import { CurrencyEditComponent } from './currency-edit/currency-edit.component';
import { CurrencyListComponent } from './currency-list/currency-list.component';
@NgModule({
// tslint:disable-next-line:max-line-length
declarations: [IndexComponent, AddproviderComponent, EditproviderComponent, ManageproviderComponent, HomeComponent, ForexproviderComponent, ChangepinComponent, CurrencyAddComponent, AddforexComponent, EditforexComponent, CurrencyEditComponent, CurrencyListComponent],
imports: [
CommonModule,
moduleRouting,
FormsModule,
ReactiveFormsModule,
TranslateModule
]
})
export class makerModule { }
// COMMON-ANGULAR-MODULES
import { ModuleWithProviders } from '@angular/core';
// ROUTING
import { Routes, RouterModule } from '@angular/router';
import { RoleGuard } from './../providers/role-guard.service';
//IMPORTED-PAGE-COMPONENTS
import { IndexComponent } from './index/index.component';
import { AddproviderComponent} from './addprovider/addprovider.component';
import { EditproviderComponent } from './editprovider/editprovider.component';
import { ManageproviderComponent } from './manageprovider/manageprovider.component';
import { ForexproviderComponent } from './forexprovider/forexprovider.component';
import { HomeComponent } from './home/home.component';
import { ChangepinComponent } from './changepin/changepin.component';
import { CurrencyAddComponent } from './currency-add/currency-add.component';
import { AuthGuard } from './../providers/auth.guard';
import { AddforexComponent } from './addforex/addforex.component';
import { EditforexComponent } from './editforex/editforex.component';
import { CurrencyEditComponent } from './currency-edit/currency-edit.component';
import { CurrencyListComponent } from './currency-list/currency-list.component';
const ModuleRoutes: Routes = [
{ path: 'maker', component: IndexComponent, canActivate: [AuthGuard],
children: [
{ path: 'provider_delivery', component: AddproviderComponent },
{ path: 'delivery_edit/:id', component: EditproviderComponent },
{ path: 'delivery', component: ManageproviderComponent },
{ path: 'forex', component: ForexproviderComponent },
{ path: 'provider_forex', component: AddforexComponent },
{ path: 'forex_edit/:id', component: EditforexComponent },
{ path: 'home', component: HomeComponent },
{ path: 'changepin', component: ChangepinComponent },
{ path: 'currency_add', component: CurrencyAddComponent},
{ path: 'currency_edit/:id', component: CurrencyEditComponent},
{ path: 'currency_list', component: CurrencyListComponent}
], data: {role: 1}
}
];
export const moduleRouting: ModuleWithProviders = RouterModule.forChild(ModuleRoutes)
<div class="custom_loader_wrapper" *ngIf="loader">
<div class="custom_loader_ring"></div>
</div>
<header class="provider_header">
<div class="row">
<div class="col-md-6">
<h4> {{'manageprovider.Forex Delivery Service Provider' | translate}}</h4>
</div>
<div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('maker/home')">
<img src="assets/images/asset_home.png">
{{'manageprovider.Home' | translate}}</button>
<button class="logout" (click)="logout()">
<img src="assets/images/asset_logout.png">
{{'manageprovider.Logout' | translate}}</button>
<img src="assets/images/asset_logo1.png">
<span (click)="goToPage('maker/changepin')"> {{'manageprovider.Change PIN' | translate}}</span>
</div>
</div>
</header>
<section>
<div class="provider_content">
<h3> {{'manageprovider.Manage Delivery Service Provider' | translate}}</h3>
<div class="provider_inner_content">
<div class="table-responsive">
<div class="alert alert-danger alert-dismissible" *ngIf="error">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong> {{'manageprovider.Warning!' | translate}}</strong> {{responseMsg}}
</div>
<div class="alert alert-success alert-dismissible" *ngIf="success">
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong> {{'manageprovider.Success!' | translate}}</strong>{{'manageprovider.Delivery provider removed successfully' | translate}}
</div>
<table class="table">
<thead>
<tr>
<th>{{'manageprovider.Provider Name' | translate}}</th>
<th> {{'manageprovider.Location' | translate}}</th>
<th> {{'manageprovider.CR Manager' | translate}}</th>
<th> {{'manageprovider.CR ID' | translate}}</th>
<th> {{'manageprovider.Contact Name' | translate}}</th>
<th> {{'manageprovider.Phone' | translate}}</th>
<th> {{'manageprovider.Email ID' | translate}}</th>
<th> {{'forexprovider.Status' | translate}}</th>
<th class="textRight">
<button class="add" (click)="goToPage('maker/provider_delivery')">+</button>
</th>
</tr>
</thead>
<tbody *ngIf="providerList; else noProvider">
<tr *ngFor="let provider of providerList;">
<td>{{provider.name | titlecase}}</td>
<td>{{provider.location | titlecase}}</td>
<td>{{provider.cr_manager | titlecase}}</td>
<td>{{provider.cr_id}}</td>
<td>{{provider.contact | titlecase}}</td>
<td>{{provider.phone}}</td>
<td>{{provider.email_id}}</td>
<td>{{get_status(provider.status)}}</td>
<td class="textRight pl0 pr0">
<button class="edit_btn"(click)="editClick(provider.id)"></button>
<button class="delete_btn" (click)="deleteClick(provider.id)"></button>
</td>
</tr>
</tbody>
</table>
<ng-template #noProvider></ng-template>
</div>
</div>
</div>
</section>
\ No newline at end of file
.provider_header{
background: #1a5c7c;
padding: 4px;
h4{
margin:0px;
color: #fff;
padding: 20px;
font-weight: 400;
font-size:20px;
}
span{
position: absolute;
bottom:-30px;
right:15px;
font-size: 14px;
cursor: pointer;
z-index: 999;
}
}
.provider_content{
width:100%;
position: relative;
h3{
margin:0px;
padding:0px;
border-bottom: 1px solid #494949;
color: #464646;
font-size: 20px;
font-weight: 400;
padding: 15px;
}
.provider_inner_content{
width:100%;
padding-top: 40px;
padding-left: 20px;
padding-right: 20px;
.row{
padding-bottom: 30px;
.provider_data_content{
width:90%;
margin:0 auto;
.edit_delivery{
color: #195c77;
text-decoration: underline;
cursor: pointer;
font-weight: 500;
position: relative;
top:30px;
}
p{
color: #464646;
margin:0px;
padding-bottom: 10px;
font-weight: 500;
}
.provider_input{
border:1px solid #b4b4b4;
height:40px;
padding-left: 10px;
padding-right: 10px;
width: 100%;
&:focus{
outline: none;
}
}
.provider_pin{
border:1px solid #b4b4b4;
height:40px;
width: calc(100% - 90%);
margin-right: calc(100% - 92%);
text-align: center;
display: inline-block;
border-radius: 10px;
&:focus{
outline: none;
}
}
}
.edit_btn{
background: #d9d9d9;
color: #1a5d7a;
border-radius:20px;
height:40px;
padding-left: 4%;
padding-right:4%;
font-weight: 500;
margin:1%;
border:none;
&:hover{
outline: none;
}
&:focus{
outline:none;
}
}
}
.add_provider_btn_bay{
width:100%;
padding-top:5%;
text-align: right;
.save_btn{
background: #cd3d3d;
color: #fff;
border-radius:20px;
height:40px;
border:none;
padding-left:4%;
padding-right:4%;
margin:1%;
&:hover{
outline: none;
}
&:focus{
outline:none;
}
}
.cancel_btn{
background: #1a5c7c;
color: #fff;
border-radius:20px;
height:40px;
padding-left:4%;
padding-right:4%;
border:none;
margin:1%;
&:hover{
outline: none;
}
&:focus{
outline:none;
}
}
}
table{
thead{
background: #1ca8cb;
tr{
th{
color: #fff;
padding-left: 25px;
font-weight: 500;
.add{
width:30px;
height:30px;
background: #1a5b77;
color: #fff;
border:1px solid #fff;
border-radius: 50%;
font-size: 18px;
cursor: pointer;
&:focus{
outline: none;
}
}
}
}
}
tbody{
tr{
border-bottom: 2px solid #fff;
td{
.edit_btn{
width:25px;
height:25px;
border:none;
background:url('/assets/images/asset_edit.png');
background-position: center;
background-size: 18px;
background-repeat: no-repeat;
margin: 2px;
&:focus{
outline:none;
}
}
.delete_btn{
width:25px;
height:25px;
border:none;
background:url('/assets/images/asset_delete.png');
background-position: center;
background-size: 20px;
background-repeat: no-repeat;
margin: 2px;
&:focus{
outline:none;
}
}
}
&:nth-child(even) {background: #f3f3f3}
&:nth-child(odd) {background: #f9f9f9}
}
}
}
}
}
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ManageproviderComponent } from './manageprovider.component';
describe('ManageproviderComponent', () => {
let component: ManageproviderComponent;
let fixture: ComponentFixture<ManageproviderComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ManageproviderComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ManageproviderComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { WebService } from './../../providers/web.service';
import { ValidationService } from './../../providers/validation.service';
@Component({
selector: 'app-manageprovider',
templateUrl: './manageprovider.component.html',
styleUrls: ['./manageprovider.component.scss']
})
export class ManageproviderComponent implements OnInit {
providerList: any[];
fname: any;
lang = 'en';
responseMsg: any;
error: boolean;
success: boolean;
loader: boolean;
constructor(private router: Router, private route: ActivatedRoute, public vs: ValidationService, public service: WebService) {
this.responseMsg = '';
this.error = false;
this.success = false;
this.loader = false;
}
ngOnInit() {
this.getProvider();
}
getProvider() {
this.loader = true;
this.fname = 'all_providers';
const post_data = {'type': 3};
this.service.post_data(this.fname, post_data).subscribe(response => {
this.loader = false;
console.log(response);
if (response.code === 1) {
this.providerList = response.responseResult;
} else {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
}
}, (error) => {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang]['ER08'];
});
const This = this;
setTimeout(function() {
This.responseMsg = '';
}, 3000);
}
goToPage(path, data = null) {
console.log(data);
this.router.navigateByUrl(path, {queryParams: data});
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
reset() {
this.error = false;
this.success = false;
}
deleteClick(provider_id: any) {
this.reset();
const res = confirm('Do you want to remove this user ?');
if (res === true) {
this.loader = true;
this.fname = 'provider_delete';
const post_data = {'provider_id': provider_id};
this.service.post_data(this.fname, post_data).subscribe(response => {
this.loader = false;
console.log(response);
if (response.code === 1) {
this.success = true;
console.log(this.success);
this.getProvider();
} else {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
}
}, (error) => {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang]['ER08'];
});
}
/* const This = this;
setTimeout(function() {
This.responseMsg = '';
}, 3000); */
}
editClick(id: number) {
this.router.navigate(['maker/delivery_edit/' + id]);
}
logout() {
this.service.logout();
}
get_status(status: number) {
let state = '';
switch (status) {
case 0:
state = 'Pending';
break;
case 1:
state = 'Approved';
break;
case 2:
state = 'Reject';
break;
default:
break;
}
return state;
}
}
...@@ -8,11 +8,20 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject'; ...@@ -8,11 +8,20 @@ import { BehaviorSubject } from 'rxjs/BehaviorSubject';
export class SubjectService { export class SubjectService {
private loginDetails = new BehaviorSubject<any>(null); private loginDetails = new BehaviorSubject<any>(null);
private isLoggined = new BehaviorSubject<any>(null); private isLoggined = new BehaviorSubject<any>(null);
private isLang = new BehaviorSubject<any>(null);
sendLoginData(loginData: any) { sendLoginData(loginData: any) {
this.loginDetails.next(loginData); this.loginDetails.next(loginData);
} }
changeLang(langData: any) {
this.isLang.next(langData);
}
getLangData(): Observable<any> {
return this.isLang.asObservable();
}
getLoginData(): Observable<any> { getLoginData(): Observable<any> {
return this.loginDetails.asObservable(); return this.loginDetails.asObservable();
} }
......
...@@ -20,7 +20,8 @@ export class ValidationService { ...@@ -20,7 +20,8 @@ export class ValidationService {
'min': 'العمر الأدنى تبدأ في', 'min': 'العمر الأدنى تبدأ في',
'max': 'العمر القصوى في نهاية', 'max': 'العمر القصوى في نهاية',
'confirm': 'عدم تطابق كلمة المرور', 'confirm': 'عدم تطابق كلمة المرور',
'pattern': 'نمط غير صالح' 'pattern': 'نمط غير صالح',
'crId': 'Invalid CR ID'
}; };
this.errorList['en'] = { this.errorList['en'] = {
'required': 'This field is required', 'required': 'This field is required',
...@@ -32,7 +33,9 @@ export class ValidationService { ...@@ -32,7 +33,9 @@ export class ValidationService {
'min': 'Age min start at ', 'min': 'Age min start at ',
'max': 'Age max end at ', 'max': 'Age max end at ',
'confirm': 'Password mismatch', 'confirm': 'Password mismatch',
'pattern': 'Invalid Pattern' 'pattern': 'Invalid Pattern',
'crId': 'Invalid CR ID',
'national_id': 'Invalid National ID'
}; };
this.errorCode['en'] = { this.errorCode['en'] = {
......
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
<div class="login_inner"> <div class="login_inner">
<img src="assets/images/asset_logo.png"> <img src="assets/images/asset_logo.png">
<hr> <hr>
<h6>Forgot your PIN</h6> <h6>
{{'forgot.Forgot your PIN' | translate}}
</h6>
<div class="login_inner_content"> <div class="login_inner_content">
<br> <br>
<div class="login_row"> <div class="login_row">
<input class="" placeholder="Email Address"> <input class="" placeholder=" {{'forgot.Email Address' | translate}}">
</div> </div>
<div class="login_row"> <div class="login_row">
<button class="login_btn" (click)="goToPage('start/newpin')">{{'forgot.SEND ME THE LINK' | translate}}</button>
<button class="login_btn" (click)="goToPage('start/newpin')">SEND ME THE LINK</button>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -3,9 +3,14 @@ ...@@ -3,9 +3,14 @@
<div class="row"> <div class="row">
<div class="login_inner"> <div class="login_inner">
<img src="assets/images/asset_logo.png"> <img src="assets/images/asset_logo.png">
<hr>
<div class="login_inner_content"> <div class="login_inner_content">
Page not found. <span (click)="back_fun()" style="color: blue;cursor: pointer;">Back</span> <div class="invalid_content">
<img src="assets/images/asset_denied.png"><br>
{{'invalid.Access Denied' | translate}} <span (click)="back_fun()"> <strong>
{{'invalid.Go Back' | translate}}
</strong> </span>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -90,4 +90,13 @@ ...@@ -90,4 +90,13 @@
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
} }
}
.invalid_content{
font-size: 30px;
color: #1a5c7c;
strong{
color: #cd3d3d;
cursor: pointer;
}
} }
\ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<hr> <hr>
<div class="login_inner_content"> <div class="login_inner_content">
<div class="login_row"> <div class="login_row">
<input type="email" class="" placeholder="Email Address" pattern="^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$" required #email_id="ngModel" id="email_id" [(ngModel)]="model.email_id"> <input type="email" class="" placeholder="{{'login.Email Address' | translate}}" pattern="^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$" required #email_id="ngModel" id="email_id" [(ngModel)]="model.email_id">
<div class="md-errors-spacer" [hidden]="email_id.valid || email_id.untouched"> <div class="md-errors-spacer" [hidden]="email_id.valid || email_id.untouched">
<div class="s_error" *ngIf="email_id.errors && email_id.errors.required"> <div class="s_error" *ngIf="email_id.errors && email_id.errors.required">
<div class="s_validation">{{error_msg.required}} </div> <div class="s_validation">{{error_msg.required}} </div>
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
</div> </div>
</div> </div>
<div class="login_row"> <div class="login_row">
<p>Enter Your 6-Digit PIN</p>
<p>{{'login.Enter Your 6-Digit PIN' | translate}}</p>
<div class="login_pin"> <div class="login_pin">
<input class="log_pin" type="password" maxlength="1" #focus1 (keyup)="processKeyUp($event, focus2)"> <input class="log_pin" type="password" maxlength="1" #focus1 (keyup)="processKeyUp($event, focus2)">
<input class="log_pin" type="password" maxlength="1" #focus2 (keydown.backspace)="processBack($event, focus1)" (keyup)="processKeyUp($event, focus3)"> <input class="log_pin" type="password" maxlength="1" #focus2 (keydown.backspace)="processBack($event, focus1)" (keyup)="processKeyUp($event, focus3)">
...@@ -35,11 +36,20 @@ ...@@ -35,11 +36,20 @@
</div> </div>
<div *ngIf="loginError" class="s_validation">{{loginMsg}}</div> <div *ngIf="loginError" class="s_validation">{{loginMsg}}</div>
<div class="login_row"> <div class="login_row">
<button class="login_btn" (click)="loginClick()">Login</button> <button class="login_btn" (click)="loginClick()">{{'login.Login' | translate}}</button>
</div> </div>
<div class="login_row"> <div class="login_row">
<h6 (click)="goToPage('start/forgot')">Forgot Password</h6> <h6 (click)="goToPage('start/forgot')">{{'login.Forgot Password' | translate}}</h6>
</div> </div>
<!---div class="login_row">
<p class="textCenter" style="text-align:center !important;">{{'login.Choose Language' | translate}}</p>
<br>
<select id="translation" class="translation" #language (change)="changeLang($event.target.value)">
<option value="0" selected>English</option>
<option value="1">Arabic</option>
</select>
</div-->
</div> </div>
</div> </div>
</div> </div>
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
text-align: center; text-align: center;
width:100%; width:100%;
padding-top:5%; padding-top:5%;
img{ img{
margin-bottom: 40px; margin-bottom:30px;
width: 180px;
} }
hr{ hr{
border:5px solid #f69d1b; border:5px solid #f69d1b;
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
width:325px; width:325px;
margin: 0 auto; margin: 0 auto;
.login_row{ .login_row{
margin-bottom: 40px; margin-bottom:30px;
input{ input{
width:100%; width:100%;
height:50px; height:50px;
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
width:100%; width:100%;
text-align: left; text-align: left;
padding-top: 15px; padding-top: 15px;
padding-bottom: 10%; padding-bottom:5%;
.log_pin{ .log_pin{
border:1px solid #d8d8d8; border:1px solid #d8d8d8;
display: inline-block; display: inline-block;
......
...@@ -3,8 +3,8 @@ import { Router, ActivatedRoute } from '@angular/router'; ...@@ -3,8 +3,8 @@ import { Router, ActivatedRoute } from '@angular/router';
import { ValidationService } from './../../providers/validation.service'; import { ValidationService } from './../../providers/validation.service';
import { SubjectService } from './../../providers/subject.service'; import { SubjectService } from './../../providers/subject.service';
import { WebService } from './../../providers/web.service'; import { WebService } from './../../providers/web.service';
import * as $ from 'jquery'; import * as $ from 'jquery';
@Component({ @Component({
selector: 'app-login', selector: 'app-login',
templateUrl: './login.component.html', templateUrl: './login.component.html',
...@@ -20,6 +20,7 @@ export class LoginComponent implements OnInit { ...@@ -20,6 +20,7 @@ export class LoginComponent implements OnInit {
@ViewChild('focus4') focus4: ElementRef; @ViewChild('focus4') focus4: ElementRef;
@ViewChild('focus5') focus5: ElementRef; @ViewChild('focus5') focus5: ElementRef;
@ViewChild('focus6') focus6: ElementRef; @ViewChild('focus6') focus6: ElementRef;
@ViewChild('language') language: ElementRef;
error_msg: any[]; error_msg: any[];
lang = 'en'; lang = 'en';
model: any; model: any;
...@@ -30,14 +31,17 @@ export class LoginComponent implements OnInit { ...@@ -30,14 +31,17 @@ export class LoginComponent implements OnInit {
loginError: boolean; loginError: boolean;
loginMsg: any; loginMsg: any;
loginDetails: any; loginDetails: any;
val = 0;
constructor( constructor(
private router: Router, private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
public vs: ValidationService, public vs: ValidationService,
public service: WebService, public service: WebService,
public subjectService: SubjectService public subjectService: SubjectService,
) { ) {
//this.language.nativeElement.value = this.service.getLocalStorageItem('lang');
//this.lang = this.service.getLocalStorageItem('lang');
this.error_msg = this.vs.errorList[this.lang]; this.error_msg = this.vs.errorList[this.lang];
console.log(this.error_msg); console.log(this.error_msg);
this.passwordErr = false; this.passwordErr = false;
...@@ -48,7 +52,7 @@ export class LoginComponent implements OnInit { ...@@ -48,7 +52,7 @@ export class LoginComponent implements OnInit {
this.loginDetails = JSON.parse(this.service.getLocalStorageItem('userData')); this.loginDetails = JSON.parse(this.service.getLocalStorageItem('userData'));
if (this.loginDetails) { if (this.loginDetails) {
if (this.loginDetails.user_type === 1) { if (this.loginDetails.user_type === 1) {
this.router.navigate(['checker/home']); this.router.navigate(['maker/home']);
} else if (this.loginDetails.user_type === 2) { } else if (this.loginDetails.user_type === 2) {
this.router.navigate(['forex']); this.router.navigate(['forex']);
} else if (this.loginDetails.user_type === 3) { } else if (this.loginDetails.user_type === 3) {
...@@ -58,6 +62,7 @@ export class LoginComponent implements OnInit { ...@@ -58,6 +62,7 @@ export class LoginComponent implements OnInit {
} }
}); });
/* this.subjectService.getisLoggined().subscribe(isLoggined => { /* this.subjectService.getisLoggined().subscribe(isLoggined => {
console.log(isLoggined); console.log(isLoggined);
if (isLoggined != null) { if (isLoggined != null) {
...@@ -70,6 +75,7 @@ export class LoginComponent implements OnInit { ...@@ -70,6 +75,7 @@ export class LoginComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.model = {'email_id': '', 'password': ''}; this.model = {'email_id': '', 'password': ''};
// this.language.nativeElement.value = this.lang === 'ar' ? 1 : 0;
} }
goToPage(path: any, data = null) { goToPage(path: any, data = null) {
...@@ -90,13 +96,7 @@ export class LoginComponent implements OnInit { ...@@ -90,13 +96,7 @@ export class LoginComponent implements OnInit {
} }
changeLang(val: string) {
/*if (val === '1') {
$('body').addClass('ar');
} else {
$('body').removeClass('ar');
}*/
}
processBack (e: any, el: any) { processBack (e: any, el: any) {
console.log(e); console.log(e);
...@@ -142,11 +142,13 @@ export class LoginComponent implements OnInit { ...@@ -142,11 +142,13 @@ export class LoginComponent implements OnInit {
this.service.setLocalStorageItem('userData', JSON.stringify(response.responseResult)); this.service.setLocalStorageItem('userData', JSON.stringify(response.responseResult));
this.subjectService.sendLoginData('logged_in'); this.subjectService.sendLoginData('logged_in');
if (responseData.user_type === 1) { if (responseData.user_type === 1) {
this.router.navigate(['checker/home']); this.router.navigate(['maker/home']);
} else if (responseData.user_type === 2) { } else if (responseData.user_type === 2) {
this.router.navigate(['forex']); this.router.navigate(['forex']);
} else if (responseData.user_type === 3) { } else if (responseData.user_type === 3) {
this.router.navigate(['delivery']); this.router.navigate(['delivery']);
} else if (responseData.user_type === 5) {
this.router.navigate(['checker/home']);
} else { } else {
this.loginError = true; this.loginError = true;
this.loginMsg = this.vs.errorCode['ER42']; this.loginMsg = this.vs.errorCode['ER42'];
...@@ -163,4 +165,17 @@ export class LoginComponent implements OnInit { ...@@ -163,4 +165,17 @@ export class LoginComponent implements OnInit {
}); });
} }
changeLang(val: string) {
if (val === '1') {
$('body').addClass('ar');
this.lang = 'ar';
this.service.setLocalStorageItem('lang', 'ar');
} else {
$('body').removeClass('ar');
this.lang = 'en';
this.service.setLocalStorageItem('lang', 'en');
}
this.subjectService.changeLang(val);
}
} }
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
<div class="login_inner"> <div class="login_inner">
<img src="assets/images/asset_logo.png"> <img src="assets/images/asset_logo.png">
<hr> <hr>
<h6>New PIN</h6> <h6>{{'newpin.New PIN' | translate}}</h6>
<div class="login_inner_content"> <div class="login_inner_content">
<br> <br>
<div class="login_row"> <div class="login_row">
<p>New PIN</p> <p>{{'newpin.New PIN' | translate}}</p>
<div class="login_pin"> <div class="login_pin">
<input class="log_pin" type="password" maxlength="1" value="0"> <input class="log_pin" type="password" maxlength="1" value="0">
<input class="log_pin" type="password" maxlength="1" value="0"> <input class="log_pin" type="password" maxlength="1" value="0">
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</div> </div>
</div> </div>
<div class="login_row"> <div class="login_row">
<p>Confirm PIN</p> <p> {{'newpin.Confirm PIN' | translate}}</p>
<div class="login_pin"> <div class="login_pin">
<input class="log_pin" type="password" maxlength="1" value="0"> <input class="log_pin" type="password" maxlength="1" value="0">
<input class="log_pin" type="password" maxlength="1" value="0"> <input class="log_pin" type="password" maxlength="1" value="0">
...@@ -48,10 +48,10 @@ ...@@ -48,10 +48,10 @@
<div class="login_btn_bay"> <div class="login_btn_bay">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<button class="cancel_btn" (click)="goToPage('start/forgot')">Cancel</button> <button class="cancel_btn" (click)="goToPage('start/forgot')">{{'newpin.Cancel' | translate}}</button>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<button class="login_btn" (click)="goToPage('start/login')">Save</button> <button class="login_btn" (click)="goToPage('start/login')"> {{'newpin.Save' | translate}}</button>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -7,6 +7,7 @@ import { moduleRouting } from './start.routing'; ...@@ -7,6 +7,7 @@ import { moduleRouting } from './start.routing';
import { NewpinComponent } from './newpin/newpin.component'; import { NewpinComponent } from './newpin/newpin.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { InvalidComponent } from './invalid/invalid.component'; import { InvalidComponent } from './invalid/invalid.component';
import { TranslateModule} from '@ngx-translate/core';
@NgModule({ @NgModule({
declarations: [IndexComponent, LoginComponent, ForgotComponent, NewpinComponent, InvalidComponent], declarations: [IndexComponent, LoginComponent, ForgotComponent, NewpinComponent, InvalidComponent],
...@@ -15,6 +16,7 @@ import { InvalidComponent } from './invalid/invalid.component'; ...@@ -15,6 +16,7 @@ import { InvalidComponent } from './invalid/invalid.component';
moduleRouting, moduleRouting,
ReactiveFormsModule, ReactiveFormsModule,
FormsModule, FormsModule,
TranslateModule
] ]
}) })
export class StartModule { } export class StartModule { }
{
"login":{
"Enter Your 6-Digit PIN": "Enter Your 6-Digit PIN",
"Email Address": "Email Address",
"Login": "Login",
"Forgot Password": "Forgot Password",
"Choose Language" : "Choose Language"
},
"forgot":{
"Forgot your PIN": "Forgot your PIN",
"Email Address": "Email Address",
"SEND ME THE LINK": "SEND ME THE LINK"
},
"invalid":{
"Access Denied": "Access Denied",
"Go Back": "Go Back"
},
"newpin":{
"New PIN": "New PIN",
"Confirm PIN": "Confirm PIN",
"Cancel": "Cancel",
"Save": "Save"
},
"addforex":{
"Forex Delivery Service Provider" :"Forex Provider",
"Change PIN":"Change PIN",
"Home" : "Home",
"Logout":"Logout",
"Add Delivery Provider":"Add Provider",
"Success!":"Success",
"Provider created successfully":"Provider created successfully",
"Warning":"Warning",
"Provider Name":"Provider Name",
"Pin":"Pin",
"Confirm Pin":"Confirm Pin",
"Location":"Location",
"CR ID":"CR ID",
"CR Manager":"CR Manager",
"Contact Name":"Contact Name",
"Phone":"Phone",
"Email id":"Email id",
"Status":"Status",
"Delivery Provider":"Delivery Provider",
"Save":"Save",
"Cancel":"Cancel"
},
"addprovider":{
"Forex Delivery Service Provider":"Forex Delivery Service Provider",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Add Delivery Provider":"Add Delivery Provider",
"Success!":"Success",
"Provider created successfully":"Provider created successfully",
"Warning!":"Warning!",
"Provider Name":"Provider Name",
"Pin":"Pin",
"Confirm Pin":"Confirm Pin",
"Location":"Location",
"CR ID":"CR ID",
"CR Manager":"CR Manager",
"Contact Name":"Contact Name",
"Phone":"Phone",
"Email id":"Email id",
"Save":"Save",
"Cancel":"Cancel"
},
"changepin":{
"Change PIN":"Change PIN",
"Old PIN":"Old PIN",
"New PIN":"New PIN",
"Confirm PIN":"Confirm PIN",
"Warning!":"Warning!",
"Success!":"Success!",
"Password Updated Successfully":"Password Updated Successfully",
"Cancel":"Cancel",
"Save":"Save"
},
"currencyadd":{
"Currency Management":"Currency Management",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Add Currency":"Add Currency",
"Success!":"Success!",
"Currency added successfully":"Currency added successfully",
"Warning!":"Warning!",
"Name":"Name",
"Symbol":"Symbol",
"Flag":"Flag",
"Rate":"Rate",
"Forex Multiple":"Forex Multiple",
"Cancel":"Cancel",
"Save":"Save"
},
"currencyedit":{
"Currency Management":"Currency Management",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Edit Currency":"Edit Currency",
"Success!":"Success!",
"Currency updated successfully":"Currency Updated successfully",
"Warning!":"Warning!",
"Name":"Name",
"Symbol":"Symbol",
"Flag":"Flag",
"Choose Flag":"Choose Flag",
"Rate":"Rate",
"Forex Amount Start From":"Forex Amount Start From",
"Cancel":"Cancel",
"Save":"Save"
},
"currencylist":{
"Manage Currency":"Manage Currency",
"Home" :"Home",
"Flag":"Flag",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Currency List":"Currency List",
"Warning!":"Warning!",
"Success!":"Success!",
"Currency removed successfully":"Currency removed successfully",
"Name":"Name",
"Symbol":"Symbol",
"Forex Multiple":"Forex Multiple",
"Rate":"Rate"
},
"editforex":{
"Manage Currency":"Manage Currency",
"Forex Provider":"Forex Provider",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Edit Forex Provider":"Edit Forex Provider",
"Warning!":"Warning!",
"Success!":"Success!",
"Provider updated successfully":"editforex.Provider updated successfully",
"Request For Approve": "Request For Approval",
"Provider Name":"Provider Name",
"Location":"Location",
"CR ID":"CR ID",
"CR Manager":"CR Manager",
"Contact Name":"Contact Name",
"Phone":"Phone",
"Email id":"Email id",
"Status":"Status",
"Online":"Online",
"Offline":"Offline",
"Delivery Provider":"Delivery Provider",
"Save":"Save",
"Cancel":"Cancel"
},
"editprovider":{
"Forex Delivery Service Provider":"Forex Delivery Service Provider",
"Edit Forex Provider":"Edit Forex Provider",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Edit Delivery Service Provider":"Edit Delivery Service Provider",
"Warning!":"Warning!",
"Success!":"Success!",
"Provider updated successfully.":"Provider updated successfully.",
"Provider Name":"Provider Name",
"Location":"Location",
"CR ID":"CR ID",
"CR Manager":"CR Manager",
"Contact Name":"Contact Name",
"Phone":"Phone",
"Email id":"Email id",
"Save":"Save",
"Cancel":"Cancel",
"Forex Provider":"Forex Provider",
"Status":"Status",
"Delivery Provider":"Delivery Provider"
},
"forexprovider":{
"Forex Provider":"Forex Provider",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Manage Forex Provider":"Manage Forex Provider",
"Warning!":"Warning!",
"Success!":"Success!",
"Forex provider removed successfully":"Forex provider removed successfully",
"Provider Name":"Provider Name",
"Location":"Location",
"CR Manager":"CR Manager",
"CR ID":"CR ID",
"Contact Name":"Contact Name",
"Phone":"Phone",
"Status": "Status",
"Email ID":"Email ID",
"Action": "Action"
},
"home":{
"Forex Delivery Service Provider":"Forex Delivery Service Provider",
"Currency":"Currency",
"Logout":"Logout",
"Manage Forex Provider":"Manage Forex Provider",
"Manage Delivery Provider":"Manage Delivery Provider"
},
"manageprovider":{
"Forex Delivery Service Provider":"Forex Delivery Service Provider",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Manage Forex Provider":"Manage Forex Provider",
"Manage Delivery Service Provider":"Manage Delivery Service Provider",
"Delivery provider removed successfully":"Delivery provider removed successfully",
"Warning!":"Warning!",
"Success!":"Success!",
"Provider Name":"Provider Name",
"Location":"Location",
"CR Manager":"CR Manager",
"CR ID":"CR ID",
"Contact Name":"Contact Name",
"Phone":"Phone",
"Email ID":"Email ID"
},
"adddriver":{
"Driver Management":"Driver Management",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Add Delivery Driver":"Add Delivery Driver",
"Warning!":"Warning!",
"Success!":"Success!",
"Driver created successfully":"Driver created successfully",
"Provider Name":"Driver Name",
"Pin":"Pin",
"Location":"Location",
"National ID":"National ID",
"Manager ID":"Manager ID",
"Phone":"Phone",
"Email id":"Email id",
"Save":"Save",
"Cancel":"Cancel",
"Confirm Pin":"Confirm Pin",
"Postal Code": "Postal Code",
"Maximum Amount": "Maximum Amount",
"Maximum Limit": "Maximum Limit"
},
"editdriver":{
"Forex Delivery Driver":"Forex Delivery Driver",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Edit Forex Delivery Driver":"Edit Forex Delivery Driver",
"Warning!":"Warning!",
"Success!":"Success!",
"Forex Delivery Driver updated successfully":"Forex Delivery Driver updated successfully",
"Provider Name":"Driver Name",
"Location":"Location",
"National ID":"National ID",
"Manager ID":"Manager ID",
"Phone":"Phone",
"Email id":"Email id",
"Save":"Save",
"Cancel":"Cancel"
},
"listdriver":{
"Driver Management":"Driver Management",
"Driver List":"Driver List",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Forex provider removed successfully":"Forex provider removed successfully",
"Warning!":"Warning!",
"Success!":"Success!",
"Provider Name":"Provider Name",
"Location":"Location",
"National ID":"National ID",
"Manager ID":"Manager ID",
"Phone":"Phone",
"Email ID":"Email ID",
"Postal Code": "Postal Code",
"Max Amount": "Max Amount",
"Max Limit": "Max Limit"
},
"currency":{
"Forex Currency Rate":"Forex Currency Rate",
"Home":"Home",
"Logout":"Logout",
"Currency & Rates":"Currency & Rates",
"Warning":"Warning",
"Success":"Success",
"Currency assigned successfully":"Currency assigned successfully",
"Currency":"Currency",
"Add":"Add",
"Remove":"Remove",
"Rates":"Rates",
"Save":"Save",
"Cancel":"Cancel"
},
"transaction":{
"Forex Transaction List":"Forex Transaction List",
"Driver Management":"Driver Management",
"Currency":"Currency",
"Settings":"Settings",
"Logout":"Logout",
"Date":"Date",
"Change PIN":"Change PIN",
"Manage Transaction":"Manage Transaction",
"Warning":"Warning",
"Success":"Success",
"Forex provider removed successfully":"Forex provider removed successfully",
"User Info":"User name",
"Phone":"Phone",
"Location":"Location",
"Amount":"Amount",
"Forex Amount":"Forex Amount",
"Driver":"Driver",
"Status":"Status",
"Assign Driver":"Assign Driver",
"User":"User",
"Assign":"Assign",
"Cancel":"Cancel",
"Provider": "Provider",
"Config": "Config"
}
}
{
"login":{
"Enter Your 6-Digit PIN": "Enter Your 6-Digit PIN",
"Email Address": "Email Address",
"Login": "Login",
"Forgot Password": "Forgot Password",
"Choose Language" : "Choose Language"
},
"forgot":{
"Forgot your PIN": "Forgot your PIN",
"Email Address": "Email Address",
"SEND ME THE LINK": "SEND ME THE LINK"
},
"invalid":{
"Access Denied": "Access Denied",
"Go Back": "Go Back"
},
"newpin":{
"New PIN": "New PIN",
"Confirm PIN": "Confirm PIN",
"Cancel": "Cancel",
"Save": "Save"
},
"addforex":{
"Forex Delivery Service Provider" :"Forex Provider",
"Change PIN":"Change PIN",
"Home" : "Home",
"Logout":"Logout",
"Add Delivery Provider":"Add Provider",
"Success!":"Success",
"Provider created successfully":"Provider created successfully",
"Warning":"Warning",
"Provider Name":"Provider Name",
"Pin":"Pin",
"Confirm Pin":"Confirm Pin",
"Location":"Location",
"CR ID":"CR ID",
"CR Manager":"CR Manager",
"Contact Name":"Contact Name",
"Phone":"Phone",
"Email id":"Email id",
"Status":"Status",
"Delivery Provider":"Delivery Provider",
"Save":"Save",
"Cancel":"Cancel"
},
"addprovider":{
"Forex Delivery Service Provider":"Forex Delivery Service Provider",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Add Delivery Provider":"Add Delivery Provider",
"Success!":"Success",
"Provider created successfully":"Provider created successfully",
"Warning!":"Warning!",
"Provider Name":"Provider Name",
"Pin":"Pin",
"Confirm Pin":"Confirm Pin",
"Location":"Location",
"CR ID":"CR ID",
"CR Manager":"CR Manager",
"Contact Name":"Contact Name",
"Phone":"Phone",
"Email id":"Email id",
"Save":"Save",
"Cancel":"Cancel"
},
"changepin":{
"Change PIN":"Change PIN",
"Old PIN":"Old PIN",
"New PIN":"New PIN",
"Confirm PIN":"Confirm PIN",
"Warning!":"Warning!",
"Success!":"Success!",
"Password Updated Successfully":"Password Updated Successfully",
"Cancel":"Cancel",
"Save":"Save"
},
"currencyadd":{
"Currency Management":"Currency Management",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Add Currency":"Add Currency",
"Success!":"Success!",
"Currency added successfully":"Currency added successfully",
"Warning!":"Warning!",
"Name":"Name",
"Symbol":"Symbol",
"Flag":"Flag",
"Rate":"Rate",
"Forex Multiple":"Forex Multiple",
"Cancel":"Cancel",
"Save":"Save"
},
"currencyedit":{
"Currency Management":"Currency Management",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Edit Currency":"Edit Currency",
"Success!":"Success!",
"Currency updated successfully":"Currency Updated successfully",
"Warning!":"Warning!",
"Name":"Name",
"Symbol":"Symbol",
"Flag":"Flag",
"Choose Flag":"Choose Flag",
"Rate":"Rate",
"Forex Amount Start From":"Forex Amount Start From",
"Cancel":"Cancel",
"Save":"Save"
},
"currencylist":{
"Manage Currency":"Manage Currency",
"Home" :"Home",
"Flag":"Flag",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Currency List":"Currency List",
"Warning!":"Warning!",
"Success!":"Success!",
"Currency removed successfully":"Currency removed successfully",
"Name":"Name",
"Symbol":"Symbol",
"Forex Multiple":"Forex Multiple",
"Rate":"Rate"
},
"editforex":{
"Manage Currency":"Manage Currency",
"Forex Provider":"Forex Provider",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Edit Forex Provider":"Edit Forex Provider",
"Warning!":"Warning!",
"Success!":"Success!",
"Provider updated successfully":"Forex Provider updated successfully",
"Provider Name":"Provider Name",
"Location":"Location",
"CR ID":"CR ID",
"CR Manager":"CR Manager",
"Contact Name":"Contact Name",
"Phone":"Phone",
"Email id":"Email id",
"Status":"Status",
"Online":"Online",
"Offline":"Offline",
"Delivery Provider":"Delivery Provider",
"Save":"Save",
"Request For Approve": "Request For Approval",
"Cancel":"Cancel"
},
"editprovider":{
"Forex Delivery Service Provider":"Forex Delivery Service Provider",
"Edit Forex Provider":"Edit Forex Provider",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Edit Delivery Service Provider":"Edit Delivery Service Provider",
"Warning!":"Warning!",
"Success!":"Success!",
"Provider updated successfully":"Provider updated successfully",
"Provider Name":"Provider Name",
"Location":"Location",
"CR ID":"CR ID",
"CR Manager":"CR Manager",
"Contact Name":"Contact Name",
"Phone":"Phone",
"Email id":"Email id",
"Save":"Save",
"Cancel":"Cancel",
"Forex Provider":"Forex Provider",
"Status":"Status",
"Delivery Provider":"Delivery Provider"
},
"forexprovider":{
"Forex Provider":"Forex Provider",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Manage Forex Provider":"Manage Forex Provider",
"Warning!":"Warning!",
"Success!":"Success!",
"Forex provider removed successfully":"Forex provider removed successfully",
"Provider Name":"Provider Name",
"Location":"Location",
"CR Manager":"CR Manager",
"CR ID":"CR ID",
"Contact Name":"Contact Name",
"Phone":"Phone",
"Status": "Status",
"Email ID":"Email ID",
"Action": "Action"
},
"home":{
"Forex Delivery Service Provider":"Forex Delivery Service Provider",
"Currency":"Currency",
"Logout":"Logout",
"Manage Forex Provider":"Manage Forex Provider",
"Manage Delivery Provider":"Manage Delivery Provider"
},
"manageprovider":{
"Forex Delivery Service Provider":"Forex Delivery Service Provider",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Manage Forex Provider":"Manage Forex Provider",
"Manage Delivery Service Provider":"Manage Delivery Service Provider",
"Delivery provider removed successfully":"Delivery provider removed successfully",
"Warning!":"Warning!",
"Success!":"Success!",
"Provider Name":"Provider Name",
"Location":"Location",
"CR Manager":"CR Manager",
"CR ID":"CR ID",
"Contact Name":"Contact Name",
"Phone":"Phone",
"Email ID":"Email ID"
},
"adddriver":{
"Driver Management":"Driver Management",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Add Delivery Driver":"Add Delivery Driver",
"Warning!":"Warning!",
"Success!":"Success!",
"Driver created successfully":"Driver created successfully",
"Provider Name":"Driver Name",
"Pin":"Pin",
"Location":"Location",
"National ID":"National ID",
"Manager ID":"Manager ID",
"Phone":"Phone",
"Email id":"Email id",
"Save":"Save",
"Cancel":"Cancel",
"Confirm Pin":"Confirm Pin",
"Postal Code": "Postal Code",
"Maximum Amount": "Maximum Amount",
"Maximum Limit": "Maximum Limit"
},
"editdriver":{
"Forex Delivery Driver":"Forex Delivery Driver",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Edit Forex Delivery Driver":"Edit Forex Delivery Driver",
"Warning!":"Warning!",
"Success!":"Success!",
"Forex Delivery Driver updated successfully":"Forex Delivery Driver updated successfully",
"Provider Name":"Driver Name",
"Location":"Location",
"National ID":"National ID",
"Manager ID":"Manager ID",
"Phone":"Phone",
"Email id":"Email id",
"Save":"Save",
"Cancel":"Cancel"
},
"listdriver":{
"Driver Management":"Driver Management",
"Driver List":"Driver List",
"Home":"Home",
"Logout":"Logout",
"Change PIN":"Change PIN",
"Forex provider removed successfully":"Forex provider removed successfully",
"Warning!":"Warning!",
"Success!":"Success!",
"Provider Name":"Driver Name",
"Location":"Location",
"National ID":"National ID",
"Manager ID":"Manager ID",
"Phone":"Phone",
"Email ID":"Email ID",
"Postal Code": "Postal Code",
"Max Amount": "Max Amount",
"Max Limit": "Max Limit"
},
"currency":{
"Forex Currency Rate":"Forex Currency Rate",
"Home":"Home",
"Logout":"Logout",
"Currency & Rates":"Currency & Rates",
"Warning":"Warning",
"Success":"Success",
"Currency assigned successfully":"Currency assigned successfully",
"Currency":"Currency",
"Add":"Add",
"Remove":"Remove",
"Rates":"Rates",
"Save":"Save",
"Cancel":"Cancel"
},
"transaction":{
"Forex Transaction List":"Forex Transaction List",
"Driver Management":"Driver Management",
"Currency":"Currency",
"Settings":"Settings",
"Logout":"Logout",
"Date":"Date",
"Change PIN":"Change PIN",
"Manage Transaction":"Manage Transaction",
"Warning":"Warning",
"Success":"Success",
"Forex provider removed successfully":"Forex provider removed successfully",
"User Info":"User name",
"Phone":"Phone",
"Location":"Location",
"Amount":"Amount",
"Forex Amount":"Forex Amount",
"Driver":"Driver",
"Status":"Status",
"Assign Driver":"Assign Driver",
"User":"User",
"Assign":"Assign",
"Cancel":"Cancel",
"Provider": "Provider",
"Config": "Config"
},
"service": {
"Configuration":"Configuration",
"Service Charge Management": "Service Charge Management",
"Change PIN": "Change PIN",
"Configuration saved successfully": "Configuration saved successfully",
"Waiting Time":"Waiting Time",
"Cancellation Time":"Cancellation Time",
"Airport Delivery":"Airport Delivery",
"Hand Delivery":"Hand Delivery",
"Tax":"Tax",
"Save":"Save"
}
}
/*.ar{ .ar{
.floatLeft{ .floatLeft{
float: right !important; float: right !important;
} }
...@@ -84,5 +84,5 @@ ...@@ -84,5 +84,5 @@
} }
} }
}*/ }
export const ImageStorage = 'http://forex.nuvento.com/'; export const ImageStorage = 'http://forex.nuvento.com/';
// export const ImageStorage = 'http://localhost:3000/'; // export const ImageStorage = 'http://localhost:3000/';
// export const apiConfig = 'http://localhost:3000/api/'; export const apiConfig = 'http://localhost:3000/api/';
export const apiConfig = 'http://forex.nuvento.com/api/'; // export const apiConfig = 'http://forex.nuvento.com/api/';
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
</head> </head>
<body class="ar"> <body class="">
<app-root></app-root> <app-root></app-root>
</body> </body>
</html> </html>
...@@ -731,6 +731,16 @@ section.module.parallax { ...@@ -731,6 +731,16 @@ section.module.parallax {
td{ td{
padding:10px !important; padding:10px !important;
text-align: center !important; text-align: center !important;
img{
display: inline-block;
width: 30px;
height: 30px;
border-radius: 50%;
border: 2px solid #b4b4b4;
-o-object-fit: cover;
object-fit: cover;
margin-right: 10px;
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment