* (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 = ""; switch ($coupon->getCouponType()) { case MM_Coupon::$TYPE_PERCENTAGE:
</td> </tr> <tr> <td colspan="2"> <div style="width: 98%; margin-top: 8px;" class="mm-divider"></div> </td> </tr> <tr> <td valign="top" width="140">Restrictions</td> <td> <table> <tr> <td width="140">Start Date</td> <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;" />