function display($tpl = null) { $this->customer = JBFactory::getAccount(); $this->config = JComponentHelper::getParams('com_bookpro'); $this->getPlugins(); parent::display($tpl); }
public function display($tpl = null) { if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $user = JBFactory::getAccount(); $this->user = $user->user; $this->customer = $user->customer->table; //$this->station = AirportHelper::getItem($this->customer->city); // debug($this->station); // debug($this->customer); //Check agent $this->isAgent = BookProHelper::isAgent(); //Add bootstrap JHtml::_('bootstrap.tooltip'); JHtml::_('behavior.multiselect'); JHtml::_('formbehavior.chosen', 'select'); parent::display($tpl); }
public function display($tpl = null) { $model = new BookProModelOrders(); $this->setModel($model, true); $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->orderstatus = $this->getOrderStatusSelect($this->state->get('filter.order_status')); $this->paystatus = $this->getPayStatusSelect($this->state->get('filter.pay_status')); $this->ordertypes = $this->getOrderTypeSelect($this->state->get('filter.order_type')); $this->agent = JBFactory::getAccount(); $this->state->set('filter.user_id', $this->agent->id); $this->config = JBFactory::getConfig(); $this->authorise = $this->agent->authorise; $group_id = $this->state->get('filter.group_id'); if (is_null($group_id)) { $this->state->set('filter.group_id', $this->config->agent_usergroup); } parent::display($tpl); }
function display($tpl = null) { //Add bootstrap JHtml::_('bootstrap.tooltip'); JHtml::_('behavior.multiselect'); JHtml::_('formbehavior.chosen', 'select'); $mainframe = JFactory::getApplication(); $document = JFactory::getDocument(); $this->user = JBFactory::getAccount(); //debug($this->customer); die; $document->setTitle('My page'); //$this->assignRef('cities', $this->getCitySelectBox($this->customer->city,$this->customer->country_id)); $orderModel = new BookProModelOrders(); $state = $orderModel->getState(); $state->set('filter.user_id', (int) $this->user->id); //$state->set('filter.datefrom', $this->datefrom); //$state->set('filter.dateto', $this->dateto); //get order $this->pagination = $orderModel->getPagination(); $this->orders = $orderModel->getItems(); parent::display($tpl); }
public function display($tpl = null) { if (!$this->is_admin) { $model = new BookproModelpassengers(); $this->setModel($model, true); } $this->state = $this->get('State'); $tour_model = new BookProModelTours(); $this->tours = $tour_model->getItemByIds(); $tour_id = $this->state->get('filter.tour_id'); if (empty($tour_id)) { $this->state->set('filter.tour_id', $this->tours[0]->id); } $from_date = $this->state->get('filter.from_date'); if (empty($from_date)) { $this->state->set('filter.from_date', JHtml::date('now', 'Y-m-d')); } $to_date = $this->state->get('filter.to_date'); if (empty($to_date)) { $this->state->set('filter.to_date', JHtml::date('now', 'Y-m-d')); } $this->state->set('filter.order_status', 'CONFIRMED'); $this->state->set('list.limit', null); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->total_order = $this->get('TotalBooking'); $this->total_pass = $this->get('Total'); $this->agent = JBFactory::getAccount(); $this->authorise = $this->agent->authorise; if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } JHtml::_('formbehavior.chosen', 'select'); parent::display($tpl); }
<?php $customer = JBFactory::getAccount(); AImporter::helper('tour', 'currency', 'date', 'paystatus', 'orderstatus'); AImporter::model('orders', 'order'); $model = new BookProModelOrders(); $state = $model->getState(); $state->set('filter.user_id', $customer->id); $state->set('list.start', 0); $state->set('list.limit', 100); $orders = $model->getItems(); ?> <div class="row-fluid"> <div class="well well-small form-inline"> <div class="span6"> <div class="pull-left lead"> <?php echo JText::_('COM_BOOKPRO_LATEST_ORDER'); ?> </div> </div> </div> <div class="well well-small"> <div class="container-fluid" style="background-color: white;"> <form name="tourOrder" action="index.php"> <table class="table"> <thead> <tr> <th><?php echo JText::_("COM_BOOKPRO_ORDER_NUMBER");
public function bplogin() { //JSession::checkToken('post') or jexit(JText::_('JInvalid_Token')); $config = JBFactory::getConfig(); $user = JFactory::getUser(); $mainframe = JFactory::getApplication('site'); $return = JRequest::getVar('return', '', 'method', 'base64'); $return1 = JRequest::getVar('return', '', 'method', 'base64'); $return = base64_decode($return); $options = array(); $options['remember'] = JRequest::getBool('remember', false); $options['return'] = $return; //debug($return); die; $credentials = array(); $credentials['username'] = JRequest::getVar('username', '', 'method', 'username'); $credentials['password'] = JRequest::getString('password', '', 'post', JREQUEST_ALLOWRAW); $result = $mainframe->login($credentials, $options); if ($result) { $customer = JBFactory::getAccount(); if ($customer->is_agent) { $mainframe->redirect(JRoute::_('index.php?option=com_bookpro&view=agents', false)); } else { $mainframe->redirect(JRoute::_('index.php?option=com_bookpro&view=mypage', false)); } } else { $mainframe->redirect(JURI::base() . 'index.php?option=com_bookpro&view=login&return=' . $return1, false); } }
private function _checkUserRight($vName, $views) { $customer = JBFactory::getAccount(); $config = JBFactory::getConfig(); $checked = false; //echo "<pre>";print_r($views);die; if (in_array($vName, $views[$config->get('supplier_usergroup')]) && $customer->isSupplier) { $checked = true; } if (in_array($vName, $views[$config->get('customer_usergroup')]) && $customer->isNormal) { $checked = true; } if (in_array($vName, $views[$config->get('agent_usergroup')]) && $customer->isAgent) { $checked = true; } return $checked; }
protected function store() { $user = JBFactory::getAccount(); if (empty($this->data)) { $this->error = new JObject(); $this->error->code = 1; $this->error->msg = 'Empty data'; return false; } if ($user->is_agent) { $this->data['agent_id'] = $user->id; } if (!is_object($this->data['params'])) { $this->data['params'] = json_decode($this->data['params']); } $sunpass = new JbObject(); $sunpass->number = trim($this->customer['sunpass']); $sunpass->log = ''; $this->data['params']->sunpass = $sunpass; $this->data['params'] = json_encode($this->data['params']); return $this->table->save($this->data); }
<label class="control-label"><?php echo JText::_('COM_BOOKPRO_REQUEST_DESC'); ?> </label> <div class="controls"> <textarea name="orderinfo[notes]" required cols="40" rows="10"></textarea> </div> </div> <div> <legend><?php echo JText::_('COM_BOOKPRO_CUSTOMER'); ?> </legend> <?php echo BookproHelper::renderLayout('customer', JBFactory::getAccount()); ?> </div> <div class="form-actions"> <button class="btn btn-primary btn-large" type="submit"><?php echo JText::_('COM_BOOKPRO_SUBMIT'); ?> </button> </div> </fieldset> <input type="hidden" name="task" value="charter.postRequest"/> <input type="hidden" name="option" value="com_bookpro"/> <?php