forked from szerko/Respond2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount.php
More file actions
356 lines (267 loc) · 10.3 KB
/
account.php
File metadata and controls
356 lines (267 loc) · 10.3 KB
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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
<?php
include 'app.php'; // import php files
$authUser = new AuthUser(); // get auth user
$authUser->Authenticate('All');
?>
<!DOCTYPE html>
<html>
<head>
<title>Settings—<?php print $authUser->SiteName; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- include css -->
<link href="<?php print FONT; ?>" rel="stylesheet" type="text/css">
<link href="<?php print BOOTSTRAP_CSS; ?>" rel="stylesheet">
<link href="<?php print FONTAWESOME_CSS; ?>" rel="stylesheet">
<link type="text/css" href="css/app.css?v=<?php print VERSION; ?>" rel="stylesheet">
<link type="text/css" href="css/messages.css?v=<?php print VERSION; ?>" rel="stylesheet">
</head>
<body data-currpage="account" data-pubkey="<?php print STRIPE_PUB_KEY; ?>">
<p id="message">
<span>Holds the message text.</span>
<a class="close" href="#"></a>
</p>
<?php include 'modules/menu.php'; ?>
<section class="main">
<nav>
<a class="show-menu"><i class="fa fa-bars fa-lg"></i></a>
<ul>
<li class="static active"><a>Account</a></li>
</ul>
</nav>
<!-- /nav -->
<div class="container">
<div class="row">
<div class="col-md-12">
<table class="read-only-table table table-bordered">
<col width="20%">
<tr>
<th>Type:</th>
<td>
<span class="loading" data-bind="visible: customerLoading()"><i class="fa fa-refresh fa-spin"></i> Loading account...</span>
<span data-bind="text:type"></span>
</td>
</tr>
<tr>
<th>Status:</th>
<td>
<span data-bind="text:status"></span>
<a class="btn btn-default" data-bind="visible: (status().toUpperCase()=='TRIAL' || status().toUpperCase()=='UNSUBSCRIBED'), click: showSubscribe">Subscribe</a>
</td>
</tr>
<tr data-bind="visible: (type().toUpperCase() == 'SUBSCRIPTION')">
<th>Plan:</th>
<td>
<span data-bind="text:planName()"></span>
<small data-bind="text:amountReadable()"></small>
<a class="btn btn-default" data-bind="visible: (status().toUpperCase()=='ACTIVE'), click: showChangePlans">Change Plan</a>
<a class="btn btn-default" data-bind="visible: (status().toUpperCase()=='ACTIVE'), click: showUnsubscribe">Unsubscribe</a>
</td>
</tr>
<tr data-bind="visible: (type().toUpperCase() == 'SUBSCRIPTION')">
<th>Renewal Date:</th>
<td>
<span data-bind="text:renewalReadable"></span>
</td>
</tr>
<tr data-bind="visible: hasCard">
<th>Payment:</th>
<td>
<span data-bind="text:cardReadable"></span>
<small data-bind="text:cardExpires"></small>
<a class="btn btn-default" data-bind="click:showUpdatePayment">Update Payment</a>
</td>
</tr>
</table>
<!-- /.table -->
</div>
<!-- /.col-md-12 -->
</div>
<!-- /.row -->
</div>
<!-- /.container -->
</section>
<!-- /.main -->
<div class="modal fade" id="unsubscribeDialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>Unsubscribe</h3>
</div>
<div class="modal-body">
<p>
Are you sure that you want to unsubscribe?
</p>
</div>
<div class="modal-footer">
<button class="secondary-button" data-dismiss="modal">Close</button>
<button class="primary-button" data-bind="click: unsubscribe">Unsubscribe</button>
</div>
<!-- /.modal-footer -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="changePlanDialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>Change Plan</h3>
</div>
<div class="modal-body">
<p class="modal-info">
Select your new plan from the list below.
</p>
<div class="form-group separator">
<div>
<!-- ko foreach: plans -->
<label class="radio">
<input type="radio" name="plan" data-bind="value:id, checked:$parent.planId()">
<span data-bind="text:name"></span><br>
<small data-bind="text:readable"></small>
</label>
<!-- /ko -->
<span class="loading" data-bind="visible: plansLoading()"><i class="fa fa-refresh fa-spin"></i> Loading plans...</span>
</div>
</div>
</div>
<div class="modal-footer">
<button class="secondary-button" data-dismiss="modal">Close</button>
<button class="primary-button" data-bind="click: changePlan">Change Plan</button>
</div>
<!-- /.modal-footer -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="updatePaymentDialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>Update Payment</h3>
</div>
<div class="modal-body">
<form data-bind="visible: (showNewCard() == false)">
<p class="modal-info">
Update the expiration date for your card. If you want to add a new card, click the "New Card" button.
</p>
<div class="form-group">
<div>
<span class="read-only">
<span data-bind="text:cardReadable"></span>
<small data-bind="text:cardExpires"></small>
</span>
</div>
</div>
<div class="form-group">
<label for="expires">Expires:</label>
<div>
<input id="changeMM" type="number" placeholder="MM" class="inline form-control input-2" maxlength="2" data-bind="value: cardExpiredMonth"> / <input id="changeYY" type="number" maxlength="4" placeholder="YYYY" class="inline form-control input-4" data-bind="value: cardExpiredYear">
</div>
</div>
</form>
<!-- /.form-horizontal -->
<form action="" method="POST" id="newcard-form" data-bind="visible: showNewCard">
<p class="modal-info">
Enter the details for your new credit card.
</p>
<div class="form-group">
<label for="update-cc">Credit Card #:</label>
<input id="update-cc" type="text" maxlength="20" data-stripe="number" class="form-control">
</div>
<div class="form-group">
<label for="update-cvc">Card Code (CVC):</label>
<input id="update-cvc" type="text" placeholder="CVC" class="form-control input-4" maxlength="4" data-stripe="cvc">
</div>
<div class="form-group separator">
<label for="update-expiresMM">Expires:</label>
<div>
<input id="update-expiresMM" type="text" placeholder="MM" class="inline form-control input-2" maxlength="2" data-stripe="exp-month"> / <input id="update-expiresYY" type="text" maxlength="4" placeholder="YYYY" class="inline form-control input-4" data-stripe="exp-year">
</div>
</div>
</form>
<!-- /.form-horizontal -->
</div>
<div class="modal-footer">
<button class="tertiary-button" data-bind="click: newCard, visible: (showNewCard()==false)">New Card</button>
<button class="secondary-button" data-dismiss="modal">Close</button>
<button class="primary-button" data-bind="click: updatePayment">Update Payment</button>
</div>
<!-- /.modal-footer -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="subscribeDialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>Subscribe</h3>
</div>
<div class="modal-body">
<form action="" method="POST" id="subscribe-form">
<p class="modal-info">
Select a plan and enter your credit card information to subscribe.
</p>
<div class="form-group separator">
<div>
<!-- ko foreach: plans -->
<label class="radio">
<input type="radio" name="plan" data-bind="value:id, checked:$parent.planId()">
<span data-bind="text:name"></span><br>
<small data-bind="text:readable"></small>
</label>
<!-- /ko -->
</div>
</div>
<div class="form-group">
<label for="address">Credit Card #:</label>
<input id="cc" type="text" maxlength="20" data-stripe="number" class="form-control">
</div>
<div class="form-group">
<label for="cvc">Card Code (CVC):</label>
<input id="cvc" type="text" placeholder="CVC" class="form-control input-4" maxlength="4" data-stripe="cvc">
</div>
<div class="form-group">
<label for="expires">Expires:</label>
<div>
<input id="expiresMM" type="text" placeholder="MM" class="inline form-control input-2" maxlength="2" data-stripe="exp-month"> / <input id="expiresYY" type="text" maxlength="4" placeholder="YYYY" class="inline form-control input-4" data-stripe="exp-year">
</div>
</div>
</form>
<!-- /.form-horizontal -->
</div>
<div class="modal-footer">
<button class="secondary-button" data-dismiss="modal">Close</button>
<button class="primary-button" data-bind="click: subscribe">Subscribe</button>
</div>
<!-- /.modal-footer -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
</body>
<!-- include js -->
<script type="text/javascript" src="<?php print JQUERY_JS; ?>"></script>
<script type="text/javascript" src="<?php print JQUERYUI_JS; ?>"></script>
<script type="text/javascript" src="<?php print BOOTSTRAP_JS; ?>"></script>
<script type="text/javascript" src="<?php print KNOCKOUT_JS; ?>"></script>
<script type="text/javascript" src="<?php print STRIPE_JS; ?>"></script>
<script type="text/javascript" src="js/helper/moment.min.js?v=<?php print VERSION; ?>"></script>
<script type="text/javascript" src="js/global.js?v=<?php print VERSION; ?>"></script>
<script type="text/javascript" src="js/dialog.js?v=<?php print VERSION; ?>"></script>
<script type="text/javascript" src="js/messages.js?v=<?php print VERSION; ?>"></script>
<script type="text/javascript" src="js/viewModels/models.js?v=<?php print VERSION; ?>"></script>
<script type="text/javascript" src="js/viewModels/accountModel.js?v=<?php print VERSION; ?>"></script>
</html>