family add

This commit is contained in:
CHIEFSOFT\ameye
2023-12-16 13:06:41 -05:00
parent ac434ac590
commit 617f27999c
5 changed files with 169 additions and 18 deletions
@@ -5,11 +5,21 @@
<div *ngIf="isModalOpenBackdrop==true">
<div style="background-color: aliceblue; border-radius: 10px; padding: 10px; margin-top: 10px;">
<ion-item lines="none">
<ion-input type="text" maxlength="15" placeholder="Firstname" [(ngModel)]='firstname' ></ion-input>
<ion-input type="text"
maxlength="15"
placeholder="Firstname"
style="background-color: aliceblue; border-radius: 10px;"
(ionChange)="verifyEntry()"
[(ngModel)]='firstname' ></ion-input>
</ion-item>
<ion-item lines="none">
<ion-input type="text" maxlength="15" placeholder="lastname" [(ngModel)]='lastname' ></ion-input>
<ion-input type="text"
maxlength="15"
placeholder="lastname"
style="background-color: aliceblue; border-radius: 10px;"
(ionChange)="verifyEntry()"
[(ngModel)]='lastname' ></ion-input>
</ion-item>
<ion-item lines="none">
@@ -17,25 +27,68 @@
</ion-item>
<ion-item lines="none">
<ion-grid>
<ion-row style="margin: 0px; padding: 0px;">
<ion-col style="margin: 0px; padding: 0px; background-color: #0b5e86;">
<ion-select aria-label="Month" value="apple" style=" background-color: aliceblue; border-radius: 5px; width: 100%; font-size: 12px;">
<ion-select-option *ngFor="let item of regMonth" value="apple">{{item}}</ion-select-option>
</ion-select>
</ion-col>
<ion-col style="margin: 0px; padding: 0px; background-color: #0b5e86;">
<ion-select aria-label="Year" value="apple" style=" background-color: aliceblue; border-radius: 5px; width: 100%; font-size: 12px;">
<ion-select-option *ngFor="let item of regYear" value="{{item}}">{{item}}</ion-select-option>
</ion-select>
<ion-col style="margin: 0px; padding: 4px;">
<div style="width: 100%; background-color: #8b198e;">
<div style="width: 30%; float: left;">
Year
</div>
<div style="width: 70%; float: right;">
<ion-select aria-label="Year"
(ionChange)="verifyEntry()"
[(ngModel)]='year'
style="background-color: aliceblue; border-radius: 10px; font-size: 12px; width:100%;">
<ion-select-option *ngFor="let item1 of regYear" value="{{item1}}">{{item1}}</ion-select-option>
</ion-select>
</div>
</div>
</ion-col>
</ion-row>
<ion-row style="margin: 0px; padding: 0px;">
<ion-col style="margin: 0px; padding: 4px; ">
<div style="width: 100%; background-color: #8b198e;">
<div style="width: 30%; float: left;">
Month
</div>
<div style="width: 70%; float: right;">
<ion-select aria-label="Month"
(ionChange)="verifyEntry()"
[(ngModel)]='month'
expand="block"
style="background-color: aliceblue; border-radius: 10px; width: 100%; font-size: 12px;">
<ion-select-option *ngFor="let item of regMonth;" value="{{item[0]}}">{{item[1]}}</ion-select-option>
</ion-select>
</div>
</div>
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
<div style="text-align: right;">
{{profileMessage}}
<ion-button shape="round" size="small" (click)="sendUpdateProfile()">Add</ion-button>
{{addFamilyResult}}
<ion-button shape="round"
[disabled]="isDisabled"
size="small"
(click)="addFamilyMember()">Add</ion-button>
</div>
</div>
@@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit, ViewChild} from '@angular/core';
import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WrenchService} from "../../services/wrench.service";
import {LoadingController} from "@ionic/angular";
@Component({
selector: 'app-add-family',
@@ -10,9 +11,18 @@ import {WrenchService} from "../../services/wrench.service";
export class AddFamilyComponent implements OnInit {
isModalOpen:boolean = false;
isModalOpenBackdrop:boolean = false;
@ViewChild('firstname') firstname;
@ViewChild('lastname') lastname;
@ViewChild('month') month;
@ViewChild('year') year;
addFamilyResult:string='';
constructor(
public sessionDataProviderService: SessionDataProviderService,
private wrenchService: WrenchService
private wrenchService: WrenchService,
private loadingCtrl: LoadingController
) { }
regMonth:any;
@@ -20,7 +30,7 @@ export class AddFamilyComponent implements OnInit {
ngOnInit() {
this.regMonth=this.sessionDataProviderService.getMonths();
this.regYear = this.sessionDataProviderService.getChildAddYears();
// debugger;
//debugger;
}
@@ -37,4 +47,72 @@ export class AddFamilyComponent implements OnInit {
},1000);
}
isDisabled:boolean= true;
verifyEntry(){
this.isDisabled= true;
if ( this.firstname.length> 1 && this.lastname.length> 1 && this.month> 0 && this.year> 0 ){
this.isDisabled= false;
}
}
/*
'member_id' => int 1
'sessionid' => string '9C780E24425EBE70E1AE3D385193E6FF0DF839A5CA62CD6A6DCE9A5065530968' (length=64)
'uid' => string '3119b744-42ad-4834-bb83-b737588754ca' (length=36)
'firstname' => string 'First406' (length=8)
'lastname' => string 'Last151' (length=7)
'year' => int 2002
'month' => int 8
'action' => int 22015
*/
reqData: {
action:number,
member_id: number,
uid: string,
sessionid: string,
firstname:string,
lastname: string,
month: number,
year: number
};
createFamilyResult:any;
async addFamilyMember(){
const loading = await this.loadingCtrl.create({
message: 'Creating Family Member...',
duration: 5000,
});
this.reqData={
action:22015,
member_id: this.sessionDataProviderService.member_id,
uid: this.sessionDataProviderService.member_uid,
sessionid: this.sessionDataProviderService.session ,
firstname: this.firstname,
lastname: this.lastname,
month: this.month,
year: this.year
}
loading.present();
this.wrenchService.familyAdd(this.reqData).subscribe(
createFamilyResult => {
loading.dismiss();
this.createFamilyResult = createFamilyResult;
console.log("this.wrenchService.createFamilyResult RETURN DATA->", this.createFamilyResult);
if (this.createFamilyResult.internal_return> 0){
this.firstname='';
this.lastname='';
this.createFamilyResult = "Family Added";
setTimeout(()=>{
this.createFamilyResult="";
},3000);
}
}
);
}
}
@@ -83,6 +83,7 @@ export class FamilysettingsPage implements OnInit {
loading.present();
this.wrenchService.uploadFile(this.uploadData).subscribe(
uploadResult => {
loading.dismiss()
this.uploadResult = uploadResult;
console.log("this.wrenchService.uploadFile RETURN DATA->", this.uploadResult);
}
+5
View File
@@ -79,6 +79,11 @@ export class WrenchService {
completeMobileSignup(reqData) {
return this.getPostData('completemobileuser', reqData);
}
//
familyAdd(reqData) {
return this.getPostData('familyadd', reqData);
}
referHx(reqData) {
return this.getPostData('refferhx', reqData);
+16 -2
View File
@@ -84,8 +84,22 @@ export class SessionDataProviderService {
session_contructed:boolean = false;
getMonths(){
return ["January","February","March","April","May","June","July",
"August","September","October","November","December"];
// return ["January","February","March","April","May","June","July",
// "August","September","October","November","December"];
return [
[ 1, 'January'],
[ 2, 'February'],
[ 3, 'March'],
[ 4, 'April'],
[ 5, 'May'],
[ 6, 'June'],
[ 7, 'July'],
[ 8, 'August'],
[ 9, 'September'],
[ 10, 'October'],
[ 11, 'November'],
[ 12, 'December']
];
}
getChildAddYears(){
var currY = new Date().getFullYear();