Skip to content

Commit

Permalink
user progile doing
Browse files Browse the repository at this point in the history
  • Loading branch information
jainam7 committed Jan 8, 2018
1 parent 65715aa commit 3bfe334
Show file tree
Hide file tree
Showing 16 changed files with 358 additions and 29 deletions.
10 changes: 8 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import { SplashScreen } from '@ionic-native/splash-screen';
import { PrescriptionProvider } from '../providers/prescription/prescription';
import { SearchproProvider } from '../providers/searchpro/searchpro';
import { UserlogProvider } from "../providers/userlog/userlog";
import { ChangepassPage } from '../pages/changepass/changepass';
import { ForgetpassPage } from "../pages/forgetpass/forgetpass";
//import { Tutorialpage1Page } from '../pages/tutorialpage1/tutorialpage1';


Expand All @@ -44,7 +46,9 @@ import { UserlogProvider } from "../providers/userlog/userlog";
Viewprescription2Page,
Viewprescription3Page,
Searchmedpage1Page,
Searchdocpage1Page
Searchdocpage1Page,
ChangepassPage,
ForgetpassPage
],
imports: [
BrowserModule,
Expand All @@ -70,7 +74,9 @@ import { UserlogProvider } from "../providers/userlog/userlog";
Viewprescription3Page,

Searchmedpage1Page,
Searchdocpage1Page
Searchdocpage1Page,
ChangepassPage,
ForgetpassPage
],
providers: [
StatusBar,
Expand Down
42 changes: 42 additions & 0 deletions src/pages/changepass/changepass.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!--
Generated template for the ChangepassPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>

<ion-navbar color="myapp1">
<ion-title>Change Password</ion-title>
</ion-navbar>

</ion-header>


<ion-content padding>
<ion-list>
<ion-item>
<ion-label floating>Enter Current Password</ion-label>
<ion-input type="password" [(ngModel)]="pass" name="pass" placeholder=""></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Enter New Password</ion-label>
<ion-input type="password" [(ngModel)]="pass" name="pass" placeholder=""></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Confirm Password</ion-label>
<ion-input type="password" [(ngModel)]="pass" name="pass" placeholder=""></ion-input>
</ion-item>

<br/>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;

<div padding>
<button ion-button round (click)="onChangePassClick()" color="myapp1" block>Change Password</button>
</div>
</ion-list>
</ion-content>
13 changes: 13 additions & 0 deletions src/pages/changepass/changepass.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { ChangepassPage } from './changepass';

@NgModule({
declarations: [
ChangepassPage,
],
imports: [
IonicPageModule.forChild(ChangepassPage),
],
})
export class ChangepassPageModule {}
3 changes: 3 additions & 0 deletions src/pages/changepass/changepass.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
page-changepass {

}
32 changes: 32 additions & 0 deletions src/pages/changepass/changepass.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { UserPage } from "../user/user";
import { UserlogProvider } from "../../providers/userlog/userlog";
import { User_Class } from "../../providers/userlog/user_class";
import { TabsPage } from "../../pages/tabs/tabs";
/**
* Generated class for the ChangepassPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/

@IonicPage()
@Component({
selector: 'page-changepass',
templateUrl: 'changepass.html',
})
export class ChangepassPage {

constructor(public navCtrl: NavController, public navParams: NavParams) {
}

ionViewDidLoad() {
console.log('ionViewDidLoad ChangepassPage');
}
onChangePassClick()
{

}

}
33 changes: 33 additions & 0 deletions src/pages/forgetpass/forgetpass.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
Generated template for the ForgetpassPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>

<ion-navbar color="myapp1">
<ion-title align="left"color="black">Forget Password</ion-title>
</ion-navbar>

</ion-header>


<ion-content padding>
<ion-list>
<ion-item>
<ion-label floating>Email Id</ion-label>
<ion-input type="email" [(ngModel)]="email_id" name="email"></ion-input>
</ion-item>

&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;
&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;


<button ion-button round (click)="onClick()"color="myapp1" block>Send Mail</button>

</ion-list>
</ion-content>
13 changes: 13 additions & 0 deletions src/pages/forgetpass/forgetpass.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { ForgetpassPage } from './forgetpass';

@NgModule({
declarations: [
ForgetpassPage,
],
imports: [
IonicPageModule.forChild(ForgetpassPage),
],
})
export class ForgetpassPageModule {}
3 changes: 3 additions & 0 deletions src/pages/forgetpass/forgetpass.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
page-forgetpass {

}
89 changes: 89 additions & 0 deletions src/pages/forgetpass/forgetpass.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { UserlogProvider } from "../../providers/userlog/userlog";
import { User_Class } from "../../providers/userlog/user_class";
import { email_class } from "../../providers/userlog/email";


/**
* Generated class for the ForgetpassPage page.
*
* See https://ionicframework.com/docs/components/#navigation for more info on
* Ionic pages and navigation.
*/

@IonicPage()
@Component({
selector: 'page-forgetpass',
templateUrl: 'forgetpass.html',
})
export class ForgetpassPage {

constructor(public navCtrl: NavController, public navParams: NavParams,public _db:UserlogProvider) {
}
email_id:string='';
password:string='';
usr:User_Class[];
mailobj:email_class[]=[];
msg:string='';
ionViewDidLoad() {
console.log('ionViewDidLoad ForgetpassPage');
}
forgotPassword()
{




//let item=new Users(this.id,this.email,this.name,this.mobno,this.img,this.pass,this.dpass);
// alert(this.email);
// let item=new Users(this.id,this.email,this.name,this.mobno,this.img,this.pass,this.dpass);
alert("ywaa");
this._db.getUser(this.email_id).subscribe(
(data:User_Class[])=>{
// alert("hiii");
if(data.length===1)
{
alert("hello");
var message="Hello "+data[0].usr_name+". You have requested to reset the password. your password is '"+data[0].usr_pass+"'. Password is one of the confidential thing, Don't share it with anyone.";
this._db.sendemail(new email_class(message,this.email_id,"Resetting the password of Expense Tracker.")).subscribe(
(data1:any)=>{
console.log("mail sent");
alert("The Password has been sent to "+this.email_id);
},

);
}
else
{
this.msg="You have entered incorrect email id. Please enter the email id you used to login with.";
}
},
function(err){},
function(){}
);
}
onClick()
{

this.forgotPassword();
/*buttons: [
{
text: 'Cancel',
handler: data => {
console.log('Cancel clicked');
}
},
{
text: 'Send',
handler: data => {
this.email_id = data.name;
//this.forgotPassword();
}
}
]*/

}


}
14 changes: 6 additions & 8 deletions src/pages/signinpage/signinpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@


<ion-content scroll="false">
<div class="splash-bg"></div>
<div class="splash-info"></div>
<!-- <div class="splash-bg"></div>
<div class="splash-info"></div>-->

<!-- <div class="img">
<img src="../../assets/imgs/med3.jpg" alt="">
</div>-->
<br/><br/>
<br/><br/>
<div class="img">
<img src="../../assets/imgs/q.jpg" alt="">
</div>
<ion-list>

<ion-item>
Expand All @@ -40,7 +38,7 @@
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;
<!--<button ion-button round color="secondary">Forget Password</button>-->
<span class="pull-right"><a href="">Forgot Password???</a></span>
<span class="pull-right"><a href="#" (click)="onForget()" color="myapp1">Forgot Password???</a></span>
<div padding>

<button ion-button round (click)="onSignInNext()"color="myapp1" block>Login</button>
Expand Down
76 changes: 75 additions & 1 deletion src/pages/signinpage/signinpage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { UserlogProvider } from "../../providers/userlog/userlog";
import { User_Class } from "../../providers/userlog/user_class";
import { SignuppagePage } from "../signuppage/signuppage";
import { Storage } from "@ionic/storage";
import { email_class } from "../../providers/userlog/email";
import { AboutPage } from '../about/about';
import { ForgetpassPage } from "../forgetpass/forgetpass";


/**
* Generated class for the SigninpagePage page.
Expand All @@ -21,7 +25,9 @@ import { Storage } from "@ionic/storage";
export class SigninpagePage {
email_id:string='';
password:string='';
userObject:User_Class;
usr:User_Class[];
mailobj:email_class[]=[];
msg:string='';
constructor(public storage:Storage,public toast:ToastController,public navCtrl: NavController,public _db:UserlogProvider){

}
Expand Down Expand Up @@ -111,4 +117,72 @@ onClick()
this.navCtrl.push(SignuppagePage);
}

forgotPassword()
{




//let item=new Users(this.id,this.email,this.name,this.mobno,this.img,this.pass,this.dpass);
// alert(this.email);
// let item=new Users(this.id,this.email,this.name,this.mobno,this.img,this.pass,this.dpass);
this._db.getUser(this.email_id).subscribe(
(data:User_Class[])=>{
if(data.length==1)
{
alert("hello");
var message="Hello "+data[0].usr_name+". You have requested to reset the password. your password is '"+data[0].usr_pass+"'. Password is one of the confidential thing, Don't share it with anyone.";
this._db.sendemail(new email_class(message,this.email_id,"Resetting the password of Expense Tracker.")).subscribe(
(data1:any)=>{
console.log("mail sent");
alert("The Password has been sent to "+this.email_id);
},

);
}
else
{
this.msg="You have entered incorrect email id. Please enter the email id you used to login with.";
}
},
function(err){},
function(){}
);
}

onForget()
{
this.navCtrl.push(ForgetpassPage);

/*let prompt = this.alert.create({
title: 'Forgot Password',
message: "Enter Your Email Id To Get Your Password",
inputs: [
{
name: 'name',
placeholder: 'Email_id'
},
],
buttons: [
{
text: 'Cancel',
handler: data => {
console.log('Cancel clicked');
}
},
{
text: 'Send',
handler: data => {
this.email_id = data.name;
//this.forgotPassword();
}
}
]
});
prompt.present();*/
}


}


Loading

0 comments on commit 3bfe334

Please sign in to comment.