/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
?>
<style>
    #mm-dialog-container { height:100%; width:100%; border-collapse:collapse; }
    .mm-dialog-button-bar { width:100%; height:40px; text-align:right; }
</style>

<table id="mm-dialog-container">
<tr><td valign="top">
<div>
<?php 
$product = new MM_Product($p->productId);
if ($product->isValid()) {
    $context = new MM_Context();
    $context->setProduct($product);
    echo MM_SmartTagUtil::processContent($product->getPurchaseConfirmationMessage(), $context);
} else {
    echo "Invalid product ID '{$p->productId}'";
}
?>
</div>
</td></tr>

<tr><td valign="bottom" class="mm-dialog-button-bar">
	<a href="javascript:pymtutils_js.placeOrderCardOnFile(<?php 
echo $p->userId;
?>
예제 #2
0
파일: products.php 프로젝트: huynp/Critical
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
$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>";
예제 #3
0
<?php

/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
$product = new MM_Product($p->id);
$enableNumberOfPayments = $product->doLimitPayments() ? "" : "disabled='disabled'";
$associatedMembership = $product->getAssociatedMembership();
$associatedBundle = $product->getAssociatedBundle();
$noAccessAssociation = !$associatedMembership->isValid() && !$associatedBundle->isValid() ? true : false;
if ($associatedMembership->isValid()) {
    $lastAccessAssociationType = "membership";
    $lastAccessAssociationId = $associatedMembership->getId();
} else {
    if ($associatedBundle->isValid()) {
        $lastAccessAssociationType = "bundle";
        $lastAccessAssociationId = $associatedBundle->getId();
    } else {
        $lastAccessAssociationType = "";
        $lastAccessAssociationId = "";
    }
}
$hasBeenPurchased = false;
if ($product->isValid()) {
    $hasBeenPurchased = MM_Product::hasBeenPurchased($product->getId());
}
$periodsArr = array('days' => 'days', 'weeks' => 'weeks', 'months' => 'months', 'years' => 'years');
$trialFrequencyList = MM_HtmlUtils::generateSelectionsList($periodsArr, $product->getTrialFrequency());
$rebillFrequencyList = MM_HtmlUtils::generateSelectionsList($periodsArr, $product->getRebillFrequency());
예제 #4
0
					<br/><br/>
					<span style="font-size:11px;">
					Default Product<?php 
    echo MM_Utils::getInfoIcon("Customers can purchase any of the products above to sign up for this membership level. It's also possible for customers to sign up for the membership directly in which case they'll end up purchasing the default product. You can specify the default product below.");
    ?>
 
					</span>
					<br/>
						<select id='mm-default-product-id'  >
							<?php 
    if ($product->isValid() && $product->getId() > 0) {
        $products = $membership->getProductIds();
        $productsArr = array();
        if (is_array($products)) {
            foreach ($products as $pid) {
                $p = new MM_Product($pid);
                $productsArr[$pid] = $p->getName();
            }
            $selections = MM_HtmlUtils::generateSelectionsList($productsArr, $product->getId());
            if (empty($selections)) {
                echo "<option value=''>Select a product</option>";
            } else {
                echo $selections;
            }
        } else {
            echo "<option value=''>Select a product</option>";
        }
        ?>
									<?php 
    } else {
        echo "<option value=''>Select a product</option>";
예제 #5
0
/**
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
$view = new MM_LimeLightProductsView();
$dataGrid = new MM_DataGrid($_REQUEST, "limelight_campaign_name", "asc", 10);
$data = $view->getViewData($dataGrid);
$dataGrid->setTotalRecords($data);
$dataGrid->recordName = "product mapping";
$rows = array();
foreach ($data as $key => $item) {
    $mmProductName = MM_NO_DATA;
    $mmProductDescription = MM_NO_DATA;
    $product = new MM_Product($item->membermouse_product_id);
    if ($product->isValid()) {
        $mmProductName = $product->getName();
        $mmProductDescription = $product->getBillingDescription() . " ";
        if ($product->hasTrial()) {
            $mmProductDescription .= MM_Utils::getIcon('clock-o', 'beige', '1.3em', '2px', 'Has Trial', 'margin-right:5px;');
        }
        if ($product->isRecurring()) {
            if ($product->doLimitPayments()) {
                $mmProductDescription .= MM_Utils::getIcon('calendar-o', 'beige', '1.3em', '2px', 'Payment Plan', 'margin-right:5px;');
            } else {
                $mmProductDescription .= MM_Utils::getIcon('refresh', 'beige', '1.3em', '2px', 'Subscription', 'margin-right:5px;');
            }
        }
        if ($product->isShippable()) {
            $mmProductDescription .= MM_Utils::getIcon('truck', 'beige', '1.3em', '2px', 'Requires Shipping', 'margin-right:5px;');
예제 #6
0
$prod = new MM_Product();
$selectedProds = array();
$id = 0;
if (isset($p->id)) {
    $id = $p->id;
}
$coupon = new MM_Coupon($id);
$prods = $coupon->getProducts();
if (!$coupon->isValid()) {
    $coupon->setStartDate(Date("m/d/Y"));
}
$editable = "";
if (MM_Coupon::isBeingUsed($coupon->getId())) {
    $editable = "disabled='disabled'";
}
$products = MM_HtmlUtils::createCheckboxGroup(MM_Product::getAll(), "mm_products", $prods);
?>
<div id="mm-coupons-container">
	<table cellspacing="10">
		<tr>
			<td width="140">Name*</td>
			<td><input type='hidden' id='id' value='<?php 
echo $coupon->getId();
?>
' />
				<input id="mm_coupon_name" type="text" value='<?php 
echo $coupon->getCouponName();
?>
' style='width:300px;' />
			</td>
		</tr>
예제 #7
0
 * (c) MemberMouse, LLC. All rights reserved.
 */
$limeLightProduct = new MM_LimeLightProduct($p->id);
$limeLightService = MM_PaymentServiceFactory::getPaymentService(MM_PaymentService::$LIMELIGHT_SERVICE_TOKEN);
?>
<div id="mm-form-container">
	<table cellspacing="10">
		<tr>
			<td width="150">MemberMouse Product</td>
			<td>
				<select name='mm_product_id' id='mm_product_id' onchange="mmjs.getMMProductDescription();">
				<?php 
$unmappedProducts = MM_LimeLightProduct::getUnmappedProducts();
// add currently selected product
if ($limeLightProduct->isValid()) {
    $product = new MM_Product($limeLightProduct->getMMProductId());
    if ($product->isValid()) {
        $unmappedProducts[$limeLightProduct->getMMProductId()] = $product->getName();
    }
}
echo MM_HtmlUtils::generateSelectionsList($unmappedProducts, $limeLightProduct->getMMProductId());
?>
				</select>
				
				<div id="mm_product_description" style="margin-top:10px;"></div>
			</td>
		</tr>
		
		<tr>
			<td colspan="2">
			<div style="width: 98%; margin-top: 8px;" class="mm-divider"></div>
예제 #8
0
 public static function getNextPaymentDate($startDate, $productId)
 {
     $product = new MM_Product($productId);
     $start = strtotime($startDate);
     if ($product->isRecurring(false)) {
         $period = $product->getRebillPeriod();
         $freq = $product->getRebillFrequency();
         $newdate = null;
         switch ($freq) {
             case "months":
                 $months = floor((mktime() - $start) / 2628000);
                 $newStart = strtotime($months . ' month', strtotime($start));
                 $newdate = strtotime($period . ' month', strtotime($newStart));
                 break;
             case "days":
                 $days = self::countDays(Date("Y-m-d h:i:s"), $startDate);
                 $diff = $days > $period ? intval($days / $period) : 1;
                 $newStart = strtotime($diff . ' day', strtotime($start));
                 $newdate = strtotime($period . ' day', strtotime($newStart));
                 break;
             case "weeks":
                 $days = self::countDays(Date("Y-m-d h:i:s"), $startDate);
                 $weeks = $days > 7 ? intval($days / 7) : 1;
                 $diff = $weeks > $period ? intval($weeks / $period) : 1;
                 $newStart = strtotime($diff . ' week', strtotime($start));
                 $newdate = strtotime($period . ' week', strtotime($newStart));
                 break;
             case "years":
                 $days = self::countDays(Date("Y-m-d h:i:s"), $startDate);
                 $years = $days > 365 ? intval($days / 365) : 1;
                 $diff = $years > $period ? intval($years / $period) : 1;
                 $newStart = strtotime($diff . ' year', strtotime($start));
                 $newdate = strtotime($period . ' year', strtotime($newStart));
                 break;
         }
         if (!is_null($newdate)) {
             return $newdate;
         }
     }
     return false;
 }
	<?php 
if (!$bundle->isFree()) {
    ?>
		<p>MemberMouse offers two methods for creating purchase links. First, select the product you want to create
		a purchase link for and then use one of the links below to allow customers to purchase access to the 
		'<?php 
    echo $p->accessTypeName;
    ?>
' bundle.</p>
		
		<input id="mm-last-selected-product-id" type="hidden" value="0" /> 
		<select id="mm-product-selector" onchange="mmjs.productChangeHandler();">
		<option value='0'>Select a product</option>
		<?php 
    foreach ($p->productIds as $id) {
        $product = new MM_Product($id);
        if ($product->isValid()) {
            echo "<option value='{$product->getId()}'>{$product->getName()}</option>";
        }
    }
    ?>
		</select>
		
	<?php 
    foreach ($p->productIds as $id) {
        generatePurchaseSection($id);
    }
} else {
    ?>
		<p>Cannot create purchase links for free bundles.</p>
	<?php 
예제 #10
0
 public function postCustomColumns($column_name, $postId)
 {
     if ($column_name === 'core_page_type') {
         $data = "";
         if (MM_CorePage::isDefaultCorePage($postId)) {
             $data = MM_Utils::getDefaultFlag("", "", true, 'margin-right:5px;');
         }
         $cp = MM_CorePage::getCorePageInfo($postId);
         if (isset($cp->core_page_type_name)) {
             switch ($cp->core_page_type_id) {
                 case MM_CorePageType::$FREE_CONFIRMATION:
                     $data .= "Confirmation (Free)";
                     break;
                 default:
                     $data .= $cp->core_page_type_name;
                     break;
             }
         }
         if (empty($data)) {
             echo MM_NO_DATA;
         } else {
             echo $data;
         }
     } else {
         if ($column_name === 'access_rights') {
             /// display access rights for post/page
             $associations = MM_ProtectedContentEngine::getAccessRights($postId);
             if (count($associations) <= 0) {
                 $memberTypesStr = "";
                 $accessTagStr = "";
                 $pages = MM_CorePage::getCorePagesByPageID($postId);
                 if (is_array($pages)) {
                     foreach ($pages as $page) {
                         switch ($page->ref_type) {
                             case "product":
                                 $product = new MM_Product($page->ref_id);
                                 $membership = $product->getAssociatedMembership();
                                 if ($membership->isValid()) {
                                     if (empty($memberTypesStr)) {
                                         $memberTypesStr = MM_Utils::getAccessIcon(MM_OrderItemAccess::$ACCESS_TYPE_MEMBERSHIP, '', 'margin-right:4px;');
                                     }
                                     $memberTypesStr .= $membership->getName() . ", ";
                                 }
                                 $bundle = $product->getAssociatedBundle();
                                 if ($bundle->isValid()) {
                                     if (empty($accessTagStr)) {
                                         $accessTagStr = MM_Utils::getAccessIcon(MM_OrderItemAccess::$ACCESS_TYPE_BUNDLE, '', 'margin-right:4px;');
                                     }
                                     $accessTagStr .= $bundle->getName() . ", ";
                                 }
                                 break;
                             case "member_type":
                                 if (empty($memberTypesStr)) {
                                     $memberTypesStr = MM_Utils::getAccessIcon(MM_OrderItemAccess::$ACCESS_TYPE_MEMBERSHIP, '', 'margin-right:4px;');
                                 }
                                 $memberTypesStr .= $page->mt_name . ", ";
                                 break;
                             case "access_tag":
                                 if (empty($accessTagStr)) {
                                     $accessTagStr = MM_Utils::getAccessIcon(MM_OrderItemAccess::$ACCESS_TYPE_BUNDLE, '', 'margin-right:4px;');
                                 }
                                 $accessTagStr .= $page->at_name . ", ";
                                 break;
                         }
                     }
                 }
                 if (empty($memberTypesStr) && empty($accessTagStr)) {
                     echo MM_NO_DATA;
                 } else {
                     if (strlen($memberTypesStr) > 0) {
                         $memberTypesStr = substr($memberTypesStr, 0, strlen($memberTypesStr) - 2);
                     }
                     if (strlen($accessTagStr) > 0) {
                         $accessTagStr = substr($accessTagStr, 0, strlen($accessTagStr) - 2);
                     }
                     echo $memberTypesStr . " " . $accessTagStr;
                 }
             } else {
                 $memberTypesStr = "";
                 $accessTagStr = "";
                 foreach ($associations as $rights) {
                     switch ($rights->access_type) {
                         case "member_type":
                             if (empty($memberTypesStr)) {
                                 $memberTypesStr = MM_Utils::getAccessIcon(MM_OrderItemAccess::$ACCESS_TYPE_MEMBERSHIP, '', 'margin-right:4px;');
                             }
                             $memberTypesStr .= $rights->mt_name . ", ";
                             break;
                         case "access_tag":
                             if (empty($accessTagStr)) {
                                 $accessTagStr = MM_Utils::getAccessIcon(MM_OrderItemAccess::$ACCESS_TYPE_BUNDLE, '', 'margin-right:4px;');
                             }
                             $accessTagStr .= $rights->at_name . ", ";
                             break;
                     }
                 }
                 if (empty($memberTypesStr) && empty($accessTagStr)) {
                     echo MM_NO_DATA;
                 } else {
                     if (strlen($memberTypesStr) > 0) {
                         $memberTypesStr = substr($memberTypesStr, 0, strlen($memberTypesStr) - 2);
                     }
                     if (strlen($accessTagStr) > 0) {
                         $accessTagStr = substr($accessTagStr, 0, strlen($accessTagStr) - 2);
                     }
                     echo $memberTypesStr . " " . $accessTagStr;
                 }
             }
         }
     }
 }
예제 #11
0
        $dataGrid->recordName = "product";
        break;
    case MM_TYPE_CUSTOM_FIELD:
        $dataGrid->recordName = "custom field";
        break;
}
$rows = array();
$headers = array('action' => array('content' => '', 'attr' => 'style="width:20px;"'), 'id' => array('content' => 'ID', 'attr' => 'style="width:20px;"'), 'name' => array('content' => 'Name'));
if ($p->objectType == MM_TYPE_PRODUCT) {
    $headers['access'] = array('content' => 'Associated Access');
}
foreach ($data as $key => $item) {
    $action = '<a title="Insert ID \'' . $item->id . '\'" onclick="stl_js.insertContent(\'' . $item->id . '\')" style="cursor:pointer;">' . MM_Utils::getIcon('plus-circle', 'green', '1.4em', '1px') . '</a>';
    $row_array = array(array('content' => $action), array('content' => $item->id), array('content' => MM_Utils::abbrevString($item->name, 25)));
    if ($p->objectType == MM_TYPE_PRODUCT) {
        $product = new MM_Product($item->id);
        // Associated Access
        $accessGranted = "";
        $membership = $product->getAssociatedMembership();
        if ($membership->isValid()) {
            $accessGranted .= MM_Utils::getAccessIcon(MM_OrderItemAccess::$ACCESS_TYPE_MEMBERSHIP);
            $accessGranted .= " " . MM_Utils::abbrevString($membership->getName(), 25) . "</a>";
        }
        if (empty($accessGranted)) {
            $bundle = $product->getAssociatedBundle();
            if ($bundle->isValid()) {
                $accessGranted .= MM_Utils::getAccessIcon(MM_OrderItemAccess::$ACCESS_TYPE_BUNDLE);
                $accessGranted .= " " . MM_Utils::abbrevString($bundle->getName(), 25) . "</a>";
            }
        }
        if (empty($accessGranted)) {
예제 #12
0
 */
global $current_user;
$memberTypeId = $p->member_type_id;
$user = new MM_User($current_user->ID);
$userMemberType = new MM_MembershipLevel($user->getMembershipId());
$memberType = new MM_MembershipLevel($memberTypeId);
$costOfNewMemberType = "Free";
if (!$memberType->isFree()) {
    $product = new MM_Product($memberType->getDefaultProduct());
    $costOfNewMemberType = "\$" . $product->getPrice(true);
}
$refund = "N/A";
$refundFloat = 0;
$currentMembershipPrice = "Free";
if (!$userMemberType->isFree()) {
    $existingProduct = new MM_Product($userMemberType->getDefaultProduct());
    if ($existingProduct->isValid()) {
        $currentMembershipPrice = "\$" . $existingProduct->getPrice(true);
    }
}
?>
<input type='hidden' id='mm-member-type-id' value='<?php 
echo $memberTypeId;
?>
' />
<table style='font-size: 14px;'> 
<tr>
	<td style='font-size: 14px;'> 
		Are you sure you'd like to change your membership level from <?php 
echo $user->getMembershipName();
?>