-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
153 lines (124 loc) · 5.22 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
<!DOCTYPE html>
<html ng-app="app">
<head >
<title>Shopping Cart</title>
<!--CSS-->
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
<!--Dependencies-->
<link rel="stylesheet" type="text/css" href="vendor/angular-material/angular-material.css">
<!--Angular CDNs-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/0.8.2/angular-material.min.js"></script>
<!--Dependencies-->
<script src="vendor/angular/angular.js"></script>
<script src="vendor/angular-animate/angular-animate.js"></script>
<script src="vendor/angular-aria/angular-aria.js"></script>
<script src="vendor/angular-material/angular-material.js"></script>
<script src="vendor/angular-mocks/angular-mocks.js"></script>
<!--Modules-->
<script type="text/javascript" src="app/app.js"></script>
<script type="text/javascript" src="app/shopping-cart/shoppingcart.module.js"></script>
<script type="text/javascript" src="app/inventory/inventory.module.js"></script>
<script type="text/javascript" src="app/purchase/purchase.module.js"></script>
<script type="text/javascript" src="app/timer/timer.module.js"></script>
<!--Controllers-->
<script type="text/javascript" src="app/inventory/controllers/inventory.controller.js"></script>
<script type="text/javascript" src="app/shopping-cart/controllers/cart.controller.js"></script>
<script type="text/javascript" src="app/purchase/controllers/purchase.controller.js"></script>
<!--Services-->
<script type="text/javascript" src="app/inventory/services/inventory.service.js"></script>
<script type="text/javascript" src="app/shopping-cart/services/cart.service.js"></script>
<script type="text/javascript" src="app/purchase/services/purchase.service.js"></script>
<script type="text/javascript" src="app/timer/services/timer.service.js"></script>
<!--Directives-->
<script type="text/javascript" src="app/inventory/directives/inventory.directive.js"></script>
</head>
<body>
<header layout="column">
<md-toolbar class="md-primary">
<h1 class="md-toolbar-tools">
<span>Some Book Store</span>
</h1>
</md-toolbar>
</header>
<md-content class="container" class ="md-padding ng-scope md-default-theme">
<md-content class="inventory" ng-controller="InventoryController as inventory">
<inventory-content></inventory-content>
</md-content>
<md-content class="checkout">
<!-- ///////////////// Cart Section ////////////////////-->
<div class="cart" ng-controller="CartController">
<md-toolbar class="md-theme-light">
<h1 class="md-toolbar-tools">
<span>Cart</span>
<span flex></span>
<span style="text-align: right"><b>{{getTotal()| currency: "₦"}}</b></span>
</h1>
<md-button class="md-raised md-accent" ng-show="count()>0" ng-click="showConfirm($event)">Checkout</md-button>
</md-toolbar>
<md-card>
<md-content style="max-height: 250px">
<md-subheader>
<span ng-hide="count()>0">Your Cart is empty</span>
<span style="md-warn" ng-show="count()>0">Items in your cart will be stored for
<b>{{getTimer()}}</b></span>
</md-subheader>
<table ng-show="count()>0">
<tr>
<th>Item</th>
<th>Price</th>
<th>QTY</th>
<th>Sub Total</th>
<th></th>
</tr>
<tr ng-repeat="products in getCart()">
<td>{{products.product.name}}</td>
<td>{{products.product.price | currency: ""}}</td>
<td>{{products.incart}}</td>
<td>{{products.product.price * products.incart| currency: ""}}</td>
<td>
<md-button class="md-warn" ng-click="removeProduct(products.product)">X</md-button>
</td>
</tr>
<tr>
<td><b>Total</b></td>
<td></td>
<td></td>
<td><b>{{getTotal()| currency: "₦"}}</b><td>
</tr>
</table>
</md-content>
<md-card>
</div>
<!--/////////////////Purchased Section ////////////////////-->
<div class="purchased" ng-controller="PurchaseController as purchase">
<md-toolbar class="md-theme-light">
<h1 class="md-toolbar-tools">
<span>Purchased</span>
</h1>
</md-toolbar>
<md-card style="max-height: 250px">
<md-content style="max-height: 200px">
<md-subheader ng-show="getPurchase().length === 0">You have not bought any item</md-subheader>
<table ng-hide="getPurchase().length === 0">
<tr>
<th>Item</th>
<th>Price</th>
<th>QTY</th>
<th>Sub Total</th>
</tr>
<tr ng-repeat="items in getPurchase()">
<td>{{items.product.name}}</td>
<td>{{items.product.price | currency: ""}}</td>
<td>{{items.incart}}</td>
<td>{{items.product.price * items.incart| currency: ""}}</td>
</tr>
</table>
</md-content>
</md-card>
</div>
</md-content>
<div clear="both"></div>
</md-content>
</body>
</html>