当前位置: 首页>>代码示例>>PHP>>正文


PHP RSMembershipHelper::getPriceFormat方法代码示例

本文整理汇总了PHP中RSMembershipHelper::getPriceFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP RSMembershipHelper::getPriceFormat方法的具体用法?PHP RSMembershipHelper::getPriceFormat怎么用?PHP RSMembershipHelper::getPriceFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RSMembershipHelper的用法示例。


在下文中一共展示了RSMembershipHelper::getPriceFormat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display

 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $params = clone $app->getParams('com_rsmembership');
     $this->params = $params;
     $this->item = $this->get('Item');
     if (empty($this->item->id) || !$this->item->published) {
         JError::raiseWarning(500, JText::_('COM_RSMEMBERSHIP_MEMBERSHIP_NOT_EXIST'));
         $app->redirect(JRoute::_(RSMembershipRoute::Memberships()));
     }
     $currency = RSMembershipHelper::getConfig('currency');
     // {price} placeholder
     $price = RSMembershipHelper::getPriceFormat($this->item->price);
     // {extras} placeholder
     $viewclass = RSMembershipHelper::isJ3() ? 'JViewLegacy' : 'JView';
     if ($viewclass == 'JView') {
         jimport('joomla.application.component.view');
     }
     $view = new $viewclass(array('name' => 'extras', 'base_path' => JPATH_SITE . '/components/com_rsmembership'));
     $view->model = JModelLegacy::getInstance('Extras', 'RSMembershipModel');
     $view->extras = $view->model->getItems();
     $view->item = $this->item;
     $view->show_subscribe_btn = $this->item->stock == -1 ? false : true;
     $this->extras = $view->loadTemplate();
     $placeholders = array('{price}' => $price, '{buy}' => '', '{extras}' => '', '{stock}' => $this->item->stock > -1 ? $this->item->stock == 0 ? JText::_('COM_RSMEMBERSHIP_UNLIMITED') : $this->item->stock : JText::_('COM_RSMEMBERSHIP_OUT_OF_STOCK_PLACEHOLDER'), '<hr id="system-readmore" />' => '');
     $replace = array_keys($placeholders);
     $with = array_values($placeholders);
     $this->item->description = str_replace($replace, $with, $this->item->description);
     // prepare the Pathway
     $pathway = $app->getPathway();
     $this->Itemid = JFactory::getApplication()->input->get('Itemid', 0, 'int');
     $layout = JFactory::getApplication()->input->get('layout', '', 'cmd');
     if ($this->item->category_id) {
         $pathway->addItem($this->item->category_name, JRoute::_(RSMembershipRoute::Memberships($this->item->category_id, $this->Itemid, $layout)));
     }
     $pathway->addItem($this->item->name, '');
     // Title
     if (!$params->get('page_title')) {
         $this->document->setTitle($this->item->name);
     } else {
         $this->document->setTitle($params->get('page_title') . ' - ' . $this->item->name);
     }
     // Description
     if ($params->get('menu-meta_description')) {
         $this->document->setDescription($params->get('menu-meta_description'));
     }
     // Keywords
     if ($params->get('menu-meta_keywords')) {
         $this->document->setMetadata('keywords', $params->get('menu-meta_keywords'));
     }
     // Robots
     if ($params->get('robots')) {
         $this->document->setMetadata('robots', $params->get('robots'));
     }
     parent::display();
 }
开发者ID:JozefAB,项目名称:qk,代码行数:56,代码来源:view.html.php

示例2: onMembershipPayment

 function onMembershipPayment($plugin, $data, $extra, $membership, &$transaction)
 {
     $this->loadLanguage('plg_system_rsmembership', JPATH_ADMINISTRATOR);
     $this->loadLanguage('plg_system_rsmembershipwire', JPATH_ADMINISTRATOR);
     if (!$this->canRun()) {
         return;
     }
     if (!preg_match('#rsmembershipwire([0-9]+)#', $plugin, $match)) {
         return false;
     }
     $id = (int) $match[1];
     $db =& JFactory::getDBO();
     $db->setQuery("SELECT * FROM #__rsmembership_payments WHERE `id`='" . $id . "'");
     $payment = $db->loadObject();
     $tax_value = $payment->tax_value;
     if (!empty($tax_value)) {
         $tax_type = $payment->tax_type;
         // percent ?
         if ($tax_type == 0) {
             $tax_value = $transaction->price * ($tax_value / 100);
         }
         $transaction->price = $transaction->price + $tax_value;
     }
     $html = '';
     $html .= $payment->details;
     $replace = array('{price}', '{membership}');
     $with = array(RSMembershipHelper::getPriceFormat($transaction->price), $membership->name);
     $html = str_replace($replace, $with, $html);
     $html .= '<form method="post" action="' . JRoute::_('index.php?option=com_rsmembership&task=thankyou') . '">';
     $html .= '<input class="button" type="submit" value="' . JText::_('RSM_CONTINUE') . '" />';
     $html .= '<input type="hidden" name="option" value="com_rsmembership" />';
     $html .= '<input type="hidden" name="task" value="thankyou" />';
     $html .= '</form>';
     // No hash for this
     $transaction->hash = '';
     $transaction->gateway = $payment->name;
     if ($membership->activation == 2) {
         $transaction->status = 'completed';
     }
     return $html;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:41,代码来源:rsmembershipwire.php

示例3: display

 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     // get parameters
     $params = clone $mainframe->getParams('com_rsmembership');
     $pathway =& $mainframe->getPathway();
     $pathway->addItem(JText::_('RSM_UPGRADE'), '');
     // token
     $token = JHTML::_('form.token');
     // get the current layout
     $layout = $this->getLayout();
     if ($layout == 'default') {
         $this->assign('payments', RSMembership::getPlugins());
         // get the encoded return url
         $return = base64_encode(JRequest::getURI());
         $this->assignRef('return', $return);
         $data = $this->get('data');
         $this->assignRef('data', $data);
         // get the upgrade
         $upgrade = $this->get('upgrade');
         $this->assignRef('upgrade', $upgrade);
         // price
         $this->assign('total', RSMembershipHelper::getPriceFormat($upgrade->price));
         $this->assignRef('fields', RSMembershipHelper::getFields(false));
         $this->assignRef('membershipterms', $this->get('membershipterms'));
     } elseif ($layout == 'payment') {
         $this->assignRef('html', $this->get('html'));
     }
     $this->assignRef('cid', $this->get('cid'));
     $this->assignRef('config', $this->get('config'));
     $this->assignRef('params', $params);
     $this->assignRef('user', $this->get('user'));
     $this->assignRef('token', $token);
     $this->assign('currency', RSMembershipHelper::getConfig('currency'));
     parent::display();
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:36,代码来源:view.html.php

示例4: strtoupper

                echo $this->cache->memberships[$params['membership_id']];
            }
            break;
    }
    ?>
		</td>
		<td><?php 
    echo RSMembershipHelper::showDate($row->date);
    ?>
</td>
		<td><?php 
    echo $this->escape($row->ip);
    ?>
</td>		
		<td><?php 
    echo RSMembershipHelper::getPriceFormat($row->price);
    ?>
</td>
		<td><?php 
    echo JText::_('COM_RSMEMBERSHIP_TRANSACTION_STATUS_' . strtoupper($row->status));
    ?>
</td>
		<td><?php 
    echo $this->escape($row->gateway);
    ?>
</td>
		<td><?php 
    echo empty($row->hash) ? '<em>' . JText::_('COM_RSMEMBERSHIP_NO_HASH') . '</em>' : $this->escape($row->hash);
    ?>
</td>
	</tr>
开发者ID:JozefAB,项目名称:qk,代码行数:31,代码来源:edit_transactions.php

示例5:

:</td>
	<td><?php 
echo $this->extra->name;
?>
 - <?php 
echo RSMembershipHelper::getPriceFormat($this->extra->price);
?>
</td>
</tr>
<tr>
	<td width="30%" height="40"><?php 
echo JText::_('COM_RSMEMBERSHIP_TOTAL_COST');
?>
:</td>
	<td><?php 
echo RSMembershipHelper::getPriceFormat($this->extra->price);
?>
</td>
</tr>
</table>
</div><!-- .item-page -->

<div class="item-page">
<h3 class="page-header"><?php 
echo JText::_('COM_RSMEMBERSHIP_ACCOUNT_INFORMATION');
?>
</h3>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="rsmembership_form_table">
<tr>
	<td width="30%" height="40"><?php 
echo JText::_('COM_RSMEMBERSHIP_NAME');
开发者ID:JozefAB,项目名称:qk,代码行数:31,代码来源:default.php

示例6: date

    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;
}
?>
		<tfoot>
			<tr>
				<td colspan="9"><?php 
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:31,代码来源:default.php

示例7: onMembershipPayment

 function onMembershipPayment($plugin, $data, $extra, $membership, &$transaction)
 {
     if (!$this->canRun()) {
         return;
     }
     if ($plugin != $this->_plugin->name) {
         return false;
     }
     $this->loadLanguage('plg_system_rsmembership');
     $this->loadLanguage('plg_system_rsmembershipauthorize');
     $document =& JFactory::getDocument();
     $document->addScript(JURI::root() . 'plugins/system/' . $this->joomla16prefix . 'rsmembershipauthorize/script.js');
     $document->addStyleSheet(JURI::root() . 'plugins/system/' . $this->joomla16prefix . 'rsmembershipauthorize/style.css');
     JHTML::_('behavior.tooltip');
     $fields = $this->_getFields();
     $transaction->gateway = 'Authorize.Net';
     $html = '';
     $html .= '<form method="post" class="rsmembership_form" action="' . JRoute::_('index.php?option=com_rsmembership&task=thankyou') . '" onsubmit="return rsm_check_authorize(\'' . JRoute::_('index.php?option=com_rsmembership&plugin_task=authorize') . '\');">';
     $html .= '<fieldset>';
     $html .= '<legend>' . JText::_('RSM_AUTHORIZE_CARD_INFO') . '</legend>';
     $html .= '<table cellpadding="0" cellspacing="0" border="0" width="100%" class="rsmembership_form_table">';
     $html .= '<tr>';
     $html .= '<td height="40">' . $fields['cc_image'][0] . '</td>';
     $html .= '<td>' . $fields['cc_image'][1] . '</td>';
     $html .= '</tr>';
     $html .= '<tr>';
     $html .= '<td height="40">' . $fields['cc_number'][0] . '</td>';
     $html .= '<td>' . $fields['cc_number'][1] . ' ' . $fields['csc_number'][0] . ' ' . $fields['csc_number'][1] . ' <span id="rsm_whats_csc" onmouseover="rsm_tooltip.show(\'rsm_tooltip\');" onmouseout="rsm_tooltip.hide();">' . JText::_('RSM_AUTHORIZE_WHATS_CSC') . '</span></td>';
     $html .= '</tr>';
     $html .= '<tr>';
     $html .= '<td height="40">' . JText::_('RSM_AUTHORIZE_EXP_DATE') . '</td>';
     $html .= '<td>' . $fields['cc_exp_mm'][0] . ' ' . $fields['cc_exp_mm'][1] . ' ' . $fields['cc_exp_yy'][0] . ' ' . $fields['cc_exp_yy'][1] . '</td>';
     $html .= '</tr>';
     $html .= '<tr>';
     $html .= '<td height="40">' . $fields['cc_fname'][0] . '</td>';
     $html .= '<td>' . $fields['cc_fname'][1] . '</td>';
     $html .= '</tr>';
     $html .= '<tr>';
     $html .= '<td height="40">' . $fields['cc_lname'][0] . '</td>';
     $html .= '<td>' . $fields['cc_lname'][1] . '</td>';
     $html .= '</tr>';
     $html .= '<tr>';
     $html .= '<td height="40" colspan="2">' . JText::sprintf('RSM_AUTHORIZE_PRICE_DESC', RSMembershipHelper::getPriceFormat($transaction->price)) . '</td>';
     $html .= '</tr>';
     $html .= '</table>';
     $html .= '</fieldset>';
     $html .= '<input class="button" type="submit" id="rsm_pay_button" value="' . JText::_('RSM_AUTHORIZE_PAY_NOW') . '" />';
     $html .= JHTML::image('components/com_rsmembership/assets/images/load.gif', 'Loading', 'id="rsm_loading" style="display: none;"');
     $html .= '<input type="hidden" name="membership_id" id="membership_id" value="' . $membership->id . '" />';
     $html .= '<input type="hidden" name="option" value="com_rsmembership" />';
     $html .= '<input type="hidden" name="task" value="thankyou" />';
     $html .= '</form>';
     $html .= '<div id="rsm_response" class="rsm_response_error">';
     $html .= '</div>';
     $html .= '<div id="rsm_tooltip" style="display: none;">';
     if (RSMembershipHelper::isJ16()) {
         $html .= '<div>' . JText::_('RSM_AUTHORIZE_WHATS_CSC_DESC', true) . '</div><div align="center">' . JHTML::image('plugins/system/' . $this->joomla16prefix . 'rsmembershipauthorize/images/cc_csc.gif', 'CSC') . '</div>';
     }
     $html .= '</div>';
     $warning = JHTML::image('plugins/system/' . $this->joomla16prefix . 'rsmembershipauthorize/images/warning.png', 'Warning', array('id' => 'rsm_warning'));
     $html .= '<script type="text/javascript">';
     $html .= 'function rsm_get_error_message(code) {';
     $html .= 'if (code == 0) return \'' . $warning . ' ' . JText::_('RSM_AUTHORIZE_ERRORS', true) . '\';';
     $html .= '}';
     $html .= '</script>';
     return $html;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:67,代码来源:Copy+of+rsmembershipauthorize.php

示例8: date

                echo $this->cache->memberships[$params['membership_id']];
            }
            break;
    }
    ?>
			</td>
			<td width="1%" nowrap="nowrap"><?php 
    echo date(RSMembershipHelper::getConfig('date_format'), RSMembershipHelper::getCurrentDate($row->date));
    ?>
</td>
			<td width="1%" nowrap="nowrap"><?php 
    echo $this->escape($row->ip);
    ?>
</td>
			<td><?php 
    echo RSMembershipHelper::getPriceFormat($row->price, $row->currency);
    ?>
</td>
			<td><?php 
    echo strlen($row->coupon) == 0 ? '<em>' . JText::_('RSM_NO_COUPON') . '</em>' : $this->escape($row->coupon);
    ?>
</td>
			<td><?php 
    echo JText::_('RSM_TRANSACTION_STATUS_' . strtoupper($row->status));
    ?>
 <a href="<?php 
    echo JRoute::_('index.php?option=com_rsmembership&view=transactions&layout=log&cid=' . $row->id . '&tmpl=component');
    ?>
" class="modal" rel="{handler: 'iframe', size: {x: 660, y: 475}}"><?php 
    echo JText::_('RSM_TRANSACTION_VIEW_LOG');
    ?>
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:31,代码来源:default.php

示例9: strtoupper

        ?>
" >
	<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>
<?php 
        $k = $k == 1 ? 2 : 1;
        $i++;
    }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:31,代码来源:default_original.php

示例10: foreach

            if (!empty($params['extras'])) {
                foreach ($params['extras'] as $extra) {
                    echo $this->cache->extra_values[$extra] . '<br />';
                }
            }
            break;
        case 'renew':
            if (!empty($params['membership_id'])) {
                echo $this->cache->memberships[$params['membership_id']];
            }
            break;
    }
    ?>
				</td>
				<td class="text-right"><?php 
    echo $this->escape(RSMembershipHelper::getPriceFormat($row->price, $row->currency));
    ?>
</td>
				<td><?php 
    echo strlen($row->coupon) == 0 ? '<em>' . JText::_('COM_RSMEMBERSHIP_NO_COUPON') . '</em>' : $this->escape($row->coupon);
    ?>
</td>
				<td><?php 
    echo JText::_('COM_RSMEMBERSHIP_TRANSACTION_STATUS_' . strtoupper($row->status));
    ?>
 <a href="<?php 
    echo JRoute::_('index.php?option=com_rsmembership&view=transactions&layout=log&cid=' . $row->id . '&tmpl=component');
    ?>
" class="modal" rel="{handler: 'iframe', size: {x: 660, y: 475}}"><?php 
    echo JText::_('COM_RSMEMBERSHIP_TRANSACTION_VIEW_LOG');
    ?>
开发者ID:JozefAB,项目名称:qk,代码行数:31,代码来源:default.php

示例11: strlen

    case 'renew':
        if (!empty($params['membership_id'])) {
            echo $this->cache->memberships[$params['membership_id']];
        }
        break;
}
?>
		</td>
	</tr>
	<tr>
		<td width="200"><?php 
echo JText::_('COM_RSMEMBERSHIP_PRICE');
?>
</td>
		<td><?php 
echo $this->escape(RSMembershipHelper::getPriceFormat($this->item->transaction_data->price, $this->item->transaction_data->currency));
?>
</td>
	</tr>
	<tr>
		<td width="200"><?php 
echo JText::_('COM_RSMEMBERSHIP_MEMBERSHIP_COUPON');
?>
</td>
		<td><?php 
echo strlen($this->item->transaction_data->coupon) == 0 ? '<em>' . JText::_('COM_RSMEMBERSHIP_NO_COUPON') . '</em>' : $this->escape($this->item->transaction_data->coupon);
?>
</td>
	</tr>
	<tr>
		<td width="200"><?php 
开发者ID:JozefAB,项目名称:qk,代码行数:31,代码来源:edit_transaction_info.php

示例12: deny

 public static function deny($transaction_id, $force = false)
 {
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_rsmembership/tables');
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     // Load the transaction
     $query->select($db->qn('id'))->from($db->qn('#__rsmembership_transactions'))->where($db->qn('id') . '=' . $db->q($transaction_id));
     if (!$force) {
         $query->where($db->qn('status') . ' != ' . $db->q('denied'));
     }
     $db->setQuery($query);
     if ($id = $db->loadResult()) {
         $transaction = JTable::getInstance('Transaction', 'RSMembershipTable');
         $transaction->load($id);
     } else {
         return false;
     }
     // Set the transaction to 'denied'
     $updateTransaction = JTable::getInstance('Transaction', 'RSMembershipTable');
     $updateTransaction->save(array('id' => $transaction->id, 'status' => 'denied'));
     $params = RSMembershipHelper::parseParams($transaction->params);
     $membership_id = false;
     switch ($transaction->type) {
         case 'renew':
         case 'new':
             if (!empty($params['membership_id'])) {
                 $membership_id = $params['membership_id'];
             }
             break;
         case 'upgrade':
             if (!empty($params['to_id'])) {
                 $membership_id = $params['to_id'];
             }
             break;
         case 'addextra':
             if (!empty($params['id'])) {
                 $query->clear();
                 $query->select($db->qn('membership_id'))->from($db->qn('#__rsmembership_membership_subscribers'))->where($db->qn('id') . ' = ' . $db->q((int) $params['id']));
                 $db->setQuery($query);
                 $membership_id = $db->loadResult();
             }
             break;
     }
     // start sending emails
     if ($membership_id) {
         $query->clear();
         $query->select('*')->from($db->qn('#__rsmembership_memberships'))->where($db->qn('id') . ' = ' . $db->q((int) $membership_id) . ' AND ( ' . $db->qn('user_email_denied_subject') . ' != ' . $db->q('') . ' OR ' . $db->qn('admin_email_denied_subject') . ' != ' . $db->q('') . ' )');
         $db->setQuery($query);
         if ($membership = $db->loadObject()) {
             $jconfig = JFactory::getConfig();
             $membership->user_email_from_addr = $membership->user_email_use_global ? $jconfig->get('mailfrom') : $membership->user_email_from_addr;
             $membership->user_email_from = $membership->user_email_use_global ? $jconfig->get('fromname') : $membership->user_email_from;
             $userEmail = array('from' => '', 'fromName' => '', 'recipient' => '', 'subject' => '', 'body' => '', 'mode' => '', 'cc' => '', 'bcc' => '', 'attachments' => '', 'replyto' => '', 'replytoname' => '');
             $adminEmail = array('from' => '', 'fromName' => '', 'recipient' => '', 'subject' => '', 'body' => '', 'mode' => '', 'cc' => '', 'bcc' => '', 'attachments' => '', 'replyto' => '', 'replytoname' => '');
             // placeholders
             $user_data = unserialize($transaction->user_data);
             $user_email = $transaction->user_email;
             $replacements = array('{membership}' => $membership->name, '{email}' => $user_email, '{name}' => $user_data->name, '{username}' => isset($user_data->username) ? $user_data->username : '', '{price}' => RSMembershipHelper::getPriceFormat($transaction->price), '{coupon}' => $transaction->coupon, '{payment}' => $transaction->gateway, '{transaction_id}' => $transaction->id);
             $replace = array_keys($replacements);
             $with = array_values($replacements);
             $fields = RSMembership::getCustomFields();
             $membership_fields = RSMembership::getCustomMembershipFields($membership_id);
             $all_fields = array_merge($fields, $membership_fields);
             foreach ($all_fields as $field) {
                 $name = $field->name;
                 $replace[] = '{' . $name . '}';
                 $object = isset($user_data->fields[$name]) ? 'fields' : 'membership_fields';
                 if (isset($user_data->fields[$name]) || isset($user_data->membership_fields[$name])) {
                     $with[] = is_array($user_data->{$object}[$name]) ? implode("\n", $user_data->{$object}[$name]) : $user_data->{$object}[$name];
                 } else {
                     $with[] = '';
                 }
             }
             // user emails
             if (!empty($membership->user_email_from_addr) && $membership->user_email_denied_subject != '') {
                 // start sending emails
                 // from address
                 $userEmail['from'] = $membership->user_email_from_addr;
                 // from name
                 $userEmail['fromName'] = $membership->user_email_from;
                 // recipient
                 $userEmail['recipient'] = $user_email;
                 // user email
                 // subject
                 $userEmail['subject'] = str_replace($replace, $with, $membership->user_email_denied_subject);
                 // body
                 $userEmail['body'] = str_replace($replace, $with, $membership->user_email_denied_text);
                 // mode
                 $userEmail['mode'] = $membership->user_email_mode;
                 // cc
                 $userEmail['cc'] = null;
                 // bcc
                 $userEmail['bcc'] = null;
                 // attachments
                 $userEmail['attachments'] = null;
                 // reply to
                 $userEmail['replyto'] = $userEmail['from'];
                 // reply to name
                 $userEmail['replytoname'] = $userEmail['fromName'];
             }
//.........这里部分代码省略.........
开发者ID:JozefAB,项目名称:qk,代码行数:101,代码来源:rsmembership.php

示例13: getMembership

 function getMembership()
 {
     $cid = JRequest::getInt('cid');
     $row =& JTable::getInstance('RSMembership_Memberships', 'Table');
     $row->load($cid);
     if ($row->stock == -1) {
         $buy = '';
         JError::raiseWarning(500, JText::_('RSM_OUT_OF_STOCK'));
     }
     $row->extras = array();
     if (!empty($row->id)) {
         $row->extras = $this->_getList("SELECT * FROM `#__rsmembership_membership_extras` `me` LEFT JOIN `#__rsmembership_extras` `e` ON (`me`.`extra_id` = `e`.`id`) WHERE `me`.`membership_id`='" . (int) $row->id . "' AND `e`.`published`='1' ORDER BY `e`.`ordering`");
     }
     if ($row->use_trial_period) {
         $row->price = $row->trial_price;
     }
     $currency = RSMembershipHelper::getConfig('currency');
     // {price} placeholder
     $price = RSMembershipHelper::getPriceFormat($row->price);
     // {buy} placeholder
     $buy = '<input type="submit" class="button" value="' . JText::_('RSM_SUBSCRIBE') . '" name="Submit" />';
     // {extras} placeholder
     $extras = '';
     foreach ($row->extras as $extra) {
         $extras .= '<h3 class="rsm_extra_title">' . $extra->name . '</h3>';
         $extras .= $extra->description;
         $extras .= '<span class="rsm_clear"></span>';
         $extra_values = $this->_getExtraValues($extra->id);
         switch ($extra->type) {
             case 'dropdown':
                 $values = array();
                 $extras .= '<select name="rsmembership_extra[' . $extra->id . ']" class="rsm_extra">';
                 $extras .= '<option value="0">' . JText::_('RSM_PLEASE_SELECT_EXTRA') . '</option>';
                 foreach ($extra_values as $value) {
                     $value_price = RSMembershipHelper::getPriceFormat($value->price);
                     $extras .= '<option ' . ($value->checked ? 'selected="selected"' : '') . ' value="' . $value->id . '">' . $value->name . ' - ' . $value_price . '</option>';
                 }
                 $extras .= '</select>';
                 break;
             case 'radio':
                 $values = array();
                 foreach ($extra_values as $i => $value) {
                     $i++;
                     $value_price = RSMembershipHelper::getPriceFormat($value->price);
                     $extras .= '<input type="radio" ' . ($value->checked ? 'checked="checked"' : '') . ' value="' . $value->id . '" id="extras' . $value->id . '" name="rsmembership_extra[' . $extra->id . ']" class="rsm_extra" />';
                     $extras .= '<label for="extras' . $value->id . '" class="rsm_extra">' . $value->name . ' - ' . $value_price . '</label>';
                 }
                 break;
             case 'checkbox':
                 foreach ($extra_values as $i => $value) {
                     $i++;
                     $value_price = RSMembershipHelper::getPriceFormat($value->price);
                     $extras .= '<input type="checkbox" ' . ($value->checked ? 'checked="checked"' : '') . ' value="' . $value->id . '" id="extras' . $value->id . '" name="rsmembership_extra[' . $extra->id . '][]" class="rsm_extra" />';
                     $extras .= '<label for="extras' . $value->id . '" class="rsm_extra">' . $value->name . ' - ' . $value_price . '</label>';
                 }
                 break;
         }
         $extras .= '<span class="rsm_clear"></span>';
     }
     $replace = array('{price}', '{buy}', '{extras}', '{stock}');
     $with = array($price, $buy, $extras, $row->stock > -1 ? $row->stock : 0);
     $row->description = str_replace($replace, $with, $row->description);
     return $row;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:64,代码来源:membership.php

示例14: array

    $this->ordering->showRow($saveOrder, $row->ordering, array('context' => 'extravalues', 'pagination' => $this->pagination, 'listDirn' => $listDirn, 'i' => $i));
    ?>
					<td><?php 
    echo JHTML::_('grid.id', $i, $row->id);
    ?>
</td>
					<td><a href="<?php 
    echo JRoute::_('index.php?option=com_rsmembership&task=extravalue.edit&extra_id=' . $row->extra_id . '&id=' . $row->id);
    ?>
"><?php 
    echo $row->name != '' ? $this->escape($row->name) : JText::_('COM_RSMEMBERSHIP_NO_TITLE');
    ?>
</a></td>
					<td>
						<?php 
    echo RSMembershipHelper::getPriceFormat($this->escape($row->price));
    ?>
					</td>
					<td width="1%" nowrap="nowrap" align="center"><?php 
    echo JHtml::_('jgrid.published', $row->published, $i, 'extravalues.');
    ?>
</td>
				</tr>
			<?php 
    $k = 1 - $k;
}
?>
			<tfoot>
				<tr>
					<td colspan="6"><?php 
echo $this->pagination->getListFooter();
开发者ID:JozefAB,项目名称:qk,代码行数:31,代码来源:default.php

示例15: finalize

 function finalize($transaction_id)
 {
     $mainframe =& JFactory::getApplication();
     $option = 'com_rsmembership';
     $db = JFactory::getDBO();
     JTable::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_rsmembership' . DS . 'tables');
     // get transaction details
     $transaction =& JTable::getInstance('RSMembership_Transactions', 'Table');
     $transaction->load($transaction_id);
     if (!$transaction->params) {
         return false;
     }
     // get user details
     $user_data = unserialize($transaction->user_data);
     $user_email = $transaction->user_email;
     // get membership details
     $params = RSMembershipHelper::parseParams($transaction->params);
     $membership =& JTable::getInstance('RSMembership_Memberships', 'Table');
     $extras = '';
     switch ($transaction->type) {
         case 'new':
             $transaction->membership_id = $params['membership_id'];
             $membership->load($transaction->membership_id);
             $message = $membership->user_email_new_text;
             $subject = $membership->user_email_new_subject;
             $admin_message = $membership->admin_email_new_text;
             $admin_subject = $membership->admin_email_new_subject;
             $email_type = 'user_email_new';
             break;
         case 'upgrade':
             $transaction->membership_id = $params['to_id'];
             $membership->load($transaction->membership_id);
             $message = $membership->user_email_upgrade_text;
             $subject = $membership->user_email_upgrade_subject;
             $admin_message = $membership->admin_email_upgrade_text;
             $admin_subject = $membership->admin_email_upgrade_subject;
             $email_type = 'user_email_upgrade';
             break;
         case 'addextra':
             $transaction->membership_id = $params['membership_id'];
             $membership->load($transaction->membership_id);
             $message = $membership->user_email_addextra_text;
             $subject = $membership->user_email_addextra_subject;
             $admin_message = $membership->admin_email_addextra_text;
             $admin_subject = $membership->admin_email_addextra_subject;
             $email_type = 'user_email_addextra';
             break;
         case 'renew':
             $transaction->membership_id = $params['membership_id'];
             $membership->load($transaction->membership_id);
             $message = $membership->user_email_renew_text;
             $subject = $membership->user_email_renew_subject;
             $admin_message = $membership->admin_email_renew_text;
             $admin_subject = $membership->admin_email_renew_subject;
             $email_type = 'user_email_renew';
             break;
     }
     if (!empty($params['extras'])) {
         $db->setQuery("SELECT `name` FROM #__rsmembership_extra_values WHERE `id` IN (" . implode(',', $params['extras']) . ")");
         $extras = implode(', ', $db->loadResultArray());
     }
     $replace = array('{membership}', '{extras}', '{email}', '{name}', '{username}', '{continue}', '{price}');
     $with = array($membership->name, $extras, $user_email, $user_data->name, isset($user_data->username) ? $user_data->username : '', '<input class="button" type="button" onclick="location.href=\'' . (!empty($membership->redirect) ? $membership->redirect : JRoute::_('index.php?option=com_rsmembership')) . '\'" value="' . JText::_('RSM_CONTINUE') . '" />', RSMembershipHelper::getPriceFormat($transaction->price));
     $db->setQuery("SELECT * FROM #__rsmembership_fields WHERE published='1'");
     $fields = $db->loadObjectList();
     foreach ($fields as $field) {
         $name = $field->name;
         $replace[] = '{' . $name . '}';
         if (isset($user_data->fields[$name])) {
             $with[] = is_array($user_data->fields[$name]) ? implode("\n", $user_data->fields[$name]) : $user_data->fields[$name];
         } else {
             $with[] = '';
         }
     }
     $jconfig = JFactory::getConfig();
     $membership->user_email_from_addr = $membership->user_email_use_global ? $jconfig->getValue('config.mailfrom') : $membership->user_email_from_addr;
     $membership->user_email_from = $membership->user_email_use_global ? $jconfig->getValue('config.fromname') : $membership->user_email_from;
     // start sending emails
     // user emails
     if (!empty($membership->user_email_from_addr)) {
         $message = str_replace($replace, $with, $message);
         // from address
         $from = $membership->user_email_from_addr;
         // from name
         $fromName = $membership->user_email_from;
         // recipient
         $recipient = $user_email;
         // user email
         // subject
         $subject = str_replace($replace, $with, $subject);
         // body
         $body = $message;
         // mode
         $mode = $membership->user_email_mode;
         // cc
         $cc = null;
         // bcc
         $bcc = null;
         // attachments
         $db->setQuery("SELECT `path` FROM #__rsmembership_membership_attachments WHERE `membership_id`='" . $transaction->membership_id . "' AND `email_type`='" . $email_type . "' AND `published`='1' ORDER BY `ordering`");
//.........这里部分代码省略.........
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:101,代码来源:rsmembership.php


注:本文中的RSMembershipHelper::getPriceFormat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。