Beispiel #1
0
 function calculateAmount()
 {
     $paid_amount = 0;
     foreach (DT_Session::get('register.User') as $key => $user) {
         if ($key === 'process') {
             continue;
         }
         if (isset($user['fee']['paying_amount'])) {
             $paid_amount += $user['fee']['paying_amount'];
         }
     }
     $this->amount = $paid_amount;
 }
 function __construct($config = array())
 {
     $this->addModelPath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'models');
     parent::__construct($config);
     if (isset($config['task_map'])) {
         foreach ($config['task_map'] as $task => $map) {
             $this->registerTask($task, $map);
         }
     }
     $view =& $this->getView($this->name, 'html');
     $this->getModel('payoption');
     $this->config = $this->getModel('config');
     $this->config->setGlobal();
     global $sign_up_redirect, $Itemid, $private_event_notification, $private_event_redirect;
     if ($private_event_notification == 'redirect') {
         $sign_up_redirect = $private_event_redirect;
     } else {
         $sign_up_redirect = "index.php?option=com_dtregister&controller=content&Itemid={$Itemid}&task=sign_up";
     }
     $view->setModel($this->getModel('dtregister'), false);
     $view->setModel($this->getModel('config'), false);
     $view->setModel($this->getModel('Currency'), false);
     $view->setModel($this->getModel('jomsocial'), false);
     $view->setModel($this->getModel('cbprofiler'), false);
     $view->setModel($this->getModel('buttoncolor'), false);
     $view->setModel($this->getModel('dateformat'), false);
     $view->setModel($this->getModel('paymentmethod'), false);
     $view->setModel($this->getModel('cardtype'), false);
     $view->setModel($this->getModel('paylater'), false);
     $view->setModel($this->getModel('country'), false);
     $view->setModel($this->getModel('barcode'), false);
     $view->setModel($this->getModel('aro'), false);
     $view->setModel($this->getModel('permission'), false);
     $view->setModel($this->getModel('aco'), false);
     $this->getModel('field');
     $eventId = DT_Session::get('register.Event.eventId');
     if ($this->checkpermission() === false) {
         JRequest::setVar('task', 'auth');
     } elseif ($eventId) {
         $evtTable = $this->getModel('event')->table;
         $evtTable->load($eventId);
         $user =& JFactory::getUser();
         if ($evtTable->title !== "") {
             if ((!($evtTable->TableCategory->access <= $user->get('aid')) || $evtTable->TableCategory->published == 0) && $evtTable->TableCategory->categoryId > 0) {
                 JRequest::setVar('task', 'auth');
             }
         }
     }
 }
Beispiel #3
0
 function discountcode()
 {
     //$userIndex = DT_Session::get('register.Setting.current.userIndex');
     $eventId = JRequest::getVar('eventId', DT_Session::get('register.Event.eventId'));
     $event =& DtrTable::getInstance('Event', 'Table');
     $event->load($eventId);
     $error = true;
     if (isset($_REQUEST['discount_code']) && $_REQUEST['discount_code'] != "") {
         $discount_code_id = $event->validate_code($_REQUEST['discount_code']);
         if ($discount_code_id !== false) {
             $error = false;
             // DT_Session::set('register.User.'.$userIndex.'.discount_code_id', $discount_code_id );
         } else {
             // DT_Session::set('register.User.'.$userIndex.'.discount_code_id', false );
             $error = true;
             $this->view->assign('discountCodeError', $event->TableEventdiscountcode->TableDiscountcode->error);
             $event->TableEventdiscountcode->TableDiscountcode->error;
         }
     }
     ///ob_clean();
     echo $error ? 'false' : 'true';
     die;
 }
Beispiel #4
0
 function viewUserField()
 {
     require_once JPATH_SITE . "/components/com_dtregister/views/field/view.html.php";
     $fieldView = new DtregisterViewField(array());
     foreach ($fieldView->_path['template'] as $path) {
         if (file_exists($path)) {
             $basepath = $path;
             break;
         }
     }
     $file = $basepath . "default.php";
     $tpl = file_get_contents($file);
     $userIndex = DT_Session::get('register.Setting.current.userIndex');
     $label = JText::_('DT_USERNAME');
     $value = DT_Session::get('register.User.' . $userIndex . '.username');
     if ($value == "") {
         return "";
     }
     $constants = array('[label]', '[value]', '[description]');
     $replace = array($label, $value, '');
     $tpl = file_get_contents($file);
     return $html = str_replace($constants, $replace, $tpl);
 }
* @copyright contact dthdev@dthdevelopment.com
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
?>

<div id="pricebox">
  
	  <?php 
global $currency_code, $show_price_tax, $show_fee_breakdown;
$mEvent = $this->getModel('event');
$tEvent = $mEvent->table;
$tEvent->load(DT_Session::get('register.User.eventId'));
$tEvent->overrideGlobal(DT_Session::get('register.User.eventId'));
//pr($tEvent);
$TableUser =& DtrTable::getInstance('Duser', 'Table');
$userdata = DT_Session::get('register.User');
$TableUser->create($userdata);
$feeObj = new DT_Fee($tEvent, $TableUser);
$juser = JFactory::getUser();
$feeObj->getFee($juser->id);
if ($feeObj->paid_fee > 0) {
    $memtot = $TableUser->memtot;
    $discount = $feeObj->memberdiscount + $feeObj->birddiscount + $feeObj->discountcodefee;
    ?>
            <strong><?php 
    echo JText::_('TOTAL_REGISTRATION_COST');
    ?>
:</strong> <?php 
    echo DTreg::displayRate($feeObj->paid_fee, $currency_code);
    ?>
           <?php 
Beispiel #6
0
 function notify()
 {
     if ($this->validate_ipn() && ($_REQUEST['payment_status'] == 'Completed' || $_REQUEST['payment_status'] == 'Pending' || $_REQUEST['payment_status'] == 'Processed')) {
         $this->transactionId = $_REQUEST['txn_id'];
         DT_Session::set('register.payment.transactionId', $this->transactionId);
         return true;
     } else {
         return true;
     }
 }
 function after_user_save($user)
 {
     if (DT_Session::get('register.payment.offline_process')) {
         $billing = DT_Session::get('register.payment.billing');
         $billing['userId'] = $user->userId;
         $billing['status'] = 0;
         $user->TableCard->save($billing);
     }
     return;
 }
Beispiel #8
0
    function offline_payment($recipient)
    {
        global $cardtype;
        pr($cardtype);
        $cardtype_temp = array_values($cardtype);
        $user = $this->getuser($recipient);
        $billingInfo = DT_Session::get('register.payment.billing');
        //if(DT_Session::get('register.payment.offline_process')) {
        if ($user->card) {
            $billingInfo = (array) $user->card;
            pr($billingInfo);
            $country_field = $this->tfield->fingbyName('country');
            $countries = explode("|", $country_field->values);
            ob_start();
            ?>
		  <table>
			 <tr>
				<td><?php 
            echo JText::_('DT_CARD_HOLDER_FIRSTNAME');
            ?>
</td><td><?php 
            echo $billingInfo['firstname'];
            ?>
</td>
			 </tr>
			 <tr>
				<td><?php 
            echo JText::_('DT_CARD_HOLDER_LASTNAME');
            ?>
</td><td><?php 
            echo $billingInfo['lastname'];
            ?>
</td>
			 </tr>
			 <tr>
				<td><?php 
            echo JText::_('DT_BILLING_ADDRESS');
            ?>
</td><td><?php 
            echo $billingInfo['address'];
            ?>
</td>
			 </tr>
			 <tr>
                <td><?php 
            echo JText::_('DT_CITY');
            ?>
</td><td><?php 
            echo $billingInfo['city'];
            ?>
</td>
             </tr>
             
             <tr>
                <td><?php 
            echo JText::_('DT_STATE');
            ?>
</td><td><?php 
            echo $billingInfo['state'];
            ?>
</td>
             </tr>
             
             <tr>
                <td><?php 
            echo JText::_('DT_COUNTRY');
            ?>
</td><td><?php 
            echo $countries[$billingInfo['country']];
            ?>
</td>
             </tr>
             
             <tr>
                <td><?php 
            echo JText::_('DT_ZIPCODE');
            ?>
</td><td><?php 
            echo $billingInfo['zipcode'];
            ?>
</td>
             </tr>
             
             <tr>
                <td><?php 
            echo JText::_('DT_PHONE');
            ?>
</td><td><?php 
            echo $billingInfo['phone'];
            ?>
</td>
             </tr>
             
              <tr>
                <td><?php 
            echo JText::_('CARD_TYPE');
            ?>
</td><td><?php 
            echo $cardtype_temp[$billingInfo['cardtype']];
            ?>
</td>
             </tr>
             
              <tr>
                <td><?php 
            echo JText::_('CARD_NUMBER');
            ?>
</td>
                <td><?php 
            echo 'XXXX-XXXX-XXXX-' . substr($billingInfo['x_card_num'], -4);
            ?>
</td>
             </tr>
             
              <tr>
                <td><?php 
            echo JText::_('CARD_EXPIRY_DATE');
            ?>
</td><td><?php 
            echo $billingInfo['x_exp_date'];
            ?>
</td>
             </tr>
             <?php 
            if (DT_Session::get('register.payment.billing.x_card_code')) {
                $ccv_code = DT_Session::get('register.payment.billing.x_card_code');
                ?>
              <tr>
                <td><?php 
                echo JText::_('CVV_CODE');
                ?>
</td><td><?php 
                echo $ccv_code;
                ?>
</td>
             </tr>
          	<?php 
            }
            ?>
          </table>
	    <?php 
            return str_replace("\n", "", ob_get_clean());
        } else {
            return "";
        }
    }
 function process()
 {
     $this->setFields();
     $fields = $this->formatfields();
     $this->url;
     $ch = curl_init($this->url);
     if ($this->godaddy_hosting) {
         curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
         curl_setopt($ch, CURLOPT_PROXY, "http://proxy.shr.secureserver.net:3128");
     }
     curl_setopt($ch, CURLOPT_HEADER, 0);
     // set to 0 to eliminate header info from response
     //curl_setopt($ch, CURLOPT_VERBOSE, 1);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     // Returns response data instead of TRUE(1)
     curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim($fields, "& "));
     // use HTTP POST to send form data
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
     // uncomment this line if you get no gateway response. ###
     $resp = curl_exec($ch);
     //execute post and get results
     $this->response = $resp;
     $this->parseResponse();
     if ($this->responseParts[0] == 1) {
         $this->transactionId = $this->responseParts[6];
         DT_Session::set('register.payment.transactionId', $this->transactionId);
         return true;
     } else {
         $res = $this->responseParts;
         switch ($res[0]) {
             case 1:
                 $this->errorMsg = JText::_('DT_PAYMENT_SUCCESSFUL') . '<br />';
                 $this->errorMsg .= JText::_('DT_AUTHORIZATION_CODE') . ': ' . $res[4] . '<br />';
                 $this->errorMsg .= JText::_('DT_AMOUNT') . ': ' . $res[9] . '<br />';
                 $this->errorMsg .= JText::_('TRANS_ID') . ': ' . $res[6] . '<br />';
                 $this->errorMsg .= JText::_('DT_INVOICE_NUMBER') . ': ' . $res[7] . '<br /><br />';
                 break;
             case 2:
                 if ($res[2] == 2 || $res[2] == 4) {
                     $this->errorMsg = JText::_('DT_PAYMENT_DECLINED');
                     $this->errorMsg .= JText::_('DT_REASON') . ": " . $res[3] . "<br />";
                 }
                 break;
             case 3:
                 $this->errorMsg = $res[3];
                 echo JText::_('DT_REASON') . ": ";
                 switch ($res[2]) {
                     case 5:
                         $this->errorMsg = JText::_('DT_AMOUNT_NOT_VALID');
                         break;
                     case 6:
                     case 37:
                         $this->errorMsg = JText::_('DT_CARD_NUMBER_INVALID');
                         break;
                     case 7:
                         $this->errorMsg = JText::_('DT_EXP_DATE_INVALID');
                         break;
                     case 11:
                         $this->errorMsg = JText::_('DT_DUPLICATE_TRANSACTION');
                         break;
                     case 13:
                         $this->errorMsg = JText::_('DT_API_LOGIN_INVALID');
                         break;
                     case 17:
                     case 28:
                         $this->errorMsg = JText::_('DT_MERCHANT_NOT_CONFIGURED');
                         break;
                     case 19:
                     case 20:
                     case 21:
                     case 22:
                     case 23:
                     case 25:
                     case 26:
                     case 57:
                     case 58:
                     case 59:
                     case 60:
                     case 61:
                     case 62:
                     case 63:
                         $this->errorMsg = JText::_('DT_ERROR_OCCURRED');
                         $this->errorMsg .= '<a href="' . JRoute::_('index.php?option=com_dtregister&Itemid=' . $Itemid, $xhtml_url) . '">' . JText::_('DT_CLICK_HERE') . '</a>';
                         break;
                     case 27:
                         $this->errorMsg = JText::_('DT_AUTH_AVS_MISMATCH');
                         break;
                     case 34:
                     case 35:
                     case 38:
                     case 43:
                         $this->errorMsg = JText::_('DT_AUTH_MERCH_SETUP_PROCESSOR');
                         break;
                     case 49:
                         $this->errorMsg = JText::_('DT_AUTH_MAX_ALLOWED');
                         break;
                     case 50:
                         $this->errorMsg = JText::_('DT_AUTH_TRANS_SETTLE_REFUNDED');
                         break;
                     case 54:
                         $this->errorMsg = JText::_('DT_AUTH_REF_TRANS');
                         break;
                     case 55:
                         $this->errorMsg = JText::_('DT_AUTH_SUM_CREDIT_REF_TRANS');
                         break;
                     case 56:
                         $this->errorMsg = JText::_('DT_AUTH_ECHECK_ONLY');
                         break;
                     case 66:
                         $this->errorMsg = JText::_('DT_AUTH_SECURITY_GUIDELINES');
                         break;
                     case 68:
                         $this->errorMsg = JText::_('DT_AUTH_XVERSION_INVALID');
                         break;
                     case 69:
                         $this->errorMsg = JText::_('DT_AUTH_XTYPE_INVALID');
                         break;
                     case 78:
                         $this->errorMsg = JText::_('DT_AUTH_XCARD_FAILED');
                         break;
                 }
                 break;
         }
         switch ($res[38]) {
             case 'N':
                 $this->errorMsg = JText::_('DT_AUTH_CC_CODE_MISMATCH');
                 break;
             case 'P':
                 $this->errorMsg = JText::_('DT_AUTH_CC_NOT_PROCESSED');
                 break;
             case 'S':
                 $this->errorMsg = JText::_('DT_AUTH_CC_CODE_NOT_PRESENT');
                 break;
             case 'U':
                 $this->errorMsg = JText::_('DT_AUTH_ISSUER_NOT_PROCESS');
                 break;
         }
         echo $this->errorMsg;
         return false;
     }
     prd($resp);
 }
Beispiel #10
0
 function price_header()
 {
     $layout = JRequest::getVar('dttmpl', 'price_header');
     if (isset($_REQUEST['Field'])) {
         $userIndex = DT_Session::get('register.Setting.current.userIndex');
         if (isset($_REQUEST['memberIndex'])) {
             $memberIndex = JRequest::getVar('memberIndex', 0);
             DT_Session::set('register.User.' . $userIndex . '.members.' . $memberIndex . '.fields', $_REQUEST['Field']);
         } else {
             DT_Session::set('register.User.' . $userIndex . '.fields', $_REQUEST['Field']);
             if (isset($_REQUEST['username'])) {
                 DT_Session::set('register.User.' . $userIndex . '.username', $_REQUEST['username']);
                 DT_Session::set('register.User.' . $userIndex . '.password', $_REQUEST['password']);
             }
             if (isset($_REQUEST['discount_code']) && $_REQUEST['discount_code'] != "") {
                 $eventId = JRequest::getVar('eventId', DT_Session::get('register.Event.eventId'));
                 $event = $this->getModel('event')->table;
                 $event->load($eventId);
                 $discount_code_id = $event->validate_code($_REQUEST['discount_code']);
                 if ($discount_code_id !== false) {
                     DT_Session::set('register.User.' . $userIndex . '.discount_code_id', $discount_code_id);
                 } else {
                     DT_Session::set('register.User.' . $userIndex . '.discount_code_id', false);
                     $this->view->assign('discountCodeError', $event->TableEventdiscountcode->TableDiscountcode->error);
                 }
             } else {
                 DT_Session::set('register.User.' . $userIndex . '.discount_code_id', 0);
             }
         }
     }
     $this->view->setLayout($layout);
     $this->view->display();
     die;
 }
Beispiel #11
0
 function success()
 {
     $this->transactionId = $this->payEway->get_transaction_detail();
     if ($this->transactionId === false) {
         return false;
     }
     DT_Session::set('register.payment.transactionId', $this->transactionId);
     return true;
 }
Beispiel #12
0
<?php

/**
* @version 2.7.7
* @package Joomla 1.5
* @subpackage DT Register
* @copyright Copyright (C) 2006 DTH Development
* @copyright contact dthdev@dthdevelopment.com
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
global $Itemid, $xhtml_url;
if (DT_Session::get('register.User.process')) {
    include JPATH_SITE . DS . 'components' . DS . 'com_dtregister' . DS . 'views' . DS . 'user' . DS . 'tmpl' . DS . 'event_header.php';
} else {
    ?>
  <div class="componentheading"><?php 
    echo JText::_('DT_EVENT_REGISTRATION');
    ?>
: <?php 
    echo JText::_('DT_PAYMENT');
    ?>

		</div>
  <?php 
}
?>

<form method="post" name="frmcart" id="frmcart">

<table>
Beispiel #13
0
 function success()
 {
     $id = JRequest::getVar('transaction_id', 0);
     $this->checkPayment($id);
     if (!$this->paid_status) {
         return false;
     }
     if ($id) {
         $this->transactionId = JRequest::getVar('transaction_id');
         DT_Session::set('register.payment.transactionId', $this->transactionId);
         $database =& JFactory::getDBO();
         $data = $_SESSION;
         $sql = "update #__dtregister_session set `data`= " . $database->Quote(serialize($data)) . " where id=" . $id;
         $database->setQuery($sql);
         $database->query();
         $database->getErrorMsg();
         return true;
     } else {
         return false;
     }
 }
Beispiel #14
0
 function restoreFromPayment($paypal_session_id = 0)
 {
     $database =& JFactory::getDBO();
     $sql = "select * from #__dtregister_session where id={$paypal_session_id}";
     $database->setQuery($sql);
     $database->query();
     // echo $database->getQuery();
     $row = $database->loadObjectList();
     $data = unserialize($row[0]->data);
     $dt_userId = $row[0]->user_id;
     $session =& JFactory::getSession();
     $_SESSION = $data;
     $session->getToken(true);
     //$session->fork();
     $session->set('session.timer.start', strtotime('now'));
     $session->set('session.counter', 1);
     $session->set('session.timer.last', strtotime('now'));
     $session->set('session.timer.now', strtotime('now'));
     $session->set('__dtregister', $data['__dtregister']);
     $_SESSION['__dtregister'] = $data['__dtregister'];
     DT_Session::set('register.restore.userId', $dt_userId);
     DT_Session::set('register.restore.processed', $row[0]->processed);
     DT_Session::set('register.restore.id', $paypal_session_id);
     //prd($data);
     //pr($session->getExpire());
     //pr($session->getStores());
     //pr($session->getState());
     //pr($session);
 }
Beispiel #15
0
 function confirm()
 {
     global $Itemid, $mainframe, $xhtml, $xhtml_url;
     $this->view->setModel($this->getModel('field'));
     $this->view->setModel($this->getModel('fieldtype'));
     $step = JRequest::getVar('step', 0);
     if ($step === "confirm") {
         if (isset($_REQUEST['partial_payment'])) {
             if ($_REQUEST['partial_payment'] == 'full') {
                 $paying_amount = JRequest::getVar('paying_amount', 0);
             } else {
                 $paying_amount = JRequest::getVar('partial_payment_amount', 0);
             }
         } else {
             $paying_amount = JRequest::getVar('paying_amount', 0);
         }
         if ($paying_amount > 0) {
             $paid_amount = DT_Session::get('register.User.fee.paid_amount') + $paying_amount;
         } else {
             $paid_amount = DT_Session::get('register.User.fee.paid_amount');
         }
         if (DT_Session::get('register.User.0') === false) {
             DT_Session::set('register.User.fee.paying_amount', $paying_amount);
             DT_Session::set('register.User.fee.paid_amount', $paid_amount);
             $user = DT_Session::get('register.User');
             DT_Session::clear('register.User');
             DT_Session::set('register.User.process', $user['process']);
             unset($user['process']);
             DT_Session::set('register.User.0', $user);
         } else {
         }
         $paymethod = DT_Session::get('register.payment.method');
         if ($paying_amount <= 0) {
             $function = DT_Session::get('register.User.process');
             $tableUser = $this->getModel('user')->table;
             $tableUser->{$function}(DT_Session::get('register'));
             $messageTask = $function;
             $mainframe->redirect("index.php?option=com_dtregister&controller=message&Itemid={$Itemid}&task=" . $messageTask);
         } else {
             $mainframe->redirect(JRoute::_("index.php?option=com_dtregister&controller=payment&task=methods", $xhtml_url));
         }
     }
     $eventId = JRequest::getVar('eventId', DT_Session::get('register.User.eventId'));
     $this->view->assign('header_eventId', $eventId);
     $event =& DtrTable::getInstance('Event', 'Table');
     $event->load($eventId);
     $fieldtype = $this->getModel('fieldtype');
     $viewMemFields = "";
     if (DT_Session::get('register.User.type') == 'G') {
         $back = JRoute::_("index.php?option=com_dtregister&Itemid=" . $Itemid . "&eventId=" . $eventId . "&controller=user&task=edit&back=1&userId=" . DT_Session::get('register.User.userId'));
         $type = 'B';
         $members = DT_Session::get('register.User.members');
         $i = 0;
         if (is_array($members)) {
             foreach ($members as $key => $member) {
                 $viewMemFields .= "<tr><td colspan='2'>&nbsp;</td></tr><tr><td colspan='3'><u>" . JText::_('DT_MEMBER') . ($i + 1) . " </u></td></tr>";
                 $viewMemFields .= $event->viewFields('M', DT_Session::get('register.User.members.' . $key), false, 'frmcart', false);
                 $i++;
             }
         }
     } else {
         $back = JRoute::_("index.php?option=com_dtregister&Itemid=" . $Itemid . "&eventId=" . $eventId . "&controller=user&task=edit&back=1&userId=" . DT_Session::get('register.User.userId'));
         $type = 'I';
     }
     $TableUser =& DtrTable::getInstance('Duser', 'Table');
     $TableUser->create(DT_Session::get('register.User'));
     $feeObj = new DT_Fee($event, $TableUser);
     $feeObj->setPaidAmount(DT_Session::get('register.User.fee.paid_amount'));
     $feeObj->getFee(false);
     $feesession = $feeObj;
     unset($feesession->TableEvent);
     unset($feesession->TableUser);
     DT_Session::set('register.User.fee', (array) $feesession);
     $this->view->assign('feeObj', $feeObj);
     $this->view->assign('back', $back);
     $this->view->assign('eventId', $eventId);
     $event->load($eventId);
     $this->view->assign('viewFields', $event->viewFields($type, DT_Session::get('register.User'), false, 'frmcart', false));
     $this->view->assign('viewMemFields', $viewMemFields);
     $this->view->assign('partial_payment_enable', $event->partial_payment_enable);
     $this->display();
 }
Beispiel #16
0
    function form()
    {
        global $Itemid;
        if (DT_Session::get('register.User.process')) {
            $this->view->assign('header_eventId', DT_Session::get('register.User.0.eventId'));
            $this->header_eventId = DT_Session::get('register.User.0.eventId');
        }
        if (DT_Session::get('register.User.process')) {
            include JPATH_SITE . DS . 'components' . DS . 'com_dtregister' . DS . 'views' . DS . 'user' . DS . 'tmpl' . DS . 'event_header.php';
        } else {
            ?>
         <div class="componentheading"><?php 
            echo JText::_('DT_EVENT_REGISTRATION');
            ?>
: <?php 
            echo JText::_('DT_PAYMENT');
            ?>

		</div>
      <?php 
        }
        global $mainframe, $Itemid;
        $userIndex = DT_Session::get('register.Setting.current.userIndex');
        if ($userIndex !== false && $userIndex != "") {
            DT_Session::clear('register.User.' . $userIndex . '.TableEvent');
            DT_Session::clear('register.User.' . $userIndex . '.TableUser');
        }
        $billingInfo = DT_Session::get('register.payment.billing');
        if (isset($_REQUEST['paymentmethod'])) {
            if ($_REQUEST['paymentmethod'] == "pay_later") {
                DT_Session::set('register.payment.method', $_REQUEST['pay_later_option']);
            } else {
                DT_Session::set('register.payment.method', $_REQUEST['paymentmethod']);
            }
        }
        $no_billing = array('GoogleCheckout', 'paypal', 'pay_later', 'saferpay', 'Eway', 'psigate');
        $paymentClass = DT_Session::get('register.payment.method');
        if (!is_numeric($paymentClass)) {
            require_once JPATH_SITE . '/components/com_dtregister/lib/payment/' . $paymentClass . '.php';
            $payment = new $paymentClass();
        } else {
        }
        if (empty($billingInfo) && (!in_array($paymentClass, $no_billing) || !is_numeric($paymentClass) && $payment->bywebservice) && $_REQUEST['paymentmethod'] != "pay_later" && !is_numeric($paymentClass)) {
            $mainframe->redirect(JRoute::_("index.php?option=com_dtregister&controller=payment&task=billinginfo&Itemid=" . $Itemid, false));
        }
        $tableUser = $this->getModel('user')->table;
        $paymentClass = DT_Session::get('register.payment.method');
        if (isset($_REQUEST['paymentmethod']) && $_REQUEST['paymentmethod'] == "pay_later") {
            $paymethod = DT_Session::get('register.payment.method');
            $tableUser->registerall(DT_Session::get('register'), $paymethod);
            $mainframe->redirect(JRoute::_("index.php?option=com_dtregister&controller=message&task=paylater&Itemid=" . $Itemid, false));
        } else {
            require_once JPATH_SITE . '/components/com_dtregister/lib/payment/' . $paymentClass . '.php';
            //  prd($billingInfo);
            $payment->setBillinginfo($billingInfo);
            if (DT_Session::get('register.User.process') == "") {
                $function = 'registerall';
                $messageTask = 'thanks';
                $count = count(DT_Session::get('register.User'));
                $payment->confirmNum = DT_Session::get('register.User.0.confirmNum');
                if ($count == 1) {
                    $payment->description = $this->evtTable->title;
                } else {
                    $payment->description = JText::_('DT_EVENT_PAYMENT_DESCRIPTION');
                }
            } else {
                $function = DT_Session::get('register.User.process');
                $payment->confirmNum = DT_Session::get('register.User.0.confirmNum');
                $payment->description = $this->evtTable->title;
            }
            $success = $payment->process();
            if ($payment->bywebservice) {
                if ($success === true) {
                    $paymethod = DT_Session::get('register.payment.method');
                    if (DT_Session::get('register.User.process') === false || DT_Session::get('register.User.process') == "") {
                        $function = 'registerall';
                        $messageTask = 'thanks';
                    } else {
                        $messageTask = DT_Session::get('register.User.process');
                        $function = DT_Session::get('register.User.process');
                    }
                    $tableUser->{$function}(DT_Session::get('register'), $paymethod);
                    $mainframe->redirect(JRoute::_("index.php?option=com_dtregister&controller=message&Itemid={$Itemid}&task=" . $messageTask, false));
                } else {
                    if ($success === false) {
                        $payment->afterFailed();
                        echo $payment->tryAgain();
                    }
                }
            }
        }
        $this->view->setLayout('form');
        $this->view->display();
    }
    function billingform()
    {
        ob_start();
        $paymentMethod = DT_Session::get('register.payment.method');
        ?>

		        <tr><td colspan="2" ><strong><?php 
        echo JText::_('DT_PAYMENT_INFORMATION');
        ?>
</strong></td></tr>

                <tr><td colspan="2" >&nbsp;
                	<input type="hidden" name="paymentmethod" value="<?php 
        echo $paymentMethod;
        ?>
" />
                </td></tr>

			<?php 
        if (count(DT_Session::get('register.User')) == 1) {
            ?>
             <tr>
                	<td><?php 
            echo JText::_('DT_SAME_BILLING_INFO');
            ?>
</td>
                	<td><input type="checkbox" class="inputbox" name="same" id="same" value="1" /></td>
             </tr>
            <?php 
        }
        ?>

		        <tr>

                	<td width="31%"><?php 
        echo JText::_('DT_CARD_HOLDER_FIRSTNAME');
        ?>
:<span class="dtrequired">  *  </span></td>

                    <td width="69%" align="left" > <input id="billingFirstname"  class="inputbox required" type="text" name="billing[firstname]" value="<?php 
        echo isset($this->firstname) ? $this->firstname : '';
        ?>
" /> </td>

                 </tr>

                   <tr>

                	<td width="31%"  ><?php 
        echo JText::_('DT_CARD_HOLDER_LASTNAME');
        ?>
:<span class="dtrequired">  *  </span></td>

                    <td width="69%" align="left" > <input id="billingLastname" class="inputbox required" type="text" name="billing[lastname]" value="<?php 
        echo isset($this->lastname) ? $this->lastname : '';
        ?>
" /> </td>

                 </tr>

                   <tr>

                	<td width="31%"  ><?php 
        echo JText::_('DT_BILLING_ADDRESS');
        ?>
:<span class="dtrequired">  *  </span></td>

                    <td width="69%" align="left" > <input id="billingAddress" class="inputbox required" type="text" name="billing[address]" value="<?php 
        echo isset($this->address) ? $this->address : '';
        ?>
" /> </td>

                 </tr>

                   <tr>

                	<td width="31%"  ><?php 
        echo JText::_('DT_CITY');
        ?>
:<span class="dtrequired">  *  </span></td>

                    <td width="69%" align="left" ><input id="billingCity" class="inputbox required" type="text" name="billing[city]" value="<?php 
        echo isset($this->city) ? $this->city : '';
        ?>
" />  </td>

                 </tr>

                   <tr>

                	<td width="31%"  ><?php 
        echo JText::_('DT_STATE');
        ?>
:<span class="dtrequired">  *  </span></td>

                    <td width="69%" align="left" > <input  id="billingState" class="inputbox required" type="text" name="billing[state]" value="<?php 
        echo isset($this->state) ? $this->state : '';
        ?>
" /> </td>

                 </tr>
<?php 
        $countylist = new TableField();
        $field = $countylist->fingbyName('country');
        // pr($field->id);
        $paymentmethod = DtrModel::getInstance('paymentmethod', 'DtregisterModel');
        global $paypal_pro_country;
        if (get_class($this) == 'paypal_pro') {
            $value = isset($this->country) ? $this->country : $paypal_pro_country;
            $dropDownDatas = $paymentmethod->paypal_country_codes();
            $countrydropdown = JHTML::_('select.genericlist', DtHtml::options($dropDownDatas, JText::_("DT_SELECT_COUNTRY")), 'billing[country]', $value, 'value', 'text', array($value));
            // pr($value); pr($countrydropdown); exit;
        } else {
            if ($field) {
                $dropDownDatas = explode("|", $field->values);
                $value = isset($this->country) ? $this->country : $field->selected;
                $countrydropdown = JHTML::_('select.genericlist', DtHtml::options($dropDownDatas, JText::_("DT_SELECT_COUNTRY")), 'billing[country]', ' ', 'value', 'text', $value);
            }
        }
        ?>
        <tr>
			   <td>
				 <?php 
        echo JText::_('DT_COUNTRY');
        ?>
			   </td>
			   <td>
				 <?php 
        echo $countrydropdown;
        ?>
			   </td>
		</tr>
       
                 <tr>
                	<td width="31%"><?php 
        echo JText::_('DT_ZIPCODE');
        ?>
:<span class="dtrequired">  *  </span></td>
                    <td width="69%" align="left"> <input id="billingZipcode" class="inputbox required" type="text" name="billing[zipcode]" value="<?php 
        echo isset($this->zipcode) ? $this->zipcode : '';
        ?>
" /> </td>
                 </tr>
  
                 <tr>
                	<td width="31%"><?php 
        echo JText::_('DT_PHONE');
        ?>
:<span class="dtrequired">  *  </span></td>
                    <td width="69%" align="left"> <input id="billingPhone" class="inputbox required" type="text" name="billing[phone]" value="<?php 
        echo isset($this->phone) ? $this->phone : '';
        ?>
" /> </td>
                 </tr>
  <?php 
        if (get_class($this) != 'offline_payment') {
            ?>
                 <tr>
                	<td width="31%"><?php 
            echo JText::_('DT_EMAIL');
            ?>
:<span class="dtrequired">  *  </span></td>
                    <td width="69%" align="left"> <input id="billingEmail" class="inputbox required" type="text" name="billing[email]" value="<?php 
            echo isset($this->email) ? $this->email : '';
            ?>
" /> </td>
                 </tr>
   <?php 
        }
        ?>
                 <?php 
        foreach (DT_Session::get('register.User') as $key => $user) {
            if (!intval($key)) {
                continue;
            }
            break;
        }
        ?>

				<script language="javascript" type="text/javascript">

                    //<![CDATA[
							<?php 
        $field = $countylist->fingbyName('firstname');
        ?>
							var billing_firstname = "<?php 
        echo $field ? $user['fields'][$field->id] : '';
        ?>
";
							<?php 
        $field = $countylist->fingbyName('lastname');
        ?>
							var billing_lastname = "<?php 
        echo $field ? $user['fields'][$field->id] : '';
        ?>
";
							<?php 
        $field = $countylist->fingbyName('address');
        ?>
							var billing_address = "<?php 
        echo $field ? $user['fields'][$field->id] : '';
        ?>
";
							<?php 
        $field = $countylist->fingbyName('city');
        ?>
							var billing_city = "<?php 
        echo $field ? $user['fields'][$field->id] : '';
        ?>
";
							<?php 
        $field = $countylist->fingbyName('state');
        ?>
							var billing_state = "<?php 
        echo isset($this->state) ? $this->state : '';
        ?>
";
							<?php 
        $field = $countylist->fingbyName('zip');
        ?>
							var billing_zipcode = "<?php 
        echo $field && isset($user['fields'][$field->id]) ? $user['fields'][$field->id] : '';
        ?>
";
							<?php 
        $field = $countylist->fingbyName('email');
        ?>
							var billing_email = "<?php 
        echo $field ? $user['fields'][$field->id] : '';
        ?>
";
							<?php 
        $field = $countylist->fingbyName('country');
        ?>
							var billing_country = "<?php 
        echo $field ? $user['fields'][$field->id] : '';
        ?>
";
		
							DTjQuery(function(){
								DTjQuery("#same").click(function(){
									
									if(this.checked) {
										DTjQuery("#billingFirstname").val(billing_firstname);
										DTjQuery("#billingLastname").val(billing_lastname);
										DTjQuery("#billingAddress").val(billing_address);
										DTjQuery("#billingCity").val(billing_city);
										DTjQuery("#billingState").val(billing_state);
										DTjQuery("#billingZipcode").val(billing_zipcode);
										DTjQuery("#billingEmail").val(billing_email);
										DTjQuery("#billingcountry").val(billing_country);
									} else {
										DTjQuery("#billingFirstname").val('');
										DTjQuery("#billingLastname").val('');
										DTjQuery("#billingAddress").val('');
										DTjQuery("#billingCity").val('');
										DTjQuery("#billingState").val('');
										DTjQuery("#billingZipcode").val('');
										DTjQuery("#billingEmail").val('');
										DTjQuery("#billingcountry").val('');
									}
		
								});
							});
                    
							//]]>

                   </script>

                <?php 
        $data = ob_get_clean();
        return $data;
    }
Beispiel #18
0
 function process()
 {
     global $currency_code, $Itemid;
     $this->sCurrency = $currency_code;
     $this->setOrderId($this->confirmNum);
     $session_id = $this->saveSession();
     DT_Session::set('register.payment.transactionId', $this->sOrderId);
     $mosConfig_live_site = JURI::root(false);
     $urlSuccess = "{$mosConfig_live_site}components/com_dtregister/success.php?return={$session_id}&Itemid={$Itemid}&task=restore";
     $urlCancel = "{$mosConfig_live_site}components/com_dtregister/success.php?return={$session_id}&Itemid={$Itemid}&task=cancel";
     $urlError = "{$mosConfig_live_site}index.php?option=com_dtregister&task=error&controller=payment&Itemid={$Itemid}";
     $this->setUrlCancel($urlCancel);
     $this->setUrlSuccess($urlSuccess);
     $this->setUrlError($urlError);
     $this->setAmount($this->cart->getAmount());
     $this->setOrderDescription($this->description);
     echo $this->createForm();
 }
Beispiel #19
0
 function process()
 {
     global $currency_code, $cardtype;
     if ($currency_code == "") {
         $currency_code = 'USD';
     }
     switch ($cardtype[$this->cardtype]) {
         case 'AmericanExpress':
             $this->cardtype = 'Amex';
             break;
         default:
             $this->cardtype = $cardtype[$this->cardtype];
             break;
     }
     $card_expiry_array = explode("/", $this->x_exp_date);
     $firstName = urlencode($this->firstname);
     $lastName = urlencode($this->lastname);
     $creditCardType = urlencode($this->cardtype);
     $creditCardNumber = urlencode($this->x_card_num);
     $expDateMonth = urlencode($card_expiry_array[0]);
     $expDateYear = urlencode($card_expiry_array[1]);
     $cvv2Number = urlencode($this->x_card_code);
     $address1 = urlencode($this->address);
     $address2 = '';
     $city = urlencode($this->city);
     $state = urlencode($this->state);
     $zip = isset($this->zipcode) ? urlencode($this->zipcode) : '';
     $amount = urlencode($this->cart->getAmount());
     $currencyCode = urlencode($currency_code);
     $paymentAction = urlencode("Sale");
     $nvpRecurring = '';
     $methodToCall = 'DoDirectPayment';
     $nvpstr = '&PAYMENTACTION=' . $paymentAction . '&AMT=' . $amount . '&CREDITCARDTYPE=' . $creditCardType . '&ACCT=' . $creditCardNumber . '&EXPDATE=' . $expDateMonth . $expDateYear . '&CVV2=' . $cvv2Number . '&FIRSTNAME=' . $firstName . '&LASTNAME=' . $lastName . '&STREET=' . $address1 . '&CITY=' . $city . '&STATE=' . $state . '&ZIP=' . $zip . '&COUNTRYCODE=' . $this->country . '&CURRENCYCODE=' . $currencyCode . '&IPADDRESS=' . urlencode($_SERVER['REMOTE_ADDR']) . '';
     //$nvpstr='&PAYMENTACTION=Sale&AMT=2&CREDITCARDTYPE=Visa&ACCT=4340325581348705&EXPDATE=082019&CVV2=123&FIRSTNAME=Lucky&LASTNAME=Litt&STREET=address&CITY=city&STATE=state&ZIP=12345&COUNTRYCODE=US&CURRENCYCODE=USD&IPADDRESS='.urlencode($_SERVER['REMOTE_ADDR']).'';
     //pr($nvpstr);
     $resArray = $this->hash_call($methodToCall, $nvpstr);
     $ack = strtoupper($resArray["ACK"]);
     // pr($resArray);
     if (isset($resArray['TRANSACTIONID']) && $resArray['TRANSACTIONID'] != "") {
         $this->transactionId = $res['TRANSACTIONID'];
         DT_Session::set('register.payment.transactionId', $this->transactionId);
         return true;
     } else {
         echo JText::_('DT_PAYPAL_PRO_FAILURE') . '<br /><br />';
         return false;
     }
 }
Beispiel #20
0
 function save()
 {
     global $mainframe, $Itemid, $DT_mailfrom, $DT_fromname, $frontendEventNotification;
     $row = $this->getModel('event')->table;
     $data = JRequest::getVar('data');
     $error = false;
     if ($data['event']['slabId'] != "") {
         $row->load($data['event']['slabId']);
         if (!$row->validDateChange($data)) {
             $this->error = JText::_("DT_REPTITIONS_NOT_VALID");
             $error = true;
         }
     }
     if ($error) {
         DT_Session::set('event.data', $data);
         $files = JRequest::getVar('event_files', null, 'files', 'array');
         DT_Session::set('event.event_files', $files);
         $this->view->setLayout('warning');
         $this->view->assign('message', JText::_("DT_REPEAT_DELETE_WARNING"));
         $this->view->display();
     } else {
         if ($row->save($data) !== false) {
             global $eventListOrder;
             $conf = DtrModel::getInstance('config', 'DtregisterModel');
             $conf->updateEventorder($eventListOrder);
             $subject = JText::_('DT_EVENT_EDIT_SUBJECT');
             $message = JText::_('DT_EVENT_EDIT_MESSAGE');
             $user = $this->getModel('user')->table;
             $Tagparser = new Tagparser();
             if (isset($data['event']['slabId']) && $data['event']['slabId'] > 0) {
                 $token_subject = JText::_('DT_EVENT_EDIT_SUBJECT');
                 $token_msg = "";
                 $token_msg .= '<p>' . JText::_('DT_EVENT_EDIT_MESSAGE') . '</p><p>' . JText::_('DT_EVENT_NAME') . ': [EVENT_NAME]';
                 $token_msg .= '<br />' . JText::_('DT_EVENT_DATE') . ': [EVENT_DATE]';
                 $token_msg .= '<br />' . JText::_('DT_EVENT_TIME') . ': [EVENT_TIME]';
                 $token_msg .= '<br />' . JText::_('DT_LOCATION') . ': [LOCATION]</p>';
             } else {
                 $token_subject = JText::_('DT_EVENT_CREATE_SUBJECT');
                 $token_msg = "";
                 $token_msg .= '<p>' . JText::_('DT_EVENT_CREATE_MESSAGE') . '</p><p>' . JText::_('DT_EVENT_NAME') . ': [EVENT_NAME]';
                 $token_msg .= '<br />' . JText::_('DT_EVENT_DATE') . ': [EVENT_DATE]';
                 $token_msg .= '<br />' . JText::_('DT_EVENT_TIME') . ': [EVENT_TIME]';
                 $token_msg .= '<br />' . JText::_('DT_LOCATION') . ': [LOCATION]</p>';
             }
             $user->eventId = $row->slabId;
             $user->load(0);
             $message = $Tagparser->parsetags($token_msg, $user);
             $subject = $Tagparser->parsetags($token_subject, $user);
             $email = $frontendEventNotification;
             $emails = explode(";", $email);
             foreach ($emails as $email) {
                 JUTility::sendMail($DT_mailfrom, $DT_fromname, $email, $subject, $message, 1);
             }
         } else {
             $mainframe->redirect("index.php?option=com_dtregister&controller=eventmanage&Itemid={$Itemid}&task=edit&cid[]=" . $row->slabId, $row->error);
         }
         $mainframe->redirect("index.php?option=com_dtregister&controller=eventmanage&Itemid={$Itemid}");
     }
 }
Beispiel #21
0
 function add()
 {
     global $mainframe, $Itemid, $now;
     $userId = JRequest::getVar('userId', 0);
     $mMember = $this->getModel('member');
     $tMember = $mMember->table;
     $tUser = $this->getModel('user')->table;
     $tUser->load($userId);
     $tEvt = $this->getModel('event')->table;
     $tEvt->load($tUser->eventId);
     $eventId = $tUser->eventId;
     $memtot = DT_Session::get('register.User.memtot');
     if ($memtot >= $tEvt->max_group_size) {
         $mainframe->redirect("index.php?option=com_dtregister&controller=member&userId=" . $userId . "&Itemid=" . $Itemid, JText::_('DT_MAX_GROUP_SIZE_REACHED'));
     }
     if (isset($_POST['formsubmit'])) {
         $min = $tEvt->min_group_size == "" ? 2 : $tEvt->min_group_size;
         $data = $_POST['Member'];
         $data['fields'] = JRequest::getVar('Field', array(), null, 'array');
         $data['created'] = $now->toMySQL();
         $members = DT_Session::get('register.User.members');
         $members[] = $data;
         DT_Session::set('register.User.members', $members);
         $memtot = DT_Session::get('register.User.memtot');
         $memtot++;
         DT_Session::set('register.User.memtot', $memtot);
         $mainframe->redirect("index.php?option=com_dtregister&controller=member&userId=" . $userId . "&Itemid=" . $Itemid);
         pr($tUser->TableFee);
         prd($fee);
         die;
     }
     $type = 'M';
     $this->view->assign('header_eventId', $eventId);
     $this->view->assign('form', $tUser->TableEvent->form($type, array(), false, 'frmcart', false));
     $this->view->assign('userId', $userId);
     $this->display();
 }
Beispiel #22
0
 function afterpayment()
 {
     prd($_REQUEST);
     $this->transactionId = $_REQUEST['ewayTrxnReference'];
     DT_Session::set('register.payment.transactionId', $this->transactionId);
     $this->confirmNum = $_SESSION['register']['billingInfo']['confirmNum'];
     unset($_SESSION['register']['billingInfo']['confirmNum']);
 }
Beispiel #23
0
 function freethanks()
 {
     global $mainframe, $thanksmsg, $thanks_redirection, $thanks_redirect_url;
     if (isset($thanks_redirection) && $thanks_redirection == 0 && isset($thanks_redirect_url)) {
         DT_Session::clearAll();
         $mainframe->redirect($thanks_redirect_url);
         exit;
     }
     $userIndex = DT_Session::get('register.Setting.current.userIndex');
     $user = DT_Session::get('register.User.' . $userIndex);
     $userTable = $this->getModel('user')->table;
     $TableEvent = $this->getModel('event')->table;
     $Tagparser = new Tagparser();
     $messages = array();
     if (DT_Session::get('register.User')) {
         $userTable->load($user['userId']);
         $TableEvent->load($user['eventId']);
         $tokenmessage = $TableEvent->thanksmsg_set ? $TableEvent->thanksmsg : $thanksmsg;
         $messages[] = stripslashes($Tagparser->parsetags($tokenmessage, $userTable));
     }
     $this->view->setLayout('freethanks');
     $this->view->assign('messages', $messages);
     $this->view->display();
     DT_Session::clearAll();
 }
Beispiel #24
0
 function save()
 {
     global $mainframe;
     $row = $this->getModel('event')->table;
     $data = JRequest::getVar('data');
     $error = false;
     $error = false;
     if ($data['event']['slabId'] != "") {
         $row->load($data['event']['slabId']);
         if (!$row->validDateChange($data)) {
         }
         if (!$row->comparerepeat($data) && $row->repetition !== false) {
             $this->error = JText::_("DT_REPTITIONS_NOT_VALID");
             $error = true;
             //$error  = false ;
         }
     }
     if ($error) {
         DT_Session::set('event.data', $data);
         $files = JRequest::getVar('event_files', null, 'files', 'array');
         DT_Session::set('event.event_files', $files);
         $this->view->setLayout('warning');
         $this->view->assign('message', JText::_("DT_REPEAT_DELETE_WARNING"));
         $this->view->display();
     } else {
         if ($row->save($data) !== false) {
             global $eventListOrder;
             $conf = DtrModel::getInstance('config', 'DtregisterModel');
             $conf->updateEventorder($eventListOrder);
         } else {
             $mainframe->redirect("index.php?option=com_dtregister&controller=event&task=edit&cid[]=" . $row->slabId, $row->error);
         }
         $mainframe->redirect("index.php?option=com_dtregister&controller=event");
     }
 }
Beispiel #25
0
 function success()
 {
     global $mainframe, $Itemid, $now;
     $ret = $this->validate();
     if ($ret) {
         $id = JRequest::getVar('order_id', 0);
         $this->transactionId = JRequest::getVar('transaction_id');
         DT_Session::set('register.payment.transactionId', $this->transactionId);
         $database =& JFactory::getDBO();
         $data = $_SESSION;
         $sql = "update #__dtregister_session set `data`= " . $database->Quote(serialize($data)) . " where id=" . $id;
         $database->setQuery($sql);
         $database->query();
         $database->getErrorMsg();
         return true;
     } else {
         return false;
     }
 }
Beispiel #26
0
 function process()
 {
     $this->setFields();
     $fields = $this->formatfields();
     $this->url;
     $ch = curl_init($this->url);
     if ($this->godaddy_hosting) {
         curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
         curl_setopt($ch, CURLOPT_PROXY, "http://proxy.shr.secureserver.net:3128");
     }
     curl_setopt($ch, CURLOPT_HEADER, 0);
     // set to 0 to eliminate header info from response
     //curl_setopt($ch, CURLOPT_VERBOSE, 1);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     // Returns response data instead of TRUE(1)
     curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim($fields, "& "));
     // use HTTP POST to send form data
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
     // uncomment this line if you get no gateway response. ###
     $resp = curl_exec($ch);
     //execute post and get results
     $this->response = $resp;
     $this->parseResponse();
     if ($this->responseParts['success'] == 'A') {
         $this->transactionId = $gatewaydata['TransactionID'];
         DT_Session::set('register.payment.transactionId', $this->transactionId);
         return true;
     } else {
         echo $this->responseParts['message'];
         return false;
     }
     prd($resp);
 }
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
?>

<div id="dt_pricebox">
  
	  <?php 
global $currency_code, $show_price_tax, $show_fee_breakdown;
$mEvent = $this->getModel('event');
$tEvent = $mEvent->table;
$tEvent->load(DT_Session::get('register.Event.eventId'));
$tEvent->overrideGlobal(DT_Session::get('register.Event.eventId'));
//pr($tEvent);
$userIndex = DT_Session::get('register.Setting.current.userIndex');
$TableUser =& DtrTable::getInstance('Duser', 'Table');
$TableUser->create(DT_Session::get('register.User.' . $userIndex));
$feeObj = new DT_Fee($tEvent, $TableUser);
$juser = JFactory::getUser();
$feeObj->getFee($juser->id);
// pr( $feeObj->slab->type);
if ($feeObj->paid_fee > 0) {
    $memtot = $TableUser->memtot;
    $discount = $feeObj->memberdiscount + $feeObj->birddiscount + $feeObj->discountcodefee;
    ?>
            <strong><?php 
    echo JText::_('TOTAL_REGISTRATION_COST');
    ?>
:</strong> <?php 
    echo DTreg::displayRate($feeObj->paid_fee, $currency_code);
    ?>
           <?php 
 function notify()
 {
     if ($_REQUEST['_type'] == 'new-order-notification') {
         $this->transactionId = $_REQUEST['google-order-number'];
         DT_Session::set('register.payment.transactionId', $this->transactionId);
         return true;
     } else {
         return false;
     }
 }
Beispiel #29
0
<?php

/**
* @version 2.7.0
* @package Joomla 1.5
* @subpackage DT Register
* @copyright Copyright (C) 2006 DTH Development
* @copyright contact dthdev@dthdevelopment.com
* @license Commercial
*/
global $Itemid, $xhtml;
// pr(DT_Session::get('register.User'));
$events = array();
$html = "";
foreach (DT_Session::get('register.User') as $key => $registration) {
    $eventTable = DtrTable::getInstance('event', 'Table');
    if (!isset($events[$registration['eventId']])) {
        $eventTable->load($registration['eventId']);
        $events[$registration['eventId']] = $eventTable;
    }
    if (isset($registration['remove']) && $registration['remove'] == 1) {
        continue;
    }
    if (!isset($registration['confirmed']) || $registration['confirmed'] != 1) {
        continue;
    }
    $event = $events[$registration['eventId']];
    $this->assign('index', $key);
    $this->assign('event', $event);
    $this->assign('registration', $registration);
    $html .= $this->loadTemplate('row');
Beispiel #30
0
 function group_registration()
 {
     global $mainframe;
     if (isset($_POST['formsubmit'])) {
         DT_Session::set('register.User.memtot', JRequest::getVar('memtot', 1));
         $eventId = DT_Session::get('register.User.eventId');
         $event = $this->getModel('event')->table;
         $event->load($eventId);
         if ($event->group_registration_type != "detail") {
             $mainframe->redirect("index.php?option=com_dtregister&controller=user&task=billing");
         } else {
             $mainframe->redirect("index.php?option=com_dtregister&controller=user&task=member");
         }
         //prd($_SESSION);
     } else {
         DT_Session::clear('register');
         $search = JRequest::getVar('search');
         $eventId = $search['eventId'];
         DT_Session::set('register.User.type', 'G');
         DT_Session::set('register.User.eventId', $eventId);
         DT_Session::set('register.User.members', array());
     }
     // Check for capacity registration for a particular event
     $eventTable = $this->getModel('event')->table;
     $eventTable->load($eventId);
     $registered = $eventTable->getTotalregistered($eventId);
     $max_registrations = $eventTable->max_registrations;
     if ($max_registrations > $registered) {
         $availableSpots = $max_registrations - $registered;
     } elseif ($max_registrations != 0) {
         $mainframe->redirect("index.php?option=com_dtregister&controller=user", JText::_('DT_ALERT_FULL_EVENT'));
         exit;
     }
     JToolBarHelper::save('group_registration', JText::_('DT_NEXT_STEP'));
     $this->view->assign('eventId', $eventId);
     $this->view->setLayout('memtotform');
     $this->view->display();
 }