Commit 867addc7 authored by mohan122's avatar mohan122

Registr_page_added

parent 647a1c25
......@@ -17,5 +17,199 @@
</ion-header>
<ion-content>
<p>Hi i am vamsi</p>
<ion-item id="password" style="padding:10px;">
<ion-label floating>Name of Item</ion-label>
<ion-input type="text" #itemname></ion-input>
</ion-item>
<!--<ion-item *ngFor="let item of listItems">
<form [formGroup]="registeritems">
<ion-item style="padding:10px;">
<ion-label floating>ITEM NAME</ion-label>
<ion-input [formControl]="registeritems.controls['nameofitem']" type="text"></ion-input>
</ion-item>
<ion-item style="padding:10px;">
<ion-label floating>AVAILABLE QUANTITY (IN KGS)</ion-label>
<ion-input [formControl]="registeritems.controls['cost']" type="text"></ion-input>
</ion-item>
<ion-item style="padding:10px;">
<ion-label floating>PRICE (PER KG)</ion-label>
<ion-input [formControl]="registeritems.controls['price']" type="text"></ion-input>
</ion-item>
<ion-item style="padding:10px;">
<ion-label floating>ANY OFEERS (PER KG)</ion-label>
<ion-input [formControl]="registeritems.controls['offers']" type="text"></ion-input>
</ion-item>
<ion-item style="padding:10px;">
<ion-label floating>NO OF PIECES</ion-label>
<ion-input [formControl]="registeritems.controls['pieces']" type="text"></ion-input>
</ion-item>
<button ion-button type="submit" (click)="submit()">Submit</button>
</form>
-->
<ion-item style="padding:10px;">
<ion-label floating>SELECT-BY</ion-label>
<ion-select (ionCancel)="cancel()">
<ion-option value="Kgs" (ionSelect)="selectItem('Kgs');">Kgs</ion-option>
<ion-option value="Pieces" (ionSelect)="selectItem('Pieces');">Pieces</ion-option>
</ion-select>
</ion-item>
<ion-row>
<ion-col col-9>
<ion-item style="padding:10px;" *ngIf="isKgsSelected">
<ion-label floating>AVAILABLE QUANTITY (IN KGS)</ion-label>
<ion-input *ngIf="isKgsSelected"></ion-input>
</ion-item>
</ion-col>
<ion-col col-9>
<ion-item style="padding-left:10px;" *ngIf="isKgsSelected">
<ion-label floating *ngIf="isKgsSelected">PRICE (PER KG)</ion-label>
<ion-input *ngIf="isKgsSelected"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<p *ngIf="isPiecesSelected" style="padding:10px;">Note:Weight in Grams</p>
<ion-row row-1>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">Weight</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">pieces</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">cost</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row row-2>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">Weight</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">pieces</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">cost</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row row-3>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">Weight</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">pieces</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">cost</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row row-4>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">Weight</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">pieces</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">cost</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row row-5>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">Weight</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">pieces</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">cost</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row row-6>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">Weight</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">pieces</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
<ion-col col-4>
<ion-item style="padding:0px;" *ngIf="isPiecesSelected">
<ion-label floating *ngIf="isPiecesSelected">cost</ion-label>
<ion-input *ngIf="isPiecesSelected"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<!--
<ion-card>
<div class="card-title">{{item.name}}</div>
<button ion-button icon-left clear item-end>
<ion-icon name="done-all"></ion-icon>
SUBMIT
</button>
</ion-card>
</ion-item>
-->
</ion-content>
\ No newline at end of file
......@@ -2,6 +2,10 @@ import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, ToastController } from 'ionic-angular';
import {AngularFireAuth} from 'angularfire2/auth';
import { LoginPage } from '../login/login';
import { FormBuilder,FormGroup} from '@angular/forms';
/**
* Generated class for the HomePage page.
......@@ -17,14 +21,74 @@ import { LoginPage } from '../login/login';
})
export class HomePage {
constructor(public navCtrl: NavController, public navParams: NavParams,private fire:AngularFireAuth,private toast:ToastController) {
registeritems:FormGroup;
public isKgsSelected: boolean;
public isPiecesSelected: boolean;
/* public listItems: any;*/
constructor(public navCtrl: NavController,private formBuilder:FormBuilder, public navParams: NavParams,private fire:AngularFireAuth,private toast:ToastController) {
/*this.listItems=[{
}];*/
this.registeritems=this.formBuilder.group({
nameofitem:[''],
cost:[''],
price:[''],
offers:[''],
pieces:[''],
});
}
submit(){
this.registeritems.reset();
}
/*public additem():void{
this.listItems.push({
name: "vamsi",
value: 1
});
}*/
selectItem(Mode)
{
if(Mode == 'Kgs')
{
this.isPiecesSelected = false;
this.isKgsSelected = true;
}
else if(Mode == 'Pieces')
{
this.isKgsSelected = false;
this.isPiecesSelected = true;
}
}
cancel()
{
this.isKgsSelected = false;
this.isPiecesSelected = false;
}
Logout(){
this.navCtrl.setRoot(LoginPage);
}
ionViewWillLoad() {
this.isKgsSelected = false;
this.isPiecesSelected = false;
this.fire.authState.subscribe(user=>{
if(user && user.email && user.uid){
this.toast.create({
......
......@@ -39,12 +39,12 @@
</ion-select>
</ion-item>
<ion-item id="password" style="position: relative; padding:0px;">
<ion-label floating>{{ location?.coords.latitude}}/ {{ location?.coords.longitude }}</ion-label>
<ion-input type="text"></ion-input>
<ion-label floating>LOCATION</ion-label>
<ion-input type="text" value="{{ location?.coords.latitude}} {{ location?.coords.longitude }}" readonly></ion-input>
</ion-item>
<!--
%<p> Location:{{ location?.coords.latitude}}/ {{ location?.coords.longitude }}</p>
%<p> Location:{{ location?.coords.latitude}}/ {{ location?.coords.longitude }} </p>
-->
</ion-list>
<div padding>
......
......@@ -7,11 +7,10 @@
z-index: 100000;
width: 100%;
background-color: rgb(240, 225, 186);
}
.flb {
background-color: #ffdd1a;
background-color: rgb(202, 191, 41);
height: 100%;
width: 100%;
animation: pulse 1s linear forwards;
......@@ -270,4 +269,4 @@
-webkit-transform: matrix3d(2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
transform: matrix3d(2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
}
}
\ No newline at end of file
import { Component } from '@angular/core';
import { IonicPage, NavController } from 'ionic-angular';
import { IonicPage, NavController, AlertController } from 'ionic-angular';
import { LoginPage } from '../login/login';
/**
......@@ -23,9 +23,31 @@ export class TabhPage {
constructor(public navCtrl: NavController) {}
constructor(public navCtrl: NavController,private alertCtrl: AlertController) {}
Logout(){
this.navCtrl.setRoot(LoginPage);
let alert = this.alertCtrl.create({
title: 'CONFIRM LOGOUT',
message: 'Do you want to Logout',
buttons: [
{
text: 'stay',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
this.navCtrl.setRoot(TabhPage);
}
},
{
text: 'Logout',
handler: () => {
console.log('Buy clicked');
this.navCtrl.setRoot(LoginPage);
}
}
]
});
alert.present();
}
}
}
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