-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathcustomers.php
55 lines (49 loc) · 1.58 KB
/
customers.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
<?php require_once( 'inc/partials/header.php' ); ?>
<div class="page-header">
<h1>Customers</h1>
</div>
<?php iconic_display_notices(); ?>
<?php $customers = iconic_api_get_collection( 'customers', array(
'orderby' => 'id',
) ); ?>
<?php if ( ! empty( $customers ) ) { ?>
<table class="table">
<thead>
<tr>
<th scope="col">ID</th>
<th scope="col">First Name</th>
<th scope="col">Last Name</th>
<th scope="col">Email</th>
<th scope="col">Total Orders</th>
<th scope="col">Total Spent</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
<?php foreach( $customers as $customer ) { ?>
<tr>
<th scope="row"><?php echo $customer->id; ?></th>
<td><?php echo $customer->first_name; ?></td>
<td><?php echo $customer->last_name; ?></td>
<td><?php echo $customer->email; ?></td>
<td><?php echo $customer->orders_count; ?></td>
<td><?php echo $customer->total_spent; ?></td>
<td>
<a href="/edit-customer.php?id=<?php echo $customer->id; ?>" class="btn btn-default">Edit</a>
<a href="<?php echo iconic_get_current_url( array(
'action' => 'delete_collection_item',
'type' => 'customers',
'id' => $customer->id,
) ); ?>" class="btn btn-default">Delete</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php iconic_display_pagination_links( 'customers' ); ?>
<?php } else { ?>
<div class="alert alert-warning" role="alert">
<p>Sorry, no customers were found.</p>
</div>
<?php } ?>
<?php require_once( 'inc/partials/footer.php' ); ?>