<?php
include_once('guestbook.class.php');
// Add your own session logick here
session_start();
$_SESSION['admin'] = 1;
if($_SESSION['admin']){
$guestbookAdmin = new guestbookAdmin();
//approve guestbook entry
if(isset($_REQUEST['approve']) && isset($_REQUEST['entry']) && isset($_REQUEST['email'])){
$guestbookAdmin->approveGuestbook($_REQUEST['entry'],$_REQUEST['email']);
header ('location: guestbookadmin.php');
}
//delete guestbook entry
if(isset($_REQUEST['del']) && isset($_REQUEST['entry']) && isset($_REQUEST['email'])){
$guestbookAdmin->destroyGuestbook($_REQUEST['entry'],$_REQUEST['email']);
header ('location: guestbookadmin.php');
}
echo "Approved guestbook entries <br />";
echo $guestbookAdmin->displayResults($guestbookAdmin->readAllguestbook(1));
echo "<br />";
echo "Non-approved guestbook entries <br />";
echo $guestbookAdmin->displayResults($guestbookAdmin->readAllguestbook(0));
}
?>
<script type="text/javascript">
function readGuestbook(id){
w_left = ((screen.width/2)-(680/2));
w_top = ((screen.height/2)-(552/2));
EditWin=window.open("showguestbook.php?id="+id, "EditWin","resizable=1,location=0,scrollbars=1,left="+w_left+",top="+w_top+",width=620,height=300");
this.EditWin.focus()
}
this.focus()
</script>
<a href="createdb.php">Create new DB entry</a><br />
<a href="createdb.php?del=true">Destroy DB entry</a><br />
<a href="guestbook.php">user</a>
|