Esempio n. 1
0
 function events()
 {
     $startdate = JREquest::getVar('showdate');
     $viewtype = JREquest::getVar('viewtype', 'month');
     $cat = JREquest::getVar('cat', 'all');
     $daterange = DTrCommon::getDateRangeByViewType($startdate, $viewtype);
     $mevt = $this->getModel('event');
     $tevt = $mevt->table;
     $query = $mevt->listingQuery($daterange, $cat);
     ///  prd($query);
     $events = $tevt->query($query, null, null);
     $this->view->assign('eventTable', $tevt);
     $this->view->assign('events', $events);
     $this->display();
 }
Esempio n. 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();
 }
Esempio n. 3
0
 function delete()
 {
     global $mainframe, $Itemid;
     $key = JRequest::getVar('key');
     $userId = DT_Session::get('register.User.members.' . $key . '.groupUserId');
     $memtot = DTrCommon::cntMemtotInSession(DT_Session::get('register.User.members'));
     $tUser = $this->getModel('user')->table;
     $tUser->load($userId);
     $tEvt = $this->getModel('event')->table;
     $tEvt->load($tUser->eventId);
     $min = $tEvt->min_group_size == "" ? 2 : $tEvt->min_group_size;
     if ($memtot <= $min) {
         $mainframe->redirect("index.php?option=com_dtregister&controller=member&userId=" . $userId . "&Itemid=" . $Itemid, JText::_('DT_MEMBER_REMOVE_ERROR'));
     }
     $memtot = DT_Session::get('register.User.memtot');
     $memtot--;
     DT_Session::set('register.User.memtot', $memtot);
     DT_Session::set('register.User.members.' . $key . '.remove', true);
     $mainframe->redirect("index.php?option=com_dtregister&controller=member&userId=" . $userId . "&Itemid=" . $Itemid);
 }
Esempio n. 4
0
 function edit_group()
 {
     global $mainframe, $Itemid;
     $mUser = $this->getModel('user');
     $tUser = $mUser->table;
     $userId = JRequest::getVar('userId', 0);
     if (isset($_POST['formsubmit'])) {
         if (isset($_POST['memtot']) && $_POST['memtot'] != "") {
             DT_Session::set('register.User.memtot', $_POST['memtot']);
         }
         $userId = $_POST['User']['userId'];
         $link = JRoute::_("index.php?option=com_dtregister&controller=user&task=edit&userId=" . $userId . "&Itemid=" . $Itemid, $xhtml_url);
         $mainframe->redirect($link);
     }
     $tUser->load($userId);
     DT_Session::set('register.Event.eventId', $tUser->eventId);
     $userObj = $tUser->getObjData();
     $user = DTrCommon::objectToArray($userObj);
     $user['process'] = 'change';
     $eventId = $tUser->eventId;
     $this->view->assign('header_eventId', $eventId);
     // pr(DTrCommon::objectToArray($userObj));
     // pr($user);
     $type = $tUser->type == 'I' ? 'I' : 'B';
     $tUser->TableEvent->duplicate_check = false;
     // $this->view->assign( 'form' ,$tUser->TableEvent->form($type,(array)$tUser,false,'frmcart',true));
     $tUser->TableEvent->load($eventId);
     $this->view->assign('tEvent', $tUser->TableEvent);
     $this->view->assign('mUser', $mUser);
     $this->display();
 }
Esempio n. 5
0
 function getIndividualRate($row = null)
 {
     $this->slabId = !$row ? $this->slabId : $row->slabId;
     $groups = $this->getGroup(' member=1 ');
     $amount = isset($groups[0]) ? $groups[0]->amount : 0;
     if (isset($row->bird) && $row->bird == 'y') {
         $amount = DTrCommon::birdDiscountCalc($row->bird_discount_type, $row->bird_discount_amount, $amount);
     }
     return $amount;
 }
Esempio n. 6
0
    //$where[]  = " b.public = 1 ";
}
$user =& JFactory::getUser();
$rows1 = $categoryTable->find('published = 1 and access <= ' . $user->get('aid'), 'ordering');
$rows2 = $locationTable->find(' 1=1 ');
$arrLocation = array();
foreach ($rows2 as $rows) {
    $arrLocation[$rows->id] = $rows->name;
}
$arrCategory = array();
for ($i = 0, $n = count($rows1); $i < $n; $i++) {
    $row1 = $rows1[$i];
    $catId = $row1->categoryId;
    $catName = $row1->categoryName;
    $tmpArr = array($catId => $catName);
    DTrCommon::array_push_associative($arrCategory, $tmpArr);
}
$rows = $eventTable->findAllByCategoryTree($categoryTable->orderByParent($rows1), implode(' and ', array_filter($where)), " c.ordering, b.ordering ASC ");
// pr($rows);
?>

 <script type="text/javascript">

    //<![CDATA[

	DTjQuery(function(){ 

	  window.status='test';

	  DTjQuery(".colorbox").colorbox({width:550, height:550,iframe:true});