-
Notifications
You must be signed in to change notification settings - Fork 0
/
clientchange19.html
341 lines (323 loc) · 16.7 KB
/
clientchange19.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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<!-- <script src="jquery-1.4.1.min.js" type="text/javascript"></script> -->
<!-- remove above import if not testing locally - seems to be merged into main js import on clickfunnel pages -->
<style type="text/css" media="screen">
.done {
/* text-decoration: line-through; */
display: none;
}
.formdiv {
margin: 0 auto;
width: 320px;
}
.formlabel {
display: block;
text-align: center;
font-size: 25px;
color: rgb(0, 117, 178);
margin-top: 5px;
margin-bottom: 5px;
}
.forminput {
display: block;
width: 100%;
margin-top: 5px;
margin-bottom: 15px;
/* text-align: center; */
}
.fieldresponse {
width: 100%;
text-align: center;
min-height: 36px;
margin-top: 5px;
margin-bottom: 10px;
font-size: larger;
font-size: 30px;
color: maroon;
}
.fieldresponseerror {
width: 100%;
text-align: left;
min-height: 36px;
margin-top: 5px;
margin-bottom: 10px;
font-size: larger;
font-size: 22px;
color: maroon;
}
/* .formbtn{
border: 1px solid grey;
padding-right: 20px;
padding-top: 6px;
padding-bottom: 6px;
padding-left: 20px;
font-weight: bold;
display: block;
text-align: center;
margin-left: auto;
margin-right: auto;
font-size:larger;
} */
.formbtn {
color: #fff !important;
text-transform: uppercase;
background: #60a3bc;
padding: 20px;
border-radius: 50px;
display: inline-block;
border: none;
transition: all 0.4s ease 0s;
font-size: large;
}
.formbtn:not(.no-hover):hover {
text-shadow: 0px 0px 6px rgba(255, 255, 255, 1);
box-shadow: 0px 5px 40px -10px rgba(0,0,0,0.57);
-webkit-box-shadow: 0px 5px 40px -10px rgba(0,0,0,0.57);
-moz-box-shadow: 0px 5px 40px -10px rgba(0,0,0,0.57);
transition: all 0.4s ease 0s;
}
.formbtn:focus {
outline: none;
box-shadow: none;
}
.forminfo {
font-size: larger;
color: black;
text-align: center;
margin-bottom: 5px;
min-height: 50px;
}
.formresult {
width: 100%;
text-align: center;
min-height: 50px;
font-size: large;
color: red;
margin-bottom: 5px;
}
</style>
<script>
function addAsRestParam(url, name, value) {
if (url.indexOf("?") == -1) {
return url + "?" + name + "=" + encodeURIComponent(value);
} else {
return url + "&" + name + "=" + encodeURIComponent(value);
}
}
</script>
<script type="text/javascript">
$("#btnCancel").live("click", function () {
if (document.getElementById('btnCancel').classList.contains('no-hover')) {
return;
}
$("#fieldresponse").html('');
$("#info").html('');
$("#fieldresponse").html('<b style="font-size: 22; color: black;">Working...</b>');
document.getElementById('btnCancel').classList.add('no-hover');
//.setAttribute('disabled', true);
// var url = 'http://127.0.0.1:5000/cbapi/requestchange19';
// var url = 'https://3.22.1.101:5001/cbapi/requestcancel';
// var url = 'http://3.22.1.101:5000/cbapi/requestcancel';
var url = 'https://cbapi.jb3innovations.com:5001/cbapi/requestchange19';
var email = $("#email").val();
var lastName = $("#lastName").val();
var zip = $("#zip").val();
if (!email || !lastName || !zip) {
$("#fieldresponse").html('<b style="font-size: 22;">Please fill all form fields.</b>');
$("#fieldresponse").addClass('fieldresponseerror');
document.getElementById('btnCancel').classList.remove('no-hover');
if (!email) {
$("#lblEmail").html('<b style="color:red;">Email</b>');
} else {
$("#lblEmail").html('<b>Email</b>');
}
if (!zip) {
$("#lblZip").html('<b style="color:red;">Zip</b>');
} else {
$("#lblZip").html('<b>Zip</b>');
}
if (!lastName) {
$("#lblLastName").html('<b style="color:red;">Last Name</b>');
} else {
$("#lblLastName").html('<b>Last Name</b>');
}
}
else {
$("#fieldresponse").removeClass('fieldresponseerror');
$("#lblEmail").html('<b>Email</b>');
$("#lblZip").html('<b>Zip</b>');
$("#lblLastName").html('<b>Last Name</b>');
url = addAsRestParam(url, "email", $("#email").val())
url = addAsRestParam(url, "lastName", $("#lastName").val())
url = addAsRestParam(url, "zip", $("#zip").val())
$.ajax({
type: "GET",
contentType: "text/plain",
url: url,
// data: '{"email": "' + $("#email").val() + ',' + '"zip": "' + $("#zip").val() + ',' + '"lastName": "' + $("#lastName").val() + '"}',
// data: '{}',
processData: false,
dataType: "json",
headers: {
'Content-Type': 'text/plain',
'crossDomain': 'true',
'Connection': 'keep-alive',
'User-Agent': '*/*',
'Connection': '*/*',
"Access-Control-Allow-Origin": '*',
},
success: function (response) {
if (response != null) {
// var result = eval(response.d);
switch (eval(response.d)) {
case 'OK':
$("#fieldresponse").html('<b style="color:green; font-weight:bold; ">Success</b>');
$("#info").html('<b style="color:green; font-weight:bold; ">Congratulations! Your monthly subscription cost has been reduced to $19.00! You will receive a confirmation email within the next 24 hours.</b>');
document.getElementById('btnCancel').classList.toggle('done');
document.getElementById('btnCancel').classList.add('no-hover');
document.getElementById('lastName').setAttribute('disabled', true);
document.getElementById('email').setAttribute('disabled', true);
document.getElementById('zip').setAttribute('disabled', true);
window.location.replace("https://www.soloprehab.com/pfc-19-month-discount-subscription1608483679830");
break;
case 'OK MORE':
$("#fieldresponse").html('<b style="color:green; font-weight:bold; ">Success</b>');
$("#info").html('<b style="color:green; font-weight:bold; ">Congratulations! Your monthly subscription cost has been reduced to $19.00! You will receive a confirmation email within the next 24 hours.<br>Please note that we found more than 1 active Pain Free Club subscription with your email. Contact support if this is in error.</b>');
document.getElementById('btnCancel').classList.toggle('done');
document.getElementById('btnCancel').classList.add('no-hover');
document.getElementById('lastName').setAttribute('disabled', true);
document.getElementById('email').setAttribute('disabled', true);
document.getElementById('zip').setAttribute('disabled', true);
window.location.replace("https://www.soloprehab.com/pfc-19-month-discount-subscription1608483679830");
break;
case 'ALREADY 19':
$("#fieldresponse").html('<b style="color:red; font-weight:bold; ">Success</b>');
$("#info").html('<b style="color:maroon; font-weight:bold; ">Your monthly subscription cost was already $19. You should receive a confirmation email within 24 hours.</b>');
document.getElementById('btnCancel').classList.toggle('done');
document.getElementById('btnCancel').classList.add('no-hover');
document.getElementById('lastName').setAttribute('disabled', true);
document.getElementById('email').setAttribute('disabled', true);
document.getElementById('zip').setAttribute('disabled', true);
break;
case 'FAIL':
$("#fieldresponse").html('<b style="color:red; font-weight:bold; ">Error: Unknown Error</b>');
$("#info").html('<b style="color:red; font-weight:bold; ">An unknown error occured. <br>Double-check above fields or contact support.</b>');
document.getElementById('btnCancel').classList.remove('no-hover');
break;
case 'REJECT':
$("#fieldresponse").html('<b style="color:red; font-weight:bold; ">Error: Form Rejected</b>');
$("#info").html('<b style="color:red; font-weight:bold; ">We have received too many form submissions from your IP address. Please try again in 24 hours or contact support.</b>');
document.getElementById('btnCancel').classList.toggle('done');
document.getElementById('btnCancel').classList.add('no-hover');
document.getElementById('lastName').setAttribute('disabled', true);
document.getElementById('email').setAttribute('disabled', true);
document.getElementById('zip').setAttribute('disabled', true);
break;
case 'NOT FOUND':
$("#fieldresponse").html('<b style="color:red; font-weight:bold; ">Error: Not Found</b>');
$("#info").html('<b style="color:maroon; font-weight:bold; ">We couldn\'t find any active subscriptions for the information you provided. Please double-check your information or contact support.</b>');
document.getElementById('btnCancel').classList.remove('no-hover');
break;
default:
$("#fieldresponse").html('<b style="color:red; font-weight:bold; ">Error: Connection Failed</b>');
$("#info").html('<b style="color:red; font-weight:bold; ">We couldn\'t contact our server. <br>Please try again later or contact support.</b>');
document.getElementById('btnCancel').classList.remove('no-hover');
break;
}
}else {
$("#fieldresponse").html('<b style="color:red;">Error</b>');
$("#info").html('<b style="color:red;">' + (a.responseText == "" ? "Error: Unknown, Contact Support" : a.responseText) + '</b>');
// $("#info").html('<b style="color:red;">Error: No Response, Contact Support</b>');
}
// var html = "";
// $.each(customers, function () {
// html += "<span>Name: " + this.Name + " Id: " + this.Id + "</span><br />";
// });color:darkred;
// $("#result").attr.apply("color: green;")
// $("#result").addClass("style", "green")
},
error: function (a, b, c) {
if (a != null) {
switch (a.responseText) {
case 'OK':
$("#fieldresponse").html('<b style="color:green; font-weight:bold; ">Success</b>');
$("#info").html('<b style="color:green; font-weight:bold; ">Congratulations! Your monthly subscription cost has been reduced to $19.00! You will receive a confirmation email within the next 24 hours.</b>');
document.getElementById('btnCancel').classList.toggle('done');
document.getElementById('btnCancel').classList.add('no-hover');
document.getElementById('lastName').setAttribute('disabled', true);
document.getElementById('email').setAttribute('disabled', true);
document.getElementById('zip').setAttribute('disabled', true);
window.location.replace("https://www.soloprehab.com/pfc-19-month-discount-subscription1608483679830");
break;
case 'OK MORE':
$("#fieldresponse").html('<b style="color:green; font-weight:bold; ">Success</b>');
$("#info").html('<b style="color:green; font-weight:bold; ">Congratulations! Your monthly subscription cost has been reduced to $19.00! You will receive a confirmation email within the next 24 hours.<br>Please note that we found more than 1 active Pain Free Club subscription with your email. Contact support if this is in error.</b>');
document.getElementById('btnCancel').classList.toggle('done');
document.getElementById('btnCancel').classList.add('no-hover');
document.getElementById('lastName').setAttribute('disabled', true);
document.getElementById('email').setAttribute('disabled', true);
document.getElementById('zip').setAttribute('disabled', true);
window.location.replace("https://www.soloprehab.com/pfc-19-month-discount-subscription1608483679830");
break;
case 'ALREADY 19':
$("#fieldresponse").html('<b style="color:red; font-weight:bold; ">Success</b>');
$("#info").html('<b style="color:maroon; font-weight:bold; ">Your monthly subscription cost was already $19. You should receive a confirmation email within 24 hours.</b>');
document.getElementById('btnCancel').classList.toggle('done');
document.getElementById('btnCancel').classList.add('no-hover');
document.getElementById('lastName').setAttribute('disabled', true);
document.getElementById('email').setAttribute('disabled', true);
document.getElementById('zip').setAttribute('disabled', true);
break;
case 'FAIL':
$("#fieldresponse").html('<b style="color:red; font-weight:bold; ">Error: Unknown Error</b>');
$("#info").html('<b style="color:red; font-weight:bold; ">An unknown error occured. <br>Double-check above fields or contact support.</b>');
document.getElementById('btnCancel').classList.remove('no-hover');
break;
case 'REJECT':
$("#fieldresponse").html('<b style="color:red; font-weight:bold; ">Error: Form Rejected</b>');
$("#info").html('<b style="color:red; font-weight:bold; ">We have received too many form submissions from your IP address. Please try again in 24 hours or contact support.</b>');
document.getElementById('btnCancel').classList.toggle('done');
document.getElementById('btnCancel').classList.add('no-hover');
document.getElementById('lastName').setAttribute('disabled', true);
document.getElementById('email').setAttribute('disabled', true);
document.getElementById('zip').setAttribute('disabled', true);
break;
case 'NOT FOUND':
$("#fieldresponse").html('<b style="color:red; font-weight:bold; ">Error: Not Found</b>');
$("#info").html('<b style="color:maroon; font-weight:bold; ">We couldn\'t find any active subscriptions for the information you provided. Please double-check your information or contact support.</b>');
document.getElementById('btnCancel').classList.remove('no-hover');
break;
default:
$("#fieldresponse").html('<b style="color:red; font-weight:bold; ">Error: Connection Failed</b>');
$("#info").html('<b style="color:red; font-weight:bold; ">We couldn\'t contact our server. <br>Please try again later or contact support.</b>');
document.getElementById('btnCancel').classList.remove('no-hover');
break;
}
} else {
$("#fieldresponse").html('<b style="color:red;">Error</b>');
$("#info").html('<b style="color:red;">' + (a.responseText == "" ? "Error: Unknown, Contact Support" : a.responseText) + '</b>');
document.getElementById('btnCancel').classList.remove('no-hover');
}
// alert(a.responseText);
}
});
}
});
</script>
<div class="formdiv">
<form id="formCancel" runat="server" style="padding-top:20px; min-width: 100px;">
<label id="lblEmail" for="email" class="formlabel"><b>Email</b></label>
<input type="text" id="email" class="forminput" />
<label id="lblZip" for="zip" class="formlabel"><b>Zip</b></label>
<input type="text" id="zip" class="forminput" />
<label id="lblLastName" for="lastName" class="formlabel"><b>Last Name</b></label>
<input type="text" id="lastName" class="forminput" />
<div id="fieldresponse" class="fieldresponse"></div>
<div id="result" class="formresult">
<div class="formdiv">
<b><input id="btnCancel" class="formbtn" type="button" value="Get Access For $19/Monthly" /></b>
</div><br>
</div>
<div id="info" class="forminfo">
</div>
</form>
</div>