<?
if(defined('AGRIZ_FREE_SCRIPTS') && AGRIZ_FREE_SCRIPTS == 'agrizlive.com'){
}
else{
exit;
}
include_once("functions/gb_functions.php");
if(isset($_REQUEST['page'])){
$page = $_REQUEST['page'];
$limit = ($page-1) * GUESTBOOK_ADMIN_DISPLAY;
$t_page = $_REQUEST['t_page'];
}
else{
$page = 1;
$limit = ($page-1) * GUESTBOOK_ADMIN_DISPLAY;
$total = getTotalGuestBooks();
if($total > 0){ $t_page = ceil($total / GUESTBOOK_ADMIN_DISPLAY);} else {$t_page = 0;}
}
$result = getGuestBooksBackEnd($limit);
?>
<div id="box">
<h3>GuestBook</h3>
<table width="100%">
<thead>
<tr>
<th width="40px"><a href="#">ID<img src="img/icons/arrow_down_mini.gif" width="16" height="16" align="absmiddle" /></a></th>
<?if($display_username_box){?>
<th><a href="#">Username</a></th>
<?}?>
<?if($display_user_email){?>
<th><a href="#">Email</a></th>
<?}?>
<?if($display_user_website){?>
<th><a href="#">Website</a></th>
<?}?>
<th>Status</th>
<th><a href="#">Comment</a></th>
<th width="60px"><a href="#">Action</a></th>
</tr>
</thead>
<tbody>
<?
while($value = mysql_fetch_array($result))
{
?>
<tr>
<td class="a-center"><?=$value['guestbook_id']?></td>
<?if($display_username_box){?>
<td><?=stripslashes($value['user_name'])?></td>
<?}?>
<?if($display_user_email){?>
<td><?=stripslashes($value['user_email'])?></td>
<?}?>
<?if($display_user_website){?>
<td><?=stripslashes($value['user_website'])?></td>
<?}?>
<td><?=stripslashes($value['status'])?></td>
<td><?=stripslashes($value['guestbook_message'])?></td>
<td>
<a href="?content=guestbook&value=add&id=<?=$value['guestbook_id']?>"><img src="img/icons/user_edit.png" title="Edit Guestbook" width="16" height="16" /></a>
<a href="?content=guestbook&value=delete&id=<?=$value['guestbook_id']?>" onclick="return confirm('are you sure you want to delete?')"><img src="img/icons/user_delete.png" title="Delete" width="16" height="16" /></a>
</td>
</tr>
<?
}
?>
</tbody>
</table>
<div id="pager">
Page <?if($page > 1){?><a href="index.php?content=guestbook&page=<?=$page-1?>&t_page=<?=$t_page?>"><img src="img/icons/arrow_left.gif" width="16" height="16" /></a><?}?>
<input size="1" value="<?=$page?>" type="text" name="page" id="page" />
<?if($page < $t_page){?><a href="index.php?content=guestbook&page=<?=$page+1?>&t_page=<?=$t_page?>"><img src="img/icons/arrow_right.gif" width="16" height="16" /></a><?}?> of <?=$t_page?> pages
</div>
</div>