Manage Entries

Select an entry to modify or delete.

'; $nEntries_result = mysqli_fetch_array(mysqli_query($con, "select count(*) as 'nPost' from `blog12`;")); $nEntries = $nEntries_result["nPost"]; /* determine the number of pages to be written */ if (fmod($nEntries, $nPerPage) == 0) $nPage = $nEntries / $nPerPage; else $nPage = ($nEntries / $nPerPage) + 1; if ($_GET["anchor"] == "") $_GET["anchor"] = 0; /* write navigator on the top */ echo '

'; for ($n=0;$n<($nPage-1);$n++) { if ($n == ($_GET["anchor"] / $nPerPage)) echo ''.($n+1).'  '; else echo ''.($n+1).'  '; }; echo '

'; /* write table header */ echo ''; /* build query to retrieve all entries */ $query = "select `id`, monthname(`dop`) as `month`, dayofmonth(`dop`) as `day`, year(`dop`) as `year`, `title` from `blog12` order by `dop` desc, `id` desc limit ".$_GET["anchor"].", ".$nPerPage.";"; $output = mysqli_query($con, $query); /* start writing rows of entry metadata */ while ($row = mysqli_fetch_array($output)) { $timeString = $row['month']." ".$row['day'].", ".$row['year']; echo ' '; }; echo '

Title

Date Published

'.decodeEntities($row['title']).'

'.$timeString.'

modify

delete

display

manage comments

'; /* write navigator on the bottom */ echo '

'; for ($n=0;$n<($nPage-1);$n++) { if ($n == ($_GET["anchor"] / $nPerPage)) echo ''.($n+1).'  '; else echo ''.($n+1).'  '; }; echo '

'; ?>