Location: PHPKode > projects > Guestbook! > guestbook/adm/gb.php
<?php
include("auth.php");
include( "../inc/nocache.inc" );
include( "../dbopen.php" );
include( "../common.php" );

$pageSize = 20; //êîë-âî çàïèñåé íà ñòðàíèöó

$page=((!isset($_GET["page"]))?"":$_GET["page"]);

  if ($page == "") {
      $page = 1;
  }
?>
<html>
<head>
<link href="style.css" type="text/css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
</head>
<body>
<?php
	
  $sSQL_cnt = "SELECT count(*) As Total FROM guestbook";
  $result_cnt = mysql_query($sSQL_cnt, $link);
  $row = mysql_fetch_object($result_cnt);
  $nrows = $row -> Total;

  $navbar = pager($page, $pageSize, $nrows, "gb.php", "");

  $offset = ($page - 1)*$pageSize;
  $sSQL = "SELECT guestbook_id, num, DATE_FORMAT(issuedate,\"%d-%m-%Y %H:%i\") As fissuedate, content, user_name, publication FROM guestbook ORDER BY issuedate DESC, guestbook_id DESC LIMIT $offset,$pageSize";
  
  $result = mysql_query($sSQL, $link);

?>
<center><h3>Ãîñòåâàÿ êíèãà</h3></center>
<p>
<table width='100%' border='0' cellspacing='1' cellpadding='2'>
	<tr valign='bottom'>
<td class='page'><a href='gb.php' class='page'>Ãîñòåâàÿ êíèãà</a></td>
	
	</tr>
</table>

<table width='100%' border='0' cellspacing='1' cellpadding='2'>
	<tr bgcolor='#c0c0c0'>
		<td align='center' nowrap><b>N</b>
                </td>
		<td nowrap width=100><b>Äàòà</b></td>
		<td><b>Èìÿ</b></td>
		<td width='100%'><b>Ñîîáùåíèå</b></td>
<td align='center'><b>Ñòàòóñ (èçìåíèòü)</b></td>
<td colspan='2' align='center'>&nbsp;</td>
	</tr>
 <?php

  while($row = mysql_fetch_array($result)) {
	if ($row["publication"] == 1)
		$pub = "îòêðûò";
	else
		$pub = "çàêðûò";

 ?>
 <tr bgcolor='#f0f0f0'>
	<td align='center' nowrap><?php echo($row["num"]); ?></td>
	<td nowrap><nobr><?php echo($row["fissuedate"]); ?></nobr></td>
	<td><?php echo($row["user_name"]); ?></td>
	<td><?php echo(wordwrap_msg(nl2br($row["content"]))); ?></td>
	<td align='center'><a href="status.php?id=<?php echo($row["guestbook_id"]); ?>"><?php echo($pub); ?></a></td>
	<td width='60'><a href='edit_gb.php?id=<?php echo($row["guestbook_id"]); ?>'>Ðåäàêòèðîâàòü</a></td>
	<td width='60'><a href="javascript:if (confirm('Âû äåéñòâèòåëüíî õîòèòå óäàëèòü ýòó çàïèñü ?')) {document.location = 'del_gb.php?id=<?php echo($row["guestbook_id"]); ?>';}">Óäàëèòü</a></td>
 </tr>
<?php
  } 

mysql_close($link);
 ?>
</table>
<p align=center>
<?php

if ($navbar != "") {
	echo($navbar);
}

?>
</body>
</html>
Return current item: Guestbook!