Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kollipara Deepak
DigiMart
Commits
3f7a76a7
Commit
3f7a76a7
authored
Mar 13, 2018
by
mohan122
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mailidonheader
parent
5b9306e3
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
258 additions
and
101 deletions
+258
-101
home/home.html
home/home.html
+24
-22
home/home.ts
home/home.ts
+71
-22
login/login.scss
login/login.scss
+1
-1
login/login.ts
login/login.ts
+3
-1
maps/maps.html
maps/maps.html
+14
-9
maps/maps.scss
maps/maps.scss
+7
-2
maps/maps.ts
maps/maps.ts
+46
-2
register/register.html
register/register.html
+43
-38
register/register.ts
register/register.ts
+49
-4
No files found.
home/home.html
View file @
3f7a76a7
...
...
@@ -7,7 +7,8 @@
<ion-header>
<ion-navbar
color=
"vamsi"
>
<ion-title>
Home
</ion-title>
<ion-title>
HOME
</ion-title>
<span
style=
"color:rgb(255, 255, 255)"
>
{{this.record}}
</span>
<ion-buttons
end
id=
"BUTON"
>
<button
(click)=
"Logout()"
id=
"BUTON"
>
<ion-icon
name=
"log-out"
color=
"white"
></ion-icon>
...
...
@@ -50,6 +51,8 @@
<form
[formGroup]=
"registeritems"
>
<ion-item
id=
"password"
style=
"padding:10px;"
>
<ion-label
floating
>
Name of Item
</ion-label>
<ion-input
type=
"text"
#itemname
[formControl]=
"registeritems.controls['nameofitem']"
></ion-input>
...
...
@@ -81,19 +84,19 @@
<ion-col
col-4
>
<ion-item
style=
"padding:0px;"
*ngIf=
"isPiecesSelected"
>
<ion-label
floating
*ngIf=
"isPiecesSelected"
>
Weight
</ion-label>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['Weight
1
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['Weight
a
']"
></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"
[formControl]=
"registeritems.controls['pieces
1
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['pieces
a
']"
></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"
[formControl]=
"registeritems.controls['cost
1
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['cost
a
']"
></ion-input>
</ion-item>
</ion-col>
</ion-row>
...
...
@@ -101,19 +104,19 @@
<ion-col
col-4
>
<ion-item
style=
"padding:0px;"
*ngIf=
"isPiecesSelected"
>
<ion-label
floating
*ngIf=
"isPiecesSelected"
>
Weight
</ion-label>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['Weight
2
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['Weight
b
']"
></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"
[formControl]=
"registeritems.controls['pieces
2
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['pieces
b
']"
></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"
[formControl]=
"registeritems.controls['cost
2
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['cost
b
']"
></ion-input>
</ion-item>
</ion-col>
</ion-row>
...
...
@@ -121,19 +124,19 @@
<ion-col
col-4
>
<ion-item
style=
"padding:0px;"
*ngIf=
"isPiecesSelected"
>
<ion-label
floating
*ngIf=
"isPiecesSelected"
>
Weight
</ion-label>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['Weight
3
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['Weight
c
']"
></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"
[formControl]=
"registeritems.controls['pieces
3
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['pieces
c
']"
></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"
[formControl]=
"registeritems.controls['cost
3
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['cost
c
']"
></ion-input>
</ion-item>
</ion-col>
</ion-row>
...
...
@@ -141,19 +144,19 @@
<ion-col
col-4
>
<ion-item
style=
"padding:0px;"
*ngIf=
"isPiecesSelected"
>
<ion-label
floating
*ngIf=
"isPiecesSelected"
>
Weight
</ion-label>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['Weight
4
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['Weight
d
']"
></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"
[formControl]=
"registeritems.controls['pieces
4
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['pieces
d
']"
></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"
[formControl]=
"registeritems.controls['cost
4
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['cost
d
']"
></ion-input>
</ion-item>
</ion-col>
</ion-row>
...
...
@@ -161,19 +164,19 @@
<ion-col
col-4
>
<ion-item
style=
"padding:0px;"
*ngIf=
"isPiecesSelected"
>
<ion-label
floating
*ngIf=
"isPiecesSelected"
>
Weight
</ion-label>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['Weight
5
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['Weight
e
']"
></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"
[formControl]=
"registeritems.controls['pieces
5
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['pieces
e
']"
></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"
[formControl]=
"registeritems.controls['cost
5
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['cost
e
']"
></ion-input>
</ion-item>
</ion-col>
</ion-row>
...
...
@@ -181,19 +184,19 @@
<ion-col
col-4
>
<ion-item
style=
"padding:0px;"
*ngIf=
"isPiecesSelected"
>
<ion-label
floating
*ngIf=
"isPiecesSelected"
>
Weight
</ion-label>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['Weight
6
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['Weight
f
']"
></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"
[formControl]=
"registeritems.controls['pieces
6
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['pieces
f
']"
></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"
[formControl]=
"registeritems.controls['cost
6
']"
></ion-input>
<ion-input
*ngIf=
"isPiecesSelected"
[formControl]=
"registeritems.controls['cost
f
']"
></ion-input>
</ion-item>
</ion-col>
</ion-row>
...
...
@@ -201,12 +204,11 @@
</form>
<div>
<button
ion-button
block
color=
"vamsi"
medium
(click)=
"s
ubmit
()"
>
Register
</button>
<button
ion-button
block
color=
"vamsi"
medium
(click)=
"s
aveEntry
()"
>
Register
</button>
</div>
<!--
<ion-card>
<div class="card-title">{{item.name}}</div>
...
...
home/home.ts
View file @
3f7a76a7
...
...
@@ -3,6 +3,7 @@ import { IonicPage, NavController, NavParams, ToastController } from 'ionic-angu
import
{
AngularFireAuth
}
from
'
angularfire2/auth
'
;
import
{
LoginPage
}
from
'
../login/login
'
;
import
{
FormBuilder
,
FormGroup
}
from
'
@angular/forms
'
;
import
{
HttpClient
,
HttpHeaders
}
from
'
@angular/common/http
'
;
...
...
@@ -24,9 +25,9 @@ export class HomePage {
registeritems
:
FormGroup
;
public
isKgsSelected
:
boolean
;
public
isPiecesSelected
:
boolean
;
private
baseURI
:
string
=
"
http://localhost/vamsi/updateitems.php
"
;
record
:
any
;
/* public listItems: any;*/
...
...
@@ -34,33 +35,35 @@ public isPiecesSelected: boolean;
constructor
(
public
navCtrl
:
NavController
,
private
formBuilder
:
FormBuilder
,
public
navParams
:
NavParams
,
private
fire
:
AngularFireAuth
,
private
toast
:
ToastController
)
{
constructor
(
public
navCtrl
:
NavController
,
private
formBuilder
:
FormBuilder
,
public
http
:
HttpClient
,
public
navParams
:
NavParams
,
private
fire
:
AngularFireAuth
,
private
toast
:
ToastController
)
{
this
.
record
=
navParams
.
get
(
'
emails
'
)
console
.
log
(
this
.
record
);
/*this.listItems=[{
}];*/
this
.
registeritems
=
this
.
formBuilder
.
group
({
nameofitem
:[
''
],
aq
:[
''
],
price
:[
''
],
Weight
1
:[
''
],
pieces
1
:[
''
],
cost
1
:[
''
],
Weight
2
:[
''
],
pieces
2
:[
''
],
cost
2
:[
''
],
Weight
3
:[
''
],
pieces
3
:[
''
],
cost
3
:[
''
],
Weight
4
:[
''
],
pieces
4
:[
''
],
cost
4
:[
''
],
Weight
5
:[
''
],
pieces
5
:[
''
],
cost
5
:[
''
],
Weight
6
:[
''
],
pieces
6
:[
''
],
cost
6
:[
''
],
Weight
a
:[
''
],
pieces
a
:[
''
],
cost
a
:[
''
],
Weight
b
:[
''
],
pieces
b
:[
''
],
cost
b
:[
''
],
Weight
c
:[
''
],
pieces
c
:[
''
],
cost
c
:[
''
],
Weight
d
:[
''
],
pieces
d
:[
''
],
cost
d
:[
''
],
Weight
e
:[
''
],
pieces
e
:[
''
],
cost
e
:[
''
],
Weight
f
:[
''
],
pieces
f
:[
''
],
cost
f
:[
''
],
});
...
...
@@ -69,6 +72,51 @@ public isPiecesSelected: boolean;
this
.
registeritems
.
reset
();
}
createEntry
(
EMAIL
:
string
,
weighta
:
number
,
piecesa
:
number
,
costa
:
number
,
weightb
:
number
,
piecesb
:
number
,
costb
:
number
,
weightc
:
number
,
piecesc
:
number
,
costc
:
number
,
weightd
:
number
,
piecesd
:
number
,
costd
:
number
,
weighte
:
number
,
piecese
:
number
,
coste
:
number
,
weightf
:
number
,
piecesf
:
number
,
costf
:
number
)
:
void
{
let
headers
:
any
=
new
HttpHeaders
({
'
Content-Type
'
:
'
application/json
'
}),
options
:
any
=
{
"
key
"
:
"
create
"
,
"
EMAIL
"
:
EMAIL
,
"
weighta
"
:
weighta
,
"
piecesa
"
:
piecesa
,
"
costa
"
:
costa
,
"
weightb
"
:
weightb
,
"
piecesb
"
:
piecesb
,
"
costb
"
:
costb
,
"
weightc
"
:
weightc
,
"
piecesc
"
:
piecesc
,
"
costc
"
:
costc
,
"
weightd
"
:
weightd
,
"
piecesd
"
:
piecesd
,
"
costd
"
:
costd
,
"
weighte
"
:
weighte
,
"
piecese
"
:
piecese
,
"
coste
"
:
coste
,
"
weightf
"
:
weightf
,
"
piecesf
"
:
piecesf
,
"
costf
"
:
costf
},
url
:
any
=
this
.
baseURI
;
this
.
http
.
post
(
url
,
JSON
.
stringify
(
options
),
headers
)
.
subscribe
((
data
:
any
)
=>
{
// If the request was successful notify the user
console
.
log
(
`Congratulations the
${
EMAIL
}
was successfully added`
);
this
.
registeritems
.
reset
();
},
(
error
:
any
)
=>
{
console
.
log
(
'
Something went wrong!
'
);
});
}
saveEntry
()
:
void
{
let
EMAIL
:
string
=
this
.
registeritems
.
controls
[
"
nameofitem
"
].
value
,
weighta
:
number
=
this
.
registeritems
.
controls
[
"
Weighta
"
].
value
,
piecesa
:
number
=
this
.
registeritems
.
controls
[
"
piecesa
"
].
value
,
costa
:
number
=
this
.
registeritems
.
controls
[
"
costa
"
].
value
,
weightb
:
number
=
this
.
registeritems
.
controls
[
"
Weightb
"
].
value
,
piecesb
:
number
=
this
.
registeritems
.
controls
[
"
piecesb
"
].
value
,
costb
:
number
=
this
.
registeritems
.
controls
[
"
costb
"
].
value
,
weightc
:
number
=
this
.
registeritems
.
controls
[
"
Weightc
"
].
value
,
piecesc
:
number
=
this
.
registeritems
.
controls
[
"
piecesc
"
].
value
,
costc
:
number
=
this
.
registeritems
.
controls
[
"
costc
"
].
value
,
weightd
:
number
=
this
.
registeritems
.
controls
[
"
Weightd
"
].
value
,
piecesd
:
number
=
this
.
registeritems
.
controls
[
"
piecesd
"
].
value
,
costd
:
number
=
this
.
registeritems
.
controls
[
"
costd
"
].
value
,
weighte
:
number
=
this
.
registeritems
.
controls
[
"
Weighte
"
].
value
,
piecese
:
number
=
this
.
registeritems
.
controls
[
"
piecese
"
].
value
,
coste
:
number
=
this
.
registeritems
.
controls
[
"
coste
"
].
value
,
weightf
:
number
=
this
.
registeritems
.
controls
[
"
Weightf
"
].
value
,
piecesf
:
number
=
this
.
registeritems
.
controls
[
"
piecesf
"
].
value
,
costf
:
number
=
this
.
registeritems
.
controls
[
"
costf
"
].
value
this
.
createEntry
(
EMAIL
,
weighta
,
piecesa
,
costa
,
weightb
,
piecesb
,
costb
,
weightc
,
piecesc
,
costc
,
weightd
,
piecesd
,
costd
,
weighte
,
piecese
,
coste
,
weightf
,
piecesf
,
costf
);
}
/*public additem():void{
this.listItems.push({
name: "vamsi",
...
...
@@ -76,6 +124,7 @@ public isPiecesSelected: boolean;
});
}*/
selectItem
(
Mode
)
{
if
(
Mode
==
'
Kgs
'
)
...
...
login/login.scss
View file @
3f7a76a7
...
...
@@ -6,4 +6,4 @@ page-login {
background
:
color
(
$colors
,
white
);
width
:
95%
;
}
}
}
\ No newline at end of file
login/login.ts
View file @
3f7a76a7
...
...
@@ -13,6 +13,7 @@ import { TabhPage } from '../tabh/tabh';
})
export
class
LoginPage
{
user
=
{}
as
User
;
public
email
:
any
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
fire
:
AngularFireAuth
,
private
alertctrl
:
AlertController
)
{
}
...
...
@@ -27,7 +28,8 @@ export class LoginPage {
this
.
fire
.
auth
.
signInWithEmailAndPassword
(
this
.
user
.
email
,
this
.
user
.
password
)
.
then
(
data
=>
{
this
.
navCtrl
.
setRoot
(
TabhPage
);
console
.
log
(
this
.
user
.
email
);
this
.
navCtrl
.
push
(
HomePage
,{
emails
:
this
.
user
.
email
});
})
.
catch
(
error
=>
{
...
...
maps/maps.html
View file @
3f7a76a7
...
...
@@ -4,10 +4,15 @@
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>
maps
</ion-title>
<ion-header
color=
"vamsi"
>
<ion-navbar
color=
"vamsi"
>
<ion-title>
TRACING..
</ion-title>
<ion-buttons
end
id=
"BUTON"
>
<button
ion-button
large
(click)=
"mapUser()"
id=
"BUTON"
>
<ion-icon
large
name=
"locate"
color=
"white"
></ion-icon>
</button>
</ion-buttons>
</ion-navbar>
</ion-header>
...
...
@@ -19,15 +24,15 @@
<ion-label floating>LOCATION</ion-label>
<ion-input type="text" value="{{ location?.coords.latitude}} {{ location?.coords.longitude }}" readonly></ion-input>
</ion-item>
-->
<div padding>
<button
block
ion-button
color=
"
vamsi
"
style=
"padding:0px; width: 100%;"
medium
(click)=
"mapUser()"
>
LOCATE ME
</button>
<button
outline
ion-button
id="vamsi"
color="
light
" style="
z-index:2;
padding:0px; width: 100%;"
[disabled]="disabled" small
(click)="mapUser()">LOCATE ME</button>
</div>
-->
<agm-map
[disableDefaultUI]=
"true"
[latitude]=
"location?.coords.latitude"
[streetViewControl]=
"true"
[longitude]=
"location?.coords.longitude"
[mapTypeId]=
"'roadmap'"
[zoom]=
"15"
>
<agm-marker
[label]=
"
location.title
"
[latitude]=
"
location?.coords.latitude"
[longitude]=
"location?.coords.longitude"
[markerClickable]=
"true"
></agm-marker>
<agm-marker
[label]=
"
options
"
[latitude]=
"location?.coords.latitude"
[longitude]=
"location?.coords.longitude"
[markerClickable]=
"true"
></agm-marker>
</agm-map>
<div
id=
map
></div>
<div
#map
id=
map
style=
"height:100%;"
></div>
</ion-content>
\ No newline at end of file
maps/maps.scss
View file @
3f7a76a7
...
...
@@ -3,12 +3,17 @@ page-maps {
background
:
color
(
$colors
,
white
);
width
:
95%
;
}
#BUTON
{
background
:
color
(
$colors
,
vamsi
);
}
agm-map
{
height
:
400px
;
width
:
320px
;
width
:
auto
;
position
:
absolute
;
left
:
0
;
bottom
:
5
;
bottom
:
0
;
top
:
0
;
right
:
0
;
}
map
{
height
:
400px
;
...
...
maps/maps.ts
View file @
3f7a76a7
...
...
@@ -2,6 +2,9 @@ import { Component } from '@angular/core';
import
{
IonicPage
,
NavController
,
NavParams
,
Platform
}
from
'
ionic-angular
'
;
import
{
Geolocation
}
from
'
@ionic-native/geolocation
'
;
import
{
AgmCoreModule
}
from
'
@agm/core
'
;
import
{
variable
}
from
'
@angular/compiler/src/output/output_ast
'
;
import
{
GoogleMap
,
GoogleMaps
,
LatLng
,
CameraPosition
,
GoogleMapsEvent
}
from
'
@ionic-native/google-maps
'
;
/*import {
GoogleMaps,
GoogleMap,
...
...
@@ -27,15 +30,55 @@ import { AgmCoreModule } from '@agm/core';
})
export
class
MapsPage
{
location
:
any
;
public
locatio
:
any
;
disabled
:
boolean
;
position
:
any
;
map
:
GoogleMap
;
// map: GoogleMap;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
geolocation
:
Geolocation
,
public
platform
:
Platform
)
{
constructor
(
public
navCtrl
:
NavController
,
public
googleMaps
:
GoogleMaps
,
public
navParams
:
NavParams
,
private
geolocation
:
Geolocation
,
public
platform
:
Platform
)
{
this
.
locatio
=
[{
title
:
'
V
'
}];
var
disabled
=
false
;
}
/*
ngAfterViewInit(){
this.platform.ready().then(() => {
this.loadMap();
});
}
loadMap(){
//let element = document.getElementById('map');
this.map = GoogleMaps.create('map_canvas');
//let map:GoogleMap=this.googleMaps.create(element,{});
let latlng=new LatLng(40.7128,74.0059);
this.map.one(GoogleMapsEvent.MAP_READY).then(()=>{
let position:CameraPosition<LatLng>={
target:latlng,
zoom:10,
tilt:30
}
this.map.moveCamera(position);
})
}*/
options
=
{
color
:
'
#ASDF96
'
,
fontFamily
:
''
,
fontSize
:
'
14px
'
,
fontWeight
:
'
bold
'
,
text
:
'
S
'
,
}
/*loadMap() {
let mapOptions: GoogleMapOptions = {
...
...
@@ -80,6 +123,7 @@ export class MapsPage {
this
.
geolocation
.
getCurrentPosition
(
options
).
then
((
location
)
=>
{
console
.
log
(
'
Fetched the location successfully
'
,
location
);
this
.
location
=
location
;
this
.
disabled
=
true
;
}).
catch
((
error
)
=>
{
console
.
log
(
'
Error getting location
'
,
error
);
});
...
...
register/register.html
View file @
3f7a76a7
...
...
@@ -6,48 +6,53 @@
</ion-header>
<ion-content
padding
id=
"register"
>
<ion-list>
<ion-item
id=
"password"
style=
"padding:0px;"
>
<ion-label
floating
>
NAME
</ion-label>
<ion-input
type=
"Email"
#username
></ion-input>
</ion-item>
<ion-item
id=
"password"
style=
"position: relative; padding:0px;"
>
<ion-label
floating
>
Mobile
</ion-label>
<ion-input
type=
"tel"
></ion-input>
</ion-item>
<ion-item
id=
"password"
style=
"position: relative; padding:0px;"
>
<ion-label
floating
>
Password
</ion-label>
<ion-input
type=
"password"
#password
minlength=
"6"
></ion-input>
</ion-item>
<ion-item
id=
"password"
style=
"position: relative; padding:0px;"
>
<ion-label
floating
>
Re-type Password
</ion-label>
<ion-input
type=
"password"
></ion-input>
</ion-item>
<ion-item
id=
"password"
style=
"position: relative; padding:0px;"
>
<ion-label
floating
>
Name of the Shop
</ion-label>
<ion-input
type=
"text"
></ion-input>
</ion-item>
<div
class=
"spacer"
style=
"width: 50px; height: 20px;"
></div>
<ion-item
style=
"padding:0px; width:370px"
>
<ion-label>
Shop category
</ion-label>
<ion-select
id=
"category"
multiple=
"false"
>
<ion-option>
Kirana
</ion-option>
<ion-option>
Fancy
</ion-option>
<ion-option>
Medical
</ion-option>
<ion-option>
Floral
</ion-option>
<ion-option>
None
</ion-option>
</ion-select>
</ion-item>
<ion-item
id=
"password"
style=
"position: relative; padding:0px;"
>
<ion-label
floating
>
LOCATION
</ion-label>
<ion-input
type=
"text"
value=
"{{ location?.coords.latitude}} {{ location?.coords.longitude }}"
readonly
></ion-input>
</ion-item>
<form
[formGroup]=
"register"
>
<ion-list>
<ion-item
id=
"password"
style=
"padding:0px;"
>
<ion-label
floating
>
NAME
</ion-label>
<ion-input
[formControl]=
"register.controls['name']"
type=
"Email"
#username
></ion-input>
</ion-item>
<ion-item
id=
"password"
style=
"position: relative; padding:0px;"
>
<ion-label
floating
>
Mobile
</ion-label>
<ion-input
[formControl]=
"register.controls['mobile']"
type=
"tel"
></ion-input>
</ion-item>
<ion-item
id=
"password"
style=
"position: relative; padding:0px;"
>
<ion-label
floating
>
Password
</ion-label>
<ion-input
[formControl]=
"register.controls['password']"
type=
"password"
#password
minlength=
"6"
></ion-input>
</ion-item>
<ion-item
id=
"password"
style=
"position: relative; padding:0px;"
>
<ion-label
floating
>
Re-type Password
</ion-label>
<ion-input
[formControl]=
"register.controls['retypepassword']"
type=
"password"
></ion-input>
</ion-item>
<ion-item
id=
"password"
style=
"position: relative; padding:0px;"
>
<ion-label
floating
>
Name of the Shop
</ion-label>
<ion-input
[formControl]=
"register.controls['nameofshop']"
type=
"text"
></ion-input>
</ion-item>
<div
class=
"spacer"
style=
"width: 50px; height: 20px;"
></div>
<ion-item
style=
"padding:0px; width:370px"
>
<ion-label>
Shop category
</ion-label>
<ion-select
id=
"category"
[formControl]=
"register.controls['category']"
multiple=
"false"
>
<ion-option>
Kirana
</ion-option>
<ion-option>
Fancy
</ion-option>
<ion-option>
Medical
</ion-option>
<ion-option>
Floral
</ion-option>
<ion-option>
None
</ion-option>
</ion-select>
</ion-item>
<ion-item
id=
"password"
style=
"position: relative; padding:0px;"
>
<ion-label
floating
>
LOCATION
</ion-label>
<ion-input
[formControl]=
"register.controls['location']"
type=
"text"
value=
"{{ location?.coords.latitude}} {{ location?.coords.longitude }}"
readonly
></ion-input>
</ion-item>
<!--
<!--
%<p> Location:{{ location?.coords.latitude}}/ {{ location?.coords.longitude }} </p>
-->
</ion-list>
</ion-list>
</form>
<div
padding
>
<button
block
ion-button
color=
"vamsi"
style=
"padding:0px; width: 100%;"
medium
(click)=
"registerUser()"
>
Sign Up
</button>
</div>
<div
padding
>
<button
block
ion-button
color=
"vamsi"
style=
"padding:0px; width: 100%;"
medium
(click)=
"saveEntry()"
>
Sign
</button>
</div>
</ion-content>
\ No newline at end of file
register/register.ts
View file @
3f7a76a7
...
...
@@ -3,6 +3,8 @@ import { IonicPage, NavController, NavParams ,Platform} from 'ionic-angular';
import
{
AngularFireAuth
}
from
'
angularfire2/auth
'
;
import
{
Component
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Geolocation
}
from
'
@ionic-native/geolocation
'
;
import
{
FormBuilder
,
FormGroup
}
from
'
@angular/forms
'
;
import
{
HttpClient
,
HttpHeaders
}
from
'
@angular/common/http
'
;
...
...
@@ -23,15 +25,54 @@ export class RegisterPage {
@
ViewChild
(
'
username
'
)
user
;
@
ViewChild
(
'
password
'
)
password
;
location
:
any
;
public
register
:
FormGroup
;
private
baseURI
:
string
=
"
http://localhost/vamsi/register.php
"
;
constructor
(
private
fire
:
AngularFireAuth
,
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
geolocation
:
Geolocation
,
public
platform
:
Platform
)
{
constructor
(
private
fire
:
AngularFireAuth
,
public
http
:
HttpClient
,
public
formBuilder
:
FormBuilder
,
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
private
geolocation
:
Geolocation
,
public
platform
:
Platform
)
{
this
.
register
=
this
.
formBuilder
.
group
({
name
:[
''
],
mobile
:[
''
],
password
:[
''
],
retypepassword
:[
''
],
category
:[
''
],
nameofshop
:[
''
],
location
:[
''
],
});
}
createEntry
(
name
:
string
,
mobile
:
number
,
password
:
string
,
retypepassword
:
string
,
nameofshop
:
string
,
category
:
string
,
location
:
string
)
:
void
{
let
headers
:
any
=
new
HttpHeaders
({
'
Content-Type
'
:
'
application/json
'
}),
options
:
any
=
{
"
key
"
:
"
create
"
,
"
NAME
"
:
name
,
"
MOBILE
"
:
mobile
,
"
PASSWORD
"
:
password
,
"
RETYPEPASSWORD
"
:
retypepassword
,
"
CATEGORY
"
:
category
,
"
SHOPNAME
"
:
nameofshop
,
"
LOCATION
"
:
location
},
url
:
any
=
this
.
baseURI
;
ionViewDidLoad
()
{
console
.
log
(
'
ionViewDidLoad RegisterPage
'
);
this
.
http
.
post
(
url
,
JSON
.
stringify
(
options
),
headers
)
.
subscribe
((
data
:
any
)
=>
{
// If the request was successful notify the user
console
.
log
(
`Congratulations the
${
name
}
was successfully added`
);
},
(
error
:
any
)
=>
{
console
.
log
(
'
Something went wrong!
'
);
});
}
saveEntry
()
:
void
{
let
name
:
string
=
this
.
register
.
controls
[
"
name
"
].
value
,
mobile
:
number
=
this
.
register
.
controls
[
"
mobile
"
].
value
,
password
:
string
=
this
.
register
.
controls
[
"
password
"
].
value
,
retypepassword
:
string
=
this
.
register
.
controls
[
"
retypepassword
"
].
value
,
nameofshop
:
string
=
this
.
register
.
controls
[
"
nameofshop
"
].
value
,
category
:
string
=
this
.
register
.
controls
[
"
category
"
].
value
,
location
:
string
=
this
.
register
.
controls
[
"
location
"
].
value
;