Пример #1
0
 /**
  * Displays the zone list
  */
 function rows($result, $map, $reload_allowed, $page, $total_pages)
 {
     global $fmdb, $__FM_CONFIG;
     $all_num_rows = $num_rows = $fmdb->num_rows;
     $results = $fmdb->last_result;
     if (currentUserCan('reload_zones', $_SESSION['module'])) {
         $bulk_actions_list = array(__('Reload'));
         $checkbox[] = array('title' => '<input type="checkbox" class="tickall" onClick="toggle(this, \'domain_list[]\')" />', 'class' => 'header-tiny header-nosort');
     } else {
         $checkbox = $bulk_actions_list = null;
     }
     if (!$result) {
         printf('<p id="table_edits" class="noresult" name="domains">%s</p>', __('There are no zones.'));
     } else {
         if (array_key_exists('attention', $_GET)) {
             $num_rows = $GLOBALS['zone_badge_counts'][$map];
             $total_pages = ceil($num_rows / $_SESSION['user']['record_count']);
             if ($page > $total_pages) {
                 $page = $total_pages;
             }
         }
         $start = $_SESSION['user']['record_count'] * ($page - 1);
         $end = $_SESSION['user']['record_count'] * $page > $num_rows ? $num_rows : $_SESSION['user']['record_count'] * $page;
         $classes = array_key_exists('attention', $_GET) ? null : ' grey';
         $eye_attention = $GLOBALS['zone_badge_counts'][$map] ? '<i class="fa fa-eye fa-lg eye-attention' . $classes . '" title="' . __('Only view zones that need attention') . '"></i>' : null;
         $addl_blocks = array(@buildBulkActionMenu($bulk_actions_list, 'server_id_list'), $this->buildFilterMenu(), $eye_attention);
         $fmdb->num_rows = $num_rows;
         echo displayPagination($page, $total_pages, $addl_blocks);
         $table_info = array('class' => 'display_results sortable', 'id' => 'table_edits', 'name' => 'domains');
         $title_array = array(array('title' => __('ID'), 'class' => 'header-small header-nosort'), array('title' => __('Domain'), 'rel' => 'domain_name'), array('title' => __('Type'), 'rel' => 'domain_type'), array('title' => __('Views'), 'class' => 'header-nosort'), array('title' => __('Records'), 'class' => 'header-small  header-nosort'));
         $title_array[] = array('title' => __('Actions'), 'class' => 'header-actions header-nosort');
         if (is_array($checkbox)) {
             $title_array = array_merge($checkbox, $title_array);
         }
         echo displayTableHeader($table_info, $title_array, 'zones');
         $y = 0;
         for ($x = $start; $x < $all_num_rows; $x++) {
             if ($y == $_SESSION['user']['record_count']) {
                 break;
             }
             if (array_key_exists('attention', $_GET)) {
                 if (!$results[$x]->domain_clone_domain_id && $results[$x]->domain_type == 'master' && $results[$x]->domain_template == 'no' && (!getSOACount($results[$x]->domain_id) || !getNSCount($results[$x]->domain_id) || $results[$x]->domain_reload != 'no')) {
                     $this->displayRow($results[$x], $map, $reload_allowed);
                     $y++;
                 }
             } else {
                 $this->displayRow($results[$x], $map, $reload_allowed);
                 $y++;
             }
         }
         echo "</tbody>\n</table>\n";
     }
 }
Пример #2
0
    $sort_direction = null;
    if (isset($_SESSION[$_SESSION['module']][$GLOBALS['path_parts']['filename']])) {
        extract($_SESSION[$_SESSION['module']][$GLOBALS['path_parts']['filename']], EXTR_OVERWRITE);
    }
    if (in_array($record_type, array('A', 'AAAA')) && $sort_field == 'record_value') {
        $ip_sort = true;
    }
    if (isset($search_query)) {
        $record_sql .= $search_query;
    }
    $result = basicGetList('fm_' . $__FM_CONFIG['fmDNS']['prefix'] . 'records', array($sort_field, 'record_name'), 'record_', $record_sql, null, $ip_sort, $sort_direction);
    $total_pages = ceil($fmdb->num_rows / $_SESSION['user']['record_count']);
    if ($page > $total_pages) {
        $page = $total_pages;
    }
    $pagination = displayPagination($page, $total_pages);
    $body .= $pagination . '<div class="overflow-container">' . $form;
    $record_rows = $fm_dns_records->rows($result, $record_type, $domain_id, $page);
    if (currentUserCan('manage_records', $_SESSION['module']) && $zone_access_allowed) {
        $body .= '<div class="existing-container">' . $record_rows;
        $body .= sprintf('</div><div class="new-container">
	<a name="#manage"></a>
	<h2>%s</h2>
	%s
	<p><input type="submit" name="submit" value="%s" class="button" /></p>
</form></div>' . "\n", __('Add Record'), $fm_dns_records->printRecordsForm($form_data, $action, $record_type, $domain_id), __('Validate'));
    } else {
        $body .= '<div class="existing-container no-bottom-margin">' . $record_rows;
    }
}
echo $body . '</div>' . "\n";
Пример #3
0
    $page = isset($_GET['page']) ? (int) $_GET['page'] : -1;
    if ($page == 0 || $page == 1) {
        header('Location: ./');
    } else {
        if ($page == -1) {
            $page = 0;
        }
    }
    // check if pagination is asked
    if (!empty($_GET['page'])) {
        checkPagination($page, $books->count());
        $tpl->assign('book', $books->lastBooks(($page - 1) * PAGINATION));
    } else {
        $tpl->assign('book', $books->lastBooks());
    }
    $tpl->assign('pagination', displayPagination($page, $books->count()));
    $tpl->assign('page_title', !empty($page) ? 'Page ' . $page : '');
    $tpl->assign('menu_links', Path::menu('home'));
    $tpl->assign('menu_links_admin', Path::menuAdmin('home'));
    $tpl->assign('token', getToken());
    $tpl->draw('list');
    exit;
}
// book asked
if (!empty($_GET['book'])) {
    bookPage();
}
// admin asked
if (isset($_GET['admin'])) {
    administration();
}
Пример #4
0
function showPage($username = '', $accessLvl = '', $errors = '')
{
    //page where user will select user to edit
    global $db;
    showHeader($username, $accessLvl);
    include 'connectToDB.php';
    include 'pagination_functionality.php';
    //include 'dump_all_page_contents.php';
    if ($errors) {
        //show errors at top of page
        print '<h2 class = "error"> The following errors were encountered:</h2>';
        print '<ul><li>';
        print implode('</li><li>', $errors);
        print '</li></ul>';
    }
    $query_dept = "SELECT dept_id FROM users WHERE user_id={$_SESSION['userid']}";
    $result_dept = mysqli_query($db, $query_dept);
    $dept_row = mysqli_fetch_array($result_dept);
    $query_dept = "SELECT name FROM departments WHERE dept_id={$dept_row['dept_id']}";
    $result_deptName = mysqli_query($db, $query_dept);
    $dept_rowName = mysqli_fetch_array($result_deptName);
    if ($accessLvl == 'U') {
        //is access is only at the user level, then must match the refunds pulled to display only the current users created refunds
        if ($dept_rowName['name'] == "Accounting") {
            if (isset($_GET['refund_id'])) {
                $query = "SELECT NG_enc_id, U.first_name, U.last_name, dt_request, status, dt_required, payable, \n\t\t\taddr_ln_1, addr_ln_2, city, state, zip, purpose, amount, status, comments, assigned_to,created_by,check_date,check_nbr \n\t\t\tFROM refund AS R \n\t\t\tINNER JOIN users AS U \n\t\t\tON R.created_by= U.user_id \n\t\t\tWHERE refund_id = '{$_GET['refund_id']}' \n\t\t\tAND (status='ACCOUNTING APPROVAL') \n\t\t\tAND assigned_to='{$_SESSION['userid']}' LIMIT " . $_SESSION['initialOffset'] . "," . $_SESSION['RowsPerPage'];
            } else {
                $query = "SELECT NG_enc_id, U.first_name, U.last_name, dt_request, status, dt_required, payable, \n\t\t\taddr_ln_1, addr_ln_2, city, state, zip, purpose, amount, status, comments, assigned_to,created_by,check_date,check_nbr \n\t\t\tFROM refund AS R INNER JOIN users AS U ON R.created_by= U.user_id WHERE refund_id = '{$_POST['refund_id']}' \n\t\t\tAND (status='ACCOUNTING APPROVAL') \n\t\t\tAND assigned_to='{$_SESSION['userid']}' LIMIT " . $_SESSION['initialOffset'] . "," . $_SESSION['RowsPerPage'];
            }
        } elseif ($dept_rowName['name'] == "Billing") {
            if (isset($_GET['refund_id'])) {
                $query = "SELECT NG_enc_id, U.first_name, U.last_name, dt_request, status, dt_required, payable, \n\t\t\taddr_ln_1, addr_ln_2, city, state, zip, purpose, amount, status, comments, assigned_to,created_by,check_date,check_nbr \n\t\t\tFROM refund AS R \n\t\t\tINNER JOIN users AS U \n\t\t\tON R.created_by= U.user_id \n\t\t\tWHERE refund_id = '{$_GET['refund_id']}' \n\t\t\tAND assigned_to='{$_SESSION['userid']}' LIMIT " . $_SESSION['initialOffset'] . "," . $_SESSION['RowsPerPage'];
            } else {
                $query = "SELECT NG_enc_id, U.first_name, U.last_name, dt_request, status, dt_required, payable, \n\t\t\taddr_ln_1, addr_ln_2, city, state, zip, purpose, amount, status, comments, assigned_to,created_by,check_date,check_nbr \n\t\t\tFROM refund AS R INNER JOIN users AS U ON R.created_by= U.user_id \n\t\t\tWHERE refund_id = '{$_POST['refund_id']}' \n\t\t\tAND assigned_to='{$_SESSION['userid']}' LIMIT " . $_SESSION['initialOffset'] . "," . $_SESSION['RowsPerPage'];
            }
        }
        if (!isset($_SESSION['order'])) {
            if ($dept_rowName['name'] == "Accounting") {
                $query = "SELECT NG_enc_id, U.first_name, U.last_name, dt_request,amount, status,refund_id, payable,assigned_to \n\t\t\t\t\tFROM refund AS R \n\t\t\t\t\tINNER JOIN \n\t\t\t\t\tusers AS U \n\t\t\t\t\tON R.created_by = U.user_id \n\t\t\t\t\tWHERE status !='deleted' AND status !='VOIDED' AND (status='ACCOUNTING APPROVAL') AND assigned_to='{$_SESSION['userid']}'  \n\t\t\t\t\tORDER BY dt_request,U.last_name,status LIMIT " . $_SESSION['initialOffset'] . "," . $_SESSION['RowsPerPage'];
            } elseif ($dept_rowName['name'] == "Billing") {
                $query = "SELECT NG_enc_id, U.first_name, U.last_name, dt_request,amount, status,refund_id, payable,assigned_to \n\t\t\t\t\tFROM refund AS R \n\t\t\t\t\tINNER JOIN \n\t\t\t\t\tusers AS U \n\t\t\t\t\tON R.created_by = U.user_id \n\t\t\t\t\tWHERE status !='deleted' AND status !='VOIDED' AND (status='ACCOUNTING APPROVED' OR status='NEW') assigned_to='{$_SESSION['userid']}'  \n\t\t\t\t\tORDER BY dt_request,U.last_name,status AND LIMIT " . $_SESSION['initialOffset'] . "," . $_SESSION['RowsPerPage'];
            }
        } else {
            if ($dept_rowName['name'] == "Accounting") {
                $query = "SELECT NG_enc_id, U.first_name, U.last_name, dt_request,amount, status,refund_id, payable,assigned_to \n\t\t\t\t\tFROM refund AS R \n\t\t\t\t\tINNER JOIN \n\t\t\t\t\tusers AS U \n\t\t\t\t\tON R.created_by = U.user_id \n\t\t\t\t\tWHERE status !='deleted' AND status !='VOIDED' AND (status='ACCOUNTING APPROVAL') AND assigned_to='{$_SESSION['userid']}' \n\t\t\t\t\tORDER BY " . $_SESSION['order'] . " LIMIT " . $_SESSION['initialOffset'] . "," . $_SESSION['RowsPerPage'];
            } elseif ($dept_rowName['name'] == "Billing") {
                $query = "SELECT NG_enc_id, U.first_name, U.last_name, dt_request,amount, status,refund_id, payable,assigned_to \n\t\t\t\t\tFROM refund AS R \n\t\t\t\t\tINNER JOIN \n\t\t\t\t\tusers AS U \n\t\t\t\t\tON R.created_by = U.user_id \n\t\t\t\t\tWHERE status !='deleted' AND status !='VOIDED' AND (status='ACCOUNTING APPROVED' OR status='NEW') AND assigned_to='{$_SESSION['userid']}' \n\t\t\t\t\tORDER BY " . $_SESSION['order'] . " LIMIT " . $_SESSION['initialOffset'] . "," . $_SESSION['RowsPerPage'];
            }
        }
    } else {
        //else access levels
        if (!isset($_SESSION['order'])) {
            if ($dept_rowName['name'] == "Accounting") {
                $query = "SELECT NG_enc_id, U.first_name, U.last_name, dt_request,amount, status,refund_id, payable,assigned_to,\n\t\t\t\t\taccounting_approval,billing_initial_approval,billing_final_approval,urgent \n\t\t\t\t\tFROM refund AS R \n\t\t\t\t\tINNER JOIN \n\t\t\t\t\tusers AS U \n\t\t\t\t\tON R.created_by = U.user_id \n\t\t\t\t\tWHERE status !='deleted' AND status !='VOIDED' AND (status='ACCOUNTING APPROVAL') AND assigned_to='{$_SESSION['userid']}'    \n\t\t\t\t\tORDER BY dt_request,U.last_name,status LIMIT " . $_SESSION['initialOffset'] . "," . $_SESSION['RowsPerPage'];
            } elseif ($dept_rowName['name'] == "Billing") {
                $query = "SELECT NG_enc_id, U.first_name, U.last_name, dt_request,amount, status,refund_id, payable,assigned_to,\n\t\t\t\t\taccounting_approval,billing_initial_approval,billing_final_approval,urgent \n\t\t\t\t\tFROM refund AS R \n\t\t\t\t\tINNER JOIN \n\t\t\t\t\tusers AS U \n\t\t\t\t\tON R.created_by = U.user_id \n\t\t\t\t\tWHERE status !='deleted' AND status !='VOIDED' AND (status='ACCOUNTING APPROVED' OR status='NEW') AND assigned_to='{$_SESSION['userid']}'    \n\t\t\t\t\tORDER BY dt_request,U.last_name,status LIMIT " . $_SESSION['initialOffset'] . "," . $_SESSION['RowsPerPage'];
            }
        } else {
            if ($dept_rowName['name'] == "Accounting") {
                $query = "SELECT NG_enc_id, U.first_name, U.last_name, dt_request,amount, status,refund_id, payable,assigned_to,\n\t\t\t\t\taccounting_approval,billing_initial_approval,billing_final_approval,urgent \t\t\t\n\t\t\t\t\tFROM refund AS R \n\t\t\t\t\tINNER JOIN \n\t\t\t\t\tusers AS U \n\t\t\t\t\tON R.created_by = U.user_id \n\t\t\t\t\tWHERE status !='deleted' AND status !='VOIDED' AND (status='ACCOUNTING APPROVAL') AND assigned_to='{$_SESSION['userid']}'   \n\t\t\t\t\tORDER BY " . $_SESSION['order'] . " LIMIT " . $_SESSION['initialOffset'] . "," . $_SESSION['RowsPerPage'];
            } elseif ($dept_rowName['name'] == "Billing") {
                $query = "SELECT NG_enc_id, U.first_name, U.last_name, dt_request,amount, status,refund_id, payable,assigned_to,\n\t\t\t\t\taccounting_approval,billing_initial_approval,billing_final_approval,urgent \n\t\t\t\t\tFROM refund AS R \n\t\t\t\t\tINNER JOIN \n\t\t\t\t\tusers AS U \n\t\t\t\t\tON R.created_by = U.user_id \n\t\t\t\t\tWHERE status !='deleted' AND status !='VOIDED' and (status='ACCOUNTING APPROVED' OR status='NEW') AND assigned_to='{$_SESSION['userid']}'    \n\t\t\t\t\tORDER BY dt_request,U.last_name,status LIMIT " . $_SESSION['initialOffset'] . "," . $_SESSION['RowsPerPage'];
            }
        }
    }
    echo 'new query <br>';
    echo $query;
    echo '<br>';
    $result = mysqli_query($db, $query);
    $arrayRefundUsers = array();
    $queryUserIDs = "SELECT user_id, first_name, last_name FROM users";
    $resultUserIDs = mysqli_query($db, $queryUserIDs);
    $ctr = 0;
    while ($row = mysqli_fetch_array($resultUserIDs)) {
        $arrayRefundUsers[$row['user_id']] = $row['first_name'] . ' ' . $row['last_name'];
    }
    $row = mysqli_fetch_array($result);
    print '<br /><br /><div align = "center"><b><h2>Assigned Refunds </h2></b>';
    if (sizeof($row)) {
        ///////HEADINGS FROM THE REFUNDS PAGE//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        print '<div align = "center"><p>Refund Requests Currently Assigned to you: </p><br>';
        print '<table border="1" cellpadding = "3">
		<tr>
		<td><center><b><a href=' . $_SERVER['PHP_SELF'] . '?encounter_num=y>Encounter Number</a></b></center></td>
		<td><center><b><a href=' . $_SERVER['PHP_SELF'] . '?refund_id=y>Refund ID</a></b></center></td>
		<td><center><b><a href=' . $_SERVER['PHP_SELF'] . '?encounter_date=y>Date Requested</a></b></center></td>
		<td><center><b><a href=' . $_SERVER['PHP_SELF'] . '?urgent=y>Urgent</a></b></center></td>
		<td><center><b><a href=' . $_SERVER['PHP_SELF'] . '?requested_by=y>Requested By</a></b></center></td>
		<td><center><b><a href=' . $_SERVER['PHP_SELF'] . '?payable_order=y>Payable To</a></b></center></td>
		<td><center><b><a href=' . $_SERVER['PHP_SELF'] . '?amount_order=y>Amount</a></b></center></td>
		<td><center><b><a href=' . $_SERVER['PHP_SELF'] . '?status_order=y>Status</a></b></center></td>
		<td><center><b><a href=' . $_SERVER['PHP_SELF'] . '?status_order=y>Assigned To</a></b></center></td>';
        ///////END HEADINGS FROM THE REFUNDS PAGE////////////////////?////////////////////////////////////////////////////////////////////////////////////////////////////////
        /*
        	<td><b><center>Actions</center></b></td>
        */
        $result_display_ctr = 0;
        $current_date = date("Y-m-d H:i:s");
        $result = mysqli_query($db, $query);
        while ($row = mysqli_fetch_array($result)) {
            $today_dt = $entered_dt = $interval = $refund_requested_by = $date_requested = $refund_assigned_to = $interval = "";
            calculateInterval($row, $refund_requested_by, $date_requested, $today_dt, $entered_dt, $interval, $refund_assigned_to);
            $refund_assigned_to = "";
            $queryUserIDs = "SELECT first_name, last_name FROM users WHERE user_id= '{$row['assigned_to']}'";
            $resultUserIDs = mysqli_query($db, $queryUserIDs);
            while ($rowUserIds = mysqli_fetch_array($resultUserIDs)) {
                //build up the assigned to username
                $refund_assigned_to = $rowUserIds['first_name'] . ' ' . $rowUserIds['last_name'];
            }
            if ($result_display_ctr < $_SESSION['RowsPerPage']) {
                $result_display_ctr++;
                if ($row['urgent']) {
                    print '<tr bgcolor=#EE0000 height=50>';
                } elseif ($interval->days > 30 && $row['status'] != "COMPLETED") {
                    print '<tr bgcolor=#FF69B4>';
                } elseif ($interval->days >= 15 && $interval->days < 30 && $row['status'] != "COMPLETED") {
                    print '<tr bgcolor=yellow>';
                } elseif ($interval->days <= 1 && $row['status'] != "COMPLETED") {
                    print '<tr bgcolor=#00BB00>';
                } else {
                    print '<tr>';
                }
                //print '<tr>
                print '<td><a href="' . $_SERVER['PHP_SELF'] . '?refund_id=' . $row['refund_id'] . '&action=edit">' . $row['NG_enc_id'] . '</a></td>
			<td><a href="' . $_SERVER['PHP_SELF'] . '?refund_id=' . $row['refund_id'] . '&action=edit">' . $row['refund_id'] . '</a></td>
			<td>' . $row['dt_request'] . '</td>
			<td>' . ($row['urgent'] ? 'Yes' : 'No') . '</td>
			<td>' . $row['first_name'] . ' ' . $row['last_name'] . '</td>
			<td>' . $row['payable'] . '</td>';
                print '<td>$ ' . $row['amount'] . '</td>';
                if (!$row['accounting_approval'] && !$row['billing_initial_approval'] && !$row['billing_final_approval']) {
                    print '<td>NEW</td>';
                } elseif (!$row['accounting_approval'] && $row['billing_initial_approval']) {
                    print '<td>ACCOUNTING APPROVAL</td>';
                } elseif ($row['accounting_approval'] && $row['billing_initial_approval'] && !$row['billing_final_approval']) {
                    print '<td>ACCOUNTING APPROVED</td>';
                } elseif ($row['accounting_approval'] && $row['billing_initial_approval'] && $row['billing_final_approval']) {
                    print '<td>ACCOUNTING VERIFIED</td>';
                } elseif ($row['status'] == "REJECTED") {
                    print '<td>REJECTED</td>';
                } elseif ($row['status'] == "VOIDED") {
                    print '<td>VOIDED</td>';
                }
                print '<td>' . $refund_assigned_to . '</td>';
                print '</td></tr>';
            }
            instantiate_page_variables($row, $tempOrigStartPosition, $page, $URL_String_BACK, $URL_String_FORWARD);
        }
        print '</table></div>';
        if (sizeof($row) > $_SESSION['RowsPerPage']) {
            //only conditionally display the pagination
            displayPagination($row, $tempOrigStartPosition, $URL_String_BACK, $URL_String_FORWARD);
        }
    } else {
        //end if they have refunds
        echo '<br><br>';
        echo '<center><b> You currently have no refunds assigned to you! </b></center>';
    }
    showFooter();
}
Пример #5
0
                    print '<td>COMPLETED</td>';
                } elseif ($row['status'] == "REJECTED") {
                    print '<td>REJECTED</td>';
                } elseif ($row['status'] == "VOIDED") {
                    print '<td>VOIDED</td>';
                } elseif ($row['accounting_approval'] && !$row['billing_initial_approval'] && !$row['billing_final_approval']) {
                    print '<td>ACCOUNTING APPROVED</td>';
                }
                print '<td>' . $refund_assigned_to . '</td>';
                print '</td></tr>';
            }
            instantiate_page_variables($row, $tempOrigStartPosition, $page, $URL_String_BACK, $URL_String_FORWARD);
        }
        if ($currentRowSize > $_SESSION['RowsPerPage']) {
            //only conditionally display the pagination
            displayPagination($row, $tempOrigStartPosition, $URL_String_BACK, $URL_String_FORWARD);
        }
    } elseif (array_key_exists('userid', $_SESSION)) {
        //If user is logged in show page
        if (isset($_POST['_search_submit']) && $_POST['_search_submit'] != "" && $_POST['_search_submit'] != NULL) {
            showSearchPage($_SESSION['username'], $_SESSION['access']);
            $userIDSearched = "";
            if (isset($_POST['refund_search_term']) && strpos($_POST['refund_search_term'], '_by')) {
                echo '<center> Please further specify by selecting a name from the drop down below: </center>';
                echo '<br>';
                $query_users = 'SELECT user_id, first_name, last_name FROM users';
                $result_users = mysqli_query($db, $query_users);
                print <<<EDITUSERPAGE
<center><h2 align="center">Search Refunds</h2>
<a href="reports.php">Back to Refunds</a>
<br/><br/>
Пример #6
0
 /**
  * displayPages 
  * 
  * @param int $page 
  * @param int $thread_id 
  * 
  * @return void
  */
 function displayPages($page = 1, $thread_id = 0)
 {
     $thread_id = (int) $thread_id;
     if ($thread_id < 1) {
         $sql = "SELECT count(`id`) AS c \n                    FROM `fcms_board_threads`";
         $row = $this->fcmsDatabase->getRow($sql);
         if ($row === false) {
             $this->fcmsError->displayError();
             return;
         }
         $total_pages = ceil($row['c'] / 25);
         $url = 'messageboard.php';
     } else {
         $sql = "SELECT count(`id`) AS c \n                    FROM `fcms_board_posts` \n                    WHERE `thread` = ?";
         $row = $this->fcmsDatabase->getRow($sql, $thread_id);
         if ($row === false) {
             $this->fcmsError->displayError();
             return;
         }
         $total_pages = ceil($row['c'] / 15);
         $url = 'messageboard.php?thread=' . $thread_id;
     }
     displayPagination($url, $page, $total_pages);
 }
Пример #7
0
										<div class="listing-content">
											<h3><?php 
    echo $listing["company_name"];
    ?>
</h3>
										</div>
									</a>
									<?php 
}
?>
							
						</div>

					</div>
					<?php 
displayPagination($locationId, $sectionId, $categoryId, $pagination);
?>

				</div>
			</section>

			<section class="blog-preview">
				<div class="wc cf">
					<h1><?php 
_e('KÄLLABABY BLOG', 'kb');
?>
</h1>
					<p class="mini-desc"><?php 
_e('Read about what’s new and what’s hot', 'kb');
?>
</p>
Пример #8
0
 /**
  * displayUserFamilyNews 
  * 
  * Prints the listing of family news for a given user.
  * 
  * @param int $user
  * @param int $page 
  * 
  * @return  void
  */
 function displayUserFamilyNews($user, $page = 1)
 {
     $user = (int) $user;
     $from = $page * 5 - 5;
     // Get family news
     $sql = "SELECT n.`id`, n.`user`, n.`title`, n.`news`, n.`updated`, n.`created`, \n                    n.`external_type`, n.`external_id`\n                FROM `fcms_news` AS n, `fcms_users` AS u\n                WHERE n.`user` = ? \n                    AND n.`user` = u.`id` \n                ORDER BY `updated` DESC \n                LIMIT {$from}, 5";
     $rows = $this->fcmsDatabase->getRows($sql, $user);
     if ($rows === false) {
         $this->fcmsError->displayError();
         return;
     }
     if (count($rows) <= 0) {
         echo '
         <div class="blank-state">
             <h2>' . T_('Nothing to see here') . '</h2>
             <h3>' . T_('Currently no one has added any news') . '</h3>
             <h3>' . T_('Why don\'t you be the first to add news?') . '</a></h3>
             <ol>
                 <li><a href="?addnews=yes">' . T_('Add Family News') . '</a></li>
                 <li><a href="settings.php?view=familynews">' . T_('Import News from existing blog') . '</a></li>
             </ol>
         </div>';
         return;
     }
     foreach ($rows as $row) {
         $this->displayNews($row);
     }
     // Display Pagination
     $sql = "SELECT COUNT(`id`) AS c \n                FROM `fcms_news` \n                WHERE `user` = ?";
     $row = $this->fcmsDatabase->getRow($sql, $user);
     if ($row === false) {
         $this->fcmsError->displayError();
         return;
     }
     $newscount = $row['c'];
     $total_pages = ceil($newscount / 5);
     displayPagination('familynews.php?getnews=' . $user, $page, $total_pages);
 }
                $res .= "<tr>";
                $res .= "<td colspan='9'><img src='images/warning.png'>&nbsp;&nbsp;&nbsp;";
                if (trim($rs["crawl_status_message"]) != "") {
                    $res .= "Last crawl status : " . $rs["crawl_status"] . "&nbsp;&nbsp;(";
                    $res .= wordwrap($rs["crawl_status_message"], 100, "\n", true) . ")";
                } else {
                    $res .= "Only one crawled page ! Check source settings (starting url, host and host aliases)";
                }
                $res .= "<br>[<a href='log.php?id=" . $rs["id"] . "' title='Log' target='log'>See log file</a>]";
                $res .= "</td>";
                $res .= "</tr>";
            }
        }
        $res .= "</table></center>";
        if ($onepage != "1") {
            $res .= "<br /><center>" . displayPagination($RowCount, $sources_page_size, $start, $page) . "</center>";
        }
        print $res;
        exit;
    }
}
if ($action == "displaysource") {
    $id = $_GET["id"];
    if ($id == "") {
        print "";
        exit;
    }
    $mg = mg_connect($config, "", "", "");
    if ($mg) {
        $stmt = new mg_stmt_select($mg, "sources");
        $query = array("id" => intval($id));
Пример #10
0
$response_elevate = $solr->elevate(preg_replace('/\\s+/', ' ', $q), $params);
// use the original user query not updated query
/*
if ($response_elevate->getHttpStatus()==200) {
	$hits_elevate = $response_elevate->response->numFound;
}
*/
$response = $solr->search($query, ($page - 1) * $item_per_page, $item_per_page, $params);
if ($response->getHttpStatus() == 200) {
    $hits = $response->response->numFound;
    echo '<hr>';
    echo 'Hits: ' . $hits;
    echo '<hr>';
    if ($hits > 0) {
        // Display pagination
        echo displayPagination($hits, $item_per_page, $page, $fqstr) . '<br /><br />';
        $res = '';
        // Display elevated documents
        $elevated_ids = array();
        if ($page == 1) {
            $teasers = get_object_vars($response_elevate->highlighting);
            foreach ($response_elevate->response->docs as $doc) {
                $elevated_ids[] = $doc->id;
                $res .= displayResultItem($doc, $teasers);
            }
        }
        // Display results list
        $teasers = get_object_vars($response->highlighting);
        foreach ($response->response->docs as $doc) {
            if (count($elevated_ids) > 0 && in_array($doc->id, $elevated_ids)) {
                continue;
Пример #11
0
/**
 * displayPages
 * 
 * Function renamed in 2.0, needs to stay until old calls are updated.
 *
 * @deprecated deprecated since version 2.0 
 */
function displayPages($url, $cur_page, $total_pages)
{
    displayPagination($url, $cur_page, $total_pages);
}
Пример #12
0
 /**
  * displayPrayers 
  * 
  * @return void
  */
 function displayPrayers()
 {
     $this->displayHeader(array('jsOnload' => '
 $(\'.delform input[type="submit"]\').click(function(e) {
     return confirmDeleteLink(this, "' . T_('Are you sure you want to DELETE this?') . '", e);
 });'));
     if (isset($_SESSION['success'])) {
         displayOkMessage();
         unset($_SESSION['success']);
     }
     if (isset($_SESSION['delete_success'])) {
         displayOkMessage(T_('Prayer Concern Deleted Successfully'));
         unset($_SESSION['delete_success']);
     }
     if ($this->fcmsUser->access <= 5) {
         echo '
         <div id="actions_menu">
             <ul><li><a class="action" href="?addconcern=yes">' . T_('Add a Prayer Concern') . '</a></li></ul>
         </div>';
     }
     $page = getPage();
     $from = $page * 5 - 5;
     $sql = "SELECT p.`id`, `for`, `desc`, `user`, `date` \n                FROM `fcms_prayers` AS p, `fcms_users` AS u \n                WHERE u.`id` = p.`user` \n                ORDER BY `date` DESC \n                LIMIT {$from}, 5";
     $rows = $this->fcmsDatabase->getRows($sql);
     if ($rows === false) {
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     if (count($rows) <= 0) {
         echo '
         <div class="blank-state">
             <h2>' . T_('Nothing to see here') . '</h2>
             <h3>' . T_('Currently no one has added any Prayer Concerns.') . '</h3>
             <h3><a href="?addconcern=yes">' . T_('Why don\'t you add a new Prayer Concern now?') . '</a></h3>
         </div>';
         $this->displayFooter();
         return;
     }
     foreach ($rows as $r) {
         $date = fixDate(T_('F j, Y, g:i a'), $this->fcmsUser->tzOffset, $r['date']);
         $displayname = getUserDisplayName($r['user']);
         echo '
         <hr/>
         <h4>' . $date . '</h4>
         <div class="edit_delete">';
         // Edit
         if ($this->fcmsUser->id == $r['user'] || $this->fcmsUser->access < 2) {
             echo '
         <form method="post" action="prayers.php">
             <input type="hidden" name="id" value="' . (int) $r['id'] . '"/>
             <input type="hidden" name="for" value="' . cleanOutput($r['for']) . '"/>
             <input type="hidden" name="desc" value="' . cleanOutput($r['desc']) . '"/>
             <input type="submit" name="editprayer" value="' . T_('Edit') . '" class="editbtn" title="' . T_('Edit this Prayer Concern') . '"/>
         </form>';
         }
         // Delete
         if ($this->fcmsUser->access < 2) {
             echo '
         <form class="delform" method="post" action="prayers.php">
             <input type="hidden" name="id" value="' . (int) $r['id'] . '"/>
             <input type="submit" name="delprayer" value="' . T_('Delete') . '" class="delbtn" title="' . T_('Delete this Prayer Concern') . '"/>
         </form>';
         }
         echo '
         </div>
         <div class="for">
             <b>' . sprintf(T_('%s asks that you please pray for...'), '<a href="profile.php?member=' . (int) $r['user'] . '">' . $displayname . '</a>') . '</b>
             <div>' . cleanOutput($r['for']) . '</div>
         </div>
         <div class="because">
             <b>' . T_('Because...') . '</b>
             <div>' . parse($r['desc']) . '</div>
         </div>
         <div class="top"><a href="#top">' . T_('Back to Top') . '</a></div>';
     }
     // Display Pagination
     $sql = "SELECT count(`id`) AS c \n                FROM `fcms_prayers`";
     $r = $this->fcmsDatabase->getRow($sql);
     if ($r === false) {
         $this->fcmsError->displayError();
         $this->displayFooter();
         return;
     }
     $prayercount = (int) $r['c'];
     $total_pages = ceil($prayercount / 5);
     displayPagination('prayers.php', $page, $total_pages);
     $this->displayFooter();
 }
Пример #13
0
 /**
  * showRecipeInCategory 
  *
  * Displays up to 5 recipes for the given category and page.
  * 
  * @param   int     $cat 
  * @param   int     $page 
  * @return  void
  */
 function showRecipeInCategory($cat, $page = 1)
 {
     $cat = (int) $cat;
     $page = (int) $page;
     $from = $page * 5 - 5;
     // Display Menu
     echo '
         <div id="sections_menu">
             <ul>
                 <li><a href="recipes.php">' . T_('Recipe Categories') . '</a></li>';
     if ($this->fcmsUser->access <= 5) {
         echo '
             </ul>
         </div>
         <div id="actions_menu">
             <ul>
                 <li><a href="?addrecipe=yes&amp;cat=' . $cat . '">' . T_('Add Recipe') . '</a></li>';
     }
     echo '
             </ul>
         </div>';
     // Show Category Side Menu
     $this->showCategoryMenu();
     echo '
         <div id="maincolumn">';
     // Get Recipes for this category
     $sql = "SELECT r.`id`, r.`name`, r.`category`, r.`thumbnail`, c.`name` AS category_name, r.`user`, r.`date`\n                FROM `fcms_recipes` AS r, `fcms_category` AS c\n                WHERE `category` = ?\n                AND r.`category` = c.`id` \n                ORDER BY `date` DESC \n                LIMIT {$from}, 5";
     $rows = $this->fcmsDatabase->getRows($sql, $cat);
     if ($rows === false) {
         $this->fcmsError->displayError();
         return;
     }
     $categoryName = '';
     // Display Recipes
     if (count($rows) > 0) {
         $displayed_category = false;
         $path = 'uploads/upimages/';
         if (defined('UPLOADS')) {
             $path = 'file.php?u=';
         }
         foreach ($rows as $r) {
             // Category
             if (!$displayed_category) {
                 $displayed_category = true;
                 $categoryName = cleanOutput($r['category_name']);
                 echo '
         <h2>' . $categoryName . '</h2>
         <ul id="recipe-list">';
             }
             $since = getHumanTimeSince(strtotime($r['date']));
             echo '
             <li>
                 <a href="?category=' . $cat . '&amp;id=' . (int) $r['id'] . '">
                     <span>' . T_('Click to view recipe') . '</span>
                     <img src="' . URL_PREFIX . $path . basename($r['thumbnail']) . '"/>
                     <b>' . cleanOutput($r['name']) . '</b>
                     <i>' . $since . '</i>
                 </a>
             </li>';
         }
         echo '
         </ul>';
         // Display Pagination
         $sql = "SELECT count(`id`) AS c \n                    FROM `fcms_recipes` \n                    WHERE `category` = ?";
         $r = $this->fcmsDatabase->getRow($sql, $cat);
         if ($r === false) {
             $this->fcmsError->displayError();
             return;
         }
         $recipecount = $r['c'];
         $total_pages = ceil($recipecount / 5);
         displayPagination('recipes.php?category=' . $cat, $page, $total_pages);
         // No recipes for this category
     } else {
         echo '
         <div class="info-alert">
             <h2>' . $categoryName . '</h2>
             <p><i>' . T_('Currently no one has added any recipes to this category.') . '</i></p>
             <p><a href="?addrecipe=yes&amp;cat=' . $cat . '">' . T_('Add a Recipe') . '</a></p>
         </div>';
     }
     echo '
         </div>';
 }