示例#1
0
 function __construct(&$db = null)
 {
     $db =& JFactory::getDBO();
     $this->db =& $db;
     include_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_dtregister' . DS . 'models' . DS . 'user.php';
     $this->TableJuser =& DtrTable::getInstance('Juser', 'Table');
     parent::__construct('#__dtregister_aros', 'id', $db);
 }
示例#2
0
 function __construct($config = array())
 {
     $config['name'] = 'config';
     parent::__construct($config);
     $this->table = new DtrTable('#__dtregister_config', 'id', $this->getDBO());
     $this->TablePayoption =& DtrTable::getInstance('payoption', 'Table');
     $this->db = $this->getDBO();
 }
示例#3
0
 function __construct(&$db = null)
 {
     $db =& JFactory::getDBO();
     $this->db = $db;
     parent::__construct('#__dtregister_payment', 'id', $db);
     $this->TablePayoptionconfig =& DtrTable::getInstance('Payoptionconfig', 'Table');
     $this->TablePaylater =& DtrTable::getInstance('paylater', 'Table');
 }
示例#4
0
 function __construct(&$db = null)
 {
     $db =& JFactory::getDBO();
     parent::__construct('#__dtregister_export_settings', 'id', $db);
     $this->UserModel =& DtrModel::getInstance('User', 'DtregisterModel');
     $this->pmethod =& DtrModel::getInstance('paymentmethod', 'DtregisterModel');
     $this->feeModel =& DtrModel::getInstance('fee', 'DtregisterModel');
     $this->Tablefield =& DtrTable::getInstance('Field', 'Table');
     $this->generalFields = array('event_date' => JText::_('DT_EVENT_DATE'), 'type' => JText::_('DT_USER_TYPE'), 'amount' => JText::_('DT_AMOUNT'), 'payment_type' => JText::_('DT_PAYMENT_TYPE'), 'paid' => JText::_('DT_PAYMENT_STATUS'), 'paid_amount' => JText::_('DT_AMOUNT_PAID'), 'memtot' => JText::_('DT_NUMBER_MEMBERS'), 'confirmNum' => JText::_('DT_CONFIRMATION_NUMBER'), 'code' => JText::_('DT_DISCOUNT_CODE'), 'category' => JText::_('DT_CATEGORY'), 'location' => JText::_('DT_LOCATION'), 'user_id' => JText::_('DT_JOOMLA_USERID'), 'attend' => JText::_('DT_ATTENDED'), 'status' => JText::_('DT_STATUS'), 'transaction_id' => JText::_('DT_TRANSACTION_ID'), 'userId' => JText::_('DT_USER_ID'));
     $fieldType = DtrModel::getInstance('Fieldtype', 'DtregisterModel');
     $this->fieldTypes = $fieldType->getTypes();
 }
示例#5
0
 function __construct(&$db = null)
 {
     $db =& JFactory::getDBO();
     $this->displayField = 'title';
     $this->db =& $db;
     $this->TableDiscountcode =& DtrTable::getInstance('Discountcode', 'Table');
     $this->TableField =& DtrTable::getInstance('Field', 'Table');
     /*
      base fee, late fee, early bird discount, member discount, tax, custom field fees/discounts, discount codes , change fee and cancel fee 
     */
     $this->feeElements = array('basefee' => array('title' => JText::_('DT_BASE_FEE'), 'type' => 'basefee'), 'latefee' => array('title' => JText::_('DT_LATE_FEE'), 'type' => 'latefee'), 'birddiscount' => array('title' => JText::_('DT_BIRD_DISCOUNT'), 'type' => 'birddiscount'), 'memberdiscount' => array('title' => JText::_('DT_MEMBER_DISCOUNT'), 'type' => 'memberdiscount'), 'tax' => array('title' => JText::_('DT_TAX_AMOUNT'), 'type' => 'tax'), 'changefee' => array('title' => JText::_('DT_CHANGE_FEE'), 'type' => 'changefee'), 'cancelfee' => array('title' => JText::_('DT_CANCEL_FEE'), 'type' => 'cancelfee'));
     parent::__construct('#__dtregister_feeorder', 'id', $db);
 }
示例#6
0
 function email()
 {
     global $usercreation;
     $database =& JFactory::getDBO();
     ob_clean();
     $eventId = $_GET['eventId'];
     $sql = "Select config_value From #__dtregister_config where config_key = 'prevent_duplication'";
     $database->setQuery($sql);
     $prevent_duplication = $database->loadResult();
     $global_prevent_duplication = $prevent_duplication;
     $eventTable =& DtrTable::getInstance('Event', 'Table');
     $eventTable->load($eventId);
     $prevent_duplication = $eventTable->prevent_duplication;
     $eventTable->overrideGlobal($eventId);
     $usercreation = $eventTable->usercreation;
     $my =& JFactory::getUser();
     $field_id = key($_REQUEST['Field']);
     $email = array_pop($_REQUEST['Field']);
     if (!$my->id && $usercreation > 0 && !isset($_GET['member_check'])) {
         $sql = "SELECT COUNT(*) FROM #__users WHERE email='{$email}' ";
         $database->setQuery($sql);
         $total = $database->loadResult();
         if ($total) {
             echo "\"" . JText::_('DT_JOOMLA_EMAIL_EXISTS') . "\"";
         } else {
             echo "true";
         }
         die;
     }
     if ($prevent_duplication) {
         $prevent_duplication = $global_prevent_duplication;
     } else {
         $prevent_duplication = 0;
     }
     if (!$prevent_duplication || isset($_REQUEST['dup_check'])) {
         echo "true";
     } else {
         $sql = "SELECT COUNT(*) FROM #__dtregister_user u inner join #__dtregister_user_field_values v on u.userId  = v.user_id   WHERE eventId='{$eventId}'  AND v.field_id = {$field_id}  and v.`value` = '{$email}' and u.cancel <> 1";
         $database->setQuery($sql);
         $total = $database->loadResult();
         if ($total) {
             $clean = ob_get_clean();
             echo "\"" . JText::_('DT_ALREADY_REGISTERED') . "\"";
             die;
         } else {
             echo "true";
         }
     }
     die;
 }
示例#7
0
 function __construct($config = array())
 {
     $this->defaultfields = array('firstname', 'lastname', 'zip', 'city', 'state', 'phone', 'email', 'address', 'address2', 'title', 'organization', 'country');
     parent::__construct($config);
     $this->TableEvent =& DtrTable::getInstance('Event', 'Table');
     $this->TableUser =& DtrTable::getInstance('Duser', 'Table');
     $this->TableUsergroupamount =& DtrTable::getInstance('Usergroupamount', 'Table');
     $this->TableUserfield =& DtrTable::getInstance('Userfield', 'Table');
     $this->TableMember =& DtrTable::getInstance('Member', 'Table');
     $this->fieldmapByName = array();
     $this->fieldmapById = array();
     $this->UserFldsTodefault = array('userFirstName' => 'firstname', 'userLastName' => 'lastname', 'userOrganization' => 'organization', 'userAddress' => 'address', 'userAddress2' => 'address2', 'userCity' => 'city', 'userState' => 'state', 'userCountry' => 'country', 'userZip' => 'zip', 'userPhone' => 'phone', 'userEmail' => 'email', 'userTitle' => 'title');
     $this->UserFldsTodefault = array_flip($this->UserFldsTodefault);
     $this->mapFields();
 }
示例#8
0
 function email()
 {
     global $usercreation;
     $database =& JFactory::getDBO();
     ob_clean();
     $sql = "Select config_value From #__dtregister_config where config_key = 'prevent_duplication'";
     $database->setQuery($sql);
     $prevent_duplication = $database->loadResult();
     $global_prevent_duplication = $prevent_duplication;
     $eventTable =& DtrTable::getInstance('Event', 'Table');
     $eventId = $_GET['eventId'];
     $eventTable->overrideGlobal($eventId);
     $my =& JFactory::getUser();
     if (!$my->id && $usercreation == 1) {
         $email = array_pop($_GET['Field']);
         $sql = "SELECT COUNT(*) FROM #__users WHERE email='{$email}' ";
         $database->setQuery($sql);
         $total = $database->loadResult();
         if ($total) {
             echo "false";
         } else {
             echo "true";
         }
     }
     if ($prevent_duplication == 1) {
         $prevent_duplication = $global_prevent_duplication;
     } else {
         $prevent_duplication = 0;
     }
     if (!$prevent_duplication) {
         echo "true";
     } else {
         $email = array_pop($_GET['Field']);
         $field_id = key($_GET['Field']);
         $sql = "SELECT COUNT(*) FROM #__dtregister_user u inner join #__dtregister_user_field_values v u.userId  = v.user_id on  WHERE eventId='{$eventId}'  AND userEmail='{$email}' and u.cancel <> 1";
         $database->setQuery($sql);
         $total = $database->loadResult();
         if ($total) {
             echo "false";
         } else {
             echo "true";
         }
     }
 }
示例#9
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();
 }
示例#10
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();
 }
* @copyright contact dthdev@dthdevelopment.com
* @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);
    ?>
示例#12
0
                 </tr>

		         <tr class="billinginfo">
		             <td><?php 
echo JText::_('DT_ZIPCODE');
?>
:<span class="dtrequired">  *  </span></td>
		             <td align="left"> <input id="billingZipcode" class="inputbox required" type="text" name="billing[zipcode]" value="<?php 
echo isset($tUser->card) && $tUser->card ? $tUser->card->zipcode : '';
?>
" /> </td>
		             <td> </td>
		         </tr>
		
    <?php 
$countylist =& DtrTable::getInstance('Field', 'Table');
$field = $countylist->fingbyName('country');
if ($field) {
    $dropDownDatas = explode("|", $field->values);
    $value = isset($tUser->card) && $tUser->card ? $tUser->card->country : $field->selected;
    $countrydropdown = JHTML::_('select.genericlist', DtHtml::options($dropDownDatas, JText::_("DT_SELECT_COUNTRY")), 'billing[country]', ' ', 'value', 'text', $value);
}
?>
     <tr class="billinginfo">
			   <td>
				 <?php 
echo JText::_('DT_COUNTRY');
?>
			   </td>
			   <td>
				 <?php 
示例#13
0
 function all_fields($recipient)
 {
     $user = $this->getuser($recipient);
     $field = DtrTable::getInstance('field', 'Table');
     $fieldType = DtrModel::getInstance('Fieldtype', 'DtregisterModel');
     $txt = "";
     $txt_parts = array();
     $fieldTypes = $fieldType->getTypes();
     foreach ($user->fields as $field_id => $value) {
         $field->load($field_id);
         if ($field->all_tag_enable) {
             $class = "Field_" . $fieldTypes[$field->type];
             $fieldTable = new $class();
             $fieldTable->load($field->id);
             $function = "viewHtml";
             if (method_exists($fieldTable, 'exportView')) {
                 $function = "exportView";
             }
             $value = $fieldTable->{$function}((array) $user);
             //$txt .= $fieldTable->label.': '.$value.'<br />';
             if (isset($value) && $value != "") {
                 $txt_parts[] = stripslashes($fieldTable->label) . ': ' . $value;
             }
         }
     }
     //$txt_parts = array_reverse($txt_parts);
     $txt = implode("<br />", $txt_parts);
     return $txt;
 }
示例#14
0
 function __construct(&$db = null)
 {
     $db =& JFactory::getDBO();
     $this->db =& $db;
     parent::__construct('#__dtregister_member_field_values', 'id', $db);
     $this->Tablefield =& DtrTable::getInstance('Field', 'Table');
     $this->TableField =& $this->Tablefield;
 }
示例#15
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();
 }
示例#16
0
 function __construct(&$db = null)
 {
     $db =& JFactory::getDBO();
     $this->db =& $db;
     $this->TableEventfeeorder =& DtrTable::getInstance('Feeorder', 'Table');
     $this->TableField =& DtrTable::getInstance('Field', 'Table');
     parent::__construct('#__dtregister_field_event', 'id', $db);
 }
示例#17
0
    function getConditonField()
    {
        global $mainframe;
        $document =& JFactory::getDocument();
        if (isset($document->_script["text/javascript"])) {
            unset($document->_script["text/javascript"]);
        }
        $field = $this->getModel('field')->table;
        $field->load(JRequest::getVar('field_id', 0));
        $childs = $field->getchild($published = 1);
        $selectionindex = JRequest::getVar('selection', '');
        $not_remove = JRequest::getVar('not_remove', array());
        if (!is_array($not_remove)) {
            $not_remove = array($not_remove);
        }
        if ($field->type == 1) {
            $selectionindex--;
        }
        $elements = array();
        // $event = new Event(JRequest::getVar('eventId',0));
        $childjs = "";
        $user = unserialize(base64_decode(JRequest::getVar('obj', '')));
        $eventId = JRequest::getVar('eventId', '');
        $event = DtrTable::getInstance('event', 'Table');
        $event->load($eventId);
        ///$evt_fields = $event->getAllFields();
        $remove_elements = array();
        $ordering = array();
        require_once JPATH_COMPONENT . "/views/field/view.html.php";
        $fieldView = new DtregisterViewField(array());
        if (is_array($fieldView->_path['template'])) {
            foreach ($fieldView->_path['template'] as $path) {
                if (file_exists($path)) {
                    $basepath = $path;
                    break;
                }
            }
        }
        if (is_array($childs)) {
            foreach ($childs as $key => $child) {
                $selection = explode('|', $child->selection_values);
                $ordering[$child->id] = $child->ordering;
                $selectionindex;
                $fieldType = DtrModel::getInstance('Fieldtype', 'DtregisterModel');
                $fieldTypes = $fieldType->getTypes();
                if (in_array($selectionindex, $selection)) {
                    $class = "Field_" . $fieldTypes[$child->type];
                    $childObj = new $class();
                    $childObj->load($child->id);
                    //if(isset($evt_fields[$child->id])){
                    //$child->required = $evt_fields[$child->id]->required ;
                    //}
                    $file = $basepath . "field_" . $fieldTypes[$child->type] . ".php";
                    if (!file_exists($file)) {
                        $file = $basepath . "default.php";
                    }
                    $child->label = stripslashes($child->label) . ":";
                    if ($child->required) {
                        $child->label = $child->label . " <span class='dtrequired'>&nbsp;&nbsp;*&nbsp;&nbsp;</span> ";
                    }
                    $tpl = file_get_contents($file);
                    $constants = array('[label]', '[value]', '[description]');
                    $description = trim($child->description) != "" ? JHTML::tooltip($child->description, '', 'tooltip.png', '', '') : '';
                    $replace = array($child->label, $childObj->formhtml($user, $event, 'adminForm', true), $description);
                    $childjs .= $childObj->childJs;
                    $elements[$child->id] = str_replace($constants, $replace, $tpl);
                } else {
                    $remove = true;
                    if (is_array($selection)) {
                        foreach ($selection as $val) {
                            if (in_array($val, $not_remove)) {
                                $remove = false;
                                break;
                            }
                        }
                    }
                    if ($remove) {
                        $remove_elements[$child->id] = $child->id;
                    }
                }
            }
        }
        $temp = $remove_elements;
        foreach ($remove_elements as $remove_element) {
            $rChilds = array();
            $field->findtree($remove_element, $rChilds);
            foreach ($rChilds as $rchild) {
                if (!in_array($rchild->id, array_keys($elements))) {
                    $temp[$rchild->id] = $rchild->id;
                }
            }
        }
        $remove_elements = $temp;
        ob_start();
        ?>

	 var elements = <?php 
        echo json_encode($elements);
        ?>
;

	 var remove_elements = <?php 
        echo json_encode($remove_elements);
        ?>
;

     var ordering = <?php 
        echo json_encode($ordering);
        ?>
;

     <?php 
        echo $childjs;
        echo chr(13);
        if (isset($document->_script["text/javascript"])) {
            echo $document->_script['text/javascript'];
        }
        $data = ob_get_clean();
        echo str_replace("\n", ' ', $data) . "/*DTendScript*/";
        die;
    }
示例#18
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');