Exemplo n.º 1
0
 public function listAllCustomers(array $catalogue)
 {
     $message = $this->getMessage();
     $html = '<table><thead><tr><th>Name</th><th>Surname</th><th>Telephone</th><th>Email</th><th>Edit</th><th>Delete</th></tr></thead><tbody>';
     foreach ($catalogue as $key => $customer) {
         assert($customer instanceof Customer);
         $editLink = \Toeswade\Navigation\VNavigation::createActionLink('update', $customer->getId());
         $deleteLink = \Toeswade\Navigation\VNavigation::createActionLink('delete', $customer->getId());
         $html .= '<tr>';
         $html .= '<td>' . $customer->getName() . '</td>';
         $html .= '<td>' . $customer->getSurname() . '</td>';
         $html .= '<td>' . $customer->getTelephone() . '</td>';
         $html .= '<td>' . $customer->getEmail() . '</td>';
         $html .= '<td><a href="' . $editLink . '" title="Edit this customer">Edit</a></td>';
         $html .= '<td><a href="' . $deleteLink . '" title="Delete this customer">Delete</a></td>';
         $html .= '<tr>';
     }
     $html .= '</tbody></table>';
     // Set page title
     $this->pageTitle = 'List customers';
     // Set HTML
     $this->HTML = $message . $html;
 }