-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
304 lines (295 loc) · 19.3 KB
/
index.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
<!doctype html>
<html lang="en" is="dmx-app">
<head>
<base href="/">
<meta name="ac:route" content="/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title dmx-text="dvMetaTags.data[0].metaTitle"></title>
<meta name="description" content="" dmx-bind:content="dvMetaTags.data[0].metaDescription">
<!-- Generated using https://realfavicongenerator.net/ -->
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="site.webmanifest">
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="bootstrap/4/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="dmxAppConnect/dmxValidator/dmxValidator.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css" integrity="sha384-REHJTs1r2ErKBuJB0fCK99gCYsVjwxHrSU0N7I1zl9vZbggVJXRMsv/sLlOAGb4M" crossorigin="anonymous">
<link rel="stylesheet" href="dmxAppConnect/dmxNotifications/dmxNotifications.css">
<link rel="stylesheet" href="dmxAppConnect/dmxBootstrap4TableGenerator/dmxBootstrap4TableGenerator.css">
<link rel="stylesheet" href="dmxAppConnect/dmxAnimateCSS/animate.min.css">
<script src="dmxAppConnect/dmxAppConnect.js"></script>
<script src="js/jquery-3.3.1.slim.min.js"></script>
<script src="dmxAppConnect/dmxBootstrap4Navigation/dmxBootstrap4Navigation.js" defer=""></script>
<script src="dmxAppConnect/dmxFormatter/dmxFormatter.js" defer=""></script>
<script src="dmxAppConnect/dmxBrowser/dmxBrowser.js" defer=""></script>
<script src="dmxAppConnect/dmxStateManagement/dmxStateManagement.js" defer=""></script>
<script src="dmxAppConnect/dmxValidator/dmxValidator.js" defer=""></script>
<script src="dmxAppConnect/dmxDataTraversal/dmxDataTraversal.js" defer=""></script>
<script src="dmxAppConnect/dmxRouting/dmxRouting.js" defer=""></script>
<script src="dmxAppConnect/dmxSmoothScroll/dmxSmoothScroll.js" defer=""></script>
<script src="dmxAppConnect/dmxBootstrap4Modal/dmxBootstrap4Modal.js" defer=""></script>
<script src="dmxAppConnect/dmxNotifications/dmxNotifications.js" defer=""></script>
<script src="dmxAppConnect/dmxAnimateCSS/dmxAnimateCSS.js" defer=""></script>
<script src="dmxAppConnect/dmxDatastore/dmxDatastore.js" defer=""></script>
<script type="text/javascript" language="javascript" src="//cdn.datatables.net/plug-ins/1.10.20/api/sum().js"></script>
<script src="dmxAppConnect/dmxBootstrap4Alert/dmxBootstrap4Alert.js" defer=""></script>
</head>
<body id="index">
<dmx-datastore id="dsCart"></dmx-datastore>
<dmx-serverconnect id="scLoggedinCustomer" url="dmxConnect/api/security/customerDetails.php"></dmx-serverconnect>
<dmx-serverconnect id="scLogoutCustomer" url="dmxConnect/api/security/customerLogout.php" noload="noload" dmx-on:success="notifies.success('You have successfully logged out');varLoggedin.setValue(0)"></dmx-serverconnect>
<dmx-serverconnect id="scCompany" url="dmxConnect/api/company/list.php"></dmx-serverconnect>
<dmx-serverconnect id="scOrders" url="dmxConnect/api/orders/list.php"></dmx-serverconnect>
<dmx-serverconnect id="scProducts" url="dmxConnect/api/products/list.php"></dmx-serverconnect>
<dmx-serverconnect id="scCategories" url="dmxConnect/api/categories/list.php"></dmx-serverconnect>
<dmx-serverconnect id="scCountries" url="dmxConnect/api/countries/list.php"></dmx-serverconnect>
<dmx-serverconnect id="scRegionsFiltered" url="dmxConnect/api/regionsFiltered/list.php" dmx-param:filter="mdlRegisterCustomer.frmRegisterCustomer.sel_CustomerCountry.value"></dmx-serverconnect>
<dmx-serverconnect id="scMetaTags" url="dmxConnect/api/metatags/list.php"></dmx-serverconnect>
<dmx-data-view id="dvOrderDetail" dmx-bind:data="scOrders.data.rptOrderDetail[0].qryOrderDetail" filter="(OrderID ==params.id)"></dmx-data-view>
<dmx-data-view id="dvOrders" dmx-bind:data="scOrders.data.rptOrderDetail" filter="(scLoggedinCustomer.data.qryCustomer.CustomerID == OrderCustomerID)"></dmx-data-view>
<dmx-data-view id="dvProducts" dmx-bind:data="scProducts.data.rptProducts" filter="(routeproducts.params.category == "all") ? ProductLive : ((CategoryURL == routeproducts.params.category) && ProductLive))"></dmx-data-view>
<dmx-data-view id="dvMetaTags" dmx-bind:data="scMetaTags.data.qryMetaTags" filter="(metaURL == browser.location.pathname)"></dmx-data-view>
<dmx-data-view id="dvCountry" dmx-bind:data="scCountries.data.qryCountries" filter="(CountryISO == scLoggedinCustomer.data.qryCustomer.CustomerCountry)"></dmx-data-view>
<div is="dmx-browser" id="browser"></div>
<dmx-datetime id="varDate" interval="days"></dmx-datetime>
<dmx-smooth-scroll id="scroll"></dmx-smooth-scroll>
<dmx-notifications id="notifies"></dmx-notifications>
<dmx-value id="varLoggedin" dmx-bind:value="scLoggedinCustomer.data.qryCustomer.CustomerID"></dmx-value>
<dmx-value id="varCheckoutCheck" dmx-bind:value="1"></dmx-value>
<header class="bg-dark fixed-top shadow">
<div class="container">
<div class="row">
<div class="col">
<nav class="navbar navbar-expand-lg justify-content-end navbar-dark bg-dark pt-0 pb-0">
<a class="navbar-brand ml-auto" href="./" dmx-on:click="scroll.goto('#index')" data-toggle="collapse" data-target=".navbar-collapse.show">
<img dmx-bind:src="assets/images/company_logo/{{scCompany.data.qryCompany.CompanyLogo}}" height="45" alt="Company Logo"> {{scCompany.data.qryCompany.CompanyName}} </a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar1_collapse" aria-controls="navbar1_collapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbar1_collapse">
<div class="navbar-nav">
<button class="btn text-warning" dmx-on:click="mdlShoppingCart.show()" dmx-show="dsCart.data.hasItems()"><i class="fas fa-shopping-cart fa-lg"></i> {{dsCart.data.sum(`quantity`)}} </button>
<a class="nav-item nav-link active" href="./" dmx-on:click="scroll.goto('#index')">Home</a>
<a class="nav-item nav-link" href="./about" dmx-on:click="scroll.goto('#index')">About</a>
<div class="dropdown">
<a href="#" class="nav-item nav-link dropdown-toggle" data-toggle="dropdown">Products</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="./products/all">All</a>
<a class="dropdown-item" href="#" dmx-repeat:repeat1="scCategories.data.qryCategories" dmx-bind:href="metaURL">{{CategoryName}}</a>
</div>
</div>
<a class="nav-item nav-link" href="./contact" dmx-on:click="scroll.goto('#index')">Contact</a>
<a class="nav-item nav-link" href="#" dmx-on:click="mdlRegisterCustomer.show('signup')" dmx-hide="(varLoggedin.value >= 1)">Login</a>
<a class="nav-item nav-link" href="#" dmx-show="(varLoggedin.value >= 1)" dmx-on:click="scLogoutCustomer.load({});scOrders.load({});scLoggedinCustomer.load({});varLoggedin.setValue(0)">Logout </a>
<a class="nav-item nav-link" href="./user-home" dmx-show="(varLoggedin.value >= 1)">{{scLoggedinCustomer.data.qryCustomer.CustomerFirstName}} <i class="fas fa-user-cog"></i>
</a>
</div>
</div>
</nav>
</div>
</div>
</div>
</header>
<main>
<div is="dmx-route" path="/" url="_home.html" id="routehome" exact></div>
<div is="dmx-route" path="/about" url="_about.html" id="routeabout" exact></div>
<div is="dmx-route" path="/products/:category" url="_products.html" id="routeproducts" exact></div>
<div is="dmx-route" path="/contact" url="_contact.html" id="routecontact" exact></div>
<div is="dmx-route" path="/checkout" url="_checkout.html" id="routecheckout"></div>
<div is="dmx-route" path="/user-home" url="_user-home.html" id="routeuserhome"></div>
</main>
<footer class="mt-4 navbar-dark bg-dark">
<div class="container">
<div class="row">
<div class="col pt-2">
<p class="text-center small text-light">© Copyright
<span
dmx-hide="scCompany.data.qryCompany.CompanyRegistrationDate.getYear(scCompany.data.qryCompany.CompanyRegistrationDate) == varDate.datetime.getYear(varDate.datetime)">{{scCompany.data.qryCompany.CompanyRegistrationDate.getYear(scCompany.data.qryCompany.CompanyRegistrationDate)}}-</span>{{varDate.datetime.getYear(varDate.datetime)}}
-
{{scCompany.data.qryCompany.CompanyName}} - All Rights Reserved.
</p>
</div>
</div>
</div>
</footer>
<!-- Modal for Shopping Cart -->
<div class="modal fade" id="mdlShoppingCart" is="dmx-bs4-modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header bg-primary text-light">
<h5 class="modal-title"><i class="fas fa-shopping-cart"></i> Shopping Cart</h5>
<button type="button" class="close text-light" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<h6 dmx-hide="dsCart.data.hasItems()">The Shopping Cart is empty!
</h6>
<table class="table" dmx-show="dsCart.data.hasItems()">
<thead>
<tr>
<th>Product</th>
<th class="text-center">Price</th>
<th class="text-center">Quantity</th>
<th class="text-center">Remove</th>
<th class="text-right">Amount</th>
</tr>
</thead>
<tbody is="dmx-repeat" dmx-generator="bs4table" dmx-bind:repeat="dsCart.data" id="rptCartItems" dmx-show="dsCart.data.hasItems()">
<tr>
<td dmx-text="productname"></td>
<td class="text-center" dmx-text="productprice.formatCurrency("$", ".", ",", "2")"></td>
<td class="text-center">
<button class="btn btn-sm text-primary" style="box-shadow: 0 0 0 0; margin-top: -5px;" dmx-on:click="dsCart.update({$id: $id},{quantity: quantity - 1})" dmx-bind:disabled="quantity == 1"><i
class="fas fa-minus fa-xs"></i></button>
{{quantity}}
<button class="btn btn-sm text-primary" style="box-shadow: 0 0 0 0; margin-top: -5px;" dmx-on:click="dsCart.update({$id: $id},{quantity: quantity + 1})"><i class="fas fa-plus fa-xs"></i></button>
</td>
<td class="text-center">
<button class="btn btn-sm text-danger" style="margin-top: -5px;" dmx-on:click="dsCart.delete({$id: $id})" dmx-show="(dsCart.data.count() > 1)"><i class="far fa-trash-alt"></i></button>
<button class="btn btn-sm text-danger" style="margin-top: -5px;" dmx-on:click="dsCart.clear();mdlShoppingCart.hide()" dmx-hide="(dsCart.data.count() > 1)"><i class="far fa-trash-alt"></i></button>
</td>
<td dmx-text="(productprice * quantity).formatCurrency("$", ".", ",", "2")" class="text-right">
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td><button class="btn btn-outline-danger btn-sm" dmx-on:click="dsCart.clear();mdlShoppingCart.hide()" dmx-show="(dsCart.data.count() > 1)"><i class="far fa-trash-alt"></i> Empty Cart</button></td>
<th colspan="3" class="text-right">Total Amount</th>
<td class="text-right" dmx-text="(dsCart.data.sum(`productprice * quantity`)).formatCurrency("$", ".", ",", "2")"></td>
</tr>
</tfoot>
</table>
</div>
<div class="modal-footer">
<a href="./products/all" class="btn btn-primary" data-dismiss="modal"><i class="fas fa-arrow-alt-circle-left fa-lg"></i> Continue Shopping</a>
<a href="./checkout" class="btn btn-primary" dmx-show="dsCart.data.hasItems()" dmx-on:click="mdlShoppingCart.hide()">Checkout <i class="fas fa-arrow-alt-circle-right fa-lg"></i></a>
</div>
</div>
</div>
</div>
<!-- Modal Register Customer -->
<div class="modal fade" id="mdlRegisterCustomer" is="dmx-bs4-modal" tabindex="-1" role="dialog" dmx-on:hide-bs-modal="frmLoginCustomer.reset();frmRegisterCustomer.reset()">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="nav nav-pills nav-fill">
<a class="nav-item nav-link border border-primary border-rounded active m-2" data-toggle="pill" href="#login" role="tab" aria-selected="true" data-target="#login">Login</a>
<a class="nav-item nav-link border border-primary border-rounded m-2" data-toggle="pill" href="#signup" role="tab" aria-selected="false" data-target="#signup">Register</a>
</div>
<div class="tab-content py-0">
<div class="tab-pane fade in active show" id="login" role="tabpanel">
<form id="frmLoginCustomer" method="post" is="dmx-serverconnect-form" action="dmxConnect/api/security/customerLogin.php"
dmx-on:success="scLoggedinCustomer.load();scOrders.load({});mdlRegisterCustomer.hide();notifies.success('You have successfully logged in');varLoggedin.setValue(1)"
dmx-on:unauthorized="notifies.danger('Your login details are incorrect. Please try again or register as a customer.')" dmx-on:error="notifies.danger('An error has occurred')">
<div class="form-group">
<label for="logincustomerusername">Username</label>
<input type="text" class="form-control" id="logincustomerusername" name="username" placeholder="Your username or email">
</div>
<div class="form-group mt-2">
<label for="logincustomerpassword">Password</label>
<input type="password" class="form-control" id="logincustomerpassword" name="password" placeholder="Your password">
</div>
<div class="form-group mt-2">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" value="1" id="logincustomerremember" name="remember">
<label class="custom-control-label" for="logincustomerremember">Keep me logged in</label>
</div>
</div>
<div class="form-group mt-4">
<a href="" class="btn btn-outline-primary" type="submit">Forgot password?</a>
<button type="submit" class="btn btn-primary">Login</button>
</div>
</form>
</div>
<div class="tab-pane fade" id="signup" role="tabpanel">
<p>We need your information to know where to send the parcel as well as for you to view archived invoices. We will never share this infomation with others.</p>
<form is="dmx-serverconnect-form" id="frmRegisterCustomer" method="post" action="dmxConnect/api/customers/register.php" dmx-generator="bootstrap4" dmx-form-type="horizontal"
dmx-on:success="scLoggedinCustomer.load({},true);scOrders.load({});mdlRegisterCustomer.hide();notifies.success('You have successfully registered and are now logged in');varLoggedin.setValue(1)"
dmx-on:error="notifies.danger('An error has occurred')" dmx-on:unauthorized="notifies.danger('An error has occurred')">
<div class="form-group row">
<label for="inp_CustomerFirstName" class="col-sm-2 col-form-label">Firstname</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inp_CustomerFirstName" name="CustomerFirstName" aria-describedby="inp_CustomerFirstName_help" placeholder="Enter Firstname" maxlength="50" required="">
</div>
</div>
<div class="form-group row mt-2">
<label for="inp_CustomerLastName" class="col-sm-2 col-form-label">Lastname</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inp_CustomerLastName" name="CustomerLastName" aria-describedby="inp_CustomerLastName_help" placeholder="Enter Lastname" maxlength="50" required="">
</div>
</div>
<div class="form-group row mt-2">
<label for="inp_CustomerEmail" class="col-sm-2 col-form-label">Email</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inp_CustomerEmail" name="CustomerEmail" aria-describedby="inp_CustomerEmail_help" placeholder="Enter Email" maxlength="60" data-rule-email="" required="">
</div>
</div>
<div class="form-group row mt-2">
<label for="inp_CustomerPassword" class="col-sm-2 col-form-label">Password</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="inp_CustomerPassword" name="CustomerPassword" aria-describedby="inp_CustomerPassword_help" placeholder="Enter Password" maxlength="20" required="">
</div>
</div>
<div class="form-group row mt-2">
<label for="inp_CustomerAddress" class="col-sm-2 col-form-label">Address</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inp_CustomerAddress" name="CustomerAddress" aria-describedby="inp_CustomerAddress_help" placeholder="Enter Address" maxlength="60" required="">
</div>
</div>
<div class="form-group row mt-2">
<label for="inp_CustomerCity" class="col-sm-2 col-form-label">City</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inp_CustomerCity" name="CustomerCity" aria-describedby="inp_CustomerCity_help" placeholder="Enter City" maxlength="30" required="">
</div>
</div>
<div class="form-group row mt-2">
<label for="inp_CustomerZip" class="col-sm-2 col-form-label">Postcode</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inp_CustomerZip" name="CustomerZip" aria-describedby="inp_CustomerZip_help" placeholder="Enter Postcode" maxlength="12" required="">
</div>
</div>
<div class="form-group row mt-2" dmx-show="scRegionsFiltered.data.qryRegions[0].RegionName">
<label for="sel_CustomerStateCustomerState" class="col-sm-2 col-form-label">Region</label>
<div class="col-sm-10">
<select id="sel_CustomerState" class="form-control" name="CustomerState">
<option value="">Select your region...</option>
<option value="" dmx-repeat:repeatregions="scRegionsFiltered.data.qryRegions" dmx-bind:value="RegionCode">{{RegionName}}</option>
</select>
</div>
</div>
<div class="form-group row mt-2">
<label for="inp_CustomerCountry" class="col-sm-2 col-form-label">Country</label>
<div class="col-sm-10">
<select id="sel_CustomerCountry" class="form-control" name="CustomerCountry" required="">
<option value="">Select your country...</option>
<option dmx-repeat:repeatcountries="scCountries.data.qryCountries" dmx-bind:value="CountryISO">{{CountryName}}</option>
</select>
</div>
</div>
<div class="form-group row mt-2">
<div class="col-sm-10 offset-2">
<button class="btn btn-primary" type="submit">Sign Up</button>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-outline-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script src="bootstrap/4/js/bootstrap.min.js"></script>
<script src="bootstrap/4/js/script.js"></script>
<script src="bootstrap/4/js/popper.min.js"></script>
</body>
</html>