<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 
    if ($show_fee_breakdown) {
        ?>
            <br /><div id="dt_price_breakdown">
예제 #2
0
 function confirm()
 {
     global $mainframe, $Itemid, $xhtml;
     if (false === DT_Session::get('register.Event.eventId') || DT_Session::get('register.Event.eventId') == 0) {
         $mainframe->redirect("index.php?option=com_dtregister&Itemid=" . $Itemid);
     }
     global $Itemid, $mainframe, $xhtml_url;
     $this->view->setModel($this->getModel('field'));
     $this->view->setModel($this->getModel('fieldtype'));
     $userIndex = DT_Session::get('register.Setting.current.userIndex');
     $step = JRequest::getVar('step', 0);
     $my =& JFactory::getUser();
     if ($step === "confirm") {
         /*foreach(DT_Session::get('register.User') as $key=>$registration){
         			pr($registration);
         		}*/
         // pr(DT_Session::get('register.User')); prd('exit here');
         $paying_amount = JRequest::getVar('paying_amount', 0);
         DT_Session::clear('register.User.process');
         DT_Session::set('register.User.' . $userIndex . '.fee.paid_amount', $paying_amount);
         DT_Session::set('register.User.' . $userIndex . '.fee.paying_amount', $paying_amount);
         DT_Session::set('register.User.' . $userIndex . '.confirmed', 1);
         if ($my->id) {
             DT_Session::set('register.User.' . $userIndex . '.user_id', $my->id);
         }
         $tableUser = $this->getModel('user')->table;
         DT_Session::set('register.User.' . $userIndex . '.confirmNum', $tableUser->generateconfirmNum());
         $status = DT_Session::get('register.User.' . $userIndex . '.status');
         if ($status == -2) {
             // free or waiting $paying_amount <= 0
             if ($status == -2) {
                 DT_Session::set('register.User.' . $userIndex . '.fee.paid_amount', 0);
                 DT_Session::set('register.User.' . $userIndex . '.fee.paying_amount', 0);
                 $task = "waiting_msg";
             } else {
                 $task = "freethanks";
             }
             $tableUser->register(DT_Session::get('register.User.' . $userIndex));
             DT_Session::set('register.User.' . $userIndex . '.userId', $tableUser->userId);
             $mainframe->redirect("index.php?option=com_dtregister&controller=message&task={$task}&Itemid=" . $Itemid);
         } else {
             $mainframe->redirect("index.php?option=com_dtregister&controller=event&task=viewCart&Itemid=" . $Itemid);
         }
     }
     $eventId = JRequest::getVar('eventId', DT_Session::get('register.Event.eventId'));
     $event =& DtrTable::getInstance('Event', 'Table');
     $event->load($eventId);
     if (isset($_REQUEST['Field'])) {
         // pr('register.User.'.$userIndex.'.fields') ;
         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'] != "") {
             $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);
             }
         }
     }
     $userIndex = DT_Session::get('register.Setting.current.userIndex');
     DT_Session::set('register.User.' . $userIndex . '.eventId', $eventId);
     $fieldtype = $this->getModel('fieldtype');
     $viewMemFields = "";
     if (DT_Session::get('register.User.' . $userIndex . '.type') == 'G') {
         $back = JRoute::_("index.php?option=com_dtregister&Itemid=" . $Itemid . "&eventId=" . $eventId . "&controller=event&task=billinginfo&back=1", $xhtml_url);
         $type = 'B';
         $members = DT_Session::get('register.User.' . $userIndex . '.members');
         if ($members) {
             foreach ($members as $key => $member) {
                 $viewMemFields .= "<tr><td colspan='2'>&nbsp;</td></tr><tr><td colspan='3'><u>" . JText::_('DT_MEMBER') . ($key + 1) . " </u></td></tr>";
                 $viewMemFields .= $event->viewFields('M', DT_Session::get('register.User.' . $userIndex . '.members.' . $key), false, 'frmcart', false);
             }
         }
     } else {
         $back = JRoute::_("index.php?option=com_dtregister&Itemid=" . $Itemid . "&eventId=" . $eventId . "&controller=event&task=individualRegister&back=1", $xhtml_url);
         $type = 'I';
     }
     $TableUser =& DtrTable::getInstance('Duser', 'Table');
     $TableUser->create(DT_Session::get('register.User.' . $userIndex));
     $feeObj = new DT_Fee($event, $TableUser);
     $feeObj->getFee($my->id);
     $feesession = $feeObj;
     unset($feesession->TableEvent);
     unset($feesession->TableUser);
     if ($event->is_waiting()) {
         DT_Session::set('register.User.' . $userIndex . '.status', -2);
         $this->view->assign('paying_amount', 0);
     } else {
         $this->view->assign('paying_amount', $feeObj->paid_fee);
     }
     $temp_feesession = clone $feesession;
     //DTrCommon::objectToArray($temp_feesession);
     DT_Session::set('register.User.' . $userIndex . '.fee', DTrCommon::objectToArray($temp_feesession));
     $this->view->assign('feeObj', $feeObj);
     $this->view->assign('back', $back);
     $this->view->assign('eventId', $eventId);
     $this->view->assign('header_eventId', $eventId);
     //$event->load($eventId);
     $this->view->assign('viewFields', $event->viewFields($type, DT_Session::get('register.User.' . $userIndex), false, 'frmcart', false));
     $this->view->assign('viewMemFields', $viewMemFields);
     $this->view->assign('event', $event);
     $this->view->setLayout('confirm');
     $this->view->display();
     // $db = &JFactory::getDBO();
     // $db->profileData = array();
 }
예제 #3
0
 function billing()
 {
     global $mainframe;
     if (isset($_POST['formsubmit'])) {
         $data = JRequest::getVar('User', array(), null, 'array');
         $data['fields'] = JRequest::getVar('Field', array(), null, 'array');
         $eventId = $data['eventId'];
         $event =& DtrTable::getInstance('Event', 'Table');
         $event->load($eventId);
         if (isset($data['discount_code']) && $data['discount_code'] != "") {
             $discount_code_id = $event->validate_code($data['discount_code']);
             unset($data['discount_code']);
             if ($discount_code_id !== false) {
                 $data['discount_code_id'] = $discount_code_id;
             } else {
                 $data['discount_code_id'] = false;
                 $this->view->assign('discountCodeError', $event->TableEventdiscountcode->TableDiscountcode->error);
             }
         }
         $data = array_merge(DT_Session::get('register.User'), array_filter($data));
         $TableUser =& DtrTable::getInstance('Duser', 'Table');
         $TableUser->create($data);
         $feeObj = new DT_Fee($event, $TableUser);
         $feeObj->getFee($data['user_id'] == "" ? false : true);
         $feeObj->setPaidMethod($data['Fee']['payment_method']);
         $feeObj->setPaidAmount($data['Fee']['paid_amount']);
         $feeObj->setPaidStatus($data['Fee']['status']);
         $fee = $feeObj;
         unset($fee->TableEvent);
         unset($fee->TableUser);
         $data['fee'] = (array) $fee;
         $confirmNum = $TableUser->generateconfirmNum();
         $data['confirmNum'] = $confirmNum;
         $TableUser->register($data);
         DT_Session::clear('register');
         $mainframe->redirect("index.php?option=com_dtregister&controller=user&task=index");
     }
     JToolBarHelper::save('billing', JText::_('DT_SAVE'));
     $mUser = $this->getModel('user');
     $tUser = $mUser->table;
     $eventId = DT_Session::get('register.User.eventId');
     $memtot = DT_Session::get('register.User.memtot');
     $tUser->TableEvent->load($eventId);
     $this->view->assign('form', $tUser->TableEvent->form('B', array(), false, 'adminForm', false));
     $this->view->assign('mUser', $mUser);
     $this->view->assign('eventId', $eventId);
     $this->view->assign('type', 'G');
     $this->view->assign('memtot', $memtot);
     $this->view->setLayout('add');
     $this->view->display();
 }
예제 #4
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();
 }
예제 #5
0
 function calculateFee()
 {
     if ($this->discount_code_id != "") {
         $this->TableEvent->loadDiscountCode($this->discount_code_id);
     }
     $feeObj = new DT_Fee($this->TableEvent, $this);
     $feeObj->getFee($this->user_id == "" ? false : true, $this->register_date);
     unset($feeObj->TableEvent);
     unset($feeObj->TableUser);
     return $feeObj;
 }