Просмотр файла katrinka.ru/admin/msgall.php

Размер файла: 1.44Kb
<?php
  $ppp=50;
  include '../wap/guestbook/mylib.php';
  include '../wap/config.php';
  include 'acl.php';
  if (!$uid) list ($uid, $pl) = priv_level();
  header("Cache-Control: no-cache");
  $lang=$_GET['lang'];
  $conn=pg_connect("host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass");
  pg_query($conn,"SET CLIENT_ENCODING TO 'KOI8';");
  $res=pg_query($conn,"select messages.id,users.login,messages.time,messages.message,messages.fr_u,messages.to_u from messages,users where messages.fr_u=users.id order by messages.id desc limit $ppp");
  $rows=pg_numrows($res);
?>
<html>
<head>
<title>мЙЮОЩЕ УППВЭЕОЙС</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" content="no-cache">
</head>
<body>
<table width="100%">
<tr align=center bgcolor="e0e0e0"><td>From</td><td>To</td><td>Time</td><td>Message</td></tr>
<?php
  for ($i=0; $i<$rows; $i++)
  {
	$tid=pg_result($res,$i,5);
	$rto=pg_query($conn,"select login from users where id='$tid';");
	$to=pg_result($rto,0,0);
	print "<tr bgcolor=\"f0f0f0\"><td><a href=user_edit.php?id=".pg_result($res,$i,4).">".pg_result($res,$i,1)."</a></td><td><a href=user_edit.php?id=".$tid.">".$to."</a></td>";
	print "<td>".strftime("%R %d %b %G", pg_result($res,$i,2))."</td>";
	print "<td>".pg_result($res,$i,3)."</td></tr>\n";
  }
?>
</table>
<a href="newmsg.php">оБРЙУБФШ ОПЧПЕ</a>&nbsp;&nbsp;
<a href="msgdel.php?id=all">хДБМЙФШ ЧУЕ</a>
</body>
</html>
<?php
  pg_close($conn);
?>