$dataGrid->recordName = "duplicate";
// define datagrid headers
$headers = array('member_name' => array('content' => 'Name', "attr" => "style='width:140px;'"), 'user_email' => array('content' => 'Email', "attr" => "style='width:200px;'"), 'order_number' => array('content' => 'Order#', "attr" => "style='width:80px;'"), 'product' => array('content' => 'Product'), 'date_added' => array('content' => 'Date', "attr" => "style='width:140px;'"), 'actions' => array('content' => 'Actions', "attr" => "style='width:160px;'"));
$datagridRows = array();
$blankRow = array(array('content' => '', "attr" => "style='height:2px; background-color:#ECECEC'"), array('content' => '', "attr" => "style='background-color:#ECECEC'"), array('content' => '', "attr" => "style='background-color:#ECECEC'"), array('content' => '', "attr" => "style='background-color:#ECECEC'"), array('content' => '', "attr" => "style='background-color:#ECECEC'"), array('content' => '', "attr" => "style='background-color:#ECECEC'"));
$lastUserId = "";
// process data
foreach ($data as $key => $item) {
    if (!empty($lastUserId) && $item->user_id != $lastUserId) {
        $datagridRows[] = $blankRow;
    }
    $lastUserId = $item->user_id;
    // actions
    $actions = "<a onclick='mmjs.cancelSubscription(\"{$item->id}\",\"{$item->order_number}\")' style='margin-left: 5px; cursor:pointer;' class='mm-ui-button'>Cancel Subscription</a>";
    // build datagrid row
    $row = array();
    $row[] = array('content' => "<span title='User ID: [{$item->user_id}]' style='line-height:20px;'>{$item->member_name}</span>");
    $row[] = array('content' => "<a href='" . MM_ModuleUtils::getUrl(MM_MODULE_MANAGE_MEMBERS, MM_MODULE_MEMBER_DETAILS_TRANSACTION_HISTORY) . "&user_id={$item->user_id}' target='_blank'>{$item->user_email}");
    $row[] = array('content' => "<span style='font-family:courier;'>{$item->order_number}</span>");
    $row[] = array('content' => $item->product);
    $row[] = array('content' => MM_Utils::dateToLocal($item->date_added));
    $row[] = array('content' => $actions);
    $datagridRows[] = $row;
}
$dataGrid->setHeaders($headers);
$dataGrid->setRows($datagridRows);
$dgHtml = $dataGrid->generateHtml();
if (empty($dgHtml)) {
    $dgHtml = "<p><i>No duplicate subscriptions found.</i></p>";
}
echo "<div style='width:85%'>{$dgHtml}</div>";
	<input id="mm-expiration-date" type="text" style="width: 152px" value="<?php 
        echo $expirationDate;
        ?>
" /> 
	<a onClick="jQuery('#mm-expiration-date').focus();"><?php 
        echo MM_Utils::getCalendarIcon();
        ?>
</a>
</p>
<?php 
    }
    ?>

<?php 
    if ($appliedBundle->isPendingCancellation()) {
        $cancellationDate = MM_Utils::dateToLocal($appliedBundle->getCancellationDate(false), "m/d/Y");
        ?>
<div style="width: 360px; margin-top: 8px; margin-bottom: 8px;" class="mm-divider"></div>
<p>Bundle Pending <?php 
        echo $appliedBundle->getPendingStatus() == MM_Status::$CANCELED ? "Cancellation" : "Pause";
        ?>
</p>

<p>
	<?php 
        echo MM_Utils::getInfoIcon();
        ?>
	<em>You can force <?php 
        echo $appliedBundle->getPendingStatus() == MM_Status::$CANCELED ? "cancel" : "pause";
        ?>
 the bundle by setting the cancellation date to any date in the past.</em>
Esempio n. 3
0
" /> 
				<a onClick="jQuery('#mm-membership-expiration-date').focus();"><?php 
                    echo MM_Utils::getCalendarIcon();
                    ?>
</a>
			</div>
			<?php 
                }
                ?>
		<?php 
            }
            ?>
		
		<?php 
            if ($user->isPendingCancellation()) {
                $cancellationDate = MM_Utils::dateToLocal($user->getCancellationDate(false), "m/d/Y");
                ?>
		<div style="margin-top:20px; margin-bottom:10px;">
			<span class="mm-section-header" style="font-size:14px;">Membership Pending <?php 
                echo $user->getPendingStatus() == MM_Status::$CANCELED ? "Cancellation" : "Pause";
                ?>
</span> 
		</div>
		
		<div style="margin-bottom:5px;">
			<?php 
                echo MM_Utils::getInfoIcon();
                ?>
 
			<em>You can force <?php 
                echo $user->getPendingStatus() == MM_Status::$CANCELED ? "cancel" : "pause";
Esempio n. 4
0
        $txnType = "<span style='font-family:courier;'>{$item->txn_type}</span>";
    }
    // payment status
    $pymtStatus = MM_NO_DATA;
    if (!empty($item->payment_status)) {
        $pymtStatus = "<span style='font-family:courier;'>{$item->payment_status}</span>";
    }
    $ipnDetails = "<a href='javascript:viewInfo({$item->id})'>View IPN Details</a>";
    $row = array();
    $row[] = array('content' => $memberLink);
    $row[] = array('content' => $orderLink);
    $row[] = array('content' => $txnId);
    $row[] = array('content' => $txnType);
    $row[] = array('content' => $pymtStatus);
    $row[] = array('content' => $ipnDetails);
    $row[] = array('content' => MM_Utils::dateToLocal($item->received));
    $rows[] = $row;
}
$headers['user_id'] = array('content' => '<a onclick="mmjs.sort(\'user_id\');" href="#">Member</a>', "attr" => "style='width:250px;'");
$headers['order_id'] = array('content' => '<a onclick="mmjs.sort(\'order_id\');" href="#">Order#</a>', "attr" => "style='width:80px;'");
$headers['txn_id'] = array('content' => '<a onclick="mmjs.sort(\'txn_id\');" href="#">Transaction ID</a>', "attr" => "style='width:150px;'");
$headers['txn_type'] = array('content' => '<a onclick="mmjs.sort(\'txn_type\');" href="#">Transaction Type</a>', "attr" => "style='width:150px;'");
$headers['payment_status'] = array('content' => '<a onclick="mmjs.sort(\'payment_status\');" href="#">Payment Status</a>', "attr" => "style='width:150px;'");
$headers['ipn_content'] = array('content' => 'IPN Details', "attr" => "style='width:150px;'");
$headers['received'] = array('content' => '<a onclick="mmjs.sort(\'received\');" href="#">Date</a>', "attr" => "style='width:150px;'");
$dataGrid->setHeaders($headers);
$dataGrid->setRows($rows);
$dgHtml = $dataGrid->generateHtml();
if ($dgHtml == "") {
    $dgHtml = "<p><i>No IPNs found.</i></p>";
}
    }
    $affiliateId = MM_NO_DATA;
    $subAffiliateId = MM_NO_DATA;
    if (!empty($item->affiliate_id)) {
        $affiliateId = $item->affiliate_id;
    }
    if (!empty($item->sub_affiliate_id)) {
        $subAffiliateId = $item->sub_affiliate_id;
    }
    if ($item->is_test) {
        $transactionTypeIcons .= MM_Utils::getIcon('flask', 'grey', '1.3em', '2px', "Test Transaction", "padding-left:4px;");
    }
    // build datagrid row
    $row = array();
    $row[] = array('content' => $transactionTypeIcons);
    $row[] = array('content' => MM_Utils::dateToLocal($item->transaction_date));
    $row[] = array('content' => "<a href='" . MM_ModuleUtils::getUrl(MM_MODULE_MANAGE_MEMBERS, MM_MODULE_MEMBER_DETAILS_TRANSACTION_HISTORY) . "&user_id={$item->user_id}'>{$item->order_number}</a>");
    $row[] = array('content' => _mmf($item->transaction_amount, $item->currency));
    $row[] = array('content' => $fullName);
    $row[] = array('content' => "<a href='" . MM_ModuleUtils::getUrl(MM_MODULE_MANAGE_MEMBERS, MM_MODULE_MEMBER_DETAILS_GENERAL) . "&user_id={$item->user_id}'>" . MM_Utils::abbrevString($item->user_email, 30) . "</a>");
    $row[] = array('content' => "<span style='font-family:courier; font-size:11px;'>" . MM_Utils::abbrevString($affiliateId, 15) . "</span>");
    $row[] = array('content' => "<span style='font-family:courier; font-size:11px;'>" . MM_Utils::abbrevString($subAffiliateId, 15) . "</span>");
    $row[] = array('content' => MM_Utils::abbrevString($item->description, 30));
    $datagridRows[] = $row;
}
$dataGrid->setHeaders($headers);
$dataGrid->setRows($datagridRows);
$dgHtml = $dataGrid->generateHtml();
if (empty($dgHtml)) {
    $dgHtml = "<p><i>No transactions found.</i></p>";
}
Esempio n. 6
0
 */
if (isset($_POST["clear-upgrade-notice"]) && $_POST["clear-upgrade-notice"] == "1") {
    MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_UPGRADE_NOTICE, "");
}
$versions = array();
$view = new MM_ManageInstallView();
$dataGrid = new MM_DataGrid($_REQUEST, "id", "desc", 10);
$dataGrid->showPagingControls = false;
$data = $view->getViewData($dataGrid);
$dataGrid->setTotalRecords($data);
$dataGrid->width = "500px";
$dataGrid->recordName = "version";
$rows = array();
$headers = array('version' => array('content' => '<a onclick="mmjs.sort(\'version\');" href="#">Version</a>'), 'date_added' => array('content' => '<a onclick="mmjs.sort(\'date_added\');" href="#">Date</a>'));
foreach ($data as $key => $item) {
    $rows[] = array(array('content' => $item->version), array('content' => MM_Utils::dateToLocal($item->date_added)));
}
$dataGrid->setHeaders($headers);
$dataGrid->setRows($rows);
$dgHtml = $dataGrid->generateHtml();
if ($dgHtml == "") {
    $dgHtml = "<p><i>No version history.</i></p>";
}
?>
<div class="mm-wrap">
    <p class="mm-header-text" style="margin-bottom:15px;">Version History</p>

    <?php 
if (MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_UPGRADE_NOTICE)) {
    ?>
    <form method="post" style="margin-top:10px;">
Esempio n. 7
0
         case MM_TransactionLog::$TRANSACTION_TYPE_PAYMENT:
             $transactionTypeLabel = "Initial Payment or One-Time Payment";
             break;
         case MM_TransactionLog::$TRANSACTION_TYPE_RECURRING_PAYMENT:
             $transactionTypeLabel = "Recurring Payment";
             break;
         case MM_TransactionLog::$TRANSACTION_TYPE_REFUND:
             $transactionTypeLabel = "Refund";
             break;
         default:
             $transactionTypeLabel = "";
             break;
     }
     //now populate the row
     $outputArray[] = $transactionTypeLabel;
     $outputArray[] = MM_Utils::dateToLocal($row->transaction_date);
     $outputArray[] = $row->order_number;
     $outputArray[] = $row->transaction_amount;
     $outputArray[] = $row->currency;
     $outputArray[] = $fullName;
     $outputArray[] = $row->user_email;
     $outputArray[] = $row->affiliate_id;
     $outputArray[] = $row->sub_affiliate_id;
     $outputArray[] = $row->description;
     //output to the screen (the file)
     fputcsv($handle, $outputArray);
 }
 if ($error_message = $error_function($wpdb->dbh)) {
     //optionally do something here if there was an error
 }
 @$free_result_function($result);
<?php

$orderItem = new MM_OrderItem($p->orderItemId);
if ($orderItem->isValid()) {
    $scheduledPaymentEvent = MM_ScheduledPaymentEvent::findNextScheduledEventByOrderItemId($orderItem->getId(), false);
    if ($scheduledPaymentEvent->isValid()) {
        $crntRebillDate = MM_Utils::dateToLocal($scheduledPaymentEvent->getScheduledDate(), "m/d/Y");
        ?>
<div id='mm-edit-subscription-div'>
<input type='hidden' id='order_item_id' value='<?php 
        echo $p->orderItemId;
        ?>
' />
<a href="#"></a>
<p>Next Rebill Date</p>
<p style="font-size:11px;">
	<input id="mm-next-rebill-date" type="text" style="width: 152px" value="<?php 
        echo $crntRebillDate;
        ?>
" /> 
	<a onClick="jQuery('#mm-next-rebill-date').focus();"><?php 
        echo MM_Utils::getCalendarIcon();
        ?>
</a>
</p>

</div>

<div class="mm-dialog-footer-container">
<div class="mm-dialog-button-container">
<a href="javascript:mmjs.saveSubscription();" class="mm-ui-button blue">Save</a>
Esempio n. 9
0
    ?>
	
	<div style="margin-top: 20px; width: 750px;">
		<p><span style="font-size:16px;">Safe Mode Log</span> <a onclick="mmjs.clearLog()" style="font-size:11px; margin-left:5px;">clear log</a></p>
		<table style="width:100%;">
			<tr>
				<td style="width:180px;"><strong>Date</strong></td>
				<td style="width:60px;"><strong>Action</strong></td>
				<td><strong>Details</strong></td>
			</tr>
			<?php 
    foreach ($log as $logEvent) {
        ?>
			<tr>
				<td style="vertical-align:top;"><?php 
        echo MM_Utils::dateToLocal($logEvent->date);
        ?>
</td>
				<td style="vertical-align:top;"><?php 
        if ($logEvent->mode == MM_SafeMode::$MODE_ENABLED) {
            echo MM_Utils::getIcon('play-circle', 'green', '1.3em', '2px', "Safe Mode Enabled");
        } else {
            echo MM_Utils::getIcon('stop', 'red', '1.2em', '1px', "Safe Mode Disabled");
        }
        ?>
</td>
				<td><span style="font-size:11px"><?php 
        echo $logEvent->message;
        ?>
</span></td>
			</tr>
Esempio n. 10
0
 $row[] = array('content' => $userEngagement);
 $row[] = array('content' => $status);
 $row[] = array('content' => $actions);
 $datagridRows[] = $row;
 // build CSV row
 if ($doGenerateCsv) {
     $csvRow = array();
     $csvRow[] = $user->getId();
     $csvRow[] = $user->getFirstName();
     $csvRow[] = $user->getLastName();
     $csvRow[] = $user->getEmail();
     $csvRow[] = $user->getPhone();
     $csvRow[] = $user->getMembershipName();
     $csvRow[] = $bundles == MM_NO_DATA ? "" : $bundles;
     $csvRow[] = $user->getRegistrationDate(true);
     $csvRow[] = MM_Utils::dateToLocal($item->status_updated);
     $csvRow[] = $user->getStatusName();
     $csvRow[] = $user->getBillingAddress();
     $csvRow[] = $user->getBillingCity();
     $csvRow[] = $user->getBillingState();
     $csvRow[] = $user->getBillingZipCode();
     $csvRow[] = $user->getBillingCountryName();
     $csvRow[] = $user->getShippingAddress();
     $csvRow[] = $user->getShippingCity();
     $csvRow[] = $user->getShippingState();
     $csvRow[] = $user->getShippingZipCode();
     $csvRow[] = $user->getShippingCountryName();
     $fields = MM_CustomField::getCustomFieldsList();
     foreach ($fields as $id => $val) {
         $customField = new MM_CustomField($id);
         if ($customField->isValid()) {
Esempio n. 11
0
    $newBundleCancelPaid = $result->total_bundles;
} else {
    $newBundleCancelPaid = 0;
}
// FREE BUNDLES
$result = $wpdb->get_row($baseSql . " AND bundles.is_free = '1';");
if ($result) {
    $newBundleCancelFree = $result->total_bundles;
} else {
    $newBundleCancelFree = 0;
}
/*
 * end calculations
 */
//reformat start date for display
$startDate = MM_Utils::dateToLocal($startDate);
?>

<div class="mm-view-container">
	<div class="mm-dashboard-header">       
        <div class="logo"><a href="http://membermouse.com/" target="_blank"><img src="https://dl.dropboxusercontent.com/u/265387542/plugin_images/membermouse-logo.png" alt="MemberMouse" style="width:340px; padding-top:12px;"></a></div> 
		        <ul class="mm-quick-nav">
	   				<li><a href="<?php 
echo MM_ModuleUtils::getUrl(MM_MODULE_MANAGE_MEMBERS);
?>
"><i class="fa fa-users"></i> Manage Members</a></li>
	   				<li><a href="<?php 
echo MM_ModuleUtils::getUrl(MM_MODULE_MANAGE_TRANSACTIONS);
?>
"><i class="fa fa-money"></i> Browse Transactions</a></li>
	   				<li><a href="<?php