View file katrinka.ru/admin/messages.php

File size: 1.51Kb
<?php
  $ppp=120;
  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';");
  pg_query($conn,"update messages set flag=1 where to_u='$uid' and flag=0;");
  $res=pg_query($conn,"select messages.id,messages.flag,users.login,messages.time,messages.message,messages.fr_u from messages,users where messages.to_u='$uid' and 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>RPL</td><td>DEL</td><td>From</td><td>Time</td><td>Message</td></tr>
<?php
  for ($i=0; $i<$rows; $i++)
  {
	print "<tr bgcolor=\"f0f0f0\"><td><a href=newmsg.php?rpl=".pg_result($res,$i,0).">R</a></td><td><a href=msgdel.php?id=".pg_result($res,$i,0).">X</a></td><td><a href=user_edit.php?id=".pg_result($res,$i,5).">".pg_result($res,$i,2)."</a></td>";
	print "<td>".strftime("%R %d %b %G", pg_result($res,$i,3))."</td>";
	print "<td>".pg_result($res,$i,4)."</td></tr>\n";
  }
?>
</table>
<a href="newmsg.php">оБРЙУБФШ ОПЧПЕ</a>&nbsp;&nbsp;
<a href="msgdel.php?id=all">хДБМЙФШ ЧУЕ</a>
</body>
</html>
<?php
  pg_close($conn);
?>