rps.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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'], '">', $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="row my-4">
  28. <div class="col-sm-9">
  29. <?= HTML::tablist($tabs_info, $cur_tab, 'nav-pills') ?>
  30. </div>
  31. </div>
  32. <div class="top-buffer-sm"></div>
  33. <?php
  34. echo '<div class="', join($div_classes, ' '), '">';
  35. echo '<table class="', join($table_classes, ' '), '">';
  36. echo '<thead>';
  37. echo $header;
  38. echo '</thead>';
  39. echo '<tbody>';
  40. foreach ($pag->get() as $idx => $row) {
  41. echoRemoteProblem($row);
  42. echo "\n";
  43. }
  44. if ($pag->isEmpty()) {
  45. echo '<tr><td class="text-center" colspan="233">'.UOJLocale::get('none').'</td></tr>';
  46. }
  47. echo '</tbody>';
  48. echo '</table>';
  49. echo '</div>';
  50. echo "<div class='mt-4'>";
  51. echo $pag->pagination();
  52. echo "</div>";
  53. ?>
  54. <?php echoUOJPageFooter() ?>