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

Размер файла: 2.83Kb
  1. <?php
  2. include '../wap/config.php';
  3. include 'acl.php';
  4. list ($aid, $pl) = priv_level();
  5. header("Cache-Control: no-cache");
  6. $lang=$_GET['lang'];
  7. $r=htmlspecialchars(trim($_GET['r']),ENT_QUOTES);
  8. $mot=1;
  9. ?>
  10. <html>
  11. <head>
  12. <title>лФП ЗДЕ</title>
  13. <META HTTP-EQUIV="Refresh" CONTENT="300">
  14. <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  15. <META HTTP-EQUIV="Cache-Control" content="no-cache">
  16. </head>
  17. <?php
  18. if (!($conn=pg_connect("host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass")))
  19. { ?>
  20. <body>
  21. <p align="center">
  22. &#x041E;&#x0448;&#x0438;&#x0431;&#x043A;&#x0430; &#x043F;&#x043E;&#x0434;&#x043A;&#x043B;&#x044E;&#x0447;&#x0435;&#x043D;&#x0438;&#x044F; &#x043A; &#x0411;&#x0414<br/>
  23. <a href="/">&#x041D;&#x0430; &#x0433;&#x043B;&#x0430;&#x0432;&#x043D;&#x0443;&#x044E;</a>
  24. </p>
  25. </body>
  26. </html>
  27. <?php
  28. exit;
  29. }
  30. $uid=0;
  31. $access=1;
  32. print "<body>\n";
  33. print "<p>\n";
  34. pg_query($conn,"SET CLIENT_ENCODING TO 'KOI8';");
  35. $res=pg_query($conn,"select id,name_eng,name_rus,flag from chat_rooms order by id;");
  36. $rows=pg_numrows($res);
  37. $timex=time()-300;
  38. $res_cnt_t=pg_query($conn,"select distinct chat.fr_u,users.login,users.id,users.access from chat,users where users.id=chat.fr_u and users.moder=0 and chat.time > '$timex';");
  39. $total=pg_numrows($res_cnt_t);
  40. print "<table>\n";
  41. print "<tr><td>лПНОБФБ</td><td>лФП ФХФ</td></tr>\n";
  42. for ($i=0; $i<$rows; $i++) {
  43. $flag=pg_result($res,$i,3);
  44. $room='';
  45. $rid=pg_result($res,$i,0);
  46. if (($rid==16)&&($aid!=1)&&($aid!=2)) continue;
  47. if ($lang!='eng') $room=pg_result($res,$i,2);
  48. if (($flag!=1)||(($flag==1)&&($access))) {
  49. if ($room=='') $room=pg_result($res,$i,1);
  50. if ($rid!=18) {
  51. $res_cnt=pg_query($conn,"select distinct chat.fr_u,users.login,users.id,users.access from chat,users where users.id=chat.fr_u and users.moder=0 and chat.time > '$timex' and chat.room='$rid';");
  52. } else {
  53. $res_cnt=pg_query($conn,"select distinct chat_tet.fr_u,users.login,users.id,users.access from chat_tet,users where users.id=chat_tet.fr_u and users.moder=0 and chat_tet.time > '$timex';");
  54. }
  55. $rows_cnt=pg_numrows($res_cnt);
  56. print "<tr><td><a href=\"chat.php?r=".$rid."&amp;lang=".$lang."\">".$room." (".$rows_cnt.")</a></td><td>\n";
  57. if ((!$r)||($r==$rid)) {
  58. for ($j=0; $j<$rows_cnt; $j++) {
  59. $uid=pg_result($res_cnt,$j,2);
  60. $acc=pg_result($res_cnt,$j,3);
  61. $login=pg_result($res_cnt,$j,1);
  62. if ($acc==1) $login=sprintf("<i>%s</i>", pg_result($res_cnt,$j,1));
  63. if (($acc==2)||($acc==3)) $login=sprintf("<b>%s</b>", pg_result($res_cnt,$j,1));
  64. if ($acc==4) $login=sprintf("<b><i>%s</i></b>", pg_result($res_cnt,$j,1));
  65. print "<a href=\"user_edit.php?id=".$uid."&amp;r=".$rid."&amp;lang=".$lang."\">".$login."</a> \n";
  66. }
  67. print "</td></tr>\n";
  68. }
  69. }
  70. }
  71. print "</table>\n";
  72. print "Total: ".$total."<br>\n";
  73. pg_close($conn);
  74. ?>
  75. </p>
  76. </body>
  77. </html>