-
Notifications
You must be signed in to change notification settings - Fork 0
/
businesssignup.html
242 lines (227 loc) · 9.83 KB
/
businesssignup.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!DOCTYPE HTML>
<html>
<head>
<title>Sign Up</title>
<meta charset="utf-8"/>
<meta http-equiv="content-type" content="text/html" />
<meta name ="viewport" content="width=device-width, initial-scale=1" />
<link rel="import" href="bower_components/paper-input/paper-input.html" />
<link rel="import" href="bower_components/paper-button/paper-button.html" />
<link rel="import" href="bower_components/paper-header-panel/paper-header-panel.html" />
<link rel="import" href="bower_components/paper-toolbar/paper-toolbar.html" />
<link rel="import" href="bower_components/paper-dialog/paper-dialog.html" />
<link rel="import" href="bower_components/paper-dropdown-menu/paper-dropdown-menu.html" />
<link rel="import" href="bower_components/paper-menu/paper-menu.html" />
<link rel="import" href="bower_components/paper-item/paper-item.html" />
<link rel="import" href="bower_components/paper-input/paper-textarea.html" />
<link rel="import" href="bower_components/paper-styles/color.html" />
<link rel="import" href="bower_components/iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="bower_components/iron-ajax/iron-ajax.html">
<link rel="import" href="bower_components/font-roboto/roboto.html">
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<style is="custom-style">
body {
font-family: Roboto;
}
.centered {
margin: auto;
margin-left: auto;
margin-right: auto;
margin-top: 50px;
max-width: 420px;
max-height: 450px;
}
img .center{
max-width: 90px;
margin-left: auto;
margin-right: auto;
}
paper-button.blue {
background: #22A7F0;
color: white;
margin-top: 10px;
width: 100%;
}
paper-dialog {
border: 5px;
}
</style>
</head>
<body>
<template is="dom-bind" id="app">
<div class="centered">
<paper-material elevation="1" style="padding: 30px; border-radius: 5px">
<center><a href="index.php"><img src="res/anyprintlogo.png" align="middle" alt="Anyprint's Logo" width="90px" height="72px"></img></a></center>
<h3 style="text-align: center; color: #22A7F0;">Expand your printing business for FREE!</h3>
<form id ="formSignUp" action="verify.php" method="post">
<h3>Your Details</h3>
<paper-input id= "unamefake" label="Username" pattern="[a-zA-z0-9]*" required auto-validate error-message="Invalid Username" value="{{uname}}" ></paper-input>
<input type="hidden" id="uname" name="uname" />
<paper-input id="upasswordfake" label="Password (8-12 characters)" type="password" minlength="8" maxlength="12" required auto-validate error-message="Invalid password" value={{upassword}}></paper-input>
<input type="hidden" id="upassword" name="upassword" />
<paper-input id="uemailfake" label="Email" type="email" required auto-validate error-message="Invalid email address" value={{uemail}}></paper-input>
<input type="hidden" id="uemail" name="uemail" />
<paper-input id="uhpnumfake" label="H/P Number (0123456789)" minlength="10" maxlength="11" allowed-pattern="[0-9]" required auto-validate error-message="Invalid phone number" value={{uhpnum}}></paper-input>
<input type="hidden" id="uhpnum" name="uhpnum" />
<h3>Your Shop's Details</h3>
<paper-input id= "upsnamefake" label="Your shop's name (At least 8 char)" minlength="8" pattern="[a-zA-z0-9 ]*" required auto-validate error-message="Invalid shop's name" value="{{upsname}}" ></paper-input>
<input type="hidden" id="upsname" name="upsname" />
<paper-dropdown-menu id="upsareafake" label="Your shop's location (State)" style="width: 100%;">
<paper-menu class="dropdown-content" selected="2">
<paper-item>Kedah</paper-item>
<paper-item>Kelantan</paper-item>
<paper-item>Kuala Lumpur</paper-item>
<paper-item>Melaka</paper-item>
<paper-item>Negeri Sembilan</paper-item>
<paper-item>Pahang</paper-item>
<paper-item>Perak</paper-item>
<paper-item>Perlis</paper-item>
<paper-item>Penang</paper-item>
<paper-item>Sabah</paper-item>
<paper-item>Sarawak</paper-item>
<paper-item>Selangor</paper-item>
<paper-item>Terengganu</paper-item>
</paper-menu>
</paper-dropdown-menu>
<input type="hidden" id="upsarea" name="upsarea" />
<paper-input id="upsaddressfake" label="Your shop's address" required auto-validate error-message="Address is required" value={{upsaddress}}></paper-input>
<input type="hidden" id="upsaddress" name="upsaddress" />
<paper-dropdown-menu id="upsohfake" label="Opening Hour (From)" style="width: 100%">
<paper-menu class="dropdown-content" selected="9">
<paper-item>12 AM</paper-item>
<paper-item>1 AM</paper-item>
<paper-item>2 AM</paper-item>
<paper-item>3 AM</paper-item>
<paper-item>4 AM</paper-item>
<paper-item>5 AM</paper-item>
<paper-item>6 AM</paper-item>
<paper-item>7 AM</paper-item>
<paper-item>8 AM</paper-item>
<paper-item>9 AM</paper-item>
<paper-item>10 AM</paper-item>
<paper-item>11 AM</paper-item>
<paper-item>12 PM</paper-item>
<paper-item>1 PM</paper-item>
<paper-item>2 PM</paper-item>
<paper-item>3 PM</paper-item>
<paper-item>4 PM</paper-item>
<paper-item>5 PM</paper-item>
<paper-item>6 PM</paper-item>
<paper-item>7 PM</paper-item>
<paper-item>8 PM</paper-item>
<paper-item>9 PM</paper-item>
<paper-item>10 PM</paper-item>
<paper-item>11 PM</paper-item>
</paper-menu>
</paper-dropdown-menu>
<input type="hidden" id="upsoh" name="upsoh" />
<paper-dropdown-menu id="upschfake" label="Closing Hour (Until)" style="width: 100%">
<paper-menu class="dropdown-content" selected="17">
<paper-item>12 AM</paper-item>
<paper-item>1 AM</paper-item>
<paper-item>2 AM</paper-item>
<paper-item>3 AM</paper-item>
<paper-item>4 AM</paper-item>
<paper-item>5 AM</paper-item>
<paper-item>6 AM</paper-item>
<paper-item>7 AM</paper-item>
<paper-item>8 AM</paper-item>
<paper-item>9 AM</paper-item>
<paper-item>10 AM</paper-item>
<paper-item>11 AM</paper-item>
<paper-item>12 PM</paper-item>
<paper-item>1 PM</paper-item>
<paper-item>2 PM</paper-item>
<paper-item>3 PM</paper-item>
<paper-item>4 PM</paper-item>
<paper-item>5 PM</paper-item>
<paper-item>6 PM</paper-item>
<paper-item>7 PM</paper-item>
<paper-item>8 PM</paper-item>
<paper-item>9 PM</paper-item>
<paper-item>10 PM</paper-item>
<paper-item>11 PM</paper-item>
</paper-menu>
</paper-dropdown-menu>
<input type="hidden" id="upsch" name="upsch" />
<paper-button name="btnsignup" class="blue" raised onclick="submitHandler()" value="signup">CREATE AN ACCOUNT</paper-button>
<input type="hidden" name="signupbusiness" value="signupbusiness"/>
</form>
</paper-material elevation="1">
</div>
<paper-dialog id="verification" with-backdrop modal>
<h1>One more step...</h1>
<div>
<p>A 4-digit verification code will be send to your registered address in 2-3 days to verify your identity. Please key in the code once you got the code during your next login. Please confirm the key in address is correct: <p>
<center><h3 style="color: red"><b>{{upsaddress}}</b></h3></center>
<p><b>NOTE: Your printing shop will not show up in customer's page unless you key in the correct code</b></p>
</div>
<div class="buttons">
<paper-button dialog-dismiss>Cancel</paper-button>
<paper-button autofocus onclick="continueReg()">Continue...</paper-button>
</paper-dialog>
</template>
<script>
var app = document.querySelector('#app');
var oh;
var ch;
var realOh = -1;
var realCh = -1;
var submitHandler = function(){
console.log(app.$.upsohfake.value);
if(!app.$.unamefake.validate()){
return;
}
if(!app.$.upasswordfake.validate()){
return;
}
if(!app.$.uemailfake.validate()){
return;
}
if(!app.$.uhpnumfake.validate()){
return;
}
if(!app.$.upsnamefake.validate()){
return;
}
if(!app.$.upsaddressfake.validate()){
return;
}
if(app.$.upsohfake.value == app.$.upschfake.value){
alert("Invalid Time!");
return;
}
oh = app.$.upsohfake.value.split(" ");
ch = app.$.upschfake.value.split(" ");
realOh = parseInt(oh[0]);
realCh = parseInt(ch[0]);
if(oh[1] == "PM"){
realOh = realOh + 12;
if(realOh == 24){
realOh = 0;
}
}
if(ch[1] == "PM"){
realCh = realCh + 12;
if(realCh == 24){
realCh = 0;
}
}
var dialog = document.querySelector("#verification");
dialog.open();
}
var continueReg = function(){
app.$.uname.value = app.uname;
app.$.upassword.value = app.upassword;
app.$.uemail.value = app.uemail;
app.$.uhpnum.value = app.uhpnum;
app.$.upsname.value = app.upsname;
app.$.upsarea.value = app.$.upsareafake.value;
app.$.upsaddress.value = app.upsaddress;
app.$.upsoh.value = realOh;
app.$.upsch.value = realCh;
app.$.formSignUp.submit();
}
</script>
</body>
</html>