<th>Date Added</th> <th>Invert Status</th> <th>Edit</th> </tr>'; $pid = $_GET['page-id']; if (empty($pid)) { $pid = 1; } $lastPage = ceil($client->getTotalRecordCount() / $websiteProperty->getProperty('max_client_entries_per_page')); if ($pid < 1) { $pid = 1; } elseif ($pid > $lastPage) { $pid = $lastPage; } if ($_SERVER['REQUEST_METHOD'] == "POST" && !empty($_POST['search'])) { $dataArr = $client->getClientsLike($_POST['search']); } else { $dataArr = $client->getClients($websiteProperty->getProperty('max_client_entries_per_page'), ($pid - 1) * $websiteProperty->getProperty('max_client_entries_per_page')); } if ($dataArr !== false) { foreach ($dataArr as $data) { echo '<tr>'; echo '<td>' . $data['id'] . '</td>'; echo '<td>'; if ($data['fname'] == "NA") { echo '<p class="notification red minimal">n/a</p>'; } else { echo $data['fname']; } echo '</td>'; echo '<td>';
if ($pid !== $lastPage) { $next = $pid + 1; echo " <a href='?page=" . $_GET['page'] . "&page-id={$next}#pagination'>></a> "; echo " "; echo " <a href='?page=" . $_GET['page'] . "&page-id={$lastPage}#pagination'>>></a>"; } echo ' </div>'; ?> <h2 id="search">Check if you're on the list</h2> <?php if ($_SERVER['REQUEST_METHOD'] == "POST") { $search = $_POST['search']; if (strlen($search) == 0) { echo '<p class="notification red">Please enter a name or nickname.</p>'; } else { $dataArr1 = $client1->getClientsLike($search); if ($dataArr1) { if ($dataArr1 > 0) { echo '<p class="notification green">We have found one or more results, you can see them in the list below.</p>'; $resultsFound = true; } } else { echo '<p class="notification red">We couldn\'t find this nickname or first name in the database.<br />Make sure you didn\'t made spelling mistakes.<p>'; } } } ?> <form class="styled" action="#search" method="post"> <label style="width: 180px;">First name or nickname</label> <input type="text" name="search" /> <input type="submit" value="Search" style="margin-left: 25px;"/>