3 set_include_path(get_include_path() . PATH_SEPARATOR
. '../lib');
5 include_once("aur.inc.php");
6 include_once("pkgfuncs.inc.php");
11 if (isset($base_id)) {
12 if (!has_credential(CRED_PKGREQ_FILE
)) {
13 header('Location: /');
16 html_header(__("Submit Request"));
17 include('pkgreq_form.php');
18 } elseif (isset($pkgreq_id)) {
19 if (!has_credential(CRED_PKGREQ_CLOSE
)) {
20 header('Location: /');
23 html_header(__("Close Request"));
24 $pkgbase_name = pkgreq_get_pkgbase_name($pkgreq_id);
25 include('pkgreq_close_form.php');
27 if (!has_credential(CRED_PKGREQ_LIST
)) {
28 header('Location: /');
32 /* Sanitize paging variables. */
33 if (isset($_GET['O'])) {
34 $_GET['O'] = max(intval($_GET['O']), 0);
39 if (isset($_GET["PP"])) {
40 $_GET["PP"] = bound(intval($_GET["PP"]), 50, 250);
45 $results = pkgreq_list($_GET['O'], $_GET['PP']);
46 $total = pkgreq_count();
48 /* Calculate the results to use. */
49 $first = $_GET['O'] +
1;
51 /* Calculation of pagination links. */
52 $per_page = ($_GET['PP'] > 0) ?
$_GET['PP'] : 50;
53 $current = ceil($first / $per_page);
54 $pages = ceil($total / $per_page);
55 $templ_pages = array();
58 $templ_pages['« ' . __('First')] = 0;
59 $templ_pages['‹ ' . __('Previous')] = ($current - 2) * $per_page;
63 $templ_pages["..."] = false;
65 for ($i = max($current - 5, 1); $i <= min($pages, $current +
5); $i++
) {
66 $templ_pages[$i] = ($i - 1) * $per_page;
69 if ($current +
5 < $pages)
70 $templ_pages["... "] = false;
72 if ($current < $pages) {
73 $templ_pages[__('Next') . ' ›'] = $current * $per_page;
74 $templ_pages[__('Last') . ' »'] = ($pages - 1) * $per_page;
77 $SID = $_COOKIE['AURSID'];
79 html_header(__("Requests"));
80 include('pkgreq_results.php');
83 html_footer(AURWEB_VERSION
);