-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstorage-user.php
203 lines (192 loc) · 10.4 KB
/
storage-user.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
<?php
include "src/header.php";
$currentMonth = date('m');
$currentYear = date('Y');
$listCustomer = "SELECT * FROM customer INNER JOIN price ON customer.cust_id = price.cust_id";
$execListCustomer = mysqli_query($conn, $listCustomer);
?>
<!-- ============================================================== -->
<!-- Page wrapper -->
<!-- ============================================================== -->
<div class="page-wrapper">
<!-- ============================================================== -->
<!-- Bread crumb and right sidebar toggle -->
<!-- ============================================================== -->
<div class="page-breadcrumb">
<div class="row">
<div class="col-7 align-self-center">
<h4 class="page-title text-truncate text-dark font-weight-medium mb-1">Customer Management</h4>
<div class="d-flex align-items-center">
<nav aria-label="breadcrumb">
<ol class="breadcrumb m-0 p-0">
<li class="breadcrumb-item text-muted active" aria-current="page">Customer Management</li>
</ol>
</nav>
</div>
</div>
<div class="col-5 align-self-center">
<div class="col-12 align-right">
<div class="customize-input float-right" data-toggle="modal" data-target="#add-user-modal">
<button id="btnPrint" class="btn btn-dark">Add Customer</button>
</div>
</div>
</div>
</div>
</div>
<!-- ============================================================== -->
<!-- End Bread crumb and right sidebar toggle -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<!-- Container fluid -->
<!-- ============================================================== -->
<div class="container-fluid">
<!-- ============================================================== -->
<!-- Start Page Content -->
<!-- ============================================================== -->
<div class="row">
<!-- Start List Directory Table -->
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table id="zero_config" class="table table-striped table-bordered no-wrap">
<thead>
<tr>
<th>No</th>
<th>Customer</th>
<th>Price Per GB (RM)</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$listNum = 1;
foreach ($execListCustomer as $row) {
echo "<tr>";
echo "<td>".$listNum."</td>";
echo "<td>".$row['cust_name']."</td>";
echo "<td>".$row['price']."</td>";
echo "<td>";
echo "<a href='report-detail.php?cust_id=".$row['cust_id']."&report_date=".$currentYear."-".$currentMonth."' class='btn btn-sm btn-primary btn-rounded'";
echo "data-toggle='tooltip' data-placement='top' title='View Report'>";
echo "Report";
echo "</a>";
echo " ";
echo "<a href='storage-detail.php?cust_id=".$row['cust_id']."' class='btn btn-sm btn-success btn-rounded'";
echo "data-toggle='tooltip' data-placement='top' title='View Customer Detail'>";
echo "Detail";
echo "</a>";
echo " ";
echo "<a href='#' class='btn btn-sm btn-danger btn-rounded'";
echo "data-toggle='tooltip' data-placement='top' title='Delete Customer'>";
echo "Delete";
echo "</a>";
echo "</td>";
echo "</tr>";
$listNum++;
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- End List Directory Table -->
</div>
<!-- ============================================================== -->
<!-- End PAge Content -->
<!-- ============================================================== -->
<!-- ============================================================== -->
<!-- Right sidebar -->
<!-- ============================================================== -->
<!-- .right-sidebar -->
<!-- ============================================================== -->
<!-- End Right sidebar -->
<!-- ============================================================== -->
</div>
<!-- ============================================================== -->
<!-- End Container fluid -->
<!-- ============================================================== -->
</div>
<!-- ============================================================== -->
<!-- End Page wrapper -->
<!-- ============================================================== -->
<?php
include "src/footer.php";
?>
</body>
<!-- Add Customer modal content -->
<div id="add-user-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-body">
<div class="text-center mt-2 mb-4">
<h4 class="card-title">Add new customer</h4>
</div>
<form action="#" class="pl-3 pr-3">
<div class="form-body">
<label>Customer ID </label>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<input type="text" class="form-control" placeholder="custid" id="cust_id" name="cust_id" required="" maxlength="255">
<div class="invalid-feedback" id="cust-id-error" style="display: none">
Customer ID is required!
</div>
<div class="invalid-feedback" id="cust-id-error-exist" style="display: none">
Customer ID is already been used, please insert new customer id.
</div>
</div>
</div>
</div>
<label>Customer Name </label>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<input type="text" class="form-control" placeholder="Customer Name" id="cust_name" name="cust_name" required="" maxlength="255">
<div class="invalid-feedback" id="cust-name-error" style="display: none">
Customer Name is required!
</div>
</div>
</div>
</div>
<label>Customer Description </label>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<input type="text" class="form-control" placeholder="Customer Description" id="cust_desc" name="cust_desc" required="" maxlength="64">
<div class="invalid-feedback" id="cust-desc-error" style="display: none">
Customer Description is required!
</div>
</div>
</div>
</div>
<label>Price per GB (RM) </label>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<input type="number" class="form-control" placeholder="0.02 | 245.00" id="cust_price" name="cust_price" required="">
<div class="invalid-feedback" id="cust-price-error" style="display: none">
Price is required!
</div>
<div class="invalid-feedback" id="cust-price-error-value" style="display: none">
Price cannot be less than 0
</div>
</div>
</div>
</div>
<div class="form-group text-center">
<button class="btn btn-rounded btn-danger" type="button" data-dismiss="modal" id="cancelAdd">Cancel</button>
<button class="btn btn-rounded btn-success" type="button" id="addCustomer">Add Customer</button>
</div>
</div>
</form>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- script for report -->
<script src="src/dist/js/report.js"></script>
<script src="src/dist/js/ajaxForm/addCustomer.js"></script>
</html>