diff --git a/src/pages/otp/otp.html b/src/pages/otp/otp.html index bf0ebe9e..5c5abb16 100755 --- a/src/pages/otp/otp.html +++ b/src/pages/otp/otp.html @@ -57,28 +57,40 @@ - + -

OTP

+

With out OTP Reason

+
+ - - + + + + {{otp.rejection_reason}} + + + {{reason}} + + +
- + + diff --git a/src/pages/otp/otp.ts b/src/pages/otp/otp.ts index 4b6807e3..e687faf8 100755 --- a/src/pages/otp/otp.ts +++ b/src/pages/otp/otp.ts @@ -5,6 +5,8 @@ import { PdQuestionCategoryPage } from '../pd-question-category/pd-question-cate import { ToastProvider } from '../../providers/common-provider/toast'; import { ConstantsProvider } from '../../providers/constants/constants'; import { AwsServiceProvider } from '../../providers/aws-service/aws-service'; +import { QuestionCategoryProvider } from '../../providers/question-category/question-category'; +import { FormGroup, FormBuilder, Validators } from '@angular/forms'; /** @@ -22,6 +24,8 @@ import { AwsServiceProvider } from '../../providers/aws-service/aws-service'; export class OtpPage { + timeLimit: any; + reason_otp: any; users: any; timerOn: boolean = true; balance_time: string; @@ -31,9 +35,17 @@ export class OtpPage { applicatentDetails: any; commonImage:any; maxtime: any=30; - constructor(public navCtrl: NavController, public navParams: NavParams,public pddetails:PdtriggerProvider,public toast:ToastProvider,public Menu:MenuController,public commonconstant:ConstantsProvider,public aws:AwsServiceProvider,public alertCtrl:AlertController) { + + reasonForm:FormGroup + constructor(public navCtrl: NavController, public navParams: NavParams,public pddetails:PdtriggerProvider,public toast:ToastProvider,public Menu:MenuController,public commonconstant:ConstantsProvider,public aws:AwsServiceProvider,public alertCtrl:AlertController,public qustCat:QuestionCategoryProvider,public fb:FormBuilder) { this.commonImage = this.commonconstant.commonimage; this.applicatentDetails = this.navParams.get('pdDetails'); + this.reasonForm = this.fb.group( + { + reason:[null,Validators.compose([Validators.required])], + others_reason:[null], + }) + this.getDropdown(); } ionViewDidLoad() { @@ -41,11 +53,23 @@ export class OtpPage { } ionViewDidEnter(){ //this.Menu.enable(false); - this.timer(5); + this.timer(1); } ionViewWillLeave(){ //this.Menu.enable(true); - + clearTimeout(this.timeLimit); + } + getDropdown() + { + this.qustCat.getcommondrop('OTPREJECTION').subscribe(res=> + { + if(res['dataStatus']==true) + { + this.reason_otp = res['records'].filter(otp=>otp.isactive==1); + // console.log(this.reason_otp); + + } + }) } checkotp(otp) { @@ -73,9 +97,9 @@ export class OtpPage { // var balance_time = m + ':' + s; this.balance_time = m + ':' + s; remaining -=1; - console.log(this.balance_time); + // console.log(this.balance_time); if(remaining >= 0 && this.timerOn) { - setTimeout(()=> { + this.timeLimit = setTimeout(()=> { this.timer(remaining); }, 1000); return; @@ -90,19 +114,19 @@ export class OtpPage { this.users = this.aws.getlocale(); let data:any; let alert = this.alertCtrl.create({ - title: 'Starting PD Officer', - message: 'Do you want sure PD officer Start', + title: 'OTP Expired ', + message: 'Do you want sure resend OTP', buttons: [ { - text: 'No', - role: 'cancel', + text: 'OTP Without Start', + handler: () => { this.otpStatusAccess = false; } }, { - text: 'YES', + text: 'Resend OTP', handler: () => { @@ -122,9 +146,27 @@ export class OtpPage { alert.present(); } - check() + saveotpreasno() { - console.log('check'); + console.log(this.reasonForm.value); + if(this.reasonForm.valid) + { + let data = {'pd_id':this.applicatentDetails.pd_id,'reason':this.reasonForm.value.reason,'other_reason':this.reasonForm.value.others_reason}; + this.pddetails.checkotp(data).subscribe(res=> + { + this.otpStatus = res; + if(this.otpStatus.dataStatus == true) + { + this.navCtrl.setRoot(PdQuestionCategoryPage,{'pdDetails':this.applicatentDetails}); + }else + { + // this.toast.pdTriggerappmessage('Enter the Correct OTP'); + } + }) + }else + { + this.toast.pdTriggerappmessage('Enter The All Field'); + } } } diff --git a/src/pages/pd-general-images/pd-general-images.html b/src/pages/pd-general-images/pd-general-images.html index 81ba5324..fb1d2864 100644 --- a/src/pages/pd-general-images/pd-general-images.html +++ b/src/pages/pd-general-images/pd-general-images.html @@ -24,11 +24,29 @@ -
- {{img.name}} -
+
+ + +
+
+ {{img.Name}} +
+ + + + - + + + + + + + + diff --git a/src/pages/pd-general-images/pd-general-images.ts b/src/pages/pd-general-images/pd-general-images.ts index aa6a79a3..8bf70f8f 100644 --- a/src/pages/pd-general-images/pd-general-images.ts +++ b/src/pages/pd-general-images/pd-general-images.ts @@ -1,6 +1,8 @@ import { Component } from '@angular/core'; import { IonicPage, NavController, NavParams } from 'ionic-angular'; import { CameraProvider } from '../../providers/common-provider/camera'; +import { QuestionCategoryProvider } from '../../providers/question-category/question-category'; +import { ToastProvider } from '../../providers/common-provider/toast'; /** * Generated class for the PdGeneralImagesPage page. @@ -19,9 +21,13 @@ export class PdGeneralImagesPage { cameraArr:any = []; applicatentDetails: any; count:any = 0; - constructor(public navCtrl: NavController, public navParams: NavParams,public camera:CameraProvider) { + saveAccess:boolean =false; + FormId:any = ''; + constructor(public navCtrl: NavController, public navParams: NavParams,public camera:CameraProvider,public qustCat:QuestionCategoryProvider,public toast:ToastProvider) { this.applicatentDetails = this.navParams.get('pdDetails'); + this.FormId = this.navParams.get('FormId'); + } ionViewDidLoad() { @@ -34,7 +40,7 @@ export class PdGeneralImagesPage { { this.count = this.count+1; - this.cameraArr.push({'image':image,'name':'images-'+this.count}); + this.cameraArr.push({'image':image,'name':''}); }); } @@ -44,4 +50,26 @@ export class PdGeneralImagesPage { this.cameraArr.splice(i,1); } + docnames(doc,i,img) + { + + this.cameraArr[i] = {'image':img,'Name':doc}; + // console.log(JSON.stringify(this.pddocdata)); + } + savePDImages() + { + + this.saveAccess = true; + let records :any = {'pd_id':this.applicatentDetails.pd_id,'formid':''}; + records.images = this.cameraArr; + this.qustCat.savePDImages(records).subscribe(res=> + { + if(res['dataStatus']==true){ + this.saveAccess = false; + this.navCtrl.pop(); + this.toast.pdTriggerappmessage('Record Saved Successfully.!'); + } + }) + } + } diff --git a/src/providers/question-category/question-category.ts b/src/providers/question-category/question-category.ts index 0ec7b444..a46880c5 100755 --- a/src/providers/question-category/question-category.ts +++ b/src/providers/question-category/question-category.ts @@ -76,4 +76,11 @@ getTypeofActivityForSuppliedInfoForm(pd_id: any){ return this.http.post(this.apiurl+"getTypeOfActivetyFromBusinessForm", {"records": { "pd_id" : pd_id }}); } + +/*****Save Images */ +savePDImages(imagesDetails) +{ + let record = {'records':imagesDetails}; + return this.http.post(this.apiurl+'savePDPhotos',record); +} }