Пример #1
0
        if ($item->list_type == MM_AbstractEmailServiceProvider::$LIST_TYPE_CANCELED) {
            $crntItem->canceled_list_id = $item->list_id;
        }
    }
    $bundleMappings[$item->bundle_id] = $crntItem;
}
// generate rows
$rows = array();
$export_url = MM_PLUGIN_URL . '/com/membermouse/esp/util/export_members.php';
foreach ($bundleMappings as $key => $item) {
    $bundle = new MM_Bundle($item->bundle_id);
    $bundleName = MM_NO_DATA;
    if (!$bundle->isValid()) {
        continue;
    }
    $bundleName = $bundle->getName();
    // Actions
    $editActionUrl = 'onclick="mmjs.edit(\'mm-bundle-mapping-dialog\', \'' . $item->bundle_id . '\', 475, 235)"';
    $deleteActionUrl = 'onclick="mmjs.remove(\'' . $item->bundle_id . '\')"';
    $actions = MM_Utils::getEditIcon("Edit Bundle Mapping", '', $editActionUrl);
    $actions .= MM_Utils::getDeleteIcon("Delete Bundle Mapping", 'margin-left:5px;', $deleteActionUrl);
    $actions .= "<a onclick='mmjs.exportMembers(\"{$export_url}?bundle_id={$item->bundle_id}\"); return false;' style='cursor:pointer; margin-left:5px;' title='Export members with &apos;{$bundleName}&apos; bundle active on their account'>" . MM_Utils::getIcon('download', 'green', '1.3em', '2px') . "</a>";
    $actions .= "<a onclick='mmjs.exportMembers(\"{$export_url}?bundle_id={$item->bundle_id}&export_type=canceled_bundles\"); return false;' style='cursor:pointer; margin-left:5px;' title='Export members with &apos;{$bundleName}&apos; bundle canceled on their account'>" . MM_Utils::getIcon('download', 'red', '1.3em', '2px') . "</a>";
    $activeListName = MM_NO_DATA;
    if (isset($item->active_list_id) && !empty($listNames[$item->active_list_id])) {
        $activeListName = $listNames[$item->active_list_id];
    }
    $canceledListName = MM_NO_DATA;
    if (isset($item->canceled_list_id) && !empty($listNames[$item->canceled_list_id])) {
        $canceledListName = $listNames[$item->canceled_list_id];
    }
Пример #2
0
        $membership = new MM_MembershipLevel();
        $membership->setId($_GET['membership_id']);
        $membership->getData();
        if (!$membership->isValid()) {
            exit;
        }
        $filename = preg_replace("/([^A-za-z0-9\\s])/", "", strtolower($membership->getName()));
        $filename = preg_replace("/\\s/", "_", $filename) . "_export.csv";
    } else {
        if (isset($_GET['bundle_id'])) {
            $includeBundleInfo = false;
            $bundle = new MM_Bundle($_GET['bundle_id']);
            if (!$bundle->isValid()) {
                exit;
            }
            $filename = preg_replace("/([^A-za-z0-9\\s])/", "", strtolower($bundle->getName()));
            $prefix = "";
            if ($export_type == 'canceled_bundles') {
                $prefix = "canceled_";
            }
            $filename = $prefix . preg_replace("/\\s/", "_", $filename) . "_export.csv";
        } else {
            exit;
        }
    }
} else {
    if ($export_type == 'cancellation') {
        $includeBundleInfo = true;
        $filename = "cancelled_members_export.csv";
    } else {
        $includeBundleInfo = true;
Пример #3
0
<div id="mm-form-container">
	<?php 
if ($bundle->hasSubscribers()) {
    echo "<p class='noticeMessage'>";
    echo "This bundle is being used by members so some properties have been locked to avoid accidental editing. ";
    echo "Some locked properties can be edited, <a href=\"javascript:unlockBundle()\">click here to unlock them</a>. Note ";
    echo "that any changes made to locked properties will be applied to all members who currently have this bundle.";
    echo "</p>";
}
?>
	<table cellspacing="10">
		<tr>
			<td width="150">Name*</td>
			<td><input id="mm-display-name" type="text" class="long-text" value="<?php 
echo htmlentities($bundle->getName(), ENT_QUOTES);
?>
"/></td>
		</tr>
		
		<tr>
			<td>Status</td>
			<td>
				<div id="mm-status-container">
					<input type="radio" name="status" value="active" onclick="mmjs.processForm()" <?php 
echo $bundle->getStatus() == "1" ? "checked" : "";
?>
  /> Active  &nbsp;
					<input type="radio" name="status" value="inactive" onclick="mmjs.processForm()" <?php 
echo $bundle->getStatus() == "0" ? "checked" : "";
?>
Пример #4
0
$bundle = null;
$products = array();
if ($p->accessType == MM_AccessControlEngine::$ACCESS_TYPE_MEMBERSHIP) {
    $membership = new MM_MembershipLevel($p->accessTypeId);
    if ($membership->isValid()) {
        $accessName = $membership->getName();
        $products = $membership->getProductIds();
    } else {
        echo "Payment Options Dialog: Invalid membership level ID '{$p->accessTypeId}'";
        exit;
    }
} else {
    if ($p->accessType == MM_AccessControlEngine::$ACCESS_TYPE_BUNDLE) {
        $bundle = new MM_Bundle($p->accessTypeId);
        if ($bundle->isValid()) {
            $accessName = $bundle->getName();
            $products = $bundle->getAssociatedProducts();
        } else {
            echo "Payment Options Dialog: Invalid bundle ID '{$p->accessTypeId}'";
            exit;
        }
    }
}
$actionParams = json_decode($p->lastActionParams);
$compFunction = $actionParams->mm_jshandle . ".";
$compFunction .= $actionParams->mm_compfunction . "(";
$compFunction .= htmlspecialchars(json_encode($p->lastActionParams), ENT_NOQUOTES);
$compFunction .= ");";
?>

<script>
Пример #5
0
     $membershipStr = "<em>" . $user->getMembershipName() . "</em>";
 }
 // bundles
 if (!empty($item->bundles)) {
     $bundles = explode(",", $item->bundles);
     // iterate over array of bundle IDs, lookup bundle ID name
     // and replace the ID with the bundle name
     for ($i = 0; $i < count($bundles); $i++) {
         $bundleId = $bundles[$i];
         if (isset($bundleName[$bundleId])) {
             $bundleName[$bundleId];
         } else {
             $bundle = new MM_Bundle($bundleId);
             if ($bundle->isValid()) {
                 // cache bundle name for future use while processing remaining rows
                 $bundleName[$bundleId] = $bundle->getName();
             } else {
                 $bundleName[$bundleId] = MM_NO_DATA;
             }
         }
         $bundles[$i] = $bundleName[$bundleId];
     }
     $bundles = implode(", ", $bundles);
 } else {
     $bundles = MM_NO_DATA;
 }
 // last login date
 $userEngagement = MM_NO_DATA;
 $lastLoginDate = $user->getLastLoginDate();
 if (!empty($lastLoginDate)) {
     $userEngagement = MM_Utils::getIcon('calendar-o', 'purple', '1.2em', '2px', "Last logged in {$user->getLastLoginDate(true)}", "margin-right:8px;");