rps.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. requirePHPLib('form');
  3. requirePHPLib('judger');
  4. requirePHPLib('data');
  5. function echoRemoteProblem($problem) {
  6. global $myUser;
  7. echo '<tr class="text-center">';
  8. echo '<td>' . $problem['pid'] . '</td>';
  9. echo '<td class="text-left">';
  10. echo '<a href="/rp/', $problem['pid'], '">', HTML::escape($problem['title']), '</a>';
  11. echo '</td></tr>';
  12. }
  13. $header = '<tr>';
  14. $header .= '<th class="text-center" style="width:5em;">PID</th>';
  15. $header .= '<th>远端题目</th>';
  16. $header .= '</tr>';
  17. $pag_config = array('page_len' => 100);
  18. $pag_config['col_names'] = array('pid', 'title');
  19. $pag_config['table_name'] = "rp";
  20. $pag_config['cond'] = '1';
  21. $pag_config['tail'] = "order by pid asc";
  22. $pag = new Paginator($pag_config);
  23. $div_classes = array('table-responsive', 'shadow');
  24. $table_classes = array('table', 'table-bordered', 'table-hover', 'table-striped');
  25. ?>
  26. <?php echoUOJPageHeader('远端题目') ?>
  27. <div class="top-buffer-sm"></div>
  28. <?php
  29. echo '<div class="', join($div_classes, ' '), '">';
  30. echo '<table class="', join($table_classes, ' '), '">';
  31. echo '<thead>';
  32. echo $header;
  33. echo '</thead>';
  34. echo '<tbody>';
  35. foreach ($pag->get() as $idx => $row) {
  36. echoRemoteProblem($row);
  37. echo "\n";
  38. }
  39. if ($pag->isEmpty()) {
  40. echo '<tr><td class="text-center" colspan="233">'.UOJLocale::get('none').'</td></tr>';
  41. }
  42. echo '</tbody>';
  43. echo '</table>';
  44. echo '</div>';
  45. echo "<div class='mt-4'>";
  46. echo $pag->pagination();
  47. echo "</div>";
  48. ?>
  49. <?php echoUOJPageFooter() ?>