PageRenderTime 40ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/boca-1.5.1/src/admin/log.php

https://bitbucket.org/jorgenio/boca
PHP | 76 lines | 57 code | 2 blank | 17 comment | 14 complexity | ff673859e9b96b4819e03af982b308c7 MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. ////////////////////////////////////////////////////////////////////////////////
  3. //BOCA Online Contest Administrator
  4. // Copyright (C) 2003-2012 by BOCA Development Team (bocasystem@gmail.com)
  5. //
  6. // This program is free software: you can redistribute it and/or modify
  7. // it under the terms of the GNU General Public License as published by
  8. // the Free Software Foundation, either version 3 of the License, or
  9. // (at your option) any later version.
  10. //
  11. // This program is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU General Public License for more details.
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. ////////////////////////////////////////////////////////////////////////////////
  18. // Last modified 05/aug/2012 by cassio@ime.usp.br
  19. require('header.php');
  20. if(isset($_GET["order"]))
  21. $order = myhtmlspecialchars($_GET["order"]);
  22. else $order='';
  23. if(isset($_GET["user"]))
  24. $user = myhtmlspecialchars($_GET["user"]);
  25. else $user='';
  26. if(isset($_GET["site"]))
  27. $site = myhtmlspecialchars($_GET["site"]);
  28. else $site='';
  29. if(isset($_GET["type"]))
  30. $type = myhtmlspecialchars($_GET["type"]);
  31. else $type='';
  32. if(isset($_GET["ip"]))
  33. $ip = myhtmlspecialchars($_GET["ip"]);
  34. else $ip='';
  35. $get="&order=${order}&user=${user}&site=${site}&type=${type}&ip=${ip}";
  36. if (isset($_GET["limit"]) && $_GET["limit"]>0)
  37. $limit = myhtmlspecialchars($_GET["limit"]);
  38. else $limit = 50;
  39. $log = DBGetLogs($order, $_SESSION["usertable"]["contestnumber"],
  40. $site, $user, $type, $ip, $limit);
  41. ?>
  42. <br>
  43. <table width="100%" border=1>
  44. <tr>
  45. <td><b><a href="log.php?order=site&limit=<?php echo $limit; ?>">Site</a></b></td>
  46. <td nowrap><b><a href="log.php?order=user&limit=<?php echo $limit; ?>">User #</a></b></td>
  47. <td><b><a href="log.php?order=ip&limit=<?php echo $limit; ?>">IP</a></b></td>
  48. <td><b><a href="log.php?order=type&limit=<?php echo $limit; ?>">Type</a></b></td>
  49. <td><b>Date</b></td>
  50. <td><b>Description</b></td>
  51. <td><b>Status</b></td>
  52. </tr>
  53. <?php
  54. for ($i=0; $i<count($log); $i++) {
  55. echo " <tr>\n";
  56. echo " <td nowrap><a href=\"log.php?site=" . $log[$i]["site"] . "&limit=$limit\">" . $log[$i]["site"] . "</a></td>\n";
  57. echo " <td nowrap><a href=\"log.php?user=" . $log[$i]["user"] . "&limit=$limit\">" . $log[$i]["user"] . "</a></td>\n";
  58. echo " <td nowrap><a href=\"log.php?ip=" . $log[$i]["ip"] . "&limit=$limit\">" . $log[$i]["ip"] . "</a></td>\n";
  59. echo " <td nowrap><a href=\"log.php?type=" . $log[$i]["type"] . "&limit=$limit\">" . $log[$i]["type"] . "</a></td>\n";
  60. echo " <td nowrap>" . dateconv($log[$i]["date"]) . "</td>\n";
  61. echo " <td nowrap>" . $log[$i]["data"] . "</td>\n";
  62. echo " <td nowrap>" . $log[$i]["status"] . "</td>\n";
  63. echo "</tr>\n";
  64. }
  65. echo "</table>\n";
  66. ?>
  67. <br>
  68. <center>
  69. <a href="log.php?limit=50<?php echo $get; ?>">50</a>
  70. <a href="log.php?limit=200<?php echo $get; ?>">200</a>
  71. <a href="log.php?limit=1000<?php echo $get; ?>">1000</a>
  72. <a href="log.php?limit=1000000<?php echo $get; ?>">no limit</a>
  73. </body>
  74. </html>