-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransaction.php
246 lines (239 loc) · 14.2 KB
/
transaction.php
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
<?php
include_once 'functions/authentication.php';
include_once 'functions/view/datatable.php';
include_once 'functions/view/nav-bar.php';
include_once 'functions/view/get-data.php';
$results = get_customer_data();
$fullname = $results['fullname'];
$phone = $results['phone'];
$email = $results['facebook'];
$address = $results['address'];
$id = $results['id'];
$total = get_total_rental_item($id);
$count = get_count_rental_items($id);
?>
<!DOCTYPE html>
<html data-bs-theme="light" id="bg-animation" lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>Rentals - RMMFBS</title>
<meta name="description" content="Rental Management and Monitoring for a Fashion Boutique">
<link rel="icon" type="image/png" sizes="512x512" href="assets/img/boutique.png">
<link rel="icon" type="image/png" sizes="512x512" href="assets/img/boutique.png">
<link rel="icon" type="image/png" sizes="512x512" href="assets/img/boutique.png">
<link rel="icon" type="image/png" sizes="512x512" href="assets/img/boutique.png">
<link rel="icon" type="image/png" sizes="512x512" href="assets/img/boutique.png">
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap-select.min.css">
<link rel="stylesheet" href="assets/css/Nunito.css">
<link rel="stylesheet" href="assets/css/dataTables.min.css">
<link rel="stylesheet" href="assets/fonts/fontawesome-all.min.css">
</head>
<body id="page-top">
<div id="content">
<nav class="navbar navbar-expand-lg mb-4 shadow navbar-light">
<div class="container-fluid"><img src="assets/img/boutique.png" width="60em"><a class="navbar-brand d-flex align-items-center" href="/"><span>RMMFB</span></a><button data-bs-toggle="collapse" class="navbar-toggler" data-bs-target="#navcol-1"><span class="visually-hidden">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
<div id="navcol-1" class="collapse navbar-collapse">
<ul class="navbar-nav mx-auto">
<?php navbar(); ?>
</ul>
<a class="btn btn-light shadow" role="button" data-bs-toggle="tooltip" data-bss-tooltip="" data-bs-placement="left" href="functions/logout.php" title="Here you can logout your acccount.">Logout</a>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="d-sm-flex justify-content-between align-items-center mb-4">
<h3 class="text-dark mb-0">Transaction</h3><button class="btn btn-dark btn-sm" type="button" data-bs-target="#create" data-bs-toggle="modal"><i class="fas fa-truck-loading fa-sm text-white-50"></i> Add Item</button>
</div>
<div class="row">
<div class="col-md-6 col-xl-3 mb-4">
<div class="card shadow border-start-success py-2">
<div class="card-body">
<div class="row align-items-center no-gutters">
<div class="col me-2">
<div class="text-uppercase text-success fw-bold text-xs mb-1"><span>TOTAL</span></div>
<div class="text-dark fw-bold h5 mb-0"><span>₱<?php echo number_format($total, 2); ?></span></div>
</div>
<div class="col-auto"><i class="fas fa-dollar-sign fa-2x text-gray-300"></i></div>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-xl-3 mb-4">
<div class="card shadow border-start-success py-2">
<div class="card-body">
<div class="row align-items-center no-gutters">
<div class="col me-2">
<div class="text-uppercase text-success fw-bold text-xs mb-1"><span>TOTAL ITEMS</span></div>
<div class="text-dark fw-bold h5 mb-0"><span><?php echo $count ?></span></div>
</div>
<div class="col-auto"><i class="fas fa-dollar-sign fa-2x text-gray-300"></i></div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-xl-6">
<div class="card shadow my-5">
<div class="card-header py-3">
<p class="text-primary m-0 fw-bold">Items</p>
</div>
<div class="card-body">
<div class="table-responsive table mt-2" role="grid" aria-describedby="dataTable_info">
<table class="table table-striped my-0 w-100" id="dataTable">
<thead>
<tr>
<th>ID #</th>
<th>Item</th>
<th>Qty</th>
<th>Price</th>
<th>Return Date</th>
<th class="text-center">Option</th>
</tr>
</thead>
<tbody>
<?php transaction_item_list($id) ?>
</tbody>
<tfoot>
<tr></tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-xl-6">
<div class="card shadow my-5">
<div class="card-header py-3">
<div class="row">
<div class="col">
<p class="text-primary m-0 fw-bold">Transaction Information</p>
</div>
<div class="col text-end">
<button class="btn btn-danger mx-2" type="button" data-bs-target="#cancel" data-bs-toggle="modal">Cancel</button>
<button class="btn btn-primary" type="button" data-bs-target="#proceed" data-bs-toggle="modal">Proceed</button></div>
</div>
</div>
<div class="card-body">
<form>
<div class="mb-3"><label class="form-label" for="first_name"><strong>Fullname: </strong><strong><?php echo $fullname ?></strong></label></div>
<div class="mb-3"><label class="form-label" for="last_name"><strong>Phone: </strong><strong><?php echo $phone ?></strong></div>
<div class="mb-3"><label class="form-label" for="last_name"><strong>Facebook: </strong><strong><?php echo $email ?></strong></div>
<div class="mb-3"><label class="form-label" for="last_name"><strong>Address: </strong><strong><?php echo $address ?></strong></div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" role="dialog" tabindex="-1" id="create">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Add Item</h4><button class="btn-close" type="button" aria-label="Close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<form action="functions/rent-item-add.php" method="post">
<input type="hidden" name="id" value="<?php echo $id ?>">
<div style="margin-top: 5px;"><label class="form-label">Item</label>
<select class="selectpicker select" data-live-search="true" name="item">
<optgroup label="SELECT ITEM">
<?php items() ?>
</optgroup>
</select></div>
<div style="margin-top: 5px;"><label class="form-label">Quantity</label><input class="form-control" type="number" name="qty" required="" value="1"></div>
<div style="margin-top: 5px;"><label class="form-label">Rental Return Date</label><input class="form-control" name="date" type="date" required=""></div>
</div>
<div class="modal-footer"><button class="btn btn-light" type="button" data-bs-dismiss="modal">Close</button><button class="btn btn-primary" type="submit">Save</button></div>
</form>
</div>
</div>
</div>
<div class="modal fade" role="dialog" tabindex="-1" id="update">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Update Transaction</h4><button class="btn-close" type="button" aria-label="Close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<form action="functions/rent-item-update.php" method="post">
<input type="hidden" name="data_id">
<div style="margin-top: 5px;"><label class="form-label">Rental Return Date</label><input class="form-control" name="date" type="date" required=""></div>
</div>
<div class="modal-footer"><button class="btn btn-light" type="button" data-bs-dismiss="modal">Close</button><button class="btn btn-primary" type="submit">Save</button></div>
</form>
</div>
</div>
</div>
<div class="modal fade" role="dialog" tabindex="-1" id="cancel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Cancelation</h4><button class="btn-close" type="button" aria-label="Close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<form action="functions/transaction-cancel.php" method="post">
<input type="hidden" name="id" value="<?php echo $id ?>">
<p>Are you sure you want to cancel this transaction?</p>
</div>
<div class="modal-footer"><button class="btn btn-light" type="button" data-bs-dismiss="modal">Close</button><button class="btn btn-danger" type="submit">Cancel</button></div>
</form>
</div>
</div>
</div>
<div class="modal fade" role="dialog" tabindex="-1" id="remove">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Remove Item</h4><button class="btn-close" type="button" aria-label="Close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<form action="functions/rent-item-remove.php" method="post">
<input type="hidden" name="data_id">
<p>Are you sure you want to remove this Item?</p>
</div>
<div class="modal-footer"><button class="btn btn-light" type="button" data-bs-dismiss="modal">Close</button><button class="btn btn-danger" type="submit">Remove</button></div>
</form>
</div>
</div>
</div>
<div class="modal fade" role="dialog" tabindex="-1" id="proceed">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Proceed Transaction</h4><button class="btn-close" type="button" aria-label="Close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<p>Are you sure you want to proceed this transaction?</p>
</div>
<form action="functions/transaction-proceed.php" method="post">
<input type="hidden" name="id" value="<?php echo $id ?>">
<input type="hidden" name="price" value="<?php echo $total ?>">
<div class="modal-footer"><button class="btn btn-light" type="button" data-bs-dismiss="modal">Close</button><button class="btn btn-primary" type="submit">Save</button></div>
</form>
</div>
</div>
</div><a class="border rounded d-inline scroll-to-top" href="#page-top"><i class="fas fa-angle-up"></i></a>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/bootstrap/js/bootstrap-select.min.js"></script>
<script src="assets/js/bs-init.js"></script>
<script src="assets/js/jquery.dataTables.min.js"></script>
<script src="assets/js/dataTables.bootstrap5.min.js"></script>
<script src="assets/js/dataTables.buttons.min.js"></script>
<script src="assets/js/jszip.min.js"></script>
<script src="assets/js/pdfmake.min.js"></script>
<script src="assets/js/three.min.js"></script>
<script src="assets/js/theme.js"></script>
<script src="assets/js/vfs_fonts.js"></script>
<script src="assets/js/buttons.html5.min.js"></script>
<script src="assets/js/buttons.print.min.js"></script>
<script src="assets/js/vanta.birds.min.js"></script>
<script src="assets/js/vanta.waves.min.js"></script>
<script src="assets/js/sweetalert2.all.min.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>