Created
July 19, 2017 21:57
-
-
Save tristansokol/9f87a9953617fd7eec2fa815340b45bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Use the access token from the session to access the API | |
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken($_SESSION['at']); | |
$customersApi = new SquareConnect\Api\CustomersApi(); | |
try { | |
$result = $customersApi->listCustomers(); ?> | |
<div id="table" style="display:flex;flex-direction:column;"> | |
<div class="row"> | |
<div>Created at</div> | |
<div>Name</div> | |
<div>Email Address</div> | |
<div>Phone Number</div> | |
<div></div> | |
</div> | |
<?php foreach ($result->getCustomers() as $customer) { | |
?> | |
<div class="row"> | |
<div class="timestamp"> | |
<?php echo date("g:ia \<\b\\r\> F NS, Y", strtotime($customer->getCreatedAt())); ?> | |
</div> | |
<div> | |
<?php echo $customer->getGivenName(),' ',$customer->getFamilyName() ?> | |
</div> | |
<div> | |
<?php echo $customer->getEmailAddress() ?> | |
</div> | |
<div> | |
<?php echo $customer->getPhoneNumber() ?> | |
</div> | |
<div style="text-align: center;"> | |
<a href="#" onclick="deleteCustomer(this)" class="delete" customerId="<?php echo $customer->getId(); ?>">Delete</a> | |
</div> | |
</div> | |
<?php | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment