Commit 52c9670b by Adarsh K

Change Request

parent 27a0901f
...@@ -31,6 +31,11 @@ ...@@ -31,6 +31,11 @@
<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> {{'forexprovider.Success!' | translate}}</strong> {{'forexprovider.Forex provider removed successfully' | translate}} <strong> {{'forexprovider.Success!' | translate}}</strong> {{'forexprovider.Forex provider removed successfully' | translate}}
</div> </div>
<div class="row">
<div class="col"></div>
<div class="col" style="text-align: right"><input type="text" placeholder="{{'manageprovider.Search...' | translate}}" (input)="onSearchChange($event.target.value)" /></div>
</div>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
...@@ -60,6 +65,13 @@ ...@@ -60,6 +65,13 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="forex_pagination" *ngIf="meta">
<ul>
<li *ngFor="let i of getNumber(meta.total_pages); let j = index" [ngClass]="{'activeClass': meta.current_page == j+1}" (click)="getProvider(j+1)">{{j+1}}</li>
</ul>
</div>
<ng-template #noProvider></ng-template> <ng-template #noProvider></ng-template>
</div> </div>
</div> </div>
...@@ -130,7 +142,12 @@ ...@@ -130,7 +142,12 @@
<div class="col">{{deli_provider}}</div> <div class="col">{{deli_provider}}</div>
</div> </div>
</div> </div>
<div class="col"></div> <div class="col">
<div class="row">
<div class="col">Merchant ID:</div>
<div class="col">{{provider.merchant_id}}</div>
</div>
</div>
</div> </div>
</div> </div>
<div class="forex_modal_footer_btn_bay textRight"> <div class="forex_modal_footer_btn_bay textRight">
......
...@@ -18,30 +18,48 @@ export class ForexproviderComponent implements OnInit { ...@@ -18,30 +18,48 @@ export class ForexproviderComponent implements OnInit {
loader: boolean; loader: boolean;
provider: any; provider: any;
deli_provider: any; deli_provider: any;
page_number: any;
meta: any;
searchtxt: 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 = '';
this.error = false; this.error = false;
this.success = false; this.success = false;
this.loader = false; this.loader = false;
this.searchtxt = '';
} }
ngOnInit() { ngOnInit() {
this.getProvider(); this.getProvider(1);
} }
getProvider() { getProvider(page_number: number) {
this.page_number = page_number;
this.loader = true; this.loader = true;
this.fname = 'all_providers'; this.fname = 'all_providers';
const post_data = {'type': 2}; const post_data = {'type': 2, 'page': page_number, 'searchtxt': this.searchtxt};
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);
if (response.code === 1) { if (response.code === 1) {
this.providerList = response.responseResult; this.providerList = response.responseResult.data;
this.meta = response.responseResult.meta;
} else {
if (response.errorCode === 'ER36') {
this.page_number = this.page_number - 1;
if (this.page_number >= 1) {
this.getProvider(this.page_number);
} else {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
this.providerList = [];
}
} 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];
this.providerList = [];
}
} }
}, (error) => { }, (error) => {
this.error = true; this.error = true;
...@@ -59,6 +77,10 @@ export class ForexproviderComponent implements OnInit { ...@@ -59,6 +77,10 @@ export class ForexproviderComponent implements OnInit {
this.success = false; this.success = false;
} }
getNumber(num) {
return new Array(num);
}
deleteClick(provider_id: any) { deleteClick(provider_id: any) {
this.reset(); this.reset();
const res = confirm('Do you want to remove this user ?'); const res = confirm('Do you want to remove this user ?');
...@@ -72,7 +94,7 @@ export class ForexproviderComponent implements OnInit { ...@@ -72,7 +94,7 @@ export class ForexproviderComponent implements OnInit {
if (response.code === 1) { if (response.code === 1) {
this.success = true; this.success = true;
console.log(this.success); console.log(this.success);
this.getProvider(); this.getProvider(this.page_number);
} 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];
...@@ -98,6 +120,11 @@ export class ForexproviderComponent implements OnInit { ...@@ -98,6 +120,11 @@ export class ForexproviderComponent implements OnInit {
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
} }
onSearchChange(text: string) {
this.searchtxt = text;
this.getProvider(1);
}
logout() { logout() {
this.service.logout(); this.service.logout();
} }
...@@ -169,7 +196,7 @@ export class ForexproviderComponent implements OnInit { ...@@ -169,7 +196,7 @@ export class ForexproviderComponent implements OnInit {
console.log(response); console.log(response);
if (response.code === 1) { if (response.code === 1) {
this.provider = response.responseResult; this.provider = response.responseResult;
this.getProvider(); this.getProvider(this.page_number);
} 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];
......
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
<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> {{'manageprovider.Success!' | translate}}</strong>{{'manageprovider.Delivery provider removed successfully' | translate}} <strong> {{'manageprovider.Success!' | translate}}</strong>{{'manageprovider.Delivery provider removed successfully' | translate}}
</div> </div>
<div class="row">
<div class="col"></div>
<div class="col" style="text-align: right"><input type="text" placeholder="{{'manageprovider.Search...' | translate}}" (input)="onSearchChange($event.target.value)" /></div>
</div>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
...@@ -60,6 +64,11 @@ ...@@ -60,6 +64,11 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="forex_pagination" *ngIf="meta">
<ul>
<li *ngFor="let i of getNumber(meta.total_pages); let j = index" [ngClass]="{'activeClass': meta.current_page == j+1}" (click)="getProvider(j+1)">{{j+1}}</li>
</ul>
</div>
<ng-template #noProvider></ng-template> <ng-template #noProvider></ng-template>
</div> </div>
</div> </div>
......
...@@ -17,30 +17,48 @@ export class ManageproviderComponent implements OnInit { ...@@ -17,30 +17,48 @@ export class ManageproviderComponent implements OnInit {
success: boolean; success: boolean;
loader: boolean; loader: boolean;
provider: any; provider: any;
page_number: any;
meta: any;
searchtxt: 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 = '';
this.error = false; this.error = false;
this.success = false; this.success = false;
this.loader = false; this.loader = false;
this.searchtxt = '';
} }
ngOnInit() { ngOnInit() {
this.getProvider(); this.getProvider(1);
} }
getProvider() { getProvider(page_number: number) {
this.page_number = page_number;
this.loader = true; this.loader = true;
this.fname = 'all_providers'; this.fname = 'all_providers';
const post_data = {'type': 3}; const post_data = {'type': 3, 'page': page_number, 'searchtxt': this.searchtxt};
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);
if (response.code === 1) { if (response.code === 1) {
this.providerList = response.responseResult; this.providerList = response.responseResult.data;
this.meta = response.responseResult.meta;
} else {
if (response.errorCode === 'ER36') {
this.page_number = this.page_number - 1;
if (this.page_number >= 1) {
this.getProvider(this.page_number);
} else {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
this.providerList = [];
}
} 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];
this.providerList = [];
}
} }
}, (error) => { }, (error) => {
this.error = true; this.error = true;
...@@ -53,6 +71,10 @@ export class ManageproviderComponent implements OnInit { ...@@ -53,6 +71,10 @@ export class ManageproviderComponent implements OnInit {
}, 3000); }, 3000);
} }
getNumber(num) {
return new Array(num);
}
goToPage(path, data = null) { goToPage(path, data = null) {
console.log(data); console.log(data);
this.router.navigateByUrl(path, {queryParams: data}); this.router.navigateByUrl(path, {queryParams: data});
...@@ -77,7 +99,7 @@ export class ManageproviderComponent implements OnInit { ...@@ -77,7 +99,7 @@ export class ManageproviderComponent implements OnInit {
if (response.code === 1) { if (response.code === 1) {
this.success = true; this.success = true;
console.log(this.success); console.log(this.success);
this.getProvider(); this.getProvider(this.page_number);
} 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,6 +141,11 @@ export class ManageproviderComponent implements OnInit { ...@@ -119,6 +141,11 @@ export class ManageproviderComponent implements OnInit {
return state; return state;
} }
onSearchChange(text: string) {
this.searchtxt = text;
this.getProvider(1);
}
providerState(state: number, id: number) { providerState(state: number, id: number) {
this.loader = true; this.loader = true;
this.fname = 'provider_approve'; this.fname = 'provider_approve';
...@@ -128,7 +155,7 @@ export class ManageproviderComponent implements OnInit { ...@@ -128,7 +155,7 @@ export class ManageproviderComponent implements OnInit {
console.log(response); console.log(response);
if (response.code === 1) { if (response.code === 1) {
this.provider = response.responseResult; this.provider = response.responseResult;
this.getProvider(); this.getProvider(this.page_number);
} 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];
......
...@@ -37,10 +37,11 @@ ...@@ -37,10 +37,11 @@
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th> {{'transaction.User Info' | translate}}</th> <th> {{'transaction.Customer' | translate}}</th>
<th> {{'transaction.Provider' | translate}}</th> <th> {{'transaction.Provider' | translate}}</th>
<th> {{'transaction.Phone' | translate}}</th> <th> {{'transaction.Phone' | translate}}</th>
<th> {{'transaction.Location' | translate}}</th> <th> {{'transaction.Location' | translate}}</th>
<th> {{'transaction.Pincode' | translate}}</th>
<th> {{'transaction.Currency' | translate}}</th> <th> {{'transaction.Currency' | translate}}</th>
<th> {{'transaction.Amount' | translate}}</th> <th> {{'transaction.Amount' | translate}}</th>
<th>{{'transaction.Forex Amount' | translate}}</th> <th>{{'transaction.Forex Amount' | translate}}</th>
...@@ -52,18 +53,19 @@ ...@@ -52,18 +53,19 @@
</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')}}</td> <td>{{getCustomer(tansaction.user_info,'FirstName')}}</td>
<td>{{getCustomer(tansaction.provider,'name')}}</td> <td>{{getCustomer(tansaction.provider,'name')}}</td>
<td>{{getCustomer(tansaction.user_info,'phone')}}</td> <td>{{getCustomer(tansaction.user_info,'MobileNumber')}}</td>
<td>{{getCustomer(tansaction.user_info,'location')}}</td> <td>{{getCustomer(tansaction.user_info,'City')}}</td>
<td>{{getCustomer(tansaction.user_info,'Pincode')}}</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>{{tansaction.book_date}}</td> <td>{{tansaction.book_date}}</td>
<td *ngIf="tansaction.driver_info">{{getCustomer(tansaction.driver_info,'name')}}</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 *ngIf="!tansaction.driver_info"><span style="color: blue" data-toggle="modal" data-target="#edit" (click)="assignClick(i)" *ngIf="tansaction.status == 1 || tansaction.status == 2">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 ==1"></button></td> <td><button class="edit_btn" data-toggle="modal" data-target="#edit" (click)="assignClick(i)" *ngIf="tansaction.status ==1 || tansaction.status == 2"></button></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
...@@ -96,11 +98,11 @@ ...@@ -96,11 +98,11 @@
<div class="forex_inner_wrapper" *ngIf="selectedData"> <div class="forex_inner_wrapper" *ngIf="selectedData">
<div class="row"> <div class="row">
<div class="col"><p> {{'transaction.User' | translate}}</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,'FirstName')}} {{getCustomer(selectedData.user_info,'LastName')}}</p></div>
</div> </div>
<div class="row"> <div class="row">
<div class="col"><p> {{'transaction.Location' | translate}}</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,'City')}}</p></div>
</div> </div>
<div class="row"> <div class="row">
<div class="col"><p> {{'transaction.Amount' | translate}}</p></div> <div class="col"><p> {{'transaction.Amount' | translate}}</p></div>
...@@ -110,14 +112,16 @@ ...@@ -110,14 +112,16 @@
<div class="col-md-12"> <div class="col-md-12">
<p> {{'transaction.Driver' | translate}}</p> <p> {{'transaction.Driver' | translate}}</p>
<select class="provider_input" (change)="selectDriver($event.target.value)" #driver> <select class="provider_input" (change)="selectDriver($event.target.value)" #driver>
<option disabled hidden value=""> {{'transaction.Assign Driver' | translate}}</option> <option disabled hidden value="" *ngIf="driverList.length === 0" selected="selected"> {{'transaction.No Drivers available currently!' | translate}}</option>
<option disabled hidden value="" *ngIf="driverList.length > 0" selected="selected"> {{'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"> {{'transaction.Assign' | translate}}</button> <button *ngIf="driverList && driverList.length > 0" class="okay_btn" (click)="driverAssign()" [disabled]="driverStatus" data-dismiss="modal"> {{'transaction.Assign' | translate}}</button>
<button class="cancel_btn" data-dismiss="modal"> {{'transaction.Cancel' | translate}}</button> <button class="cancel_btn" data-dismiss="modal"> {{'transaction.Cancel' | translate}}</button>
</div> </div>
</div> </div>
......
...@@ -121,12 +121,15 @@ export class TransactionComponent implements OnInit { ...@@ -121,12 +121,15 @@ export class TransactionComponent implements OnInit {
return 'Requested'; return 'Requested';
break; break;
case 2: case 2:
return 'Delivered to Driver'; return 'Assigned to Driver';
break; break;
case 3: case 3:
return 'Delivered to Customer'; return 'Delivered to Driver';
break; break;
case 4: case 4:
return 'Delivered to Customer';
break;
case 5:
return 'Refund'; return 'Refund';
break; break;
default: default:
...@@ -150,8 +153,8 @@ export class TransactionComponent implements OnInit { ...@@ -150,8 +153,8 @@ 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); const user_info = JSON.parse(this.selectedData.user_info);
console.log(user_info.PinCode); console.log(user_info.Pincode);
this.providerDriver(this.selectedData.convert_price, user_info.PinCode); this.providerDriver(this.selectedData.convert_price, user_info.Pincode);
console.log(this.selectedData); console.log(this.selectedData);
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<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>{{'editprovider.Success' | translate}}!</strong> {{'editprovider.Provider updated successfully' | translate}}. <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>
...@@ -142,6 +142,26 @@ ...@@ -142,6 +142,26 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content">
<p>{{'editprovider.Merchant ID' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="merchant_id">
</div>
<div class="s_error" *ngIf="!providerForm.controls['merchant_id'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['merchant_id'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
<div class="col"></div>
<div class="col"></div>
<!-- <div class="col">
<div class="provider_data_content">
<p></p>
<div class="edit_delivery">Edit Delivery Driver</div>
</div>
</div> -->
</div>
<div class="row">
<div class="col">
<div class="add_provider_btn_bay"> <div class="add_provider_btn_bay">
<button class="save_btn floatRight">{{'editprovider.Save' | translate}}</button> <button class="save_btn floatRight">{{'editprovider.Save' | translate}}</button>
<button class="cancel_btn floatRight" (click)="cancelClick()">{{'editprovider.Cancel' | translate}}</button> <button class="cancel_btn floatRight" (click)="cancelClick()">{{'editprovider.Cancel' | translate}}</button>
......
...@@ -55,6 +55,7 @@ export class EditproviderComponent implements OnInit { ...@@ -55,6 +55,7 @@ export class EditproviderComponent implements OnInit {
'provider_id': [], 'provider_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])],
'merchant_id': ['', Validators.compose([Validators.required])]
}); });
} }
...@@ -128,6 +129,7 @@ export class EditproviderComponent implements OnInit { ...@@ -128,6 +129,7 @@ export class EditproviderComponent 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,
merchant_id: this.provider.merchant_id
}); });
} else { } else {
this.error = true; this.error = true;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<h4>{{'service.Configuration' | translate}}</h4> <h4>{{'service.Configuration' | translate}}</h4>
</div> </div>
<div class="col-md-6 textRight relative"> <div class="col-md-6 textRight relative">
<button class="logout" (click)="goToPage('maker/home')"> <button class="logout" (click)="goToPage('forex/home')">
<img src="assets/images/asset_home.png"> <img src="assets/images/asset_home.png">
{{'service.Home' | translate}}</button> {{'service.Home' | translate}}</button>
<button class="logout" (click)="logout()"> <button class="logout" (click)="logout()">
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<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> {{'service.Success!' | translate}}</strong> {{'service.Configuration saved successfully' | translate}} <strong> {{'service.Success' | translate}}!</strong> {{'service.Configuration saved 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>
......
...@@ -120,9 +120,9 @@ export class ServiceComponent implements OnInit { ...@@ -120,9 +120,9 @@ export class ServiceComponent implements OnInit {
waiting_time: this.config.waiting_time waiting_time: this.config.waiting_time
}); });
} else { } else {
this.error = true; // this.error = true;
this.configForm.patchValue({'type': 1}); this.configForm.patchValue({'type': 1});
this.responseError = this.vs.errorCode[this.lang][response.errorCode]; // this.responseError = this.vs.errorCode[this.lang][response.errorCode];
} }
}, (error) => { }, (error) => {
this.error = true; this.error = true;
...@@ -147,4 +147,10 @@ export class ServiceComponent implements OnInit { ...@@ -147,4 +147,10 @@ export class ServiceComponent implements OnInit {
this.service.logout(); this.service.logout();
} }
goToPage(path: any, data = null) {
console.log(data);
this.router.navigateByUrl(path, {queryParams: data});
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
} }
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>{{'transaction.User Info' | translate}}</th> <th>{{'transaction.Customer' | translate}}</th>
<th>{{'transaction.Date' | translate}}</th> <th>{{'transaction.Date' | translate}}</th>
<th>{{'transaction.Phone' | translate}}</th> <th>{{'transaction.Phone' | translate}}</th>
<th>{{'transaction.Location' | translate}}</th> <th>{{'transaction.Location' | translate}}</th>
...@@ -53,10 +53,10 @@ ...@@ -53,10 +53,10 @@
</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,'FirstName') | titlecase}}</td>
<td>{{tansaction.book_date}}</td> <td>{{tansaction.book_date}}</td>
<td>{{getCustomer(tansaction.user_info,'phone') | titlecase}}</td> <td>{{getCustomer(tansaction.user_info,'MobileNumber') | titlecase}}</td>
<td>{{getCustomer(tansaction.user_info,'location') | titlecase}}</td> <td>{{getCustomer(tansaction.user_info,'City') | titlecase}}</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>
......
...@@ -89,12 +89,15 @@ export class TransactionComponent implements OnInit { ...@@ -89,12 +89,15 @@ export class TransactionComponent implements OnInit {
return 'Requested'; return 'Requested';
break; break;
case 2: case 2:
return 'Delivered to Driver'; return 'Assigned to Driver';
break; break;
case 3: case 3:
return 'Delivered to Customer'; return 'Delivered to Driver';
break; break;
case 4: case 4:
return 'Delivered to Customer';
break;
case 5:
return 'Refund'; return 'Refund';
break; break;
default: default:
......
...@@ -160,6 +160,15 @@ ...@@ -160,6 +160,15 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p>{{'editprovider.Merchant ID' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="merchant_id">
</div>
<div class="s_error" *ngIf="!providerForm.controls['merchant_id'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['merchant_id'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
<div class="col">
<div class="provider_data_content">
<p> {{'addforex.Status' | translate}}</p> <p> {{'addforex.Status' | translate}}</p>
<select class="provider_input" formControlName="online_status" tabindex="9"> <select class="provider_input" formControlName="online_status" tabindex="9">
<option disabled hidden>{{'addforex.Status' | translate}}</option> <option disabled hidden>{{'addforex.Status' | translate}}</option>
...@@ -172,7 +181,7 @@ ...@@ -172,7 +181,7 @@
</div> </div>
</div> </div>
<div class="col"></div>
<div class="col"></div> <div class="col"></div>
</div> </div>
......
...@@ -53,6 +53,7 @@ export class AddforexComponent implements OnInit { ...@@ -53,6 +53,7 @@ export class AddforexComponent implements OnInit {
'type': [2], 'type': [2],
'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])],
'merchant_id': ['', Validators.compose([Validators.required])],
'password': [''], 'password': [''],
}); });
} }
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p> {{'addprovider.Provider Name' | translate}}</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" 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>
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
<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="col"> <!--<div class="col">
<!-- <div class="provider_data_content"> <div class="provider_data_content">
<p> {{'addprovider.Confirm Pin' | translate}}</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>
...@@ -64,23 +64,23 @@ ...@@ -64,23 +64,23 @@
<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 class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p> {{'addprovider.Location' | translate}}</p> <p> {{'addprovider.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> {{'addprovider.CR ID' | translate}}</p> <p> {{'addprovider.CR ID' | translate}}</p>
<input class="provider_input" placeholder="" type="number" formControlName="cr_id"> <input class="provider_input" placeholder="" type="number" 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>
...@@ -92,18 +92,16 @@ ...@@ -92,18 +92,16 @@
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p> {{'addprovider.CR Manager' | translate}}</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" 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>
<div class="row">
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p> {{'addprovider.Contact Name' | translate}}</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" tabindex="5">
</div> </div>
<div class="s_error" *ngIf="!providerForm.controls['contact'].valid"> <div class="s_error" *ngIf="!providerForm.controls['contact'].valid">
<div class="s_validation" *ngIf="providerForm.controls['contact'].hasError('pattern')">{{error_msg.pattern}}</div> <div class="s_validation" *ngIf="providerForm.controls['contact'].hasError('pattern')">{{error_msg.pattern}}</div>
...@@ -112,10 +110,13 @@ ...@@ -112,10 +110,13 @@
<div class="s_validation" *ngIf="providerForm.controls['contact'].hasError('required')">{{error_msg.required}} </div> <div class="s_validation" *ngIf="providerForm.controls['contact'].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> {{'addprovider.Phone' | translate}}</p> <p> {{'addprovider.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>
...@@ -131,7 +132,7 @@ ...@@ -131,7 +132,7 @@
<div class="col"> <div class="col">
<div class="provider_data_content"> <div class="provider_data_content">
<p> {{'addprovider.Email id' | translate}}</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" 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>
...@@ -141,6 +142,12 @@ ...@@ -141,6 +142,12 @@
<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="add_provider_btn_bay p0">
<button class="edit_btn floatRight" (click)="goToPage('maker/editprovider')">Edit</button>
<div class="clear"></div>
</div> -->
</div>
</div> </div>
<!-- <div class="row"> <!-- <div class="row">
<div class="col"> <div class="col">
......
...@@ -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> {{'currencyedit.Forex Amount Start From' | translate}}</p> <p> {{'currencyedit.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">
......
...@@ -25,6 +25,7 @@ export class CurrencyEditComponent implements OnInit { ...@@ -25,6 +25,7 @@ export class CurrencyEditComponent implements OnInit {
file: File; file: File;
currency: any; currency: any;
image_url: any; image_url: any;
curr_id: any;
constructor(private router: Router, constructor(private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
...@@ -43,6 +44,7 @@ export class CurrencyEditComponent implements OnInit { ...@@ -43,6 +44,7 @@ export class CurrencyEditComponent implements OnInit {
const parm = decodeURIComponent(this.route.snapshot.params['id']); const parm = decodeURIComponent(this.route.snapshot.params['id']);
// tslint:disable-next-line:radix // tslint:disable-next-line:radix
const id = parseInt(parm); const id = parseInt(parm);
this.curr_id = id;
this.getCurrency(id); this.getCurrency(id);
this.currencyForm = this.formBuilder.group({ this.currencyForm = this.formBuilder.group({
'name': ['', Validators.compose([Validators.required])], 'name': ['', Validators.compose([Validators.required])],
...@@ -76,8 +78,10 @@ export class CurrencyEditComponent implements OnInit { ...@@ -76,8 +78,10 @@ export class CurrencyEditComponent implements OnInit {
this.loader = false; this.loader = false;
console.log(response); console.log(response);
if (response.code === 1) { if (response.code === 1) {
console.log(post_data);
this.success = true; this.success = true;
this.currencySubmit = false; this.currencySubmit = false;
this.getCurrency(this.curr_id);
} 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];
...@@ -92,7 +96,7 @@ export class CurrencyEditComponent implements OnInit { ...@@ -92,7 +96,7 @@ export class CurrencyEditComponent implements OnInit {
prepareSave(formHasImage): any { prepareSave(formHasImage): any {
const input = new FormData(); const input = new FormData();
if(this.file) { if (this.file) {
input.append('flag', this.file); input.append('flag', this.file);
} }
input.append('name', formHasImage.name); input.append('name', formHasImage.name);
...@@ -105,6 +109,7 @@ export class CurrencyEditComponent implements OnInit { ...@@ -105,6 +109,7 @@ export class CurrencyEditComponent implements OnInit {
} }
getCurrency(id) { getCurrency(id) {
console.log(id);
this.loader = true; this.loader = true;
this.funcName = 'currency_details'; this.funcName = 'currency_details';
const post_data = {'currency_id': id}; const post_data = {'currency_id': id};
...@@ -113,13 +118,14 @@ export class CurrencyEditComponent implements OnInit { ...@@ -113,13 +118,14 @@ export class CurrencyEditComponent implements OnInit {
console.log(response); console.log(response);
if (response.code === 1) { if (response.code === 1) {
this.currency = response.responseResult; this.currency = response.responseResult;
console.log(this.currency);
this.image_url = this.currency.flag; this.image_url = this.currency.flag;
this.currencyForm.patchValue({ this.currencyForm.patchValue({
name: this.currency.name, name: this.currency.name,
symbol: this.currency.symbol, symbol: this.currency.symbol,
rate: this.currency.rate, rate: this.currency.rate,
start_from: this.currency.start_from, start_from: this.currency.start_from,
flag: this.currency.flag flag: ''
}); });
} else { } else {
this.error = true; this.error = true;
...@@ -148,4 +154,10 @@ export class CurrencyEditComponent implements OnInit { ...@@ -148,4 +154,10 @@ export class CurrencyEditComponent implements OnInit {
this.service.logout(); this.service.logout();
} }
goToPage(path: any, data = null) {
console.log(data);
this.router.navigateByUrl(path, {queryParams: data});
document.body.scrollTop = document.documentElement.scrollTop = 0;
}
} }
...@@ -140,6 +140,26 @@ ...@@ -140,6 +140,26 @@
</div> </div>
</div> --> </div> -->
</div> </div>
<div class="row">
<div class="col">
<div class="provider_data_content">
<p>{{'editprovider.Merchant ID' | translate}}</p>
<input class="provider_input" placeholder="" type="text" formControlName="merchant_id">
</div>
<div class="s_error" *ngIf="!providerForm.controls['merchant_id'].valid && providerSubmit">
<div class="s_validation" *ngIf="providerForm.controls['merchant_id'].hasError('required')">{{error_msg.required}} </div>
</div>
</div>
<div class="col"></div>
<div class="col"></div>
<!-- <div class="col">
<div class="provider_data_content">
<p></p>
<div class="edit_delivery">Edit Delivery Driver</div>
</div>
</div> -->
</div>
<div class="row" *ngIf="provider"> <div class="row" *ngIf="provider">
<div class="col"> <div class="col">
<div class="add_provider_btn_bay"> <div class="add_provider_btn_bay">
......
...@@ -58,6 +58,7 @@ export class EditforexComponent implements OnInit { ...@@ -58,6 +58,7 @@ export class EditforexComponent implements OnInit {
'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])],
'merchant_id': ['', Validators.compose([Validators.required])],
'status': [''], 'status': [''],
}); });
} }
...@@ -104,6 +105,7 @@ export class EditforexComponent implements OnInit { ...@@ -104,6 +105,7 @@ export class EditforexComponent implements OnInit {
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, status: this.provider.status,
merchant_id: this.provider.merchant_id,
users_id: this.provider.users_id users_id: this.provider.users_id
}); });
} else { } else {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<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> {{'editprovider.Success!' | translate}}</strong> {{'editprovider.Provider updated successfully' | translate}} <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>
......
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
<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> {{'forexprovider.Success!' | translate}}</strong> {{'forexprovider.Forex provider removed successfully' | translate}} <strong> {{'forexprovider.Success!' | translate}}</strong> {{'forexprovider.Forex provider removed successfully' | translate}}
</div> </div>
<div class="row">
<div class="col"></div>
<div class="col" style="text-align: right"><input type="text" placeholder="{{'manageprovider.Search...' | translate}}" (input)="onSearchChange($event.target.value)" /></div>
</div>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
...@@ -64,6 +68,12 @@ ...@@ -64,6 +68,12 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="forex_pagination" *ngIf="meta">
<ul>
<li *ngFor="let i of getNumber(meta.total_pages); let j = index" [ngClass]="{'activeClass': meta.current_page == j+1}" (click)="getProvider(j+1)">{{j+1}}</li>
</ul>
</div>
<ng-template #noProvider></ng-template> <ng-template #noProvider></ng-template>
</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';
...@@ -16,30 +16,51 @@ export class ForexproviderComponent implements OnInit { ...@@ -16,30 +16,51 @@ export class ForexproviderComponent implements OnInit {
error: boolean; error: boolean;
success: boolean; success: boolean;
loader: boolean; loader: boolean;
meta: any;
page_number: any;
searchtxt: any;
@ViewChild('search') search: 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 = '';
this.error = false; this.error = false;
this.success = false; this.success = false;
this.loader = false; this.loader = false;
this.page_number = 1;
this.searchtxt = '';
} }
ngOnInit() { ngOnInit() {
this.getProvider(); this.getProvider(1);
} }
getProvider() { getProvider(page_number: number) {
this.page_number = page_number;
this.loader = true; this.loader = true;
this.fname = 'all_providers'; this.fname = 'all_providers';
const post_data = {'type': 2}; const post_data = {'type': 2, 'page': page_number, 'searchtxt': this.searchtxt};
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);
if (response.code === 1) { if (response.code === 1) {
this.providerList = response.responseResult; this.providerList = response.responseResult.data;
this.meta = response.responseResult.meta;
console.log(this.meta);
} else {
if (response.errorCode === 'ER36') {
this.page_number = this.page_number - 1;
if (this.page_number >= 1) {
this.getProvider(this.page_number);
} else {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
this.providerList = [];
}
} 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];
this.providerList = [];
}
} }
}, (error) => { }, (error) => {
this.error = true; this.error = true;
...@@ -57,6 +78,15 @@ export class ForexproviderComponent implements OnInit { ...@@ -57,6 +78,15 @@ export class ForexproviderComponent implements OnInit {
this.success = false; this.success = false;
} }
getNumber(num) {
return new Array(num);
}
onSearchChange(text: string) {
this.searchtxt = text;
this.getProvider(1);
}
deleteClick(provider_id: any) { deleteClick(provider_id: any) {
this.reset(); this.reset();
const res = confirm('Do you want to remove this user ?'); const res = confirm('Do you want to remove this user ?');
...@@ -70,7 +100,7 @@ export class ForexproviderComponent implements OnInit { ...@@ -70,7 +100,7 @@ export class ForexproviderComponent implements OnInit {
if (response.code === 1) { if (response.code === 1) {
this.success = true; this.success = true;
console.log(this.success); console.log(this.success);
this.getProvider(); this.getProvider(this.page_number);
} 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];
......
...@@ -31,6 +31,10 @@ ...@@ -31,6 +31,10 @@
<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> {{'manageprovider.Success!' | translate}}</strong>{{'manageprovider.Delivery provider removed successfully' | translate}} <strong> {{'manageprovider.Success!' | translate}}</strong>{{'manageprovider.Delivery provider removed successfully' | translate}}
</div> </div>
<div class="row">
<div class="col"></div>
<div class="col" style="text-align: right"><input type="text" (input)="onSearchChange($event.target.value)" placeholder="{{'manageprovider.Search...' | translate}}" /></div>
</div>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
...@@ -64,6 +68,11 @@ ...@@ -64,6 +68,11 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="forex_pagination" *ngIf="meta">
<ul>
<li *ngFor="let i of getNumber(meta.total_pages); let j = index" [ngClass]="{'activeClass': meta.current_page == j+1}" (click)="getProvider(j+1)">{{j+1}}</li>
</ul>
</div>
<ng-template #noProvider></ng-template> <ng-template #noProvider></ng-template>
</div> </div>
</div> </div>
......
...@@ -16,30 +16,50 @@ export class ManageproviderComponent implements OnInit { ...@@ -16,30 +16,50 @@ export class ManageproviderComponent implements OnInit {
error: boolean; error: boolean;
success: boolean; success: boolean;
loader: boolean; loader: boolean;
page_number: any;
meta: any;
searchtxt: 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 = '';
this.error = false; this.error = false;
this.success = false; this.success = false;
this.loader = false; this.loader = false;
this.page_number = 1;
this.searchtxt = '';
} }
ngOnInit() { ngOnInit() {
this.getProvider(); this.getProvider(1);
} }
getProvider() { getProvider(page_number: number) {
console.log(page_number);
this.page_number = page_number;
this.loader = true; this.loader = true;
this.fname = 'all_providers'; this.fname = 'all_providers';
const post_data = {'type': 3}; const post_data = {'type': 3, 'page': page_number, 'searchtxt': this.searchtxt};
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);
if (response.code === 1) { if (response.code === 1) {
this.providerList = response.responseResult; this.providerList = response.responseResult.data;
this.meta = response.responseResult.meta;
} else {
if (response.errorCode === 'ER36') {
this.page_number = this.page_number - 1;
if (this.page_number >= 1) {
this.getProvider(this.page_number);
} else {
this.error = true;
this.responseMsg = this.vs.errorCode[this.lang][response.errorCode];
this.providerList = [];
}
} 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];
this.providerList = [];
}
} }
}, (error) => { }, (error) => {
this.error = true; this.error = true;
...@@ -58,6 +78,15 @@ export class ManageproviderComponent implements OnInit { ...@@ -58,6 +78,15 @@ export class ManageproviderComponent implements OnInit {
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
} }
onSearchChange(text: string) {
this.searchtxt = text;
this.getProvider(1);
}
getNumber(num) {
return new Array(num);
}
reset() { reset() {
this.error = false; this.error = false;
this.success = false; this.success = false;
...@@ -76,7 +105,7 @@ export class ManageproviderComponent implements OnInit { ...@@ -76,7 +105,7 @@ export class ManageproviderComponent implements OnInit {
if (response.code === 1) { if (response.code === 1) {
this.success = true; this.success = true;
console.log(this.success); console.log(this.success);
this.getProvider(); this.getProvider(this.page_number);
} 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];
......
...@@ -8,14 +8,42 @@ ...@@ -8,14 +8,42 @@
{{'forgot.Forgot your PIN' | translate}} {{'forgot.Forgot your PIN' | translate}}
</h6> </h6>
<div class="login_inner_content"> <div class="login_inner_content">
<form [formGroup]="forgotForm" autocomplete="off">
<br> <br>
<div class="login_row"> <div class="login_row">
<input class="" placeholder=" {{'forgot.Email Address' | translate}}"> <input class="" placeholder=" {{'forgot.Phone Number (96655XXXXXXX)' | translate}}" formControlName="phone">
<div class="s_error" *ngIf="!forgotForm.controls['phone'].valid && forgotSubmit">
<div class="s_validation" *ngIf="forgotForm.controls['phone'].hasError('required')">{{error_msg.required}} </div>
</div> </div>
<div class="s_error" *ngIf="!forgotForm.controls['phone'].valid && forgotForm.controls['phone'].touched">
<div class="s_validation" *ngIf="forgotForm.controls['phone'].hasError('pattern')">{{error_msg.phone}}</div>
</div>
<div class="s_error" *ngIf="!forgotForm.controls['phone'].valid && forgotForm.controls['phone'].touched && !forgotForm.controls['phone'].hasError('pattern')">
<div class="s_validation" *ngIf="forgotForm.controls['phone'].hasError('maxlength')">{{error_msg.maxLength}} 11</div>
<div class="s_validation" *ngIf="forgotForm.controls['phone'].hasError('minlength')">{{error_msg.minLength}} 9</div>
</div>
</div>
<div class="login_row" *ngIf="success">
<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" #focus2 (keydown.backspace)="processBack($event, focus1)" (keyup)="processKeyUp($event, focus3)">
<input class="log_pin" type="password" maxlength="1" #focus3 (keydown.backspace)="processBack($event, focus2)" (keyup)="processKeyUp($event, focus4)">
<input class="log_pin" type="password" maxlength="1" #focus4 (keydown.backspace)="processBack($event, focus3)" (keyup)="processKeyUp($event, focus5)">
<input class="log_pin" type="password" maxlength="1" #focus5 (keydown.backspace)="processBack($event, focus4)" (keyup)="processKeyUp($event, focus6)">
<input class="log_pin m0" type="password" maxlength="1" #focus6 (keydown.backspace)="processBack($event, focus5)">
</div>
</div>
<div *ngIf="error" class="s_validation">{{responseError}}</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)="reqOtp()" *ngIf="!success">{{'forgot.SEND OTP' | translate}}</button>
<div class="row">
<div class="col"><button class="login_btn" (click)="verifyOtp()" *ngIf="success">{{'forgot.Verify OTP' | translate}}</button></div>
<div class="col"><button class="login_btn" (click)="reqOtp()" *ngIf="success">{{'forgot.Resend' | translate}}</button></div>
</div>
</div> </div>
</form>
</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 { ValidationService } from './../../providers/validation.service';
import { FormControl, FormGroup, FormBuilder, Validators, ValidationErrors } from '@angular/forms';
@Component({ @Component({
selector: 'app-forgot', selector: 'app-forgot',
...@@ -8,15 +11,155 @@ import { Router,ActivatedRoute } from '@angular/router'; ...@@ -8,15 +11,155 @@ import { Router,ActivatedRoute } from '@angular/router';
}) })
export class ForgotComponent implements OnInit { export class ForgotComponent implements OnInit {
constructor(private router: Router,private route: ActivatedRoute) { } forgotForm: FormGroup;
mobnumPattern = '^((\\+?)|0)?[0-9]{9,11}$';
forgotSubmit: boolean;
lang = 'en';
error_msg: any[];
funcName: any;
loader: boolean;
responseError: any;
error: boolean;
success: boolean;
otpErr: boolean;
otpError: boolean;
forgotMsg: any;
@ViewChild('focus1') focus1: ElementRef;
@ViewChild('focus2') focus2: ElementRef;
@ViewChild('focus3') focus3: ElementRef;
@ViewChild('focus4') focus4: ElementRef;
@ViewChild('focus5') focus5: ElementRef;
@ViewChild('focus6') focus6: ElementRef;
constructor(
private router: Router,
private route: ActivatedRoute,
public vs: ValidationService,
public service: WebService,
private formBuilder: FormBuilder
) {
this.otpErr = false;
this.otpError = false;
this.error_msg = this.vs.errorList[this.lang];
}
ngOnInit() { ngOnInit() {
this.forgotForm = this.formBuilder.group({
// tslint:disable-next-line:max-line-length
'phone': ['', Validators.compose([Validators.required, Validators.minLength(8), Validators.maxLength(15), Validators.pattern(this.mobnumPattern)])],
});
} }
goToPage(path,data=null){ goToPage(path: any, data = null){
console.log(data) console.log(data);
this.router.navigateByUrl(path,{queryParams:data}); this.router.navigateByUrl(path, {queryParams:data});
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
} }
reqOtp() {
const This = this;
this.error = false;
this.success = false;
this.forgotSubmit = true;
if (this.forgotForm.valid) {
this.loader = true;
const providerObj = this.forgotForm.value;
this.funcName = 'send_otp';
this.service.post_data(this.funcName, providerObj).subscribe(response => {
this.loader = false;
console.log(response);
if (response.code === 1) {
this.success = true;
this.forgotSubmit = false;
this.reset();
} 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');
}
processKeyUp(e: any, el: any) {
console.log(e.keyCode);
if ((e.keyCode >= 48 && e.keyCode <= 57) || (e.keyCode >= 96 && e.keyCode <= 105)) {
el.focus();
} else {
if (e.keyCode !== 8) {
e.target.value = '';
}
}
}
reset() {
if (this.focus1) {
this.focus1.nativeElement.value = '';
this.focus2.nativeElement.value = '';
this.focus3.nativeElement.value = '';
this.focus4.nativeElement.value = '';
this.focus5.nativeElement.value = '';
this.focus6.nativeElement.value = '';
}
}
processBack (e: any, el: any) {
console.log(e);
if (e.keyCode === 8) {
e.target.value = '';
el.focus();
}
}
verifyOtp() {
const password = [];
password[0] = this.focus1.nativeElement.value;
password[1] = this.focus2.nativeElement.value;
password[2] = this.focus3.nativeElement.value;
password[3] = this.focus4.nativeElement.value;
password[4] = this.focus5.nativeElement.value;
password[5] = this.focus6.nativeElement.value;
const pass = password.join('');
const phone = this.forgotForm.value['phone'];
if (phone === '') {
if (pass === '') {
this.otpErr = true;
}
return false;
}
for (const i in password) {
if (password[i] === '') {
this.otpErr = true;
return false;
}
}
this.loader = true;
this.funcName = 'otp_verify';
const post_data = {'phone': phone, 'otp': pass};
this.service.post_data(this.funcName, post_data).subscribe(response => {
this.loader = false;
console.log(response);
if (response.code === 1) {
const responseData = response.responseResult;
this.router.navigate(['start/newpin/' + responseData.user_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'];
});
}
} }
<div class="custom_loader_wrapper" *ngIf="loader">
<div class="custom_loader_ring"></div>
</div>
<div class="login_wrapper"> <div class="login_wrapper">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
......
...@@ -31,6 +31,7 @@ export class LoginComponent implements OnInit { ...@@ -31,6 +31,7 @@ export class LoginComponent implements OnInit {
loginError: boolean; loginError: boolean;
loginMsg: any; loginMsg: any;
loginDetails: any; loginDetails: any;
loader: boolean;
val = 0; val = 0;
constructor( constructor(
private router: Router, private router: Router,
...@@ -39,14 +40,12 @@ export class LoginComponent implements OnInit { ...@@ -39,14 +40,12 @@ export class LoginComponent implements OnInit {
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;
this.loginSubmit = false; this.loginSubmit = false;
this.loginError = false; this.loginError = false;
this.loader = false;
this.subjectService.getLoginData().subscribe(loginData => { this.subjectService.getLoginData().subscribe(loginData => {
this.loginDetails = JSON.parse(this.service.getLocalStorageItem('userData')); this.loginDetails = JSON.parse(this.service.getLocalStorageItem('userData'));
...@@ -61,16 +60,6 @@ export class LoginComponent implements OnInit { ...@@ -61,16 +60,6 @@ export class LoginComponent implements OnInit {
} }
} }
}); });
/* this.subjectService.getisLoggined().subscribe(isLoggined => {
console.log(isLoggined);
if (isLoggined != null) {
if (isLoggined === 'not_loggedIn') {
this.router.navigate(['/start/login']);
}
}
}); */
} }
ngOnInit() { ngOnInit() {
...@@ -133,9 +122,12 @@ export class LoginComponent implements OnInit { ...@@ -133,9 +122,12 @@ export class LoginComponent implements OnInit {
} }
} }
this.loader = true;
this.fname = 'admin_login'; this.fname = 'admin_login';
const post_data = {'email_id': this.model.email_id, 'password': pass}; const post_data = {'email_id': this.model.email_id, 'password': pass};
this.service.post_data(this.fname, post_data).subscribe(response => { this.service.post_data(this.fname, post_data).subscribe(response => {
this.loader = false;
console.log(response); console.log(response);
if (response.code === 1) { if (response.code === 1) {
const responseData = response.responseResult; const responseData = response.responseResult;
......
...@@ -9,49 +9,47 @@ ...@@ -9,49 +9,47 @@
<br> <br>
<div class="login_row"> <div class="login_row">
<p>{{'newpin.New PIN' | translate}}</p> <p>{{'changepin.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" #new1 (keyup)="processKeyUp($event, new2)">
<input class="log_pin" type="password" maxlength="1" value="0"> <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" value="0"> <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" value="0"> <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" value="0"> <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" value="0"> <input class="log_pin m0" type="password" maxlength="1" #new6 (keydown.backspace)="processBack($event, new5)">
<!-- <input class="log_pin" placeholder="*" type="password" maxlength="1">
<input class="log_pin" placeholder="*" type="password" maxlength="1">
<input class="log_pin" placeholder="*" type="password" maxlength="1">
<input class="log_pin" placeholder="*" type="password" maxlength="1">
<input class="log_pin" placeholder="*" type="password" maxlength="1">
<input class="log_pin" placeholder="*" type="password" maxlength="1"> -->
</div> </div>
</div> </div>
<div class="s_error" *ngIf="newpasswordErr">
<div class="s_validation">{{error_msg.password}} </div>
</div>
<div class="login_row"> <div class="login_row">
<p> {{'newpin.Confirm PIN' | translate}}</p> <p> {{'changepin.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" #conf1 (keyup)="processKeyUp($event, conf2)">
<input class="log_pin" type="password" maxlength="1" value="0"> <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" value="0"> <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" value="0"> <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" value="0"> <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" value="0"> <input class="log_pin m0" type="password" maxlength="1" #conf6 (keydown.backspace)="processBack($event, conf5)">
<!-- <input class="log_pin" placeholder="*" type="password" maxlength="1"> </div>
<input class="log_pin" placeholder="*" type="password" maxlength="1">
<input class="log_pin" placeholder="*" type="password" maxlength="1">
<input class="log_pin" placeholder="*" type="password" maxlength="1">
<input class="log_pin" placeholder="*" type="password" maxlength="1">
<input class="log_pin" placeholder="*" type="password" maxlength="1"> -->
</div> </div>
<div class="s_error" *ngIf="confpasswordErr">
<div class="s_validation">{{error_msg.password}} </div>
</div> </div>
<div class="s_error" *ngIf="notMatchErr">
<div class="s_validation">{{error_msg.confirm}} </div>
</div> </div>
</div> </div>
</div> </div>
<div *ngIf="success" class="s_validation">{{'newpin.Password Reset Successfully' | translate}}</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)="goToPage('start/forgot')">{{'newpin.Cancel' | translate}}</button> <button class="cancel_btn" (click)="goToPage('start/login')">{{'newpin.Cancel' | translate}}</button>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<button class="login_btn" (click)="goToPage('start/login')"> {{'newpin.Save' | translate}}</button> <button class="login_btn" (click)="saveClick()"> {{'newpin.Save' | 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 { ValidationService } from './../../providers/validation.service';
import { SubjectService } from './../../providers/subject.service';
import { WebService } from './../../providers/web.service';
@Component({ @Component({
selector: 'app-newpin', selector: 'app-newpin',
...@@ -8,15 +11,194 @@ import { Router,ActivatedRoute } from '@angular/router'; ...@@ -8,15 +11,194 @@ import { Router,ActivatedRoute } from '@angular/router';
}) })
export class NewpinComponent implements OnInit { export class NewpinComponent implements OnInit {
constructor(private router: Router,private route: ActivatedRoute) { } @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;
user_id: any;
success: boolean;
constructor(
private router: Router,
private route: ActivatedRoute,
public vs: ValidationService,
public service: WebService,
public subjectService: SubjectService
) {
this.error = false;
this.passwordErr = false;
this.newpasswordErr = false;
this.confpasswordErr = false;
this.notMatchErr = false;
this.error_msg = this.vs.errorList[this.lang];
this.user_id = decodeURIComponent(this.route.snapshot.params['id']);
console.log(this.user_id);
this.success = false;
}
ngOnInit() { ngOnInit() {
} }
goToPage(path,data=null){ goToPage(path: any, data = null){
console.log(data) console.log(data);
this.router.navigateByUrl(path,{queryParams:data}); this.router.navigateByUrl(path, {queryParams:data});
document.body.scrollTop = document.documentElement.scrollTop = 0; document.body.scrollTop = document.documentElement.scrollTop = 0;
} }
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 = [];
const This = this;
this.success = false;
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 newpass = newpassword.join('');
const confirmpass = confirm.join('');
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;
}
}
if (this.error === true) {
return false;
}
this.fname = 'confirm_pin';
const post_data = {'user_id': this.user_id, '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();
this.success = true;
setTimeout(function(){
This.router.navigate(['start/login/']);
}, 2000);
} 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 = '';
}
} }
...@@ -28,7 +28,7 @@ const ModuleRoutes: Routes = [ ...@@ -28,7 +28,7 @@ const ModuleRoutes: Routes = [
component: ForgotComponent, component: ForgotComponent,
}, },
{ {
path: "newpin", path: "newpin/:id",
component: NewpinComponent, component: NewpinComponent,
}, },
{ {
......
...@@ -172,7 +172,8 @@ ...@@ -172,7 +172,8 @@
"Cancel":"Cancel", "Cancel":"Cancel",
"Forex Provider":"Forex Provider", "Forex Provider":"Forex Provider",
"Status":"Status", "Status":"Status",
"Delivery Provider":"Delivery Provider" "Delivery Provider":"Delivery Provider",
"Merchant ID": "Merchant ID"
}, },
"forexprovider":{ "forexprovider":{
"Forex Provider":"Forex Provider", "Forex Provider":"Forex Provider",
...@@ -318,7 +319,20 @@ ...@@ -318,7 +319,20 @@
"Assign":"Assign", "Assign":"Assign",
"Cancel":"Cancel", "Cancel":"Cancel",
"Provider": "Provider", "Provider": "Provider",
"Config": "Config" "Config": "Config",
"No Drivers available currently!":"No Drivers available currently!"
},
"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"
} }
} }
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
}, },
"forgot":{ "forgot":{
"Forgot your PIN": "Forgot your PIN", "Forgot your PIN": "Forgot your PIN",
"Email Address": "Email Address", "Phone Number (96655XXXXXXX)": "Phone Number (96655XXXXXXX)",
"SEND ME THE LINK": "SEND ME THE LINK" "SEND OTP": "SEND OTP",
"Verify OTP": "Verify OTP",
"Resend": "Resend"
}, },
"invalid":{ "invalid":{
"Access Denied": "Access Denied", "Access Denied": "Access Denied",
...@@ -19,7 +21,8 @@ ...@@ -19,7 +21,8 @@
"New PIN": "New PIN", "New PIN": "New PIN",
"Confirm PIN": "Confirm PIN", "Confirm PIN": "Confirm PIN",
"Cancel": "Cancel", "Cancel": "Cancel",
"Save": "Save" "Save": "Save",
"Password Reset Successfully": "Password Reset Successfully"
}, },
"addforex":{ "addforex":{
"Forex Delivery Service Provider" :"Forex Provider", "Forex Delivery Service Provider" :"Forex Provider",
...@@ -107,7 +110,7 @@ ...@@ -107,7 +110,7 @@
"Flag":"Flag", "Flag":"Flag",
"Choose Flag":"Choose Flag", "Choose Flag":"Choose Flag",
"Rate":"Rate", "Rate":"Rate",
"Forex Amount Start From":"Forex Amount Start From", "Forex Multiple":"Forex Multiple",
"Cancel":"Cancel", "Cancel":"Cancel",
"Save":"Save" "Save":"Save"
}, },
...@@ -158,8 +161,8 @@ ...@@ -158,8 +161,8 @@
"Logout":"Logout", "Logout":"Logout",
"Change PIN":"Change PIN", "Change PIN":"Change PIN",
"Edit Delivery Service Provider":"Edit Delivery Service Provider", "Edit Delivery Service Provider":"Edit Delivery Service Provider",
"Warning!":"Warning!", "Warning":"Warning",
"Success!":"Success!", "Success":"Success",
"Provider updated successfully":"Provider updated successfully", "Provider updated successfully":"Provider updated successfully",
"Provider Name":"Provider Name", "Provider Name":"Provider Name",
"Location":"Location", "Location":"Location",
...@@ -172,7 +175,8 @@ ...@@ -172,7 +175,8 @@
"Cancel":"Cancel", "Cancel":"Cancel",
"Forex Provider":"Forex Provider", "Forex Provider":"Forex Provider",
"Status":"Status", "Status":"Status",
"Delivery Provider":"Delivery Provider" "Delivery Provider":"Delivery Provider",
"Merchant ID": "Merchant ID"
}, },
"forexprovider":{ "forexprovider":{
"Forex Provider":"Forex Provider", "Forex Provider":"Forex Provider",
...@@ -216,7 +220,8 @@ ...@@ -216,7 +220,8 @@
"CR ID":"CR ID", "CR ID":"CR ID",
"Contact Name":"Contact Name", "Contact Name":"Contact Name",
"Phone":"Phone", "Phone":"Phone",
"Email ID":"Email ID" "Email ID":"Email ID",
"Search...": "Search..."
}, },
"adddriver":{ "adddriver":{
"Driver Management":"Driver Management", "Driver Management":"Driver Management",
...@@ -306,7 +311,7 @@ ...@@ -306,7 +311,7 @@
"Warning":"Warning", "Warning":"Warning",
"Success":"Success", "Success":"Success",
"Forex provider removed successfully":"Forex provider removed successfully", "Forex provider removed successfully":"Forex provider removed successfully",
"User Info":"User name", "Customer":"Customer",
"Phone":"Phone", "Phone":"Phone",
"Location":"Location", "Location":"Location",
"Amount":"Amount", "Amount":"Amount",
...@@ -318,7 +323,9 @@ ...@@ -318,7 +323,9 @@
"Assign":"Assign", "Assign":"Assign",
"Cancel":"Cancel", "Cancel":"Cancel",
"Provider": "Provider", "Provider": "Provider",
"Config": "Config" "Config": "Config",
"Pincode": "Pincode",
"No Drivers available currently!":"No Drivers available currently!"
}, },
"service": { "service": {
"Configuration":"Configuration", "Configuration":"Configuration",
...@@ -330,7 +337,11 @@ ...@@ -330,7 +337,11 @@
"Airport Delivery":"Airport Delivery", "Airport Delivery":"Airport Delivery",
"Hand Delivery":"Hand Delivery", "Hand Delivery":"Hand Delivery",
"Tax":"Tax", "Tax":"Tax",
"Save":"Save" "Save":"Save",
"Cancel": "Cancel",
"Success": "Success",
"Home": "Home",
"Logout": "Logout"
} }
} }
export const ImageStorage = 'http://forex.nuvento.com/'; // export const ImageStorage = 'https://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 = 'https://forex.nuvento.com/api/';
...@@ -631,8 +631,13 @@ section.module.parallax { ...@@ -631,8 +631,13 @@ section.module.parallax {
display: inline-block; display: inline-block;
width: 100px; width: 100px;
height: 100px; height: 100px;
background: url("./assets/images/loader.gif");
background-position: center;
background-repeat: no-repeat;
background-size: 90px;
} }
.custom_loader_ring:after { /* .custom_loader_ring:after {
content: " "; content: " ";
display: block; display: block;
width: 100px; width: 100px;
...@@ -650,7 +655,7 @@ section.module.parallax { ...@@ -650,7 +655,7 @@ section.module.parallax {
100% { 100% {
transform: rotate(360deg); transform: rotate(360deg);
} }
} } */
.logout{ .logout{
background: transparent; background: transparent;
......
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