Exemple #1
0
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
global $current_user;
$couponsSupported = MM_PaymentServiceFactory::couponsSupported();
$view = new MM_CouponView();
$dataGrid = new MM_DataGrid($_REQUEST, "id", "desc", 10);
$data = $view->getViewData($dataGrid);
$dataGrid->setTotalRecords($data);
$dataGrid->recordName = "coupon";
$rows = array();
foreach ($data as $key => $item) {
    $coupon = new MM_Coupon($item->id);
    $availableDates = "";
    $endDate = $coupon->getEndDate(true);
    if (!empty($endDate)) {
        $availableDates = $coupon->getStartDate(true) . " - " . $endDate;
    } else {
        $availableDates = "After " . $coupon->getStartDate(true);
    }
    switch ($coupon->getQuantity()) {
        case "-1":
        case "":
            $quantityDescription = number_format($item->quantity_used) . " used";
            break;
        default:
            $quantityDescription = number_format($item->quantity_used) . " of " . number_format($coupon->getQuantity()) . " used ";
            break;
    }
    $description = "";
Exemple #2
0
						<td>
							<input id="mm_start_date" type="text" value='<?php 
echo $coupon->getStartDate(true);
?>
' style="width:110px;" />
							<a onClick="jQuery('#mm_start_date').focus();"><?php 
echo MM_Utils::getCalendarIcon();
?>
</a>
						</td>
					</tr>
					<tr>
						<td>End Date</td>
						<td>
							<input id="mm_end_date" type="text" value='<?php 
echo $coupon->getEndDate(true);
?>
' style="width:110px;" />
							<a onClick="jQuery('#mm_end_date').focus();"><?php 
echo MM_Utils::getCalendarIcon();
?>
</a>
						</td>
					</tr>
					<tr>
						<td>Limit Quantity</td>
						<td>
							<input id="mm_quantity" type="text" style='width: 80px;' value='<?php 
echo $coupon->getQuantity();
?>
' />