<?
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 = getTotalSmileys();
if($total > 0){ $t_page = ceil($total / GUESTBOOK_ADMIN_DISPLAY);} else {$t_page = 0;}
}
$result = getSmileys($limit);
?>
<div id="box">
<h3>Smileys</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>
<th><a href="#">Name</a></th>
<th><a href="#">Code</a></th>
<th><a href="#">Image</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['smiley_id']?></td>
<td><?=stripslashes($value['smiley_name'])?></td>
<td><?=stripslashes($value['short_cut'])?></td>
<td><img src="smiley/<?=stripslashes($value['smiley_image']);?>" /></td>
<td>
<a href="?content=guestbook&value=add_smiley&id=<?=$value['smiley_id']?>"><img src="img/icons/user_edit.png" title="Edit Smiley" width="16" height="16" /></a>
<a href="?content=guestbook&value=delete_smiley&id=<?=$value['smiley_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>