示例#1
0
 * @author        Open Source Excellence (R) {@link  http://www.opensource-excellence.com}
 * @author        Created on 15-Nov-2010
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 *
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *  @Copyright Copyright (C) 2010- Open Source Excellence (R)
 */
defined('_JEXEC') or die("Direct Access Not Allowed");
class oseMscViewMembers extends oseMscView
{
    function display($tpl = null)
    {
        $tmpl = JRequest::getVar('tmpl');
        if (empty($tmpl)) {
示例#2
0
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('OSE Membership™ Update Member Info.') . ' <small><small>[ ' . OSEMSCVERSION . ' ]</small></small>', 'logo');
     $doc = JFactory::getDocument();
     // init table
     $db =& JFactory::getDBO();
     // ACL Info;
     $tables = $db->getTableList();
     $jConfig = JFactory::getConfig();
     $this->checkFixTable();
     //$doc->addScript(JURI::root().'media/system/js/core.js');
     $com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
     oseHtml::script('media/system/js/core.js');
     oseHTML::initScript();
     oseHTML::script($com . '/ose/app.msg.js');
     oseHTML::script($com . '/ose/func.js');
     $com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
     $this->items = $this->get('Items');
     $this->modules = $this->get('Modules');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     parent::display($tpl);
 }
示例#3
0
 function display($tpl = null)
 {
     $tmpl = JRequest::getVar('tmpl');
     if (empty($tmpl)) {
         JRequest::setVar('tmpl', 'component');
     }
     $list = $this->get('Items');
     $this->assignRef('list', $list);
     oseHTML::initScript();
     $com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
     oseHTML::script($com . '/grid/SearchField.js');
     oseHTML::script($com . '/grid/expander.js');
     oseHTML::script($com . '/ose/app.msg.js');
     oseHTML::script($com . '/grid/limit.js');
     require_once OSEMSC_B_PATH . DS . 'helpers' . DS . "extLanguage.php";
     $OSESoftHelper = new OSESoftHelper();
     $footer = $OSESoftHelper->renderOSETM();
     $this->assignRef('footer', $footer);
     $preview_menus = $OSESoftHelper->getPreviewMenus();
     $this->assignRef('preview_menus', $preview_menus);
     $this->assignRef('OSESoftHelper', $OSESoftHelper);
     $title = JText::_('OSE Membership™ Orders Management');
     $this->assignRef('title', $title);
     parent::display($tpl);
 }
示例#4
0
 function sendToGroup($email, $group, $force2Send = false)
 {
     $db = oseDB::instance();
     $version = oseHTML::getJoomlaVersion();
     if (is_array($group)) {
         $group = implode(',', $group);
     }
     $where = array();
     if (!$force2Send) {
         $where[] = "`sendEmail` =1";
     }
     if ($version == '1.5') {
         $where[] = "`gid` IN ( {$group} )";
         $where = oseDB::implodeWhere($where);
         $query = " SELECT * FROM `#__users` AS u " . $where;
     } else {
         $where[] = "g.group_id IN ( {$group} )";
         $where = oseDB::implodeWhere($where);
         $query = " SELECT u.* FROM `#__users` AS u " . " INNER JOIN `#__user_usergroup_map` AS g ON g.user_id = u.id" . $where;
     }
     $db->setQuery($query);
     $objs = oseDB::loadList('obj');
     foreach ($objs as $obj) {
         self::sendEmail($email, $obj->email);
     }
     return true;
 }
示例#5
0
 function display($tpl = null)
 {
     $tmpl = JRequest::getVar('tmpl');
     if (empty($tmpl)) {
         JRequest::setVar('tmpl', 'component');
     }
     if (JOOMLA16 == false) {
         require_once OSEMSC_B_PATH . DS . 'helpers' . DS . "extLanguage.php";
         oseHTML::script(OSEMSC_F_URL . '/libraries/joomla.core.js', '1.5');
         $strings = oseJson::encode(oseText::jsStrings());
         $document = JFactory::getDocument();
         $document->addScriptDeclaration('(function(){var strings=' . $strings . ';Joomla.JText.load(strings)})()');
     }
     $com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
     oseHTML::initScript();
     oseHTML::script($com . '/ose/app.msg.js', '1.5');
     oseHTML::script(OSEMSC_F_URL . '/libraries/init.js', '1.5');
     require_once OSEMSC_B_PATH . DS . 'helpers' . DS . "extLanguage.php";
     $OSESoftHelper = new OSESoftHelper();
     $footer = $OSESoftHelper->renderOSETM();
     $this->assignRef('footer', $footer);
     $preview_menus = $OSESoftHelper->getPreviewMenus();
     $this->assignRef('preview_menus', $preview_menus);
     $this->assignRef('OSESoftHelper', $OSESoftHelper);
     $title = JText::_('OSE Membership™ Profile Management');
     $this->assignRef('title', $title);
     parent::display($tpl);
 }
示例#6
0
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('OSE Membership™ Reporter - Member List Export') . ' <small><small>Version ' . COMPONENTVER . '</small></small>', 'logo');
     $com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
     oseHTML::initScript();
     oseHTML::script($com . '/ose/app.msg.js');
     oseHTML::script($com . '/grid/limit.js');
     parent::display($tpl);
 }
示例#7
0
	function display($tpl = null) {
		$tpl = null;
		$config = oseMscConfig::getConfig('global', 'obj');
		$com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
		oseHTML::initScript();
		oseHTML::script($com . '/ose/app.msg.js', '1.5');
		oseHTML::script($com . '/grid/expander.js', '1.5');
		oseHTML::script(OSEMSC_F_URL . '/libraries/init.js', '1.5');
		oseHTML::stylesheet(OSEMSC_F_URL . '/assets/css/' . $config->frontend_style . '.css', (JOOMLA16) ? '1.6' : '1.5');
		$mainframe = JFactory::getApplication('SITE');
		$session = JFactory::getSession();
		$user = JFactory::getUser();
		if ($user->guest) {
			$ItemID = JRequest::getInt("Itemid");
			$return = base64_encode(str_replace("&amp;", "&", JRoute::_("index.php?option=com_osemsc&view=addons&Itemid=" . $ItemID)));
			if (JOOMLA16 == true) {
				$red = str_replace("&amp;", "&", JRoute::_("index.php?option=com_users&view=login&return=" . $return));
			} else {
				$red = str_replace("&amp;", "&", JRoute::_("index.php?option=com_user&view=login&return=" . $return));
			}
			$mainframe->redirect($red, "Please login first.");
		}
		$menu = &JSite::getMenu();
		$item = $menu->getActive();
		$addon_type = '';
		if (!empty($item)) {
			$params = &$menu->getParams($item->id);
			$addon_type = $params->get('addon_type');
		}
		$model = $this->getModel('addons');
		$items = array();
		switch ($addon_type) {
		case 'phoca':
			$items = $model->getAddonCats($addon_type);
			$link = 'index.php?option=com_phocadownload&view=category&id=';
			break;
		case 'roku':
			$items = $model->getAddonInfo($addon_type);
			$link = '';
			break;
		}
		$params = &$mainframe->getParams();
		$page_title = $params->get('page_title');
		$document = &JFactory::getDocument();
		$document->setTitle($params->get('page_title'));
		$this->assignRef('page_title', $page_title);
		$this->assignRef('addon_type', $addon_type);
		$this->assignRef('items', $items);
		$this->assignRef('link', $link);
		$this->prepareDocument();
		parent::display($tpl);
	}
示例#8
0
 public static function archive($msc_id, $member_id, $action)
 {
     $db = oseDB::instance();
     $date = oseHTML::getDateTime();
     $date = $db->Quote($date);
     $query = " INSERT INTO `#__osemsc_member_history` " . " (`msc_id`,`member_id`,`action`,`date`, `accumulated`) " . " VALUES " . " ({$msc_id},{$member_id},'{$action}',{$date}, '0') ";
     $db->setQuery($query);
     if (oseDB::query()) {
         return $db->insertid();
     } else {
         return false;
     }
 }
示例#9
0
 public static function loadAddon($obj, $type = null)
 {
     $path = null;
     if (empty($type)) {
         $type = $obj->type;
     }
     $path = oseMscMethods::getAddonPath("{$obj->name}.js", $type);
     if (JFile::exists(JPATH_SITE . DS . $path)) {
         if (!empty($obj->addon_name)) {
             oseHTML::script($path, '1.5');
         }
     }
 }
 function QuickpayOneOffPay($orderInfo, $params = array())
 {
     $pConfig = oseMscConfig::getConfig('payment', 'obj');
     $merchant = $pConfig->quickpay_merchant;
     $secret = $pConfig->quickpay_secret;
     $test_mode = $pConfig->quickpay_testmode;
     $cardtypelock = $pConfig->quickpay_cardtypelock;
     $autocapture = $pConfig->quickpay_autocapture;
     $autofee = $pConfig->quickpay_autofee;
     $lang = empty($pConfig->quickpay_lang) ? 'en' : $pConfig->quickpay_lang;
     $db = oseDB::instance();
     $member = oseRegistry::call('member');
     $member->instance($orderInfo->user_id);
     $payment = oseRegistry::call('payment');
     $paymentOrder = $payment->getInstance('Order');
     $billinginfo = $paymentOrder->getBillingInfo($orderInfo->user_id);
     $amount = $orderInfo->payment_price * 100;
     $currency = $orderInfo->payment_currency;
     $order_id = $orderInfo->order_id;
     $order_number = $orderInfo->order_number;
     $desc = self::generateDesc($order_id);
     $user =& JFactory::getUser($orderInfo->user_id);
     $order_id = sprintf("%04d", $order_id);
     $orderInfoParams = oseJson::decode($orderInfo->params);
     //$cancelUrl = JURI :: base()."index.php";
     $notifyUrl = JURI::base() . "components/com_osemsc/ipn/quickpay_notify.php";
     $returnUrl = urldecode(JROUTE::_(JURI::base() . "index.php?option=com_osemsc&view=thankyou&order_id=" . $orderInfo->order_id));
     $returnUrl = $returnUrl ? $returnUrl : JURI::base() . "index.php?option=com_osemsc&view=member&result=success&amount={$amount}&ordernumber={$order_number}";
     $date = oseHTML::getDateTime();
     $url = "https://secure.quickpay.dk/form/";
     $html['form'] = '<form action="' . $url . '" method="post">';
     // Construct variables for post
     $post_variables = array('protocol' => 5, 'msgtype' => 'authorize', 'merchant' => $merchant, 'language' => $lang, 'ordernumber' => $order_id, 'amount' => $amount, 'currency' => $currency, 'continueurl' => $returnUrl, 'continueurl' => $returnUrl, 'cancelurl' => $returnUrl, 'callbackurl' => $notifyUrl, 'autocapture' => $autocapture, 'autofee' => $autofee, 'cardtypelock' => $cardtypelock, 'description' => $desc, 'testmode' => $test_mode);
     $md5String = '';
     foreach ($post_variables as $name => $value) {
         $md5String .= $value;
     }
     $md5String .= $secret;
     $post_variables['md5check'] = md5($md5String);
     //print_r($post_variables);exit;
     $html['form'] .= '<input type="image" id="quickpay_image" name="cartImage" src="' . "components/com_osemsc/assets/images/checkout.png" . '" alt="' . JText::_('Click to pay with Quickpay') . '" />';
     // Process payment variables;
     $html['url'] = $url . "?";
     foreach ($post_variables as $name => $value) {
         $html['form'] .= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />';
         $html['url'] .= $name . "=" . urlencode($value) . "&";
     }
     $html['form'] .= '</form>';
     return $html;
 }
示例#11
0
  * @author        Open Source Excellence {@link 
http://www.opensource-excellence.co.uk}
  * @author        EasyJoomla {@link http://www.easy-joomla.org 
Easy-Joomla.org}
  * @author        SSRRN {@link http://www.ssrrn.com}
  * @author        Created on 15-Sep-2008
  * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
  *
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
示例#12
0
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('OSE Membership™ Reporter - Additional Info Export') . ' <small><small>Version ' . COMPONENTVER . '</small></small>', 'logo');
     $com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
     oseHTML::initScript();
     oseHTML::script($com . '/ose/app.msg.js');
     oseHTML::script($com . '/grid/limit.js');
     $model = $this->getModel();
     $columns = $model->getColumns();
     $store = $model->getStore();
     //$columns = trim($columns,"[");
     //$columns = trim($columns,"]");
     //print_r($columns);exit;
     //print_r($fields);exit;
     $redirectUrl = 'TEST';
     $document = JFactory::getDocument();
     $document->addScriptDeclaration('var column = ' . $columns . '; var store = ' . $store . ';');
     parent::display($tpl);
 }
示例#13
0
	function display($tpl = null) {
		$config = oseRegistry::call('msc')->getConfig('global', 'obj');
		$frontend_style = $config->frontend_style;
		$config = oseRegistry::call('msc')->getConfig('register', 'obj');
		if ($this->isMobile) {
			// Any mobile device.
			$this->setLayout('mobile');
			JRequest::setvar('tmpl', 'component');
		} else {
			$com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
			oseHTML::initScript();
			oseHTML::script($com . '/ose/app.msg.js', '1.5');
			oseHTML::script(OSEMSC_F_URL . '/libraries/init.js', '1.5');
			oseHTML::stylesheet(OSEMSC_F_URL . '/assets/css/' . $frontend_style . '.css', (JOOMLA16) ? '1.6' : '1.5');
		}
		$this->assignRef('enable_fblogin', $config->enable_fblogin);
		$this->assignRef('facebookapiid', $config->facebookapiid);
		$this->prepareDocument();
		parent::display($tpl);
	}
示例#14
0
	function display($tpl = null) {
		$tpl = null;
		$this->set('_layout', 'default');
		oseHTML::initCss();
		$com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
		oseHTML::initScript();
		oseHTML::script($com . '/ose/app.msg.js', '1.5');
		oseHTML::script($com . '/grid/expander.js', '1.5');
		oseHTML::script(OSEMSC_F_URL . '/libraries/init.js', '1.5');
		$config = oseMscConfig::getConfig('global', 'obj');
		oseHTML::stylesheet(OSEMSC_F_URL . '/assets/css/' . $config->frontend_style . '.css', (JOOMLA16) ? '1.6' : '1.5');
		$user = JFactory::getUser();
		$app = JFactory::getApplication('SITE');
		$session = JFactory::getSession();
		$db = oseDB::instance();
		$order_id = JRequest::getInt('order_id');
		$payment = oseRegistry::call('payment');
		$where = array();
		$where[] = "`order_id` = " . $db->quote($order_id);
		$order = $payment->getOrder($where, 'obj');
		$orderInfoParams = oseJson::decode($order->params);
		$redirectUrl = urldecode($orderInfoParams->returnUrl);
		$config = oseMscConfig::getConfig('thirdparty', 'obj');
		$account = oseObject::getValue($config, 'gag_account');
		$standard_type = oseObject::getValue($config, 'gag_domain_mode');
		$domain = oseObject::getValue($config, 'gag_domain');
		$htmlTrack = oseMscPublic::htmlTrack($account, $standard_type, $domain, $order_id);
		$code = oseMscPublic::ajaxOrderTrack($account, $order_id);
		if (empty($code)) {
			$code = false;
		} else {
			$code = implode("", $code);
		}
		$document = JFactory::getDocument();
		$document->addScriptDeclaration('var redirectUrl = "' . $redirectUrl . '";');
		$document->addScriptDeclaration($htmlTrack);
		$document->addScriptDeclaration($code);
		$this->assignRef('orderInfo', $order);
		$this->prepareDocument();
		parent::display($tpl);
	}
示例#15
0
	function display($tpl = null) {
		$user = oseMscPublic::getUser();
		$mainframe = JFactory::getApplication();
		$params = clone ($mainframe->getParams('com_osemsc'));
		$msc_id = $params->get('msc');
		$status = $params->get('status', 'all');
		if (empty($msc_id)) {
			$mainframe->redirect('index.php', 'Please choose a membership to show');
		}
		oseHTML::stylesheet(OSEMSC_F_URL . '/assets/css/msc5backend.css', '1.5');
		$com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
		oseHTML::script($com . '/grid/SearchField.js');
		$document = JFactory::getDocument();
		$document->addScriptDeclaration('var osememlist_msc_id = ' . $msc_id . '; var osememlist_status = \'' . $status . '\';');
		$this->prepareDocument();
		if (!empty($tpl)) {
			parent::display($tpl);
		} else {
			parent::display();
		}
	}
 function AlipayOneOffPay($orderInfo, $params = array())
 {
     $pConfig = oseMscConfig::getConfig('payment', 'obj');
     $alipay_partner = $pConfig->alipay_partner;
     $alipay_key = $pConfig->alipay_key;
     $seller_email = $pConfig->alipay_seller_email;
     $db = oseDB::instance();
     $member = oseRegistry::call('member');
     $member->instance($orderInfo->user_id);
     $payment = oseRegistry::call('payment');
     $paymentOrder = $payment->getInstance('Order');
     $billinginfo = $paymentOrder->getBillingInfo($orderInfo->user_id);
     $amount = $orderInfo->payment_price;
     $currency = $orderInfo->payment_currency;
     $order_id = $orderInfo->order_id;
     $order_number = $orderInfo->order_number;
     $desc = self::generateDesc($order_id);
     $user =& JFactory::getUser($orderInfo->user_id);
     $orderInfoParams = oseJson::decode($orderInfo->params);
     //$cancelUrl = JURI :: base()."index.php";
     $notifyUrl = JURI::base() . "components/com_osemsc/ipn/alipay_notify.php";
     $returnUrl = urldecode($orderInfoParams->returnUrl);
     $returnUrl = $returnUrl ? $returnUrl : JURI::base() . "index.php?option=com_osemsc&view=member&result=success&amount={$amount}&ordernumber={$order_number}";
     $date = oseHTML::getDateTime();
     $url = "https://mapi.alipay.com/gateway.do?";
     $html['form'] = '<form action="' . $url . '" method="post">';
     // Construct variables for post
     $variables = array('service' => 'create_direct_pay_by_user', 'payment_type' => 1, 'partner' => $alipay_partner, 'seller_email' => $seller_email, '_input_charset' => 'utf-8', 'notify_url' => $notifyUrl, 'return_url' => $returnUrl, 'out_trade_no' => $order_number, 'subject' => $desc, 'body' => $desc, 'total_fee' => $amount, 'sign_type' => 'MD5');
     $post_variables = $this->buildRequestPara($variables, $alipay_key);
     //print_r($post_variables);exit;
     $html['form'] .= '<input type="image" id="alipay_image" name="cartImage" src="' . "components/com_osemsc/assets/images/checkout.png" . '" alt="' . JText::_('Click to pay with Alipay') . '" />';
     // Process payment variables;
     $html['url'] = $url . "?";
     foreach ($post_variables as $name => $value) {
         $html['form'] .= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />';
         $html['url'] .= $name . "=" . urlencode($value) . "&";
     }
     $html['form'] .= '</form>';
     return $html;
 }
 function PayGateOneOffPay($orderInfo, $params = array())
 {
     $pConfig = oseMscConfig::getConfig('payment', 'obj');
     $paygate_id = $pConfig->paygate_id;
     $paygate_key = $pConfig->paygate_key;
     $db = oseDB::instance();
     $member = oseRegistry::call('member');
     $member->instance($orderInfo->user_id);
     $payment = oseRegistry::call('payment');
     $paymentOrder = $payment->getInstance('Order');
     $billinginfo = $paymentOrder->getBillingInfo($orderInfo->user_id);
     $amount = $orderInfo->payment_price * 100;
     $currency = $orderInfo->payment_currency;
     $order_id = $orderInfo->order_id;
     $order_number = $orderInfo->order_number;
     $desc = self::generateDesc($order_id);
     $currency = 'ZAR';
     $user =& JFactory::getUser($orderInfo->user_id);
     $orderInfoParams = oseJson::decode($orderInfo->params);
     //$cancelUrl = JURI :: base()."index.php";
     $notifyUrl = JURI::base() . "components/com_osemsc/ipn/paygate_notify.php";
     $returnUrl = urldecode($orderInfoParams->returnUrl);
     $returnUrl = $returnUrl ? $returnUrl : JURI::base() . "index.php?option=com_osemsc&view=member&result=success&amount={$amount}&ordernumber={$order_number}";
     $date = oseHTML::getDateTime();
     $CHECKSUM = md5("{$paygate_id}|{$order_number}|{$amount}|{$currency}|{$notifyUrl}|{$date}|{$user->email}|{$paygate_key}");
     $url = "https://www.paygate.co.za/paywebv2/process.trans";
     $html['form'] = '<form action="' . $url . '" method="post">';
     // Construct variables for post
     $post_variables = array('PAYGATE_ID' => $paygate_id, 'REFERENCE' => $order_number, 'AMOUNT' => $amount, 'CURRENCY' => $currency, 'RETURN_URL' => $notifyUrl, 'TRANSACTION_DATE' => $date, 'EMAIL' => $user->email, 'CHECKSUM' => $CHECKSUM);
     //print_r($post_variables);exit;
     $html['form'] .= '<input type="image" id="paygate_image" name="cartImage" src="' . "components/com_osemsc/assets/images/checkout.png" . '" alt="' . JText::_('Click to pay with PayGate') . '" />';
     // Process payment variables;
     $html['url'] = $url . "?";
     foreach ($post_variables as $name => $value) {
         $html['form'] .= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />';
         $html['url'] .= $name . "=" . urlencode($value) . "&";
     }
     $html['form'] .= '</form>';
     return $html;
 }
示例#18
0
	function display($tpl = null) {
		$tpl = null;
		$this->set('_layout', 'default');
		oseHTML::initCss();
		$com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
		oseHTML::initScript();
		oseHTML::script($com . '/ose/app.msg.js', '1.5');
		oseHTML::script($com . '/grid/expander.js', '1.5');
		oseHTML::script(OSEMSC_F_URL . '/libraries/init.js', '1.5');
		$config = oseMscConfig::getConfig('global', 'obj');
		oseHTML::stylesheet(OSEMSC_F_URL . '/assets/css/' . $config->frontend_style . '.css', (JOOMLA16) ? '1.6' : '1.5');
		$user = JFactory::getUser();
		$app = JFactory::getApplication('SITE');
		$session = JFactory::getSession();
		$db = oseDB::instance();
		$token = (isset($_REQUEST['token'])) ? urlencode($_REQUEST['token']) : "";
		$payment = oseRegistry::call('payment');
		$payment_mode = JRequest::getVar('mode');
		$orderID = JRequest::getInt('orderID');
		if (empty($orderID) || !is_numeric($orderID)) {
			echo "Order data is interrupted, payment process is terminated.";
		}
		if ($payment_mode == 'm') {
			$orderInfo = $payment->PaypalAPIPay($orderID, $token);
		} else {
			$orderInfo = $payment->PaypalAPICreateProfile($orderID, $token);
		}
		$where = array();
		$where[] = "`order_id` = " . $db->quote($orderID);
		$order = $payment->getOrder($where, 'obj');
		$orderInfoParams = oseJson::decode($order->params);
		$redirectUrl = urldecode($orderInfoParams->returnUrl);
		$document = JFactory::getDocument();
		$document->addScriptDeclaration('var redirectUrl = "' . $redirectUrl . '";');
		$this->assignRef('orderInfo', $orderInfo);
		$this->prepareDocument();
		parent::display($tpl);
	}
示例#19
0
	function display($tpl = null) {
		$model = $this->getModel('memberships');
		$items = $model->getMemberships();
		$session = JFactory::getSession();
		$osePaymentCurrency = $session->get('osePaymentCurrency', oseRegistry::call('msc')->getConfig('currency', 'obj')->primary_currency);
		$cards = array();
		$com = OSECPU_PATH_JS . '/com_ose_cpu/extjs';
		oseHTML::initScript();
		oseHTML::script($com . '/ose/app.msg.js', '1.5');
		oseHTML::script(OSEMSC_F_URL . '/libraries/init.js', '1.5');
		$register_form = oseRegistry::call('msc')->getConfig('register', 'obj')->register_form;
		$layout = JRequest::getCmd("layout");
		if (empty($register_form) || $register_form == 'default') {
			$layout = (!empty($layout) && ($layout == 'detail' || $layout == 'cartdetail')) ? "cartdetail" : 'cart';
			$this->setLayout($layout);
			$type = 'cart';
		} else {
			$layout = (!empty($layout) && ($layout == 'detail')) ? $layout : 'default';
			$this->setLayout($layout);
			$user = JFactory::getUser();
			$tpl = null;
			$type = 'os';
		}
		if ($layout == 'default' || $layout == 'cart') {
			$cards = $model->drawMscList($osePaymentCurrency, $items, $type);
		} else {
			foreach ($items as $item) {
				$msc_id = JRequest::getInt('msc_id', oseObject::getValue($item, 'id'));
				$cards = $model->getMembershipCard($msc_id);
				break;
			}
		}
		$config = oseMscConfig::getConfig('global', 'obj');
		oseHTML::stylesheet(OSEMSC_F_URL . '/assets/css/' . $config->frontend_style . '.css', (JOOMLA16) ? '1.6' : '1.5');
		$this->assignRef('cards', $cards);
		$this->prepareDocument();
		parent::display($tpl);
	}
示例#20
0
 function generateOrderItem($order_id, $entry_id, $params = array())
 {
     $db = oseDB::instance();
     //$payment= oseMscAddon :: getExtInfo($msc_id, 'payment', 'obj');
     //$params['payment_currency']=(!empty($payment->currency)) ? $payment->currency : "USD";
     $params['create_date'] = empty($params['create_date']) ? oseHTML::getDateTime() : $params['create_date'];
     $keys = array_keys($params);
     $keys = '`' . implode('`,`', $keys) . '`';
     $values = array();
     foreach ($params as $key => $value) {
         $values[$key] = $db->Quote($value);
     }
     $values = implode(',', $values);
     $query = " INSERT INTO `{$this->table}_item` " . " (`order_id`,`entry_id`,{$keys}) " . " VALUES " . " ('{$order_id}' , '{$entry_id}', {$values})";
     $db->setQuery($query);
     if (oseDB::query()) {
         $order_id = $db->insertid();
         //$orderParams= $this->autoOrderParams($params['payment_mode'], $params['params']);
         //$this->updateOrder($order_id, 'pending', array('params' => $orderParams, 'payment_mode' => $params['payment_mode']));
         return $order_id;
     } else {
         return false;
     }
 }
示例#21
0
	public static function save($params)
	{
		$now = oseHTML::getDateTime();
		
		$result = array();
		$result['success'] = true;
		
		if(empty($params['allow_work']))
		{
			$result['success'] = false;
			$result['title'] = 'Error';
			$result['content'] = JText::_("Error");
			return $result;
		}
		unset($params['allow_work']);
		
		if($params['join_from'] != 'payment')
		{
			$result['success'] = true;
			$result['title'] = 'Done';
			$result['content'] = JText::_("Done");
			return $result;
		}
		
		$post = JRequest::get('post');
		
		$member_id = $params['member_id'];
		
		$db = oseDB::instance();
		
		$user = JFactory::getUser();
		
		$query = " SELECT * FROM `#__oselic_cs_keys_view`" 
    			." WHERE user_id = {$member_id}"
    			;
    	$db->setQuery($query);
    	
    	$item = oseDB::loadItem('obj'); 
    	$company_id = $item->company_id;

		//oseExit($company);
    	
        $query = " SELECT eternal, expired_date FROM `#__osemsc_member`"
    		." WHERE member_id = {$member_id}"
    		;
    	$db->setQuery($query);
    	$obj = $db->loadObject();
    	
    	$publish_down = empty($obj->eternal)?$obj->expired_date:'0000-00-00 00:00:00';
    	
    	$query = " SELECT directory_id FROM `#__osemsc_directory`"
    			." WHERE company_id = {$company_id}"
    			;
    	$db->setQuery($query);
    	$directory_id = $db->loadResult();
    	
    	if (empty ($directory_id)) 
    	{
    		$query = " INSERT INTO `#__mt_links` (user_id,link_published,link_approved,link_created,publish_down) VALUES ('{$member_id}','1','1','{$now}', '$publish_down')";
    		$db->setQuery($query);
    		
    		if(!oseDB::query())
    		{
    			$result['success'] = false;
				$result['title'] = 'Error';
				$result['content'] = JText::_("Error");
				return $result;
    		}
    		
    		$newMtLinkID = $db->insertid();
    		
    		//Insert the image
                $query = " SELECT cf_id FROM `#__mt_customfields`"
                      ." WHERE caption = 'Image' AND field_type = 'image'";
            	$db->setQuery($query);
            	$cf_id = $db->loadResult();
            
            
           	 $query = " INSERT INTO `#__mt_cfvalues` (cf_id, link_id) VALUES ('{$cf_id}', '{$newMtLinkID}')";
           	 $db->setQuery($query);
            
           	 if(!oseDB::query())
           	 {
             	  	 $result['success'] = false;
              	  	 $result['title'] = 'Error';
               		 $result['content'] = JText::_("Error");
               		 return $result;
           	 }
            
           	 $query = " INSERT INTO `#__mt_cfvalues_att` (cf_id, link_id) VALUES ('{$cf_id}', '{$newMtLinkID}')";
          	  $db->setQuery($query);
            
          	  if(!oseDB::query())
           	 {
             		$result['success'] = false;
                	$result['title'] = 'Error';
                	$result['content'] = JText::_("Error");
                	return $result;
           	 }
            
    		
    		$query = " INSERT INTO `#__osemsc_directory` (company_id) VALUES ({$company_id})";
    		$db->setQuery($query);
    		
    		if(!oseDB::query())
    		{
    			$result['success'] = false;
				$result['title'] = 'Error';
				$result['content'] = JText::_("Error");
				return $result;
    		}
    		
    		$newDirID = $db->insertid();
    		
    		$query = " INSERT INTO `#__osemsc_mtrel` (link_id,directory_id) "
    				." VALUES ('{$newMtLinkID}','{$newDirID}')"
    				;
    		$db->setQuery($query);
    		
    		if(!oseDB::query())
    		{
    			$result['success'] = false;
				$result['title'] = 'Error';
				$result['content'] = JText::_("Error");
				return $result;
    		}
    		
			$result['success'] = true;
			$result['title'] = 'Done';
			$result['content'] = JText::_('Joined Directory.');
		} 
		else 
		{
			$result['success'] = true;
			$result['title'] = 'Done';
			$result['content'] = JText::_('Joined Directory.');
			
		}
		//echo $query;exit;
		
		return $result;
	}
示例#22
0
 public function initJs()
 {
     $result1 = $this->generateCountryStateData();
     $result2 = $this->generateMscIdOption();
     $result = array_merge($result1, $result2);
     $config = oseRegistry::call('msc')->getConfig('locale', 'obj');
     $jsonCountry = oseObject::getValue($config, 'default_country_json', false);
     if (!$jsonCountry) {
         $jsonCountry = oseJson::encode(array('code3' => 'USA', 'code2' => 'US'));
     } else {
         $jsonCountry = oseObject::getValue($config, 'default_country_json');
     }
     $js = oseHTML::getInstance('js');
     $js->append('oseMsc.defaultSelectedCountry=Ext.decode(\'' . $jsonCountry . '\');');
     $js->append('oseMsc.mscList = ' . oseJson::encode($result['mscList']) . ';');
     $js->append('oseMsc.mscOptions = ' . oseJson::encode($result['mscOptions']) . ';');
     $js->append('oseMsc.countryData = ' . oseJson::encode($result['country']) . ';');
     $js->append('oseMsc.stateData = ' . oseJson::encode($result['state']) . ';');
     $js->onReady();
     $js->wrap();
     return $js->toString();
 }
示例#23
0
  *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *  @Copyright Copyright (C) 2010- Open Source Excellence (R)
*/

defined('_JEXEC') or die("Direct Access Not Allowed");
$error_msg = "";
oseHTML::script(oseMscMethods::getJsModPath('reg','reg'),'1.5');
echo $this->initJs();
?>
<style type="text/css">
	.combo-left	{
		text-align: left
	}
</style>

<script type="text/javascript">
Ext.onReady(function(){
	var headerObjs = <?php echo oseJson::encode($this->registerOS_header);?>;
	var bodyObjs = <?php echo oseJson::encode($this->registerOS_body);?>;
	var footerObjs = <?php echo oseJson::encode($this->registerOS_footer);?>;

	var oseViewRegfp = oseMsc.reg.buildForm2c.buildForm(Ext.get('osemsc-reg').getWidth());
示例#24
0
 function getEmailVariablesReceipt($order_id, $user_id = null)
 {
     $db = oseDB::instance();
     $content = array();
     // get Order Info
     $payment = oseRegistry::call('payment');
     $where = array();
     $where[] = "order_id = {$order_id}";
     $orderInfo = $payment->getOrder($where, 'obj');
     $orderInfoParams = oseJson::decode($orderInfo->params);
     $paymentInfo = oseMscAddon::getExtInfo($orderInfo->entry_id, 'payment', 'obj');
     $member = oseRegistry::call('member');
     $member->instance($orderInfo->user_id);
     $userInfo = $member->getBillingInfo('obj');
     $userInfo->email = $userInfo->user_email;
     $orderInfo->subtotal = $orderInfoParams->subtotal;
     $orderInfo->total = $orderInfoParams->recurrence_times > 1 ? $orderInfoParams->next_total : $orderInfoParams->total;
     $orderInfo->discount = isset($orderInfoParams->discount) ? $orderInfoParams->discount : 0;
     $gw = $payment->getInstance('GateWay');
     $gwInfo = $gw->getGWInfo($orderInfo->payment_method);
     if (!empty($gwInfo)) {
         if ($gwInfo->is_cc) {
             $orderInfo->payment_method = 'Credit Card';
         }
     }
     $orderInfo->itemlist = $this->generateOrderTable($order_id, $orderInfo->user_id);
     if ($orderInfo->payment_mode == 'm') {
         $orderInfo->payment_mode = JText::_('Manual Billing');
         $orderInfo->gross_tax = oseObject::getValue($orderInfoParams, 'gross_tax', '0.00');
         if ($orderInfo->gross_tax > 0) {
             $orderInfo->vat_number = oseObject::getValue($orderInfoParams, 'vat_number');
         }
     } else {
         $orderInfo->payment_mode = JText::_('Automatic Billing');
         $params = oseJson::decode($orderInfo->params);
         $price = null;
         if (oseObject::getValue($orderInfoParams, 'has_trial', 0)) {
             if (oseObject::getValue($orderInfoParams, 'recurrence_times', 0) <= 1) {
                 $orderInfo->gross_tax = oseObject::getValue($orderInfoParams, 'gross_tax', '0.00');
             } else {
                 $orderInfo->gross_tax = oseObject::getValue($orderInfoParams, 'next_gross_tax', '0.00');
             }
         } else {
             if (oseObject::getValue($orderInfoParams, 'recurrence_times', 0) <= 2) {
                 $orderInfo->gross_tax = oseObject::getValue($orderInfoParams, 'gross_tax', '0.00');
             } else {
                 $orderInfo->gross_tax = oseObject::getValue($orderInfoParams, 'next_gross_tax', '0.00');
             }
         }
         $orderInfo->vat_number = oseObject::getValue($orderInfoParams, 'vat_number');
         $orderInfo->recurring_price = $orderInfo->payment_currency . ' ' . $orderInfoParams->next_total;
         $orderInfo->recurring_frequency = $orderInfoParams->p3 . ' ' . $orderInfoParams->t3;
     }
     $query = "SELECT entry_id FROM `#__osemsc_order_item` WHERE `order_id` = " . $order_id;
     $db->setQuery($query);
     $msc_id = $db->loadResult();
     $query = " SELECT *,DATE_SUB(`expired_date`,INTERVAL 1 DAY) AS `real_expired_date` " . " FROM `#__osemsc_member`" . " WHERE member_id = {$orderInfo->user_id} AND msc_id={$msc_id}";
     $db->setQuery($query);
     $memberInfo = oseDB::loadItem('obj');
     $query = "SELECT * FROM `#__osemsc_acl` WHERE `id` = {$msc_id}";
     $db->setQuery($query);
     $mscInfo = oseDB::loadItem('obj');
     $memberInfo->msc_title = $mscInfo->title;
     $memberInfo->msc_des = $mscInfo->description;
     $orderInfo->current_date = oseHTML::getDateTime();
     $globalConfig = oseRegistry::call('msc')->getConfig('global', 'obj');
     if (!empty($globalConfig->DateFormat)) {
         $memberInfo->start_date = date($globalConfig->DateFormat, strtotime($memberInfo->start_date));
         $orderInfo->create_date = date($globalConfig->DateFormat, strtotime($orderInfo->create_date));
         $orderInfo->current_date = date($globalConfig->DateFormat, strtotime($orderInfo->current_date));
     }
     $content['user'] = $userInfo;
     $content['order'] = $orderInfo;
     $content['profile'] = $member->getProfile();
     $content['member'] = $memberInfo;
     return $content;
 }
示例#25
0
	private static function activateInAutomaticMode($msc_id,$member_id,$orderInfo,$ext)
	{
		$db = oseDB::instance();
		
		$result = array();
		$result['success'] = true;
		
		
		$orderParams = oseJSON::decode($orderInfo->params);
		
		$start_date = oseHTML::getDateTime();
		$start_date = $db->Quote($start_date);
		
		$recurrence_num = $orderParams->p3;
		$recurrence_unit = $orderParams->t3;
		
		$expired_date = " DATE_ADD({$start_date},INTERVAL {$recurrence_num} {$recurrence_unit}) ";
		
		$query = " UPDATE `#__osemsc_member` "
				." SET  expired_date = {$expired_date}"
				." WHERE member_id = {$member_id} AND msc_id = {$msc_id} "
				;
		$db->setQuery($query);
		//oseExit($db->_sql);
		
		if(!oseDB::query())
		{
			$result['success'] = false;
			$result['title'] = 'Error';
			$result['content'] = JText::_(' Fail Updated Member\'s Recurrence ');
			
			return $result;
		}
		
		$query = " SELECT expired_date FROM `#__osemsc_member` "
				." WHERE member_id = {$member_id} AND msc_id = {$msc_id} "
				;
		$db->setQuery($query);
		$end_date = $db->loadResult();
		$end_date = $db->Quote($end_date);
		$expired_date = " DATE_ADD({$end_date},INTERVAL 1 DAY) ";
		
		if(oseObject::getValue($orderParams,'recurrence_times',0) > 1)
		{
			
		}
		else
		{
			$query = " UPDATE `#__osemsc_member` "
					." SET  expired_date = {$expired_date}"
					." WHERE member_id = {$member_id} AND msc_id = {$msc_id} "
					;
			$db->setQuery($query);
			//oseExit($db->_sql);
			
			if(!oseDB::query())
			{
				$result['success'] = false;
				$result['title'] = 'Error';
				$result['content'] = JText::_(' Fail Updated Member\'s Recurrence ');
				
				return $result;
			}
		}
			
		
		return $result;
	}
示例#26
0
 function display($tpl = null)
 {
     oseHTML::stylesheet(OSEMSC_B_URL . '/assets/css/msc5.css', '1.5');
     oseHTML::initCss();
     parent::display($tpl);
 }
 function BeanStreamCreateProfile($orderInfo, $credit_info, $params = array())
 {
     $updated = $this->BeanStreamOneOffPay($orderInfo, $credit_info, true, $params);
     //$updated = array();$updated['success'] = true;
     if ($updated['success']) {
         if (isset($updated['orderInfo'])) {
             $orderInfo = $updated['orderInfo'];
             unset($updated['orderInfo']);
         }
         $config = oseMscConfig::getConfig('', 'obj');
         $pConfig = $config;
         //oseRegistry::call('msc')->getConfig('payment', 'obj');
         $user =& JFactory::getUser($orderInfo->user_id);
         $app =& JFactory::getApplication();
         $Itemid = $this->getItemid();
         $merchant_id = $pConfig->beanstream_merchant_id;
         $username = $pConfig->beanstream_username;
         $password = $pConfig->beanstream_password;
         if (empty($merchant_id)) {
             return self::getErrorMessage('cc', '0001', null);
         }
         //require_once(OSEMSC_B_LIB.DS.'beanstreamsoap.php');
         $result = array();
         $db = oseDB::instance();
         $user_id = $orderInfo->user_id;
         $msc_id = $orderInfo->entry_id;
         $order_id = $orderInfo->order_id;
         $order_number = $orderInfo->order_number;
         $orderInfoParams = oseJson::decode($orderInfo->params);
         $desc = $this->generateDesc($order_id);
         $billingInfo = $this->getBillingInfo($orderInfo->user_id);
         $taxRate = isset($orderInfoParams->tax_rate) ? $orderInfoParams->tax_rate : 0;
         $currency = $orderInfo->payment_currency;
         $user =& JFactory::getUser($orderInfo->user_id);
         $amount = $orderInfoParams->next_total;
         if (empty($amount)) {
             return self::getErrorMessage('cc', '0002', null);
         }
         $postVar = array();
         /* $totalAmount in cents, as required by ePay:
         			The total amount in cents for the transaction, eg $1.00 = 100
         			*/
         // General
         $postVar['requestType'] = 'BACKEND';
         $postVar['merchant_id'] = $merchant_id;
         $postVar['username'] = $username;
         $postVar['password'] = $password;
         $postVar['trnAmount'] = $amount;
         $postVar['trnOrderNumber'] = substr($order_number, 0, 20);
         $postVar['trnType'] = 'P';
         $postVar['trnRecurring'] = 1;
         $postVar['paymentMethod'] = 'CC';
         $postVar['ref1'] = $order_id;
         $postVar['ref2'] = $orderInfoParams->timestamp;
         //$postVar['adjId']= $amount;
         // Card Info
         $postVar['trnCardOwner'] = $credit_info["creditcard_name"];
         $postVar['trnCardNumber'] = $credit_info["creditcard_number"];
         $postVar['trnExpMonth'] = substr($credit_info["creditcard_month"], -2);
         $postVar['trnExpYear'] = substr($credit_info["creditcard_year"], -2);
         $postVar['trnCardCvd'] = $credit_info["creditcard_cvv"];
         // Billing
         $postVar['ordName'] = $billingInfo->firstname . ' ' . $billingInfo->lastname;
         $postVar['ordEmailAddress'] = $billingInfo->email;
         $postVar['ordPhoneNumber'] = $billingInfo->telephone;
         $postVar['ordAddress1'] = $billingInfo->addr1;
         $postVar['ordCity'] = $billingInfo->city;
         $postVar['ordProvince'] = $billingInfo->state;
         $postVar['ordPostalCode'] = $billingInfo->postcode;
         $postVar['ordCountry'] = $billingInfo->country;
         // Recurring
         $curDate = oseHTML::getDateTime();
         /*
         			if($orderInfoParams->has_trial)
                     {
                     	$dateAdd = '+
         '.$orderInfoParams->p1.''.$orderInfoParams->t1;
                     	$startDate = strtotime($dateAdd,strtotime($curDate));
                     	$startDate = date('mdY',$startDate);
                     }
                     else
                     {
                     	$dateAdd = '+
         '.$orderInfoParams->p3.''.$orderInfoParams->t3;
                     	$startDate = strtotime($dateAdd,strtotime($curDate));
                     	$startDate = date('mdY',$startDate);
         
         }
         */
         if ($orderInfoParams->has_trial) {
             $nT1 = $this->BeanStreamTransInterval($orderInfoParams->t1);
             $query = " SELECT DATE_ADD('{$curDate}',INTERVAL {$orderInfoParams->p1} {$orderInfoParams->t1})";
         } else {
             $nT3 = $this->BeanStreamTransInterval($orderInfoParams->t3);
             $query = " SELECT DATE_ADD('{$curDate}',INTERVAL {$orderInfoParams->p3} {$orderInfoParams->t3})";
         }
         $db->setQuery($query);
         $date = new DateTime($db->loadResult());
         $startDate = $date->format("mdY");
         $postVar['rbCharge'] = 0;
         $postVar['rbFirstBilling'] = $startDate;
         $postVar['rbBillingPeriod'] = $this->BeanStreamTransInterval($orderInfoParams->t3);
         $postVar['rbBillingIncrement'] = $orderInfoParams->p3;
         // URL
         $postVar['errorPage'] = urlencode(JURI::root());
         $postVar['approvedPage'] = urlencode(JURI::root());
         $postVar['declinedPage'] = urlencode(JURI::root());
         $hostname = 'www.beanstream.com';
         $workstring = http_build_query($postVar);
         $uri = "/scripts/process_transaction.asp";
         require_once OSEMSC_B_LIB . DS . 'class.connection.php';
         $res = OSECONNECTOR::send_request_via_fsockopen($hostname, $uri, $workstring, 'urlencoded');
         $res = stristr($res, "\r\n\r\n");
         $res = trim($res);
         $post = array();
         parse_str($res, $post);
         if ($post['trnApproved']) {
             $updataParams = array();
             $updataParams['payment_serial_number'] = $post['rbAccountId'];
             //$updataParams['beanstream_rbAccountId'] = $post['rbAccountId'];
             $orderInfoParams->oneoff_transactionid = $orderInfo->payment_serial_number;
             $updataParams['params'] = oseJson::encode($orderInfoParams);
             $result = $this->updateOrder($order_id, 'confirmed', $updataParams);
             return $updated;
             //$this->confirmOrder($order_id,$updataParams);
         } else {
             return self::getErrorMessage('cc', '0000', JText::_('Joined Membership, but subscription fails creating. Error: ' . $post['messageText']));
         }
     } else {
         return $updated;
     }
 }
示例#28
0
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *  @Copyright Copyright (C) 2010- Open Source Excellence (R)
*/
defined('_JEXEC') or die("Direct Access Not Allowed");
oseHTML::script("administrator/" . OSEMSCFOLDER . "/views/addons/js/js.addons.simple.js", '1.5');
?>
<div id="oseheader">
	<div class="container">
		<div class="logo-labels">
			<h1>
				<a href="http://www.opensource-excellence.com" target="_blank"><?php 
echo JText::_("Open Source Excellence");
?>
				</a>
			</h1>
			<?php 
echo $this->preview_menus;
?>
		</div>
		<?php 
示例#29
0
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *  @Copyright Copyright (C) 2010- Open Source Excellence (R)
*/
defined('_JEXEC') or die('Restricted access');
oseHTML::script("administrator/components/com_osereporter/views/memlist/js/ext.memlist.js", '1.6');
?>
<script type="text/javascript">
Ext.onReady(function(){
	Ext.QuickTips.init();

	oseReporter.panel = new Ext.Panel({
		//activeItem: 0
		renderTo: 'ose-reporter'
		,width: Ext.get('ose-reporter').getWidth() - 15
		,items:	oseReporter.Memlistgrid
	});
});
</script>
<div id="ose-reporter" class="com-content"></div>
示例#30
0
	function generateOrder($member_id, $payment_method, $orderPaymentInfo) {
		return oseRegistry::call('msc')->runAddonAction('register.payment.save', array('member_id' => $member_id, 'payment_method' => $payment_method), true, false);
		$result = array();
		if (empty($member_id)) {
			$result['success'] = false;
			$result['title'] = 'Error';
			$result['content'] = JText::_('Error');
			return $result;
		}
		$paymentOrder = oseRegistry::call('payment')->getInstance('Order');
		$params = array();
		$items = $orderPaymentInfo['items'];
		unset($orderPaymentInfo['items']);
		$order_number = $paymentOrder->generateOrderNumber($member_id);
		$orderPaymentInfo['order_number'] = $order_number;
		$orderPaymentInfo['entry_type'] = 'msc_list';
		$orderPaymentInfo['create_date'] = oseHTML::getDateTime();//date("Y-m-d H:i:s");
		$orderPaymentInfo['payment_serial_number'] = substr($orderPaymentInfo['order_number'], 0, 20);
		$orderPaymentInfo['payment_method'] = 'system';
		$orderPaymentInfo['payment_from'] = 'system_admin';
		$orderPaymentInfo['payment_mode'] = 'm';
		oseObject::setParams($orderPaymentInfo, array('time_stamp' => uniqid("{$member_id}_", true)));
		// Extra Order Params Updating Function
		$list = oseMscAddon::getAddonList('register_order', true, 1, 'obj');
		foreach ($list as $addon) {
			$action_name = 'register_order.' . $addon->name . '.add';
			//echo $action_name;
			$params = oseMscAddon::runAction($action_name, $orderPaymentInfo['params'], true, false);
		}
		// generate Order
		$updated = $paymentOrder->generateOrder('', $member_id, $orderPaymentInfo);
		if (!$updated) {
			$result['success'] = false;
			$result['title'] = 'Error';
			$result['content'] = JText::_('Error');
			return $result;
		}
		// generate orer item
		// in the backend, only manual payment
		$order_id = $result['order_id'] = $updated;
		$payment_mode = 'm';
		foreach ($items as $item) {
			$itemParams = array();
			$entry_type = oseObject::getValue($item, 'entry_type');
			switch ($entry_type) {
			case ('license'):
				$license_id = oseObject::getValue($item, 'entry_id');
				$license = oseRegistry::call('lic')->getInstance(0);
				$licenseInfo = $license->getKeyInfo($license_id, 'obj');
				$licenseInfoParams = oseJson::decode($licenseInfo->params);
				$msc_id = $licenseInfoParams->msc_id;
				break;
			case ('msc'):
				$msc_id = oseObject::getValue($item, 'entry_id');
				break;
			}
			$msc_option = oseObject::getValue($item, 'msc_option');
			if (oseObject::getValue($item, 'eternal')) {
				$itemParams['payment_mode'] = 'm';
			} else {
				$itemParams['payment_mode'] = 'm';
			}
			$price = oseObject::getValue($item, 'a3');
			if ($payment_mode == 'a') {
				if (oseObject::getValue($item, 'has_trial')) {
					$price = oseObject::getValue($item, 'a1');
				}
			}
			$itemParams['entry_type'] = oseObject::getValue($item, 'entry_type');
			$itemParams['payment_price'] = 0;//oseObject::getValue($item,'first_raw_price');
			$itemParams['payment_currency'] = $orderPaymentInfo['payment_currency'];
			$itemParams['create_date'] = oseHTML::getDateTime();//date("Y-m-d H:i:s");
			$price_params = $paymentOrder->generateOrderParams($msc_id, $price, $payment_mode, $msc_option);
			$price_params['start_date'] = oseObject::getValue($item, 'start_date', null);
			$price_params['expired_date'] = oseObject::getValue($item, 'expired_date', null);
			$itemParams['params'] = oseJSON::encode($price_params);
			$paymentInfos = oseMscAddon::getExtInfo($msc_id, 'payment', 'obj');
			$paymentInfo = oseObject::getValue($paymentInfos, $msc_option);
			$updated = $paymentOrder->generateOrderItem($order_id, oseObject::getValue($item, 'entry_id'), $itemParams);
		}
		if ($updated) {
			$result['success'] = true;
			$result['title'] = JText::_('Done');
			$result['content'] = JText::_('Done');
		} else {
			$result['success'] = false;
			$result['title'] = 'Error';
			$result['content'] = JText::_('Order Generate Error');
		}
		return $result;
	}