Beispiel #1
0
                 $end_ts .= '00:00';
             }
         }
     } else {
         $end_ts = strftime("%Y-%m-%d %T");
     }
 }
 // restrict MySQL query by search string	 modified JW 2005-07-19
 $where = '' == $search ? "`latest` = 'Y'" : "`tag` LIKE '%" . $search . "%' AND `latest` = 'Y'";
 if (!empty($start_ts) && !empty($end_ts)) {
     $where .= " AND time > '" . $start_ts . "' AND time < '" . $end_ts . "'";
 }
 // get total number of pages
 $numpages = $this->getCount('pages', $where);
 // ranged drop-down
 $pages_opts = optionRanges($page_limits, $numpages, ADMINPAGES_DEFAULT_MIN_RECORDS_DISPLAY);
 $form_filter .= '<label for="l">' . T_("Show") . '</label> ' . "\n";
 $form_filter .= '<select name="l" id="l" title="' . T_("Select records-per-page limit") . '">' . "\n";
 // build drop-down
 foreach ($pages_opts as $opt) {
     $selected = $opt == $l ? ' selected="selected"' : '';
     $form_filter .= '<option value="' . $opt . '"' . $selected . '>' . $opt . '</option>' . "\n";
 }
 $form_filter .= '</select> <label for="l">' . T_("records per page") . '</label> <input type="submit" value="' . T_("Apply") . '" /><br />' . "\n";
 // build pager links
 $ll = $s + $l + 1;
 $ul = $s + 2 * $l > $numpages ? $numpages : $s + 2 * $l;
 if ($s > 0) {
     $prev = '<a href="' . $this->Href('', '', 'l=' . $l . '&amp;sort=' . $sort . '&amp;d=' . $d . '&amp;s=' . ($s - $l)) . '&amp;search=' . urlencode($search) . '&amp;start_ts=' . urlencode($start_ts) . '&amp;end_ts=' . urlencode($end_ts) . '" title="' . sprintf(T_("Show records from %d to %d"), $s - $l + 1, $s) . '">' . ($s - $l + 1) . '-' . $s . '</a> |  ' . "\n";
 }
 if ($numpages > $s + $l) {
Beispiel #2
0
 // per page, then use the default.  The problem here is that one
 // form is being used to process two post requests, so things
 // (search string, num recs per page) get out of sync, requiring
 // multiple submissions.
 if (!isset($_GET['l']) && $this->GetSafeVar('submit', 'post') != T_("Apply")) {
     $l = ADMINUSERS_DEFAULT_RECORDS_LIMIT;
 }
 // print page header
 echo '<h3>' . T_("User Administration") . '</h3>' . "\n";
 //non-working message retrieval removed, see #753
 // build pager form
 $form_filter = $this->FormOpen('', '', 'post', 'user_admin_panel');
 $form_filter .= '<fieldset><legend>' . T_("Filter view:") . '</legend>' . "\n";
 $form_filter .= '<label for="search">' . T_("Search user:"******"text" id="search" name="search" title="' . T_("Enter a search string") . '" size="20" maxlength="50" value="' . $search_disp . '"/> <input name="submit" type="submit" value="' . T_("Submit") . '" /><br />' . "\n";
 // get values range for drop-down
 $users_opts = optionRanges($user_limits, $numusers, ADMINUSERS_DEFAULT_MIN_RECORDS_DISPLAY);
 $form_filter .= '<label for="l">' . T_("Show") . '</label> ' . "\n";
 $form_filter .= '<select name="l" id="l" title="' . T_("Select records-per-page limit") . '">' . "\n";
 // build drop-down
 foreach ($users_opts as $opt) {
     $selected = $opt == $l ? ' selected="selected"' : '';
     $form_filter .= '<option value="' . $opt . '"' . $selected . '>' . $opt . '</option>' . "\n";
 }
 $form_filter .= '</select> <label for="l">' . T_("records per page") . '</label> <input name="submit" type="submit" value="' . T_("Apply") . '" /><br />' . "\n";
 // build pager links
 $ll = $s + $l + 1;
 $ul = $s + 2 * $l > $numusers ? $numusers : $s + 2 * $l;
 if ($s > 0) {
     $prev = '<a href="' . $this->Href('', '', 'l=' . $l . '&amp;sort=' . $sort . '&amp;d=' . $d . '&amp;s=' . ($s - $l)) . '&amp;search=' . urlencode($search) . '" title="' . sprintf(T_("Show records from %d to %d"), $s - $l + 1, $s) . '">' . ($s - $l + 1) . '-' . $s . '</a> |  ' . "\n";
 }
 if ($numusers > $s + $l) {