コード例 #1
0
ファイル: default.php プロジェクト: vstorm83/propertease
<?php

/**
 * @version        1.6.3
 * @package        Joomla
 * @subpackage     OS Membership
 * @author         Tuan Pham Ngoc
 * @copyright      Copyright (C) 2011 - 2013 Ossolution Team
 * @license        GNU/GPL, see LICENSE.php
 */
defined('_JEXEC') or die;
if (count($items)) {
    ?>
		
<div id="osm-plans-list-default" class="row-fluid osm-container">
	<h3 class="osm-page-heading"><?php 
    echo JText::_('OSM_SUBSCRIPTION_PLANS');
    ?>
</h3>	
	<?php 
    echo OSMembershipHelperHtml::loadCommonLayout('common/default_plans.php', array('items' => $items, 'config' => $config, 'Itemid' => $Itemid, 'categoryId' => 0));
    ?>
</div>    
    <?php 
}
コード例 #2
0
ファイル: helper.php プロジェクト: vstorm83/propertease
 /**
  * Get detail information of the subscription
  *
  * @param object $config
  * @param object $row
  *
  * @return string
  */
 public static function getEmailContent($config, $row, $toAdmin = false)
 {
     $db = JFactory::getDbo();
     $sql = 'SELECT lifetime_membership, title FROM #__osmembership_plans WHERE id=' . $row->plan_id;
     $db->setQuery($sql);
     $plan = $db->loadObject();
     $data = array();
     $data['planTitle'] = $plan->title;
     $data['lifetimeMembership'] = $plan->lifetime_membership;
     $data['config'] = $config;
     $data['row'] = $row;
     $data['toAdmin'] = $toAdmin;
     if ($row->payment_method == 'os_creditcard') {
         $cardNumber = JRequest::getVar('x_card_num', '');
         $last4Digits = substr($cardNumber, strlen($cardNumber) - 4);
         $data['last4Digits'] = $last4Digits;
     }
     if ($row->user_id) {
         $sql = 'SELECT username FROM #__users WHERE id=' . $row->user_id;
         $db->setQuery($sql);
         $username = $db->loadResult();
         $data['username'] = $username;
     }
     if ($row->username && $row->user_password) {
         $data['username'] = $row->username;
         //Password
         $privateKey = md5(JFactory::getConfig()->get('secret'));
         $key = new JCryptKey('simple', $privateKey, $privateKey);
         $crypt = new JCrypt(new JCryptCipherSimple(), $key);
         $data['password'] = $crypt->decrypt($row->user_password);
     }
     $rowFields = OSMembershipHelper::getProfileFields($row->plan_id);
     $formData = OSMembershipHelper::getProfileData($row, $row->plan_id, $rowFields);
     $form = new RADForm($rowFields);
     $form->setData($formData)->bindData();
     $data['form'] = $form;
     return OSMembershipHelperHtml::loadCommonLayout(JPATH_ROOT . '/components/com_osmembership/emailtemplates/email.php', $data);
 }
コード例 #3
0
ファイル: columns.php プロジェクト: vstorm83/propertease
 * @version        1.6.8
 * @package        Joomla
 * @subpackage     Membership Pro
 * @author         Tuan Pham Ngoc
 * @copyright      Copyright (C) 2012 - 2014 Ossolution Team
 * @license        GNU/GPL, see LICENSE.php
 */
defined('_JEXEC') or die;
if (count($this->items)) {
    ?>
<div id="osm-plans-list-columns" class="row-fluid osm-container">
	<h1 class="osm-page-title"><?php 
    echo JText::_('OSM_SUBSCRIPTION_PLANS');
    ?>
</h1>
	<?php 
    echo OSMembershipHelperHtml::loadCommonLayout('common/columns_plans.php', array('items' => $this->items, 'config' => $this->config, 'Itemid' => $this->Itemid, 'categoryId' => $this->categoryId));
    if ($this->pagination->total > $this->pagination->limit) {
        ?>
	        <div class="pagination">
	            <?php 
        echo $this->pagination->getPagesLinks();
        ?>
	        </div>
		<?php 
    }
    ?>
	
</div>
<?php 
}
コード例 #4
0
 /**
  * Replace callback function
  *
  * @param array $matches
  */
 function displayPlans($matches)
 {
     require_once JPATH_ROOT . '/components/com_osmembership/libraries/rad/bootstrap.php';
     //OS Framework
     require_once JPATH_ROOT . '/administrator/components/com_osmembership/libraries/defines.php';
     require_once JPATH_ROOT . '/administrator/components/com_osmembership/libraries/inflector.php';
     require_once JPATH_ROOT . '/administrator/components/com_osmembership/libraries/autoload.php';
     $document = JFactory::getDocument();
     $user = JFactory::getUser();
     $db = JFactory::getDBO();
     $config = OSMembershipHelper::getConfig();
     if (@$config->load_jquery !== '0') {
         OSMembershipHelper::loadJQuery();
     }
     OSMembershipHelper::loadBootstrap(true);
     JHtml::_('script', OSMembershipHelper::getSiteUrl() . 'components/com_osmembership/assets/js/jquery-noconflict.js', false, false);
     OSMembershipHelper::loadLanguage();
     $styleUrl = JURI::base(true) . '/components/com_osmembership/assets/css/style.css';
     $document->addStylesheet($styleUrl, 'text/css', null, null);
     OSMembershipHelper::loadBootstrap(false);
     $Itemid = OSMembershipHelper::getItemid();
     $planIds = $matches[1];
     $fieldSuffix = OSMembershipHelper::getFieldSuffix();
     $layout = $this->params->get('layout_type', 'default');
     if ($planIds == '*') {
         $sql = 'SELECT a.*, a.title' . $fieldSuffix . ' AS title, a.description' . $fieldSuffix . ' AS description, a.short_description' . $fieldSuffix . ' AS short_description  FROM #__osmembership_plans AS a WHERE a.published = 1 ORDER BY a.ordering';
     } elseif (strpos($planIds, 'cat-') !== false) {
         $catId = (int) substr($planIds, 4);
         $sql = 'SELECT a.*, a.title' . $fieldSuffix . ' AS title, a.description' . $fieldSuffix . ' AS description, a.short_description' . $fieldSuffix . ' AS short_description  FROM #__osmembership_plans AS a WHERE a.published = 1 AND a.category_id=' . $catId . ' ORDER BY a.ordering';
     } else {
         $sql = 'SELECT a.*, a.title' . $fieldSuffix . ' AS title, a.description' . $fieldSuffix . ' AS description, a.short_description' . $fieldSuffix . ' AS short_description  FROM #__osmembership_plans AS a WHERE a.published = 1 AND a.id IN (' . $planIds . ') ORDER BY a.ordering';
     }
     $db->setQuery($sql);
     $rows = $db->loadObjectList();
     if ($user->id) {
         for ($i = 0, $n = count($rows); $i < $n; $i++) {
             $row = $rows[$i];
             $taxRate = OSMembershipHelper::calculateTaxRate($row->id);
             if ($config->show_price_including_tax && $taxRate > 0) {
                 $row->price = $row->price * (1 + $taxRate / 100);
                 $row->trial_amount = $row->trial_amount * (1 + $taxRate / 100);
             }
             if (!$row->enable_renewal) {
                 $sql = 'SELECT COUNT(*) FROM #__osmembership_subscribers WHERE (email="' . $user->email . '" OR user_id=' . $user->id . ') AND plan_id=' . $row->id . ' AND published != 0 ';
                 $db->setQuery($sql);
                 $total = (int) $db->loadResult();
                 if ($total) {
                     $row->disable_subscribe = 1;
                 }
             }
         }
     } elseif ($config->show_price_including_tax) {
         for ($i = 0, $n = count($rows); $i < $n; $i++) {
             $row = $rows[$i];
             $taxRate = OSMembershipHelper::getPlanTaxRate($row->id);
             if ($taxRate > 0) {
                 $row->price = $row->price * (1 + $taxRate / 100);
                 $row->trial_amount = $row->trial_amount * (1 + $taxRate / 100);
             }
         }
     }
     if ($layout == 'default') {
         return '<div class="osm-container row-fluid clearfix">' . OSMembershipHelperHtml::loadCommonLayout('common/default_plans.php', array('items' => $rows, 'config' => $config, 'Itemid' => $Itemid)) . '</div>';
     } else {
         return '<div class="osm-container row-fluid clearfix">' . OSMembershipHelperHtml::loadCommonLayout('common/columns_plans.php', array('items' => $rows, 'config' => $config, 'Itemid' => $Itemid)) . '</div>';
     }
 }