本文整理汇总了PHP中RSMembershipHelper::getCurrentDate方法的典型用法代码示例。如果您正苦于以下问题:PHP RSMembershipHelper::getCurrentDate方法的具体用法?PHP RSMembershipHelper::getCurrentDate怎么用?PHP RSMembershipHelper::getCurrentDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSMembershipHelper
的用法示例。
在下文中一共展示了RSMembershipHelper::getCurrentDate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
$mainframe =& JFactory::getApplication();
JToolBarHelper::title('RSMembership!', 'rsmembership');
JSubMenuHelper::addEntry(JText::_('RSM_TRANSACTIONS'), 'index.php?option=com_rsmembership&view=transactions');
JSubMenuHelper::addEntry(JText::_('RSM_MEMBERSHIPS'), 'index.php?option=com_rsmembership&view=memberships');
JSubMenuHelper::addEntry(JText::_('RSM_CATEGORIES'), 'index.php?option=com_rsmembership&view=categories');
JSubMenuHelper::addEntry(JText::_('RSM_MEMBERSHIP_EXTRAS'), 'index.php?option=com_rsmembership&view=extras');
JSubMenuHelper::addEntry(JText::_('RSM_MEMBERSHIP_UPGRADES'), 'index.php?option=com_rsmembership&view=upgrades');
JSubMenuHelper::addEntry(JText::_('RSM_COUPONS'), 'index.php?option=com_rsmembership&view=coupons');
JSubMenuHelper::addEntry(JText::_('RSM_PAYMENT_INTEGRATIONS'), 'index.php?option=com_rsmembership&view=payments');
JSubMenuHelper::addEntry(JText::_('RSM_FILES'), 'index.php?option=com_rsmembership&view=files');
JSubMenuHelper::addEntry(JText::_('RSM_FILE_TERMS'), 'index.php?option=com_rsmembership&view=terms');
JSubMenuHelper::addEntry(JText::_('RSM_USERS'), 'index.php?option=com_rsmembership&view=users');
JSubMenuHelper::addEntry(JText::_('RSM_FIELDS'), 'index.php?option=com_rsmembership&view=fields');
JSubMenuHelper::addEntry(JText::_('RSM_REPORTS'), 'index.php?option=com_rsmembership&view=reports', true);
JSubMenuHelper::addEntry(JText::_('RSM_CONFIGURATION'), 'index.php?option=com_rsmembership&view=configuration');
JSubMenuHelper::addEntry(JText::_('RSM_UPDATES'), 'index.php?option=com_rsmembership&view=updates');
$params = array();
$params['allowAllClose'] = true;
$pane =& JPane::getInstance('sliders', $params);
$this->assignRef('pane', $pane);
$date = RSMembershipHelper::getCurrentDate();
if (RSMembershipHelper::isJ16()) {
$date =& JFactory::getDate();
$date = $date->toUnix();
}
$this->assignRef('from_calendar', JHTML::_('calendar', '', 'from_date', 'rsm_from_calendar'));
$this->assignRef('to_calendar', JHTML::_('calendar', date('Y-m-d', $date), 'to_date', 'rsm_to_calendar'));
$this->assign('user_id', $this->get('userId'));
$this->assign('report', $this->get('report'));
$this->assign('count_memberships', $this->get('countMemberships'));
$color_pickers = !empty($this->report) && $this->report == 2 ? '4' : $this->count_memberships;
$this->assign('color_pickers', $color_pickers);
$lists['transaction_types'] = $this->get('transactiontypes');
$lists['memberships'] = $this->get('memberships');
$lists['memberships_transactions'] = $this->get('membershipstransactions');
$units = array();
$units[] = JHTML::_('select.option', 'day', JText::_('RSM_DAY'));
$units[] = JHTML::_('select.option', 'month', JText::_('RSM_MONTH'));
$units[] = JHTML::_('select.option', 'quarter', JText::_('RSM_QUARTER'));
$units[] = JHTML::_('select.option', 'year', JText::_('RSM_YEAR'));
$lists['unit'] = JHTML::_('select.genericlist', $units, 'unit');
$reports = array();
$reports[] = JHTML::_('select.option', 'report_1', JText::_('RSM_REPORT_1'));
$reports[] = JHTML::_('select.option', 'report_2', JText::_('RSM_REPORT_2'));
$lists['report'] = JHTML::_('select.genericlist', $reports, 'report', 'onchange="rsm_check_report(this.value);"');
$gateways = $this->assign('gateways', $this->get('gateways'));
$viewin = array();
$viewin[] = JHTML::_('select.option', 60, JText::_('RSM_MINUTES'));
$viewin[] = JHTML::_('select.option', 3600, JText::_('RSM_HOURS'));
$viewin[] = JHTML::_('select.option', 86400, JText::_('RSM_DAYS'));
$lists['viewin'] = JHTML::_('select.genericlist', $viewin, 'viewin', 'style="display: none;"');
$this->assignRef('lists', $lists);
$this->assign('customer', $this->get('customer'));
if ($this->get('ie')) {
JError::raiseWarning(500, JText::_('RSM_IE_WARNING'));
}
parent::display($tpl);
}
示例2: getMembership
function getMembership()
{
$cid = JRequest::getInt('cid', 0);
$row =& JTable::getInstance('RSMembership_Membership_Users', 'Table');
$row->load($cid);
$user_id = JRequest::getInt('user_id');
if ($user_id > 0) {
$row->user_id = $user_id;
}
$row->user = JFactory::getUser($row->user_id);
if ($row->id == 0) {
$now = RSMembershipHelper::getCurrentDate();
$row->membership_start = $now;
$row->membership_end = $now;
}
if (!empty($row->extras)) {
$row->extras = explode(',', $row->extras);
$row->noextra = false;
} else {
$row->noextra = true;
}
return $row;
}
示例3: foreach
foreach ($this->transactions as $item) {
?>
<tr class="sectiontableentry<?php
echo $k . $this->escape($this->params->get('pageclass_sfx'));
?>
" >
<td align="right"><?php
echo $this->pagination->getRowOffset($i);
?>
</td>
<td><?php
echo JText::_('RSM_TRANSACTION_' . strtoupper($item->type));
?>
</td>
<td><?php
echo date($this->date_format, RSMembershipHelper::getCurrentDate($item->date));
?>
</td>
<td><?php
echo RSMembershipHelper::getPriceFormat($item->price);
?>
</td>
<td><?php
echo $item->gateway;
?>
</td>
<td><?php
echo JText::_('RSM_TRANSACTION_STATUS_' . strtoupper($item->status));
?>
</td>
</tr>
示例4: isCodeExpired
/**
* Check a code to see if it is expired based on creation time
*
* @access private
* @since 2.0.1
* @param $creation_time unix timestamp of code creation time
* @return bool true if code has expired, false if not
*/
function isCodeExpired()
{
$session = JFactory::getSession();
$creation_time = $session->get('com_rsmembership.securimage.ctime', 0);
$expired = true;
if (!is_numeric($this->expiry_time) || $this->expiry_time < 1) {
$expired = false;
} else {
if (RSMembershipHelper::getCurrentDate() - $creation_time < $this->expiry_time) {
$expired = false;
}
}
return $expired;
}
示例5: checkCoupon
function checkCoupon(&$membership, $verbose = true)
{
// Check if entered any coupon code
$coupon_entered = $this->getCoupon();
if (!$coupon_entered) {
return true;
}
// Check if coupon exists
$this->_db->setQuery("SELECT * FROM #__rsmembership_coupons WHERE `name`='" . $this->_db->getEscaped($coupon_entered) . "' AND `published`='1'");
$coupon = $this->_db->loadObject();
if (!$coupon) {
if ($verbose) {
JError::raiseWarning(500, JText::_('RSM_COUPON_INVALID'));
}
return $this->removeCoupon();
}
$now = RSMembershipHelper::getCurrentDate();
// Check if promotion hasn't started yet
if ($coupon->date_start && RSMembershipHelper::getCurrentDate($coupon->date_start) > $now) {
return $this->removeCoupon();
}
// Check if expired
if ($coupon->date_end && RSMembershipHelper::getCurrentDate($coupon->date_end) < $now) {
if ($verbose) {
JError::raiseWarning(500, JText::_('RSM_COUPON_CODE_EXPIRED'));
}
return $this->removeCoupon();
}
// Check if valid for this membership
$this->_db->setQuery("SELECT `membership_id` FROM #__rsmembership_coupon_items WHERE `coupon_id`='" . $coupon->id . "'");
$coupon->items = $this->_db->loadResultArray();
if (count($coupon->items) && !in_array($membership->id, $coupon->items)) {
if ($verbose) {
JError::raiseWarning(500, JText::_('RSM_COUPON_CODE_NOT_VALID_FOR_MEMBERSHIP'));
}
return $this->removeCoupon();
}
// Check max uses
if ($coupon->max_uses > 0) {
$this->_db->setQuery("SELECT COUNT(id) FROM #__rsmembership_transactions WHERE `status`='completed' AND `coupon`='" . $this->_db->getEscaped($coupon->name) . "'");
$used = $this->_db->loadResult();
if ($used >= $coupon->max_uses) {
if ($verbose) {
JError::raiseWarning(500, JText::_('RSM_COUPON_MAX_USAGE'));
}
return $this->removeCoupon();
}
}
if ($coupon->discount_type == 0) {
$coupon->discount_price = $membership->price * ($coupon->discount_price / 100);
}
$membership->price -= $coupon->discount_price;
if ($membership->price < 0) {
$membership->price = 0;
}
return true;
}
示例6: date
?>
" class="modal" rel="{handler: 'iframe', size: {x: 660, y: 475}}"><?php
echo $row->name != '' ? $row->name : JText::_('RSM_NO_TITLE');
?>
</a></td>
<td>
<?php
echo RSMembershipHelper::getPriceFormat($row->price);
?>
</td>
<td><?php
echo date(RSMembershipHelper::getConfig('date_format'), RSMembershipHelper::getCurrentDate($row->membership_start));
?>
</td>
<td><?php
echo $row->membership_end > 0 ? date(RSMembershipHelper::getConfig('date_format'), RSMembershipHelper::getCurrentDate($row->membership_end)) : JText::_('RSM_UNLIMITED');
?>
</td>
<td><?php
echo JText::_('RSM_STATUS_' . $row->status);
?>
</td>
<td align="center"><?php
echo JHTML::_('image', JURI::root() . 'administrator/' . $image, JText::_('RSM_STATUS'));
?>
</td>
<td align="center"><?php
echo JHTML::_('grid.published', $row, $i);
?>
</td>
</tr>
示例7: getMembership
function getMembership()
{
$app = JFactory::getApplication();
$cid = $app->input->get('cid', 0, 'int');
$row = JTable::getInstance('Membership_Subscriber', 'RSMembershipTable');
$row->load($cid);
$user_id = $app->input->get('user_id', 0, 'int');
if ($user_id > 0) {
$row->user_id = $user_id;
}
$row->user = JFactory::getUser($row->user_id);
if ($row->id == 0) {
$now = RSMembershipHelper::getCurrentDate();
$row->membership_start = $now;
$row->membership_end = $now;
}
if (!empty($row->extras)) {
$row->extras = explode(',', $row->extras);
$row->noextra = false;
} else {
$row->noextra = true;
}
return $row;
}
示例8: date
?>
</span> <?php
echo JHTML::calendar($this->row->membership_start, 'membership_start', 'membership_start', '%s', 'onchange="rsmembership_date(this.value,\'membership_start\')" style="display: none"');
?>
</td>
</tr>
<tr>
<td width="200"><span class="hasTip" title="<?php
echo JText::_('RSM_MEMBERSHIP_END_DESC');
?>
"><label for="membership_end"><?php
echo JText::_('RSM_MEMBERSHIP_END');
?>
</label></span></td>
<td><span id="membership_end_ajax"><?php
echo date(RSMembershipHelper::getConfig('date_format'), RSMembershipHelper::getCurrentDate($this->row->membership_end));
?>
</span> <?php
echo JHTML::calendar($this->row->membership_end, 'membership_end', 'membership_end', '%s', 'onchange="rsmembership_date(this.value,\'membership_end\')" style="display: none"');
?>
<input type="checkbox" name="unlimited" id="change_unlimited" value="1" onchange="rsmembership_change_unlimited(this);" <?php
echo $this->row->membership_end == 0 ? 'checked="checked"' : '';
?>
/> <label for="change_unlimited"><?php
echo JText::_('RSM_UNLIMITED');
?>
</label>
</td>
</tr>
<tr>
<td width="200"><span class="hasTip" title="<?php
示例9: date
echo date(RSMembershipHelper::getConfig('date_format'), RSMembershipHelper::getCurrentDate($row->date_added));
?>
</td>
<td><a href="<?php
echo JRoute::_('index.php?option=com_rsmembership&controller=coupons&task=edit&cid=' . $row->id);
?>
"><?php
echo $row->name != '' ? $row->name : JText::_('RSM_NO_TITLE');
?>
</a></td>
<td nowrap="nowrap"><?php
echo $row->date_start ? date(RSMembershipHelper::getConfig('date_format'), RSMembershipHelper::getCurrentDate($row->date_start)) : '-';
?>
</td>
<td nowrap="nowrap"><?php
echo $row->date_end ? date(RSMembershipHelper::getConfig('date_format'), RSMembershipHelper::getCurrentDate($row->date_end)) : '-';
?>
</td>
<td><?php
echo $row->discount_type ? RSMembershipHelper::getPriceFormat($row->discount_price) : $row->discount_price . '%';
?>
</td>
<td align="center"><?php
echo JHTML::_('grid.published', $row, $i);
?>
</td>
</tr>
<?php
$i++;
$k = 1 - $k;
}
示例10: getYears
function getYears()
{
$return = array();
$tmp = new stdClass();
$tmp->value = 0;
$tmp->text = JText::_('RSM_EVERY_YEAR');
$return[] = $tmp;
$max = date('Y', RSMembershipHelper::getCurrentDate());
for ($i = $max; $i <= $max + 50; $i++) {
$tmp = new stdClass();
$tmp->value = $i;
$tmp->text = $i;
$return[] = $tmp;
}
return $return;
}
示例11: ajax_date
function ajax_date()
{
$date = RSMembershipHelper::getCurrentDate(JRequest::getInt('date'));
echo date(RSMembershipHelper::getConfig('date_format'), $date);
exit;
}
示例12: date
<td width="30%" height="40"><?php
echo JText::_('RSM_MEMBERSHIP_START');
?>
:</td>
<td><?php
echo date($this->date_format, RSMembershipHelper::getCurrentDate($this->membership->membership_start));
?>
</td>
</tr>
<tr>
<td width="30%" height="40"><?php
echo JText::_('RSM_MEMBERSHIP_END');
?>
:</td>
<td><?php
echo $this->membership->membership_end > 0 ? date($this->date_format, RSMembershipHelper::getCurrentDate($this->membership->membership_end)) : JText::_('RSM_UNLIMITED');
?>
</td>
</tr>
<?php
}
if (!empty($this->membershipterms->id)) {
?>
<tr>
<td width="30%" height="40"><?php
echo JText::_('RSM_TERM');
?>
:</td>
<td><a href="<?php
echo JRoute::_('index.php?option=com_rsmembership&view=terms&cid=' . $this->membershipterms->id . ':' . JFilterOutput::stringURLSafe($this->membershipterms->name));
?>
示例13: count
<?php
$k = 0;
$i = 0;
$n = count($this->row->logs);
foreach ($this->row->logs as $row) {
?>
<tr class="row<?php
echo $k;
?>
">
<td><?php
echo $i + 1;
?>
</td>
<td><?php
echo date(RSMembershipHelper::getConfig('date_format'), RSMembershipHelper::getCurrentDate($row->date));
?>
</td>
<td><?php
echo $row->ip;
?>
</td>
<td><?php
echo $row->path;
?>
</td>
</tr>
<?php
$i++;
$k = 1 - $k;
}
示例14: getReportData
//.........这里部分代码省略.........
$status = JRequest::getVar('status_memberships');
if (!empty($status)) {
$filter['status_memberships'] = " AND status IN (" . strtolower(implode(',', $status)) . ")";
$where .= $filter['status_memberships'];
}
}
$price_from = JRequest::getVar('price_from');
if (!empty($price_from)) {
$filter['price_from'] = " AND price >= (" . $price_from . ")";
$where .= $filter['price_from'];
}
$price_to = JRequest::getVar('price_to');
if (!empty($price_to)) {
$filter['price_to'] = " AND price <= (" . $price_to . ")";
$where .= $filter['price_to'];
}
// ordering
$orderby = " ORDER BY `" . ($this->getReport() == 'report_2' ? 'date' : 'membership_start') . "` ASC";
switch ($this->getReport()) {
// number of subscribers
case 'report_1':
// query
$query = "SELECT membership_id, " . $date_column . " FROM #__rsmembership_membership_users WHERE 1";
$query = $query . $where . $orderby;
$this->_db->setQuery($query);
$subscribers = $this->_db->loadObjectList();
foreach ($memberships as $membership) {
$membership = $this->getMembershipName($membership);
$return['memberships'][$membership] = array();
}
if (!empty($subscribers)) {
foreach ($subscribers as $subscriber) {
if ($unit == 'quarter') {
$format = $this->getQuarter(RSMembershipHelper::getCurrentDate($subscriber->membership_start));
}
$date = date($format, RSMembershipHelper::getCurrentDate($subscriber->membership_start));
$membership = $this->getMembershipName($subscriber->membership_id);
@($return['units'][$date] = $date);
@($return['memberships'][$membership][$date] += 1);
@($return['totals'][$date] += 1);
}
}
if (!empty($return['totals'])) {
$this->min = $this->max = max($return['totals']);
foreach ($return['units'] as $date) {
foreach ($memberships as $membership) {
$membership = $this->getMembershipName($membership);
if (empty($return['memberships'][$membership][$date])) {
$return['memberships'][$membership][$date] = 0;
if (empty($return['totals'][$date])) {
$return['totals'][$date] = 0;
}
}
}
// min
if (!empty($return['totals'][$date])) {
$this->min = min($this->min, $return['totals'][$date]);
}
}
foreach ($return['memberships'] as $return_membership => $return_values) {
ksort($return['memberships'][$return_membership]);
}
// total
$this->total = array_sum($return['totals']);
// avg
$this->avg = floor(array_sum($return['totals']) / count($return['totals']));
示例15: calculateFixedDate
function calculateFixedDate($membership)
{
$date = JFactory::getDate();
$now = RSMembershipHelper::getCurrentDate();
$day = $membership->fixed_day;
$month = $membership->fixed_month;
$year = $membership->fixed_year;
if ($day == 0 && $month == 0 && $year == 0) {
// Add a day
$membership_end = $date->toUnix() + 86400;
} elseif ($day > 0 && $month == 0 && $year == 0) {
// If we didn't pass the expiry day, expire this month, else expire next month
$month = date('d', $now) < $day ? date('m', $now) : date('m', $now) + 1;
$year = date('Y', $now);
$membership_end = gmmktime(0, 0, 0, $month, $day, $year);
} elseif ($day == 0 && $month > 0 && $year == 0) {
$day = date('m', $now) == $month ? date('d', $now) + 1 : 1;
$year = date('Y', $now);
$membership_end = gmmktime(0, 0, 0, $month, $day, $year);
} elseif ($day == 0 && $month == 0 && $year > 0) {
$month = date('m', $now);
$day = date('d', $now) + 1;
$membership_end = gmmktime(0, 0, 0, $month, $day, $year);
} elseif ($day > 0 && $month > 0 && $year == 0) {
// If we didn't pass the expiry day and month, expire this year, else expire next year
$year = date('d', $now) < $day && date('m', $now) == $month || date('m', $now) < $month ? date('Y', $now) : date('Y', $now) + 1;
$membership_end = gmmktime(0, 0, 0, $month, $day, $year);
} elseif ($day == 0 && $month > 0 && $year > 0) {
$day = date('m', $now) == $month && date('Y', $now) == $year ? date('d', $now) + 1 : 1;
$membership_end = gmmktime(0, 0, 0, $month, $day, $year);
} elseif ($day > 0 && $month == 0 && $year > 0) {
// If we didn't pass the expiry day, expire this month, else expire next month
$month = date('d', $now) < $day ? date('m', $now) : date('m', $now) + 1;
$membership_end = gmmktime(0, 0, 0, $month, $day, $year);
} elseif ($day > 0 && $month > 0 && $year > 0) {
// Expire on a fixed date
$membership_end = gmmktime(0, 0, 0, $month, $day, $year);
}
return $membership_end;
}