<?php // validate the current user's MB login information to identify the client $result = $clientService->ValidateLogin("miketyson", "test1234"); $clientHtml = '<table><tr><td>ID</td><td>Name</td><td>GUID</td></tr>'; $client = $result->ValidateLoginResult->Client; $guid = $result->ValidateLoginResult->GUID; if ($client != null) { $clientHtml .= sprintf('<tr><td>%s</td><td>%s</td><td>%s</td></tr>', $client->ID, $client->FirstName . " " . $client->LastName, $guid); } $clientHtml .= '</table>'; ?> <h2>Selected Client</h2> <?php echo $clientHtml; // find out if they have a service to pay for this appointment $result = $clientService->GetClientServices($client->ID, array(), array(23)); $serviceHtml = '<table><tr><td>ID</td><td>Name</td></tr>'; if ($result->GetClientServicesResult->ResultCount > 0) { } $serviceHtml .= '</table>'; if ($result->GetClientServicesResult->ResultCount == 0) { $serviceHtml .= '<p>No services exist for this type.</p>'; } ?> <h2>Selected Service</h2> <?php echo $serviceHtml; // find service if ($result->GetClientServicesResult->ResultCount == 0) { $result = $saleService->GetServices(array(), array(23)); $buyserviceHTML = '<table><tr><td>ID</td><td>Name</td><td>Count</td></tr>';