示例#1
0
function renderFieldOption($optionId, $affiliateId, $profileId)
{
    ?>
	<div id="mm-partner-container-<?php 
    echo $optionId;
    ?>
">
	<input id="mm-partner-<?php 
    echo $optionId;
    ?>
" type="text" size="15" class="field-option" value="<?php 
    echo $affiliateId;
    ?>
" />
	<select id='mm-commission-profile-<?php 
    echo $optionId;
    ?>
'>
		<option value="<?php 
    MM_CommissionProfile::$DFLT_COMMISSION_PROFILE_ID;
    ?>
" <?php 
    echo $profileId == MM_CommissionProfile::$DFLT_COMMISSION_PROFILE_ID ? "selected" : "";
    ?>
>
			&mdash; Use system default &mdash;
		</option>
		<?php 
    echo MM_HtmlUtils::getCommissionProfilesList($profileId);
    ?>
	</select>
	<a href="javascript:mmjs.addFieldOption('<?php 
    echo htmlentities(MM_Utils::getIcon('plus-circle', 'green', '1.2em', '1px'), ENT_QUOTES);
    ?>
', '<?php 
    echo htmlentities(MM_Utils::getIcon('trash-o', 'red', '1.2em', '1px'), ENT_QUOTES);
    ?>
');"><?php 
    echo MM_Utils::getIcon('plus-circle', 'green', '1.2em', '1px');
    ?>
</a>
		
	<?php 
    if ($optionId > 1) {
        ?>
	<a href="javascript:mmjs.removeFieldOption('mm-partner-container-<?php 
        echo $optionId;
        ?>
');"><?php 
        echo MM_Utils::getIcon('trash-o', 'red', '1.2em', '1px');
        ?>
</a>
	<?php 
    }
    ?>
	</div>
<?php 
}
 public function deployRelease($rest)
 {
     $post = $rest->getRequest()->getPost();
     MM_LogApi::logRequest(json_encode($post), "/deployRelease");
     if (!isset($post["version"])) {
         return new Response($rest, "Major version number is required", RESPONSE_ERROR_MESSAGE_MISSING_PARAMS . " : version", RESPONSE_ERROR_CODE_MISSING_PARAMS, RESPONSE_ERROR_MESSAGE_MISSING_PARAMS);
     }
     $majorVersion = $post["version"];
     $minorVersion = isset($post["minor_version"]) ? $post["minor_version"] : MM_MemberMouseService::$DEFAULT_MINOR_VERSION;
     $crntVersion = MemberMouse::getPluginVersion();
     if ($crntVersion != $majorVersion) {
         MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_UPGRADE_NOTICE, $majorVersion);
         return new Response($rest, "Major version do not match. A notification will be displayed to the customer informing them an update is available.", "Major version do not match. A notification will be displayed to the customer informing them an update is available.", RESPONSE_ERROR_CODE_BAD_REQUEST, RESPONSE_ERROR_MESSAGE_MISSING_PARAMS);
     }
     // if major versions match, update cache with the latest files from central
     $writeableDir = MM_Utils::getCacheDir();
     // delete existing cache
     if (is_dir($writeableDir)) {
         if (is_writeable($writeableDir)) {
             if ($handle = opendir($writeableDir)) {
                 while (false !== ($file = readdir($handle))) {
                     if (!is_dir($file)) {
                         @unlink($writeableDir . "/" . $file);
                     }
                 }
                 closedir($handle);
             }
         }
     }
     // get updated classes from central
     MM_OptionUtils::setOption(MM_OptionUtils::$OPTION_KEY_MINOR_VERSION, $minorVersion);
     $ret = MM_MemberMouseService::authorize(true);
     if (MM_Response::isError($ret)) {
         return new Response($rest, "Could not find classes associated with version {$majorVersion}.{$minorVersion}", "Invalid major/minor version combination", RESPONSE_ERROR_CODE_BAD_REQUEST, RESPONSE_ERROR_MESSAGE_MISSING_PARAMS);
     }
     if (defined("DB_NAME")) {
         global $wpdb;
         if (file_exists($writeableDir . "/membermouse_schema.sql")) {
             $phpObj = new MM_PhpObj($wpdb, DB_NAME);
             if (!$phpObj->importFile($writeableDir . "/membermouse_schema.sql", true)) {
                 return new Response($rest, "Could not update MemberMouse database", "Could not update MemberMouse database", RESPONSE_ERROR_CODE_BAD_REQUEST, RESPONSE_ERROR_MESSAGE_MISSING_PARAMS);
             }
         }
     } else {
         return new Response($rest, "DB_NAME not defined", "DB_NAME not defined", RESPONSE_ERROR_CODE_BAD_REQUEST, RESPONSE_ERROR_MESSAGE_MISSING_PARAMS);
     }
     $version = $majorVersion;
     if (!empty($minorVersion)) {
         $version .= "-" . $minorVersion;
     }
     $versionRelease = MM_VersionRelease::findByVersion($version);
     $versionRelease->setVersion($version);
     $versionRelease->commitData();
     return new Response($rest);
 }
示例#3
0
 /**
  * This method should be called at class load, and stores the mode, ip address, and creates a session identifier, so that these things only need to 
  * happen once within the life of the interpreter process
  */
 public static function init()
 {
     if (!self::$initialized) {
         $currentMode = class_exists("MM_OptionUtils") ? MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_SAFE_MODE) : "";
         self::$SAFE_MODE_STATUS = empty($currentMode) ? self::$MODE_DISABLED : $currentMode;
         if (self::$SAFE_MODE_STATUS !== self::$MODE_DISABLED) {
             self::$IP_ADDRESS = class_exists("MM_Utils") ? MM_Utils::getClientIPAddress() : "unknown";
             //the transaction key class logic for generating random identifiers is reused here, for convenience
             self::$SESSION = class_exists("MM_TransactionKey") ? MM_TransactionKey::createRandomIdentifier(8) : "unknown";
         }
         self::$initialized = true;
     }
 }
示例#4
0
 /**
  * This method should be called at class load, and stores the mode, ip address, and creates a session identifier, so that these things only need to 
  * happen once within the life of the interpreter process
  */
 public static function init()
 {
     if (!self::$initialized) {
         $diagnosticMode = class_exists("MM_OptionUtils") ? MM_OptionUtils::getOption(MM_OptionUtils::$OPTION_KEY_DIAGNOSTIC_MODE) : "";
         self::$DIAGNOSTIC_MODE = empty($diagnosticMode) ? self::$MODE_OFF : $diagnosticMode;
         if (self::$DIAGNOSTIC_MODE !== self::$MODE_OFF) {
             self::$IP_ADDRESS = class_exists("MM_Utils") ? MM_Utils::getClientIPAddress() : "unknown";
             //the transaction key class logic for generating random identifiers is reused here, for convenience
             self::$SESSION = class_exists("MM_TransactionKey") ? MM_TransactionKey::createRandomIdentifier(8) : "unknown";
         }
         self::$initialized = true;
     }
 }
示例#5
0
function renderFieldOption($optionId, $value)
{
    ?>
	<div id="mm-field-option-container-<?php 
    echo $optionId;
    ?>
">
	<input id="mm-field-option-<?php 
    echo $optionId;
    ?>
" type="text" size="30" class="field-option" value="<?php 
    echo $value;
    ?>
" />
	<a href="javascript:mmjs.addFieldOption('<?php 
    echo htmlentities(MM_Utils::getIcon('plus-circle', 'green', '1.2em', '1px'), ENT_QUOTES);
    ?>
', '<?php 
    echo htmlentities(MM_Utils::getIcon('trash-o', 'red', '1.2em', '1px'), ENT_QUOTES);
    ?>
');"><?php 
    echo MM_Utils::getIcon('plus-circle', 'green', '1.2em', '1px');
    ?>
</a>
		
	<?php 
    if ($optionId > 1) {
        ?>
	<a href="javascript:mmjs.removeFieldOption('mm-field-option-container-<?php 
        echo $optionId;
        ?>
');"><?php 
        echo MM_Utils::getIcon('trash-o', 'red', '1.2em', '1px');
        ?>
</a>
	<?php 
    }
    ?>
	</div>
<?php 
}
示例#6
0
			<?php 
$validSmartTags = "Only the following SmartTags can be used here:\n";
$validSmartTags .= "[MM_Access_Decision] (you must provide an ID)\n";
$validSmartTags .= "[MM_Content_Data] (you must provide an ID)\n";
$validSmartTags .= "[MM_Content_Link] (you must provide an ID)\n";
$validSmartTags .= "[MM_CorePage_Link]\n";
$validSmartTags .= "[MM_CustomField_Data]\n";
$validSmartTags .= "[MM_Employee_Data]\n";
$validSmartTags .= "[MM_Member_Data]\n";
$validSmartTags .= "[MM_Member_Decision]\n";
$validSmartTags .= "[MM_Member_Link]\n";
$validSmartTags .= "[MM_Purchase_Link]";
?>
			<span style="font-size:11px; color:#666666; margin-left: 5px;"><em>Note: Only certain SmartTags can be used here</em></span>
			<?php 
echo MM_Utils::getInfoIcon($validSmartTags);
?>
			<div style="font-size:11px; color:#666666; margin-top:5px;"><em>The following SmartTag is required:</em> <strong><code>[MM_CorePage_Link type='resetpassword']</code></strong></div>
		</div>
		
		<div style="margin-top:5px">
			<textarea id='mm-forgot-password-email-body' name='mm-forgot-password-email-body' style="width:500px; height:180px; font-family:courier; font-size: 11px;"><?php 
echo htmlentities($forgotPasswordEmail->body, ENT_QUOTES, 'UTF-8', true);
?>
</textarea>
		</div>
	</div>
</div>

<input type='submit' name='submit' value='Save Settings' class="mm-ui-button blue" />
</form>
	<?php 
    $activeListDesc = "This is the mailing list that you want members added to when the bundle selected above is active on a member&apos;s account. If you have a Canceled List defined as well, members will be removed from this list when the bundle becomes active.";
    $canceledListDesc = "This is the mailing list that you want members added to when the bundle selected above is canceled or paused on a member&apos;s account.  If you have an Active List defined as well, members will be removed from this list when the bundle becomes canceled or paused.";
    ?>
	<td>Active List<?php 
    echo MM_Utils::getInfoIcon($activeListDesc);
    ?>
</td>
	<td><select id="mm_active_list_id" name="mm_active_list_id"><?php 
    echo MM_HtmlUtils::generateSelectionsList($lists, $activeListId);
    ?>
</select></td>
</tr>
<tr>
	<td>Canceled List<?php 
    echo MM_Utils::getInfoIcon($canceledListDesc);
    ?>
</td>
	<td><select id="mm_canceled_list_id" name="mm_canceled_list_id"><?php 
    echo MM_HtmlUtils::generateSelectionsList($lists, $canceledListId);
    ?>
</select></td>
</tr>
</table>
</div>

<div class="mm-dialog-footer-container">
<div class="mm-dialog-button-container">
<a href="javascript:mmjs.save();" class="mm-ui-button blue">Save Bundle Mapping</a>
<a href="javascript:mmjs.closeDialog();" class="mm-ui-button">Cancel</a>
</div>
示例#8
0
    	<p><code>http://yourdomain.com/checkout/?rid=4DuFx8</code></p>
    	
    	<div id="mm-disable-explicit-link-options">
    		<p>
    			<label>
				<input id="mm_disable_explicit_links_cb" value='1' type="checkbox" <?php 
echo $disableExplicitLinks == "1" ? "checked" : "";
?>
 onchange="disableExplicitLinksChangeHandler();" />
				<input id="mm_disable_explicit_links" name="mm_disable_explicit_links" value='<?php 
echo $disableExplicitLinks;
?>
' type="hidden" />
				Increase security by disabling support for explicit links (<em>recommended</em>)
				</label><?php 
echo MM_Utils::getInfoIcon($linkSecurityDescription);
?>
			</p>
			<p></p>
    
			
		</div>
    </div>
    
    <p><input onchange="linkStyleChangeHandler();" name="mm_purchase_link_style" value='<?php 
echo MM_LINK_STYLE_EXPLICIT;
?>
' type="radio" <?php 
echo $crntLinkStyle == MM_LINK_STYLE_EXPLICIT ? "checked" : "";
?>
  />
			<td colspan="2">
			<div style="width: 600px; margin-top: 8px;" class="mm-divider"></div>
			</td>
		</tr>
		
		<tr>
			<td>Refund Options</td>
			<td>
				<div>
					<input type='checkbox' id='mm-enable-reverse-commissions-checkbox' name='mm-enable-reverse-commissions-checkbox' <?php 
echo $reverseCommissionsChecked;
?>
 /> 
					Cancel commission when customer is refunded
					<?php 
echo MM_Utils::getInfoIcon('Only commissions that have not been paid out yet can be canceled.');
?>
				</div>
			</td>
		</tr>
	</table>
	
	<script type='text/javascript'>
	mmjs.renderRebillOptions();
	</script>
</div>

<div class="mm-dialog-footer-container">
<div class="mm-dialog-button-container">
<a href="javascript:mmjs.save();" class="mm-ui-button blue">Save Commission Profile</a>
<a href="javascript:mmjs.closeDialog();" class="mm-ui-button">Cancel</a>
示例#10
0
    <p class="mm-header-text">WordPress Menu Options</p>
    
	<div style="margin-top:10px;">
		<input id="mm_hide_menu_items_cb" type="checkbox" <?php 
echo $hideMenuItems == "1" ? "checked" : "";
?>
 onchange="mmjs.updateWPMenuSettingsForm();" />
		Hide Protected Menu Items<?php 
echo MM_Utils::getInfoIcon($hideMenuItemsDesc);
?>
		<input id="mm_hide_menu_items" name="mm_hide_menu_items" type="hidden" value="<?php 
echo $hideMenuItems;
?>
" />
		<a href="https://membermouse.uservoice.com/knowledgebase/articles/319082-hide-protected-wordpress-pages-from-menus" target="_blank">Learn more</a>
	</div>
	<div style="margin-top:10px;">
		<input id="mm_show_login_logout_link_cb" type="checkbox" <?php 
echo $showLoginLogoutLink == "1" ? "checked" : "";
?>
 onchange="mmjs.updateWPMenuSettingsForm();" />
		Show Login/Logout Link<?php 
echo MM_Utils::getInfoIcon($showLinkDesc);
?>
		<input id="mm_show_login_logout_link" name="mm_show_login_logout_link" type="hidden" value="<?php 
echo $showLoginLogoutLink;
?>
" />
		<a href="https://membermouse.uservoice.com/knowledgebase/articles/319081-add-login-logout-link-to-main-menu" target="_blank">Learn more</a>
	</div>
</div>
示例#11
0
		<?php 
if (MM_MemberMouseService::hasPermission(MM_MemberMouseService::$FEATURE_EMPLOYEE_ACCOUNTS)) {
    $selectedMemberships = array();
    $restrictions = $employee->getAccessRescrictions(MM_Employee::$ACCESS_TYPE_MEMBERSHIP);
    foreach ($restrictions as $key => $value) {
        $selectedMemberships[$value] = $value;
    }
    ?>
		<tr id="mm-access-restriction-row" style="display:none;">
			<td>Access Restrictions</td>
			<td>
			<?php 
    $accessDesc = "By selecting one or more membership levels below you're indicating that the employee should only be able to manage members with one of those membership levels. When no membership levels are selected this indicates that the employee should be able to manage all members.";
    ?>
			Allowed Membership Levels<?php 
    echo MM_Utils::getInfoIcon($accessDesc);
    ?>
			<select id="mm-memberships[]" size="6" multiple="multiple" style="margin-top:5px; width:400px;">
			<?php 
    echo MM_HtmlUtils::getMemberships($selectedMemberships);
    ?>
			</select>
			
			<p style="margin-top:5px; font-size:11px">
					Select Multiple Membership Levels: PC <code>ctrl + click</code> 
					Mac <code><img width="9" height="9" src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_command.gif" alt="Command key icon" data-hires="true">
(Command key) + click</code>
			</p>
			</td>
		</tr>
		<?php 
示例#12
0
$lcvDescription = "";
echo "<span style='margin-left: 5px; background-color:#fff; padding: 2px 5px 6px; border-radius: 3px; font-size: .9em; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);'>";
echo "<span style='color:#888'><abbr title=\"Lifetime Customer Value\">LCV</abbr></span> ";
if ($totalPayments > 0 && $totalRefunds > 0) {
    $lcvDescription .= _mmf($totalPayments) . " Paid";
    if ($totalRefunds > 0) {
        $lcvDescription .= " - ";
        $lcvDescription .= _mmf($totalRefunds) . " Refunded";
    }
    $lcvDescription .= " = " . _mmf($totalLCV) . " LCV";
}
echo "<span style='color:#9c3;'><abbr title=\"{$lcvDescription}\">" . _mmf($totalLCV) . "</abbr></span>";
echo "</span>";
?>
   		</h3>
   		<p>
   			<?php 
echo MM_Utils::getIcon('user', 'blue', '1.2em', '1px', "Membership Level", "margin-right:8px;");
if ($user->isImported()) {
    echo MM_Utils::getIcon('sign-in', 'blue', '1.2em', '1px', "Membership Level (Member Imported)", "margin-right:8px;");
}
echo $user->getMembershipName();
$appliedBundles = $user->getAppliedBundleNames();
if (!empty($appliedBundles)) {
    echo MM_Utils::getIcon('cubes', 'yellow', '1.2em', '1px', "Bundles", "margin-left:15px;");
    echo $appliedBundles;
}
?>
   		</p>
   	</div>
示例#13
0
 /**
  * Called upon wordpress' shutdown hook.
  * Write session data that's currently stored in memory to database
  */
 public static function sessionWrite()
 {
     global $wpdb;
     if (self::$MM_SESSION_STARTED) {
         self::sessionSetTimestamp();
         //don't store passwords in the database
         if (self::value(self::$PARAM_USER_DATA_PASSWORD) !== false) {
             self::clear(MM_Session::$PARAM_USER_DATA_PASSWORD);
         }
         $wpdb->update(MM_TABLE_SESSIONS, array('data' => self::$MM_UNTRUSTED_PLATFORM ? base64_encode(serialize(self::$MM_SESSION_DATA)) : serialize(self::$MM_SESSION_DATA), 'ip_address' => MM_Utils::getClientIPAddress(), 'expiration_date' => self::getExpirationDate()), array('id' => self::getSessionId()));
     }
 }
示例#14
0
 public static function getImage($statusId, $showTitle = true)
 {
     $title = $showTitle ? self::getName($statusId) : "";
     switch ($statusId) {
         case self::$ACTIVE:
             return MM_Utils::getIcon('play-circle', 'green', '1.3em', '2px', $title);
         case self::$CANCELED:
             return MM_Utils::getIcon('stop', 'red', '1.2em', '1px', $title);
         case self::$LOCKED:
             return MM_Utils::getIcon('lock', 'yellow', '1.4em', '2px', $title);
         case self::$PAUSED:
             return MM_Utils::getIcon('pause', 'turq', '1.2em', '1px', $title);
         case self::$OVERDUE:
             return MM_Utils::getIcon('credit-card', 'orange', '1.3em', '1px', $title);
         case self::$ERROR:
             return MM_Utils::getIcon('warning', 'red', '1.2em', '1px', $title);
         case self::$EXPIRED:
             return MM_Utils::getIcon('times-circle', 'yellow', '1.3em', '2px', $title);
         case self::$PENDING_ACTIVATION:
             return MM_Utils::getIcon('clock-o', 'blue', '1.3em', '1px', $title);
         case self::$PENDING_CANCELLATION:
             return MM_Utils::getIcon('clock-o', 'red', '1.3em', '1px', $title);
     }
     return "";
 }
示例#15
0
 public function handlePageAccess()
 {
     global $wp_query, $current_user;
     if (class_exists("MM_CorePageEngine")) {
         if (isset($wp_query->post) && isset($wp_query->post->ID)) {
             if (!isset($_POST["log"])) {
                 if (!MM_CorePageEngine::isMyAccountCorePage($wp_query->post->ID) && !MM_CorePageEngine::isLoginCorePage($wp_query->post->ID) && !MM_CorePageEngine::isErrorCorePage($wp_query->post->ID)) {
                     MM_Session::clear(MM_OptionUtils::$OPTION_KEY_LAST_PAGE_DENIED);
                 }
             }
         }
         if (MM_CorePageEngine::isFrontPage()) {
             MM_CorePageEngine::redirectToSiteHomePage(true);
         } else {
             if (isset($wp_query->post) && isset($wp_query->post->ID) && intval($wp_query->post->ID) > 0) {
                 $isAdmin = false;
                 if (isset($current_user->ID)) {
                     if (MM_Employee::isEmployee()) {
                         $isAdmin = true;
                     }
                 }
                 if ($isAdmin) {
                     $preview = MM_Preview::getData();
                     if ($preview !== false) {
                         if (MM_CorePageEngine::isMemberHomePage($wp_query->post->ID) || MM_CorePageEngine::isSaveTheSalePage($wp_query->post->ID) || MM_CorePageEngine::isMyAccountCorePage($wp_query->post->ID)) {
                             // if preview settings is set to non-members, redirect to the error page
                             if ($preview->getMembershipId() <= 0) {
                                 $url = MM_CorePageEngine::getUrl(MM_CorePageType::$ERROR, MM_Error::$ACCESS_DENIED);
                                 $currentUrl = MM_Utils::constructPageUrl();
                                 $compareUrl = preg_replace("/https?/", "", $url);
                                 $compareUrl = preg_replace("/\\/\\?/", "?", $compareUrl);
                                 $currentUrl = preg_replace("/https?/", "", $currentUrl);
                                 $currentUrl = preg_replace("/\\/\\?/", "?", $currentUrl);
                                 if (strpos($currentUrl, $compareUrl) !== 0) {
                                     header("Location: {$url}");
                                     exit;
                                 }
                             }
                         }
                     }
                 } else {
                     // check user account status
                     $userObj = new MM_User($current_user->ID);
                     if ($userObj->getStatus() == MM_Status::$CANCELED || $userObj->getStatus() == MM_Status::$LOCKED) {
                         wp_logout();
                         if ($userObj->getStatus() == MM_Status::$LOCKED) {
                             $url = MM_CorePageEngine::getUrl(MM_CorePageType::$ERROR, MM_Error::$ACCOUNT_LOCKED);
                             wp_redirect($url);
                             exit;
                         } else {
                             if ($userObj->getStatus() == MM_Status::$CANCELED && !MM_CorePageEngine::isSaveTheSalePage($wp_query->post->ID)) {
                                 $url = MM_CorePageEngine::getUrl(MM_CorePageType::$ERROR, MM_Error::$ACCOUNT_CANCELED);
                                 wp_redirect($url);
                                 exit;
                             }
                         }
                     }
                 }
                 // don't allow access to member homepages, save-the-sale pages or the
                 // my account page if the user is not logged in
                 if (MM_CorePageEngine::isMemberHomePage($wp_query->post->ID) || MM_CorePageEngine::isSaveTheSalePage($wp_query->post->ID) || MM_CorePageEngine::isMyAccountCorePage($wp_query->post->ID)) {
                     if (!is_user_logged_in()) {
                         // if user is not logged in, redirect them to the login page, but first saved
                         // the attempted access page incase they log in succesfully afterwards
                         MM_Session::value(MM_OptionUtils::$OPTION_KEY_LAST_PAGE_DENIED, $wp_query->post->ID);
                         header("Location: " . MM_CorePageEngine::getUrl(MM_CorePageType::$LOGIN_PAGE));
                         exit;
                     } else {
                         if (MM_CorePageEngine::isMemberHomePage($wp_query->post->ID)) {
                             // check if there's a specific member homepage for this user
                             MM_CorePageEngine::redirectToMemberHomePage($wp_query->post->ID);
                         } else {
                             if (MM_CorePageEngine::isSaveTheSalePage($wp_query->post->ID)) {
                                 // check if there's a specific save-the-sale page for this user
                                 MM_CorePageEngine::redirectToSaveTheSalePage($wp_query->post->ID);
                             }
                         }
                     }
                 }
             }
         }
         if (!is_admin()) {
             $protectedContent = new MM_ProtectedContentEngine();
             $postId = $wp_query->query_vars["page_id"];
             if (isset($wp_query->post) && isset($wp_query->post->ID) && intval($wp_query->post->ID) > 0) {
                 $postId = $wp_query->post->ID;
             }
             if (intval($postId) > 0) {
                 if (!is_feed()) {
                     $protectedContent->protectContent($postId, is_home());
                 }
             }
         }
     }
 }
$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>";
示例#17
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>";
}
示例#18
0
文件: view.php 项目: huynp/Critical
/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
MM_MemberMouseService::validateLicense(new MM_License());
$crntPage = MM_ModuleUtils::getPage();
$primaryTab = MM_ModuleUtils::getPrimaryTab();
$module = MM_ModuleUtils::getModule();
if (isset($_REQUEST[MM_Session::$PARAM_USER_ID])) {
    $user = new MM_User($_REQUEST[MM_Session::$PARAM_USER_ID]);
} else {
    $user = new MM_User();
}
$resourceUrl = MM_RESOURCES_URL;
if (MM_Utils::isSSL()) {
    $resourceUrl = preg_replace("/(http\\:)/", "https:", MM_RESOURCES_URL);
}
if (version_compare(get_bloginfo('version'), "3.8", ">=")) {
    ?>
<!-- override WordPress 3.8 styles -->
<style>
#wpwrap
{
	background-color: #fff;
}
.ui-widget 
{
	font-size:1em;
}
textarea, input, select
示例#19
0
	Did the current visitor come from a banner?
	<?php 
echo mm_custom_decision(array("source" => "banner")) == true ? "Yes" : "No";
?>
	<a href="<?php 
echo MM_Utils::appendUrlParam(MM_Utils::constructPageUrl(), "source", "banner");
?>
">Click here to test</a>
</p>
<p>
	Did the current visitor come from an email?
	<?php 
echo mm_custom_decision(array("source" => "email")) == true ? "Yes" : "No";
?>
	<a href="<?php 
echo MM_Utils::appendUrlParam(MM_Utils::constructPageUrl(), "source", "email");
?>
">Click here to test</a>
</p>


<h2>[MM_Member_Decision]</h2>

<!-- NOTE: The membershidId attribute should be changed to a valid Membership Level ID from your MemberMouse site. -->
<p>
	Is the current visitor a member? 
	<?php 
echo mm_member_decision(array("isMember" => "true")) == true ? "Yes" : "No";
?>
</p>
<p>
示例#20
0
?>
' id='litle_report_group' name='payment_service[litle][report_group]' style='width: 160px; font-family:courier; font-size:11px;' />
	</p>
</div>

<div id="litle-test-info" style="margin-bottom:10px; margin-left:10px;">
	<div style="margin-bottom:5px;">
		<?php 
echo MM_Utils::getIcon('credit-card', 'blue', '1.3em', '1px', "Test Credit Card Numbers", "margin-right:3px;");
?>
 
		<a href="javascript:showLitleTestCardNumbers()">Test Credit Card Numbers</a>
	</div>
	<div>
		<?php 
echo MM_Utils::getIcon('flask', 'blue', '1.3em', '1px', 'Setup Test Data', "margin-right:3px;");
?>
 
		<a href="<?php 
echo MM_ModuleUtils::getUrl(MM_ModuleUtils::getPage(), MM_MODULE_TEST_DATA);
?>
" target="_blank">Configure Test Data</a>
	</div>
</div>

<div id="litle-credentials-section">
<div style="margin-bottom:10px;">
	<span>Merchant ID</span>
	
	<p style="margin-left:10px; font-family:courier; font-size:11px;">
		<input type='text' value='<?php 
示例#21
0
		</table>
	</div>
	
	<div class="mm-button-container">
		<a id="mm-show-filters-btn" href="javascript:mmjs.showFilters();" class="mm-ui-button blue" <?php 
echo $showFilters ? "style=\"display:none;\"" : "";
?>
><?php 
echo MM_Utils::getIcon('search-plus');
?>
Filter</a>
		<a id="mm-hide-filters-btn" href="javascript:mmjs.hideFilters();" class="mm-ui-button" <?php 
echo !$showFilters ? "style=\"display:none;\"" : "";
?>
><?php 
echo MM_Utils::getIcon('search-minus');
?>
Filter</a>
		<a onclick="mmjs.clearLog()" class="mm-ui-button" style="margin-left:15px;">Delete Diagnostic Data</a>
	</div>
	<div id="mm-filter-criteria" <?php 
echo $showFilters ? "" : "style=\"display:none;\"";
?>
>
		<div id="mm-filter-criteria-container" style="width:98%">
			<?php 
echo $view->generateFilterCriteriaForm($_POST);
?>
		</div>
		<div style="width: 98%; margin-top: 0px; margin-bottom: 10px;" class="mm-divider"></div> 
	</div>
示例#22
0
	<?php 
if (!empty($p->options)) {
    ?>
	<tr>
		<td>
			<select id='new_page_id'>
			<?php 
    echo $p->options;
    ?>
			</select>
		</td>
	</tr>
	<?php 
} else {
    ?>
	<tr><td><?php 
    echo MM_Utils::getIcon('warning', 'yellow', '1.3em', '2px');
    ?>
 You do not have any available pages. <a href='post-new.php?post_type=page' target='_top'>Click here</a> to add a page.</td></tr>
	<?php 
}
?>
</table>
</div>

<div class="mm-dialog-footer-container">
<div class="mm-dialog-button-container">
<a href="javascript:corepages_js.updateCorePage();" class="mm-ui-button blue">Change Core Page</a>
<a href="javascript:corepages_js.closeDialog();" class="mm-ui-button">Cancel</a>
</div>
</div>
        ?>
 the bundle by setting the cancellation date to any date in the past.</em>
	
	<br/><br/>

	Bundle will be <?php 
        echo $appliedBundle->getPendingStatus() == MM_Status::$CANCELED ? "canceled" : "paused";
        ?>
 on 
	
	<input id="mm-cancellation-date" name="mm-cancellation-date" type="text" style="width: 152px" value="<?php 
        echo $cancellationDate;
        ?>
" /> 
	<a onClick="jQuery('#mm-cancellation-date').focus();"><?php 
        echo MM_Utils::getCalendarIcon();
        ?>
</a>
</p>
<?php 
    }
    ?>
</div>

<div class="mm-dialog-footer-container">
<div class="mm-dialog-button-container">
<a href="javascript:mmjs.saveBundleConfiguration(<?php 
    echo $p->bundleId;
    ?>
);" class="mm-ui-button blue">Save</a>
<a href="javascript:mmjs.closeDialog();" class="mm-ui-button">Cancel</a>
示例#24
0
</div>

<div style="margin-bottom:10px;">
	Notification URL
	
	<p style="margin-left:10px;">
		<?php 
$ipnUrl = MM_PLUGIN_URL . "/x.php?service=coinbase&hash=" . wp_hash("coinbase_ipn_auth");
?>
		 
		<span style="font-family:courier; font-size:11px; margin-top:5px;">
			 <input id="mm-coinbase-ipn-url" type="text" value="<?php 
echo $ipnUrl;
?>
" style="width:550px; background-color:#fff;" readonly onclick="jQuery('#mm-coinbase-ipn-url').focus(); jQuery('#mm-coinbase-ipn-url').select();" />
		</span>
	</p>
	
	<p style="font-size:11px; margin-left:10px; padding-right:20px;">
		<?php 
echo MM_Utils::getInfoIcon("", "");
?>
		Coinbase uses <abbr title="Instant Payment Notifications">IPNs</abbr> to inform 3rd party systems when events happen within Coinbase
		such as successful payments, subscription cancellations, etc. MemberMouse keeps member accounts in sync with Coinbase by listening for these notifications.
		In order for this to work, <strong style="background:#FE9;">you must copy the notification URL above and enter it as your Coinbase callback URL</strong>
		at <a href="https://coinbase.com/merchant_settings">https://coinbase.com/merchant_settings</a>.
	</p>
</div>

</div>
示例#25
0
		<input id="mm_hide_admin_bar_cb" type="checkbox" <?php 
echo $hideAdminBar == "1" ? "checked" : "";
?>
 onchange="udpateWPUserForm();" />
		Hide the admin bar for new members<?php 
echo MM_Utils::getInfoIcon($hideAdminBarDesc);
?>
		<input id="mm_hide_admin_bar" name="mm_hide_admin_bar" type="hidden" value="<?php 
echo $hideAdminBar;
?>
" />
		
		<span style="font-size:12px;"><a href="https://membermouse.uservoice.com/knowledgebase/articles/319085-hide-the-wordpress-admin-bar-from-new-members" target="_blank">Learn more</a></span>
	</div>
	
	<div style="margin-top:10px;">
		<input id="mm_enable_username_change_cb" type="checkbox" <?php 
echo $enableUsernameChange == "1" ? "checked" : "";
?>
 onchange="udpateWPUserForm();" />
		Allow members to change their username<?php 
echo MM_Utils::getInfoIcon($enableUsernameChangeDesc);
?>
		<input id="mm_enable_username_change" name="mm_enable_username_change" type="hidden" value="<?php 
echo $enableUsernameChange;
?>
" />
		
		<span style="font-size:12px;"><a href="https://membermouse.uservoice.com/knowledgebase/articles/319089-configure-if-member-can-change-their-username" target="_blank">Learn more</a></span>
	</div>
</div>
示例#26
0
<?php

$now = date("m/d/Y", MM_Utils::getCurrentTime("timestamp"));
$threeMonthsAgo = date("m/d/Y", strtotime("-3 months", MM_Utils::getCurrentTime("timestamp")));
$dashboard = new MM_ReportingDashboard();
$totalMbrsStyle = "width:25%;";
$retentionStyle = "width:25%;";
$avgCustValueStyle = "width:25%;";
$engagementStyle = "width:25%;";
$totalRevenueStyle = "width:25%;";
$retentionRateStyle = "width:15%;";
$churnStyle = "width:15%;";
$avgDailyRevenueStyle = "width:20%;";
$avgMonthlyRevenueStyle = "width:25%;";
$hasAdvancedReporting = MM_MemberMouseService::hasPermission(MM_MemberMouseService::$FEATURE_REPORTING_SUITE) == MM_MemberMouseService::$ACTIVE ? true : false;
if (!$hasAdvancedReporting) {
    $totalMbrsStyle = "width:33%;";
    $retentionStyle = "width:33%;";
    $engagementStyle = "width:33%;";
    $totalRevenueStyle = "width:33%;";
    $avgDailyRevenueStyle = "width:33%;";
    $avgMonthlyRevenueStyle = "width:33%;";
}
?>
<div class="mm-report-container">
	<h2 class="mm-dashboard-title">Dashboard</h2>
	<?php 
include "dropdown_nav_menu.php";
?>
	<!--/.reporting-dropdown-nav-->
示例#27
0
<div class="mm-wrap">
    
    <?php 
if (MM_MemberMouseService::hasPermission(MM_MemberMouseService::$FEATURE_PUSH_NOTIFICATIONS)) {
    ?>
	<div class="mm-button-container">
		<a onclick="mmjs.create('mm-push-notification-dialog', '510', '570')" class="mm-ui-button green"><?php 
    echo MM_Utils::getIcon('plus-circle', '', '1.2em', '1px');
    ?>
 Create Push Notification</a>
	</div>
	
	<div class="clear"></div>
	
	<?php 
    echo $dgHtml;
    ?>
	<?php 
} else {
    ?>
		<?php 
    echo MM_Utils::getIcon('lock', 'yellow', '1.3em', '2px');
    ?>
		This feature is not available on your current plan. To get access, <a href="<?php 
    echo MM_MemberMouseService::getUpgradeUrl(MM_MemberMouseService::$FEATURE_PUSH_NOTIFICATIONS);
    ?>
" target="_blank">upgrade your plan now</a>.
	<?php 
}
?>
</div>
示例#28
0
    $wp_filesystem->chmod($wpfsCacheDir, 0777, true);
}
?>
<div class="mm-wrap">
    <p class="mm-header-text">Repair MemberMouse</p>
	<div class="mm-button-container">
	</div>
	
	<div class="clear"></div>
	<div id='mm-repair-content' style='width: 700px; font-size:14px; line-height:26px;'>
		<?php 
if (!MM_Utils::cacheIsWriteable()) {
    ?>
		1. Unable to automatically repair the cache permissions. Please manually change the permissions on the following directory and all files contained within to 777 using an FTP/SSH client. <br/>
		Cache directory location: <strong><?php 
    echo MM_Utils::getCacheDir();
    ?>
</strong><br/>
		<?php 
} else {
    ?>
		1. Cache directory permissions modified successfully<br/>
		<?php 
}
?>
		
		2. Refreshing cache... <br/>
		<em>Please wait...</em><br/>
		
		<?php 
@ob_end_flush();
示例#29
0
        $canceledListName = $listNames[$item->canceled_list_id];
    }
    $rows[] = array(array('content' => MM_Utils::abbrevString($bundleName, 30)), array('content' => MM_Utils::abbrevString($activeListName, 30)), array('content' => MM_Utils::abbrevString($canceledListName, 30)), array('content' => $actions));
}
$headers = array('name' => array('content' => 'Bundle'), 'active_list' => array('content' => 'Active List', "attr" => ""), 'canceled_list' => array('content' => 'Canceled List', "attr" => ""), 'actions' => array('content' => 'Actions', "attr" => "style='width:86px;'"));
$dataGrid->setHeaders($headers);
$dataGrid->setRows($rows);
$dataGrid->width = "600px";
$dgHtml = $dataGrid->generateHtml();
if ($dgHtml == "") {
    $dgHtml = "<p><i>No bundle mappings.</i></p>";
}
?>
					<div class="mm-button-container">
						<a onclick="mmjs.create('mm-bundle-mapping-dialog', 475, 235)" class="mm-ui-button green"><?php 
echo MM_Utils::getIcon('plus-circle', '', '1.2em', '1px');
?>
 Create Bundle Mapping</a>
					</div>
					
					<div class="clear"></div>
					
					<?php 
echo $dgHtml;
?>
				</div>
			</td>
		</tr></table>
	</form>
		
</div>
示例#30
0
        $employee = MM_Employee::findByUserId($current_user->ID);
        $allowAccess = true;
        if ($employee->isValid()) {
            $allowAccess = $employee->canManageMember($user);
        }
        if ($allowAccess) {
            include_once MM_MODULES . "/details.header.php";
            // prepare data grid
            $view = new MM_SubscriptionsView();
            $dataGrid = new MM_DataGrid($_REQUEST, "date_added", "desc", 10);
            $data = $view->getViewData($user->getId(), $dataGrid);
            $rows = $view->generateRows($data, true);
            $dataGrid->setTotalRecords($data);
            $dataGrid->recordName = "subscription";
            $nextRebillDateInfo = "Next rebill date is only available for subscriptions billed with a card-on-file payment service (i.e. Stripe, Braintree, Authorize.net CIM). When non-card-on-file payment services are used (i.e. PayPal, Authorize.net), the billing schedule is managed on their end so MemberMouse doesn't have access to the next rebill date.";
            $headers = array('date_added' => array('content' => '<a onclick="mmjs.sort(\'date_added\');" href="#">Start Date</a>', "attr" => "style='width:100px;'"), 'order_item_status' => array('content' => 'Status', "attr" => "style='width:50px;'"), 'access_type_name' => array('content' => 'Associated Access'), 'product_id' => array('content' => 'Product Name'), 'billing_description' => array('content' => 'Billing Description'), 'rebill_date' => array('content' => 'Next Rebill Date' . MM_Utils::getInfoIcon($nextRebillDateInfo), "attr" => "style='width:140px;'"), 'actions' => array('content' => 'Actions', "attr" => "style='width:90px;'"));
            $dataGrid->setHeaders($headers);
            $dataGrid->setRows($rows);
            $dgHtml = $dataGrid->generateHtml();
            if ($dgHtml == "") {
                $dgHtml = "<p><i>No active subscriptions.</i></p>";
            }
            ?>
<div class="mm-wrap">
	<div id="mm-form-container">
		<input type="hidden" name="user_id" value="<?php 
            echo $user->getId();
            ?>
"/>
		
		<?php