Exemplo n.º 1
0
include_once "./lib/listutils.php";
include_once "./lib/sortutils.php";
include_once "./lib/HTML_Listing.class.php";
include_once "./lib/TitleMask.class.php";
if (is_site_enabled()) {
    if (is_opendb_valid_session()) {
        if (get_opendb_config_var('borrow', 'enable') !== FALSE) {
            if (is_user_granted_permission(PERM_USER_BORROWER)) {
                $listingObject = new HTML_Listing($PHP_SELF, $HTTP_VARS);
                $listingObject->setNoRowsMessage(get_opendb_lang_var('no_records_found'));
                $show_listings = TRUE;
                $checkbox_column = FALSE;
                if ($HTTP_VARS['op'] == 'my_borrowed') {
                    //all titles that the person has actually borrowed from others.
                    $page_title = get_opendb_lang_var('my_borrowed_items');
                    if (is_numeric($listingObject->getItemsPerPage())) {
                        $listingObject->setTotalItems(fetch_my_borrowed_item_cnt(get_opendb_session_var('user_id')));
                        if ($listingObject->getTotalItemCount() > 0) {
                            $result = fetch_my_borrowed_item_rs(get_opendb_session_var('user_id'), $listingObject->getCurrentOrderBy(), $listingObject->getCurrentSortOrder(), $listingObject->getStartIndex(), $listingObject->getItemsPerPage());
                        }
                    } else {
                        $result = fetch_my_borrowed_item_rs(get_opendb_session_var('user_id'), $listingObject->getCurrentOrderBy(), $listingObject->getCurrentSortOrder());
                    }
                } else {
                    if ($HTTP_VARS['op'] == 'all_borrowed' && is_user_granted_permission(PERM_ADMIN_BORROWER)) {
                        $page_title = get_opendb_lang_var('items_borrowed');
                        if (is_numeric($listingObject->getItemsPerPage())) {
                            $listingObject->setTotalItems(fetch_all_borrowed_item_cnt());
                            if ($listingObject->getTotalItemCount() > 0) {
                                $result = fetch_all_borrowed_item_rs($listingObject->getCurrentOrderBy(), $listingObject->getCurrentSortOrder(), $listingObject->getStartIndex(), $listingObject->getItemsPerPage());
                            }
Exemplo n.º 2
0
 $HTTP_VARS['checkout_item_instance_rs'] = get_encoded_item_instance_rs($altid_item_instance_rs);
 echo get_url_fields(NULL, array('checkout_item_instance_rs' => $HTTP_VARS['checkout_item_instance_rs']));
 if (is_not_empty_array($HTTP_VARS['checkout_item_instance_rs'])) {
     if ($HTTP_VARS['op'] == 'checkout') {
         echo "<input type=\"button\" class=\"button\" onclick=\"doFormSubmit(this.form, 'item_borrow.php', 'quick_check_out')\" value=\"" . get_opendb_lang_var('check_out_item(s)') . "\">";
     } else {
         $HTTP_VARS['sequence_number'] = get_borrowed_item_sequence_number_r($altid_item_instance_rs);
         echo get_url_fields(NULL, array('sequence_number' => $HTTP_VARS['sequence_number']));
         echo "<input type=\"button\" class=\"button\" onclick=\"doFormSubmit(this.form, 'item_borrow.php', 'check_in')\" value=\"" . get_opendb_lang_var('check_in_item(s)') . "\">";
     }
 }
 echo "</form>";
 unset($HTTP_VARS['alt_item_id']);
 $listingObject = new HTML_Listing($PHP_SELF, $HTTP_VARS);
 $listingObject->setNoRowsMessage(get_opendb_lang_var('no_records_found'));
 if (is_numeric($listingObject->getItemsPerPage())) {
     $listingObject->setTotalItems(count($altid_item_instance_rs));
 }
 if (is_array($altid_item_instance_rs)) {
     sort_item_listing($altid_item_instance_rs, $listingObject->getCurrentOrderBy(), $listingObject->getCurrentSortOrder());
     // Now get the bit we actually want for this page.
     if (is_numeric($listingObject->getItemsPerPage())) {
         $altid_item_instance_rs = array_slice($altid_item_instance_rs, $listingObject->getStartIndex(), $listingObject->getItemsPerPage());
     }
     // Ensure we are at the start of the array.
     if (is_array($altid_item_instance_rs)) {
         reset($altid_item_instance_rs);
     }
 }
 echo "<div id=\"checkOutListing\">";
 $listingObject->startListing($page_title);
Exemplo n.º 3
0
 echo getAlphaListBlock($PHP_SELF, $HTTP_VARS);
 if ($show_interest_column) {
     echo $xajax->printJavascript();
 }
 $listingObject = new HTML_Listing($PHP_SELF, $HTTP_VARS);
 $listingObject->startListing($page_title);
 if ($show_checkbox_column) {
     $listingObject->addHeaderColumn(NULL, 'item_id_instance_no', FALSE, 'checkbox');
 }
 for ($i = 0; $i < count($v_column_display_config_rs); $i++) {
     if ($v_column_display_config_rs[$i]['include_in_listing'] !== FALSE) {
         $listingObject->addHeaderColumn($v_column_display_config_rs[$i]['prompt'], $v_column_display_config_rs[$i]['fieldname'], $v_column_display_config_rs[$i]['orderby_support_ind'] === 'Y');
     }
 }
 // If no items Per Page - we are listing everything.
 if (is_numeric($listingObject->getItemsPerPage())) {
     $listingObject->setTotalItems(fetch_item_listing_cnt($HTTP_VARS, $v_column_display_config_rs));
 }
 // -------------------------------------- Process the Query here -----------------------------------------------------------------
 if ($result = fetch_item_listing_rs($HTTP_VARS, $v_column_display_config_rs, $listingObject->getCurrentOrderBy(), $listingObject->getCurrentSortOrder(), $listingObject->getStartIndex(), $listingObject->getItemsPerPage())) {
     // ----------------------------------------------------------------------------
     // Save current url string, so we can return to last listings page if required.
     // ----------------------------------------------------------------------------
     // The Listing class has already removed any $HTTP_VARS which should not
     // be passed onto the next request.
     $v_listing_url_vars = $HTTP_VARS;
     $v_listing_url_vars['mode'] = NULL;
     // These are listing specific - we do not want to save them.
     $v_listing_url_vars['item_id_instance_no'] = NULL;
     $v_listing_url_vars['checked_item_id_instance_no'] = NULL;
     $v_listing_url_vars['checked_item_id_instance_no_list'] = NULL;
Exemplo n.º 4
0
}
if (strlen($HTTP_VARS['op']) == 0) {
    if (is_not_empty_array($success)) {
        echo format_error_block($success, 'information');
    }
    echo "<p>[<a href=\"admin.php?type={$ADMIN_TYPE}&op=flushexpired\">Delete expired cache entries</a>] " . "[<a href=\"admin.php?type={$ADMIN_TYPE}&op=flush\">Delete all cache entries</a>]</p>";
    if (strlen($HTTP_VARS['order_by']) == 0) {
        $HTTP_VARS['order_by'] = 'cache_date';
    }
    $listingObject = new HTML_Listing($PHP_SELF, $HTTP_VARS);
    $listingObject->setNoRowsMessage(get_opendb_lang_var('no_items_found'));
    $listingObject->startListing();
    $listingObject->addHeaderColumn('URL', 'url');
    $listingObject->addHeaderColumn('Cached', 'cache_date');
    $listingObject->addHeaderColumn('Expires', 'expire_date');
    if (is_numeric($listingObject->getItemsPerPage())) {
        $listingObject->setTotalItems(fetch_file_cache_cnt($HTTP_VARS['cache_type']));
    }
    $results = fetch_file_cache_rs($HTTP_VARS['cache_type'], $listingObject->getCurrentOrderBy(), $listingObject->getCurrentSortOrder(), $listingObject->getStartIndex(), $listingObject->getItemsPerPage());
    if ($results) {
        while ($file_cache_r = db_fetch_assoc($results)) {
            $listingObject->startRow();
            if (file_cache_get_cache_file($file_cache_r)) {
                $popupUrl = "url.php?id=" . $file_cache_r['sequence_number'];
                $listingObject->addColumn("<a href=\"" . $file_cache_r['url'] . "\" onclick=\"popup('{$popupUrl}'); return false;\" target=\"_new\">" . get_overflow_tooltip_column($file_cache_r['url'], 100) . "</a>");
            } else {
                $listingObject->addColumn(get_overflow_tooltip_column($file_cache_r['url'], 100));
            }
            $listingObject->addColumn(get_localised_timestamp(get_opendb_config_var('http', 'datetime_mask'), $file_cache_r['cache_date']));
            $column = '';
            if ($file_cache_r['expired_ind'] == 'Y') {
Exemplo n.º 5
0
 }
 echo _theme_header($page_title);
 echo "<h2>" . $page_title . "</h2>";
 $listingObject = new HTML_Listing($PHP_SELF, $HTTP_VARS, $HTTP_VARS['mode']);
 $listingObject->setNoRowsMessage(get_opendb_lang_var('no_users_found'));
 if ($HTTP_VARS['restrict_active_ind'] == 'X') {
     $restrict_users_mode = INCLUDE_ACTIVATE_USER;
 } else {
     if ($HTTP_VARS['show_deactivated_users'] == 'Y') {
         $restrict_users_mode = INCLUDE_DEACTIVATED_USER;
     } else {
         $restrict_users_mode = EXCLUDE_DEACTIVATED_USER;
     }
 }
 $listingObject->startListing();
 if (is_numeric($listingObject->getItemsPerPage())) {
     $listingObject->setTotalItems(fetch_user_cnt(NULL, INCLUDE_ROLE_PERMISSIONS, INCLUDE_CURRENT_USER, $restrict_users_mode));
     if ($listingObject->getTotalItemCount() > 0) {
         $result = fetch_user_rs(NULL, INCLUDE_ROLE_PERMISSIONS, INCLUDE_CURRENT_USER, $restrict_users_mode, $listingObject->getCurrentOrderBy(), $listingObject->getCurrentSortOrder(), $listingObject->getStartIndex(), $listingObject->getItemsPerPage());
     }
 } else {
     $result = fetch_user_rs(NULL, INCLUDE_ROLE_PERMISSIONS, INCLUDE_CURRENT_USER, $restrict_users_mode, $listingObject->getCurrentOrderBy(), $listingObject->getCurrentSortOrder());
     //$include_deactivated_users
 }
 $listingObject->addHeaderColumn(NULL, 'user_id_rs', FALSE, 'checkbox');
 $listingObject->addHeaderColumn(get_opendb_lang_var('user'), 'user_id');
 $listingObject->addHeaderColumn(get_opendb_lang_var('action'));
 $listingObject->addHeaderColumn(get_opendb_lang_var('user_role'), 'role');
 if ($HTTP_VARS['restrict_active_ind'] != 'X') {
     $listingObject->addHeaderColumn(get_opendb_lang_var('last_visit'), 'lastvisit');
 }