Example #1
0
             $i++;
         }
         //This does the same as above, only checking if we are on the last page, and then generating the Next and Last links
         if ($pid < $lastPage) {
             $next = $pid + 1;
             echo " <a href='?page=" . $_GET['page'] . '&amp;action=' . $_GET['action'] . '&amp;do=' . $_GET['do'] . "&amp;page-id={$next}'>&gt;</a> ";
             echo " ";
             echo " <a href='?page=" . $_GET['page'] . '&amp;action=' . $_GET['action'] . '&amp;do=' . $_GET['do'] . "&amp;page-id={$lastPage}'>&gt;&gt;</a>";
         }
         echo ' </div>';
     }
 } elseif ($_GET['do'] == 'delete-key') {
     echo '<p>Here you can delete existing keys.</p>';
     if (!empty($_GET['delete'])) {
         if (is_numeric($_GET['delete'])) {
             if ($key->deleteKey($_GET['delete'])) {
                 echo '<p class="notification green">You have successfully deleted a 4S key.</p>';
                 $log->addLog($_SESSION['loggedIn']['id'], "Deleted a 4S key.");
             }
         }
     }
     $websiteProperty = new WebsiteProperty();
     $pid = $_GET['page-id'];
     if (empty($pid)) {
         $pid = 1;
     }
     $lastPage = ceil($key->getTotalRecordCount() / $websiteProperty->getProperty('max_key_entries_per_page'));
     if ($pid < 1) {
         $pid = 1;
     } elseif ($pid > $lastPage) {
         $pid = $lastPage;