Esempio n. 1
0
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
$view = new MM_PushNotificationView();
$dataGrid = new MM_DataGrid($_REQUEST, "event_type", "asc", 10);
$data = $view->getViewData($dataGrid);
$dataGrid->setTotalRecords($data);
$dataGrid->width = "98%";
$dataGrid->recordName = "notification";
$rows = array();
$headers = array('event_type' => array('content' => '<a onclick="mmjs.sort(\'event_type\');" href="#">Event</a>'), 'action_type' => array('content' => '<a onclick="mmjs.sort(\'action_type\');" href="#">Action</a>'), 'status' => array('content' => '<a onclick="mmjs.sort(\'status\');" href="#">Status</a>'), 'actions' => array('content' => ''));
foreach ($data as $key => $item) {
    $editActionUrl = 'onclick="mmjs.edit(\'mm-push-notification-dialog\', \'' . $item->id . '\', 510, 570)"';
    $deleteActionUrl = 'onclick="mmjs.remove(\'' . $item->id . '\')"';
    $actions = MM_Utils::getEditIcon("Edit Push Notification", '', $editActionUrl);
    $actions .= MM_Utils::getDeleteIcon("Delete Push Notification", 'margin-left:5px;', $deleteActionUrl);
    if ($item->status == "1") {
        $actions .= '<a title="Send Test Notification" style="margin-left: 5px; cursor:pointer" onclick="mmjs.sendTestNotification(\'' . $item->id . '\');">' . MM_Utils::getIcon('flask', 'green', '1.3em', '2px') . '</a>';
    } else {
        $actions .= '<a title="Activate this push notification in order to send a test" style="margin-left: 5px;">' . MM_Utils::getIcon('flask', 'grey', '1.3em', '2px') . '</a>';
    }
    $description = "";
    $actionValue = unserialize($item->action_value);
    if ($item->action_type == MM_Action::$MM_ACTION_SEND_EMAIL) {
        $description .= MM_Utils::getIcon('paper-plane-o', 'green', '1.3em', '2px', '', 'margin-right:4px;');
        $description .= " Send an email to ";
        if ($actionValue["emailToId"] == "-1") {
            $description .= "the current member";
        } else {
            $employee = new MM_Employee($actionValue["emailToId"]);
            $description .= "<span style='font-family:courier;'>" . $employee->getEmail() . "</span>";
Esempio n. 2
0
}
// 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];
    }
    $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);
Esempio n. 3
0
$view = new MM_ProductView();
$dataGrid = new MM_DataGrid($_REQUEST, "id", "desc", 10);
$data = $view->getViewData($dataGrid);
$dataGrid->setTotalRecords($data);
$dataGrid->recordName = "product";
$rows = array();
foreach ($data as $key => $item) {
    $product = new MM_Product($item->id);
    // Actions
    $editActionUrl = 'onclick="mmjs.edit(\'mm-products-dialog\', \'' . $product->getId() . '\', 580, 600)"';
    $deleteActionUrl = 'onclick="mmjs.remove(\'' . $product->getId() . '\')"';
    $actions = MM_Utils::getEditIcon("Edit Product", '', $editActionUrl);
    if (!MM_Product::isBeingUsed($product->getId()) && !MM_Product::hasBeenPurchased($product->getId())) {
        $actions .= MM_Utils::getDeleteIcon("Delete Product", 'margin-left:5px;', $deleteActionUrl);
    } else {
        $actions .= MM_Utils::getDeleteIcon("This product is currently being used and cannot be deleted", 'margin-left:5px;', '', true);
    }
    $purchaseLinks = '<a title="Get purchase links" onclick="mmjs.showPurchaseLinks(' . $product->getId() . ',\'' . htmlentities(addslashes($product->getName()), ENT_QUOTES) . '\')" class="mm-ui-button" style="margin:0px;">' . MM_Utils::getIcon('money', '', '1.3em', '1px', '', 'margin-right:0px;') . '</a>';
    // Associated Access
    $accessGranted = "";
    $membership = $product->getAssociatedMembership();
    if ($membership->isValid()) {
        $accessGranted .= MM_Utils::getAccessIcon(MM_OrderItemAccess::$ACCESS_TYPE_MEMBERSHIP);
        $accessGranted .= " <a href='" . MM_ModuleUtils::getUrl(MM_MODULE_PRODUCT_SETTINGS, MM_MODULE_MEMBERSHIP_LEVELS) . "&autoload=" . $membership->getId() . "'>" . $membership->getName() . "</a>";
    }
    if (empty($accessGranted)) {
        $bundle = $product->getAssociatedBundle();
        if ($bundle->isValid()) {
            $accessGranted .= MM_Utils::getAccessIcon(MM_OrderItemAccess::$ACCESS_TYPE_BUNDLE);
            $accessGranted .= " <a href='" . MM_ModuleUtils::getUrl(MM_MODULE_PRODUCT_SETTINGS, MM_MODULE_BUNDLES) . "&autoload=" . $bundle->getId() . "'>" . $bundle->getName() . "</a>";
        }
    $token = $split[0];
    $mmShippingMethodName = MM_NO_DATA;
    //get the shipping method
    $shippingMethod = MM_ShippingMethod::getShippingMethodByToken($token);
    if ($shippingMethod) {
        $optionRetrievalResponse = $shippingMethod->getShippingOptionByKey(new MM_Order(), $item->membermouse_shipping_option_key);
        $shippingOption = $optionRetrievalResponse->message;
        if ($shippingOption) {
            $mmShippingMethodName = "{$shippingOption->getName()} ({$shippingOption->getRate(true)})";
        }
    }
    // Actions
    $editActionUrl = 'onclick="mmjs.edit(\'mm-limelight-shipping-methods-dialog\', \'' . $item->id . '\', 550, 235)"';
    $deleteActionUrl = 'onclick="mmjs.remove(\'' . $item->id . '\')"';
    $actions = MM_Utils::getEditIcon("Edit Shipping Method Mapping", '', $editActionUrl);
    $actions .= MM_Utils::getDeleteIcon("Delete Shipping Method Mapping", 'margin-left:5px;', $deleteActionUrl);
    // Lime Light Shipping Method
    $llShippingMethod = "{$item->limelight_shipping_method_name} [{$item->limelight_shipping_method_id}]";
    $llShippingMethod .= '<a href="javascript:mmjs.getLimeLightShippingDescription(\'' . $item->limelight_shipping_method_id . '\');" style="margin-left: 5px; cursor:pointer;" title="View Lime Light Shipping Method Info">' . MM_Utils::getIcon("info-circle", "blue", "1.3em", "2px;") . '</a>';
    $rows[] = array(array('content' => $llShippingMethod), array('content' => $mmShippingMethodName), array('content' => $actions));
}
$headers = array('limelight_shipping_method_name' => array('content' => '<a onclick="mmjs.sort(\'limelight_shipping_method_name\');" href="#">Lime Light Shipping Method</a>'), 'membermouse_shipping_method_id' => array('content' => 'MemberMouse Shipping Method'), 'actions' => array('content' => 'Actions', 'attr' => 'style="width:50px;"'));
$dataGrid->setHeaders($headers);
$dataGrid->setRows($rows);
$dgHtml = $dataGrid->generateHtml();
if ($dgHtml == "") {
    $dgHtml = "<p><em>No shipping method mappings.</em></p>";
}
?>
<div class="mm-wrap">
	<?php 
Esempio n. 5
0
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
$view = new MM_UserDefinedPageView();
$dataGrid = new MM_DataGrid($_REQUEST, "id", "desc", 10);
$data = $view->getViewData($dataGrid);
$dataGrid->setTotalRecords($data);
$dataGrid->recordName = "page";
$rows = array();
foreach ($data as $key => $item) {
    $coupon = new MM_UserDefinedPage($item->id);
    $editActionUrl = 'onclick="mmjs.edit(\'mm-page-dialog\', \'' . $item->id . '\', 580, 300)"';
    $deleteActionUrl = 'onclick="mmjs.remove(\'' . $item->id . '\')"';
    $actions = MM_Utils::getEditIcon("Edit User-Defined Page", '', $editActionUrl);
    $actions .= MM_Utils::getDeleteIcon("Delete User-Defined Page", 'margin-left:5px;', $deleteActionUrl);
    $rows[] = array(array('content' => "<span title='ID [" . $coupon->getId() . "]'>" . $item->name . "</span>"), array('content' => "<span style='font-family:courier;'>" . $item->url . "</span>"), array('content' => $actions));
}
$headers = array('name' => array('content' => 'Name'), 'url' => array('content' => 'Page URL'), 'actions' => array('content' => 'Actions'));
$dataGrid->setHeaders($headers);
$dataGrid->setRows($rows);
$dgHtml = $dataGrid->generateHtml();
if ($dgHtml == "") {
    $dgHtml = "<p><i>No user-defined pages</i></p>";
}
?>
<div class="mm-wrap">	
	<div style="width:750px;" class="mm-info-box blue">
		<p>Sometimes you may have customer data specific to your business that you'd like to display alongside 
		member information in MemberMouse. User-defined pages give you the opportunity to load this proprietary customer data right 
		from the member details area. This can help streamline your internal processes by allowing your team to access everything 
Esempio n. 6
0
 * (c) MemberMouse, LLC. All rights reserved.
 */
$view = new MM_ApiView();
$dataGrid = new MM_DataGrid($_REQUEST, "id", "asc", 10);
$data = $view->getViewData($dataGrid);
$dataGrid->setTotalRecords($data);
$dataGrid->width = "700px";
$dataGrid->recordName = "API credential";
$rows = array();
$headers = array('name' => array('content' => 'Name'), 'api_key' => array('content' => 'Key'), 'api_secret' => array('content' => 'Password'), 'status' => array('content' => 'Status'), 'actions' => array('content' => 'Actions'));
foreach ($data as $key => $item) {
    // Actions
    $editActionUrl = 'onclick="mmjs.edit(\'mm-api-keys-dialog\', \'' . $item->id . '\', 500, 280)"';
    $deleteActionUrl = 'onclick="mmjs.remove(\'' . $item->id . '\')"';
    $actions = MM_Utils::getEditIcon("Edit API Credentials", '', $editActionUrl);
    $actions .= MM_Utils::getDeleteIcon("Delete API Credentials", 'margin-left:5px;', $deleteActionUrl);
    $rows[] = array(array('content' => "<span title='ID [" . $item->id . "]'>" . $item->name . "</span>"), array('content' => "<span style='font-family:courier; font-size:12px;'>" . $item->api_key . "</span>"), array('content' => "<span style='font-family:courier; font-size:12px;'>" . $item->api_secret . "</span>"), array('content' => MM_Utils::getStatusImage($item->status)), array('content' => $actions));
}
$dataGrid->setHeaders($headers);
$dataGrid->setRows($rows);
$dgHtml = $dataGrid->generateHtml();
if ($dgHtml == "") {
    $dgHtml = "<p><i>No API credentials found.</i></p>";
}
?>
<div class="mm-wrap">
	<?php 
if (MM_MemberMouseService::hasPermission(MM_MemberMouseService::$FEATURE_API)) {
    ?>
		<p style="margin-top:10px">
			<span class="mm-section-header">API URLs</span>
Esempio n. 7
0
 if (empty($phone)) {
     $phone = MM_NO_DATA;
 }
 // status
 $status = MM_Status::getImage($user->getStatus());
 // actions
 $editActionUrl = "href='" . MM_ModuleUtils::getUrl(MM_MODULE_MANAGE_MEMBERS, MM_MODULE_MEMBER_DETAILS_GENERAL) . "&user_id=" . $user->getId() . "'";
 $deleteActionUrl = 'onclick="mmjs.remove(\'' . $user->getId() . '\', \'' . $user->getEmail() . '\')"';
 $actions = MM_Utils::getEditIcon("Edit Member", '', $editActionUrl);
 if ($user->getStatus() == MM_Status::$ERROR || $user->getStatus() == MM_Status::$PENDING_ACTIVATION) {
     $actions .= MM_Utils::getDeleteIcon("Delete Member", 'margin-left:5px;', $deleteActionUrl);
 } else {
     if (!$user->hasActiveSubscriptions()) {
         $actions .= MM_Utils::getDeleteIcon("Delete Member", 'margin-left:5px;', $deleteActionUrl);
     } else {
         $actions .= MM_Utils::getDeleteIcon("This member has an active paid membership or bundle which must be canceled before they can be deleted", 'margin-left:5px;', '', true);
     }
 }
 // membership level
 $membershipStr = $user->getMembershipName();
 if ($user->getStatus() == MM_Status::$PENDING_ACTIVATION || $user->getStatus() == MM_Status::$ERROR) {
     $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])) {