예제 #1
0
    redirectToErrorPage();
}
//-------------------- Setup the direct db access methods  ------------------------------//
$fetch_object_function = _mmmd() . "_fetch_object";
$free_result_function = _mmmd() . "_free_result";
$error_function = _mmmd() . "_error";
//-------------------- Setup the filename and file type (header generation also)  ------------------------------//
//TODO: set charset to utf-8
$fileType = "application/csv";
$fileName = "export.csv";
header("Content-type: " . $fileType);
header("Content-Disposition: filename=" . $fileName);
header("Pragma: no-cache");
//-------------------- Generate Data ------------------------------//
if ($_REQUEST['module'] == "MM_ManageTransactionsView") {
    $view = new MM_ManageTransactionsView();
    $dataGrid = new MM_DataGrid($_REQUEST, "transaction_date", "desc");
    $csvHeaders = $view->getCSVHeaders();
    //headers array is keyed by the db fieldname
    $handle = fopen("php://output", "w");
    fputcsv($handle, $csvHeaders);
    $query = $view->constructQuery($_REQUEST, $dataGrid);
    $result = _mmmq($query);
    while ($row = @$fetch_object_function($result)) {
        $outputArray = array();
        //csv fields are type(transaction_type), date(transaction_date), order#(order_number), amount(transaction_amount), name(last_name), email(user_email), description
        //do some translations
        $fullName = "{$row->last_name}, {$row->first_name}";
        $transactionTypeLabel = "";
        switch ($row->transaction_type) {
            case MM_TransactionLog::$TRANSACTION_TYPE_PAYMENT:
<?php

/**
 *
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
// get data based on search criteria and datagrid settings
$view = new MM_ManageTransactionsView();
$dataGrid = new MM_DataGrid($_REQUEST, "transaction_date", "desc");
$data = $view->search($_REQUEST, $dataGrid);
$dataGrid->setTotalRecords($data);
$dataGrid->recordName = "transaction";
$headers = $view->getGridHeaders();
$datagridRows = array();
// process data
foreach ($data as $key => $item) {
    $fullName = "{$item->last_name}, {$item->first_name}";
    $transactionTypeIcons = "";
    switch ($item->transaction_type) {
        case MM_TransactionLog::$TRANSACTION_TYPE_PAYMENT:
            $transactionTypeIcons .= MM_Utils::getIcon('money', 'green', '1.4em', '2px', "Initial Payment or One-Time Payment");
            break;
        case MM_TransactionLog::$TRANSACTION_TYPE_RECURRING_PAYMENT:
            $transactionTypeIcons .= MM_Utils::getIcon('refresh', 'green', '1.4em', '2px', "Recurring Payment", "padding-left:2px;");
            break;
        case MM_TransactionLog::$TRANSACTION_TYPE_REFUND:
            $transactionTypeIcons .= MM_Utils::getIcon('money', 'red', '1.4em', '2px', "Refund");
            break;
        default:
            $transactionTypeIcons .= MM_NO_DATA;
예제 #3
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
$view = new MM_ManageTransactionsView();
$showSearch = false;
//only show 'export csv' option if current user is an administrator
global $current_user;
$showCsvExportButton = false;
if (isset($current_user) && isset($current_user->ID)) {
    $employee = MM_Employee::findByUserId($current_user->ID);
    if ($employee->isValid() && ($employee->getRoleId() == MM_Role::$ROLE_ADMINISTRATOR || $employee->doAllowExport())) {
        $showCsvExportButton = true;
        $exportDataUrl = MM_MODULES_URL . "/export_data.php";
        echo "<script type='text/javascript'>export_transactions_url = '{$exportDataUrl}';</script>\n";
    }
    echo "<input type='hidden' id='mm-admin-id' value='{$current_user->ID}' />";
    // determine if this user's preference is to have the advanced search open
    $showSearchOptionName = MM_OptionUtils::$OPTION_KEY_SHOW_TRANSACTIONS_SEARCH . "-" . $current_user->ID;
    $showSearchOptionValue = MM_OptionUtils::getOption($showSearchOptionName);
    if ($showSearchOptionValue == "1") {
        $showSearch = true;
    }
}
?>
<div class="mm-wrap">
	<div style="margin-top:20px;" class="mm-button-container">			
		<a id="mm-show-search-btn" onclick="mmjs.showSearch()" class="mm-ui-button blue" <?php