예제 #1
0
 function display($tpl = null)
 {
     $this->config = JBFactory::getConfig();
     $input = JFactory::getApplication()->input;
     AImporter::model('tour');
     $cart = JModelLegacy::getInstance('TourCart', 'bookpro');
     $cart->load();
     $cart->clear();
     $model = new BookProModelTour();
     $id = $input->getInt('id');
     $this->tour = $model->getComplexItem($id);
     $this->itineraries = TourHelper::buildItinerary($id);
     //$this->packages	= $packages;
     $date = TourHelper::getDateFirstInPackagerateFromTourid($this->tour->id);
     $this->date = JFactory::getDate($date)->format(DateHelper::getConvertDateFormat('P'));
     $this->tour->rdate = $this->date;
     $dispatcher = JDispatcher::getInstance();
     //$this->_prepareDocument();
     //		$dispatcher		= JDispatcher::getInstance();
     //		$this->event 	= new stdClass();
     //		JPluginHelper::importPlugin('bookpro');
     //		$results 		= $dispatcher->trigger('onBookproProductAfterTitle', array ($this->tour));
     //		$this->event->afterDisplayTitle=isset($results[0])?$results[0]:null;
     parent::display($tpl);
 }
예제 #2
0
 function display($tpl = null)
 {
     $this->customer = JBFactory::getAccount();
     $this->config = JComponentHelper::getParams('com_bookpro');
     $this->getPlugins();
     parent::display($tpl);
 }
예제 #3
0
 function display($tpl = null)
 {
     $this->input = JFactory::getApplication()->input;
     $order_number = $this->input->getString('order_number');
     $email = $this->input->getString('email');
     if ($order_number) {
         $orderModel = new BookProModelOrder();
         $order = $orderModel->getByOrderNumber($order_number);
         $order_id = $order->id;
         $model = new BookProModelOrder();
         $this->orderComplex = $model->getComplexItem($order_id);
         if ($this->orderComplex->customer->email == $email) {
             $this->config = JBFactory::getConfig();
             $this->order = $this->orderComplex->order;
             $this->customer = $this->orderComplex->customer;
             $this->orderinfo = $this->orderComplex->orderinfo;
             $this->passengers = $this->orderComplex->passengers;
             $this->tour = $this->orderComplex->tour;
         } else {
             JFactory::getApplication()->enqueueMessage(JText::_('COM_BOOKPRO_WRONG_ORDER_NUMBER_OR_EMAIL_WARN'));
             $this->setLayout('check');
         }
     } else {
         $this->setLayout('check');
     }
     parent::display($tpl);
 }
예제 #4
0
 /**
  * Get Joombooking config
  * @return JRegistry
  */
 static function getConfig()
 {
     if (!isset(self::$config)) {
         self::$config = JComponentHelper::getParams('com_bookpro')->toObject();
     }
     return self::$config;
 }
예제 #5
0
 function display($tpl = null)
 {
     $this->document = JFactory::getDocument();
     $user = JFactory::getUser();
     $config = JBFactory::getConfig();
     if ($user->id && in_array($config->get('supplier_usergroup'), $user->groups)) {
         JFactory::getApplication()->redirect(JUri::base() . 'index.php?option=com_bookpro&view=supplierpage&Itemid=' . JRequest::getVar('Itemid'));
     }
     $this->document->setTitle(JText::_('COM_BOOKPRO_REGISTER_VIEW'));
     parent::display($tpl);
 }
예제 #6
0
 public function EmailHelper($order_id = null)
 {
     $this->config = JBFactory::getConfig();
     if ($order_id) {
         AImporter::model('order', 'customer', 'orderinfos');
         $orderModel = new BookProModelOrder();
         $this->orderComplex = $orderModel->getComplexItem($order_id);
         $this->order = $this->orderComplex->order;
         $this->orderinfo = $this->orderComplex->orderinfo;
         $this->customer = $this->orderComplex->customer;
         $applicationModel = new BookProModelApplication();
         $this->app = $applicationModel->getItemByCode($this->order->type);
         $config = jcomponenthelper::getParams('com_bookpro');
         $cdct = JTable::getInstance('Content', 'JTable');
         $cdct->load(array('id' => $config->get('term_content_id')));
         $this->app->cdct = $cdct;
     }
 }
예제 #7
0
 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);
 }
예제 #8
0
 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);
 }
예제 #9
0
 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);
 }
예제 #10
0
 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);
 }
예제 #11
0
<?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");
예제 #12
0
/**
 * @package 	Bookpro
 * @author 		Ngo Van Quan
 * @link 		http://joombooking.com
 * @copyright 	Copyright (C) 2011 - 2012 Ngo Van Quan
 * @license 	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 * @version 	$Id: bookpro.php 80 2012-08-10 09:25:35Z quannv $
 **/
// no direct access
defined('_JEXEC') or die('Restricted access');
AImporter::helper('date');
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', 'select');
$config = JBFactory::getConfig();
BookProHelper::setSubmenu(1);
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$sortFields = array();
if ($config->ps_gender) {
    $sortFields['a.gender'] = JText::_('COM_BOOKPRO_PASSENGER_GENDER');
}
if ($config->ps_firstname) {
    $sortFields['a.firstname'] = JText::_('COM_BOOKPRO_PASSENGER_FIRSTNAME');
}
if ($config->ps_lastname) {
    $sortFields['a.lastname'] = JText::_('COM_BOOKPRO_PASSENGER_LASTNAME');
}
if ($config->ps_birthday) {
    $sortFields['a.birthday'] = JText::_('COM_BOOKPRO_PASSENGER_BIRTHDAY');
예제 #13
0
 function register()
 {
     AImporter::helper('bookpro');
     JSession::checkToken() or die(JText::_('Invalid Token'));
     $config = JBFactory::getConfig();
     $mainframe = JFactory::getApplication();
     $user = JFactory::getUser();
     $params = JComponentHelper::getParams('com_users');
     $useractivation = $params->get('useractivation');
     $input = $mainframe->input;
     $post = $input->getArray($_POST);
     $db = JFactory::getDbo();
     try {
         $db->transactionStart();
         $post['name'] = $post['firstname'] . ' ' . $post['lastname'];
         $cuser = new JUser();
         $cuser->bind($post);
         $cuser->name = $post['name'];
         //check Username
         if (!$this->checkUsernamePHP($post['username'])) {
             $mainframe->enqueueMessage(JText::_('COM_BOOKPRO_USERNAME_EXISTS'), 'warning');
             $view = $this->getView('register', 'html', 'BookProView');
             $view->assign('customer', (object) $post);
             $view->display();
             return;
         }
         if (!$this->checkEmailPHP($post['email'])) {
             $mainframe->enqueueMessage(JText::_('COM_BOOKPRO_EMAIL_EXISTS'), 'warning');
             $view = $this->getView('register', 'html', 'BookProView');
             $view->assign('obj', (object) $post);
             $view->display();
             return;
         }
         $cuser->activation = $useractivation;
         if ($post['group_id']) {
             $cuser->groups = array($post['group_id']);
         } else {
             $cuser->groups = array($config->get('customer_usergroup', 2));
         }
         $cuser->sendEmail = 1;
         $cuser->registerDate = JFactory::getDate()->toSql();
         $cuser->save();
         AImporter::classes('customer');
         $jbuser = new BookproCustomer();
         $post['user'] = $cuser->id;
         $post['state'] = 1;
         $jbuser->saveNewCustomer($post);
         $db->transactionCommit();
     } catch (Exception $e) {
         $mainframe->enqueueMessage($e->getMessage());
         $db->transactionRollback();
         $this->setRedirect(JUri::base() . 'index.php?option=com_bookpro&view=register');
     }
     if ($useractivation == 1 || $useractivation == 2) {
         $post['activation'] = JApplication::getHash(JUserHelper::genRandomPassword());
         $post['block'] = 1;
     }
     //handle email notification
     if ($useractivation == 1) {
         $config = JFactory::getConfig();
         $post['fromname'] = $config->get('fromname');
         $post['mailfrom'] = $config->get('mailfrom');
         $post['sitename'] = $config->get('sitename');
         $post['siteurl'] = JUri::root();
         $post['activate'] = JUri::base() . 'index.php?option=com_users&task=registration.activate&token=' . $post['activation'];
         $emailSubject = JText::sprintf('COM_BOOKPRO_EMAIL_ACCOUNT_DETAILS', $post['name'], JUri::base());
         $emailBody = JText::sprintf('COM_BOOKPRO_EMAIL_REGISTERED_WITH_ACTIVATION_BODY', $post['name'], $post['sitename'], $post['activate'], JUri::base(), $post['username']);
         $return = JFactory::getMailer()->sendMail($post['mailfrom'], $post['fromname'], $post['email'], $emailSubject, $emailBody);
     }
     //redirect to complete view
     if ($useractivation == 1 || $useractivation == 2) {
         $this->setMessage(JText::_('COM_USERS_REGISTRATION_COMPLETE_ACTIVATE'));
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=registration&layout=complete', false));
         return;
     }
     AImporter::helper('email');
     $mailer = new EmailHelper();
     if (isset($config->sendRegistrationsEmails) && $config->sendRegistrationsEmails > 0) {
         $mailer->registerNotify($id);
     }
     if ($config->get('auto_login')) {
         $options = array();
         $options['remember'] = JRequest::getBool('remember', true);
         $credentials['username'] = JRequest::getVar('username', '', 'method', 'username');
         $credentials['password'] = JRequest::getString('password', '', 'post', JREQUEST_ALLOWRAW);
         $error = $mainframe->login($credentials, $options);
     }
     $return = JRequest::getVar('return');
     if ($return) {
         $mainframe->redirect(base64_decode($return));
     } else {
         $mainframe->redirect(JURI::base() . 'index.php');
     }
 }
예제 #14
0
 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;
 }
예제 #15
0
 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);
 }
예제 #16
0
			<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