Esempio n. 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);
 }
Esempio n. 2
0
 /**
  * Print passenger manifest to pdf
  */
 function exportpdf()
 {
     AImporter::model('passengers');
     $app = JFactory::getApplication();
     $input = $app->input;
     AImporter::helper('pdf', 'date');
     $model = new BookproModelpassengers(array('ignore_request' => 0));
     if ($app->isAdmin()) {
         $ticket_view = $this->getView('passengers', 'html', 'BookProView');
     } else {
         $ticket_view = $this->getView('AgentPassengers', 'html', 'BookProView');
         $ticket_view->is_admin = 1;
     }
     $ticket_view->setModel($model, true);
     $ticket_view->setLayout('report');
     ob_start();
     $ticket_view->display();
     $pdf = ob_get_contents();
     ob_end_clean();
     $order = new JObject();
     $order->name = 'Tour_report' . '_export_time_' . JHtml::date('now', 'Y-m-d-H-i-s');
     $order->fontsize = 7;
     PrintPdfHelper::printTicket($pdf, $order, 'P');
     return;
 }
Esempio n. 3
0
 /**
  * Save subject.
  *
  * @param boolean $apply true state on edit page, false return to browse list
  */
 function save($apply = false)
 {
     $task = $this->getTask();
     JRequest::checkToken() or jexit('Invalid Token');
     $mainframe = JFactory::getApplication();
     $input = $mainframe->input;
     $post = JRequest::get('post');
     $post['desc'] = JRequest::getVar('desc', '', 'post', 'string', JREQUEST_ALLOWRAW);
     $post['jform']['meal'] = implode(';', $post['jform']['meal']);
     //debug($post['jform']); die;
     $db = JFactory::getDbo();
     AImporter::table('itinerary');
     $Table = new TableItinerary($db);
     $Table->bind($post['jform']);
     $Table->store();
     $id = $Table->id;
     if ($id !== false) {
         $mainframe->enqueueMessage(JText::_('Successfully saved'), 'message');
     } else {
         $mainframe->enqueueMessage(JText::_('Save failed'), 'error');
     }
     if ($task != 'save') {
         $mainframe->redirect('index.php?option=com_bookpro&view=itinerary&layout=edit&id=' . $id);
     } else {
         $mainframe->redirect('index.php?option=com_bookpro&view=itineraries');
     }
 }
Esempio n. 4
0
 protected function populateState($ordering = null, $direction = null)
 {
     AImporter::helper('date');
     parent::populateState();
     $app = JFactory::getApplication();
     $id = JRequest::getVar('id', 0, '', 'int');
     $this->setState('passengerlist.id', $id);
     // Load the filter state.
     $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
     $this->setState('filter.search', $search);
     $order_id = $this->getUserStateFromRequest($this->context . '.filter.order_id', 'filter_order_id', null, 'int');
     $this->setState('filter.order_id', $order_id);
     $tour_id = $this->getUserStateFromRequest($this->context . '.filter.tour_id', 'filter_tour_id', null, 'int');
     $this->setState('filter.tour_id', $tour_id);
     $depart_date = $this->getUserStateFromRequest($this->context . '.filter.depart_date', 'filter_depart_date', null);
     $depart_date = DateHelper::createFromFormatYmd($depart_date);
     $this->setState('filter.depart_date', $depart_date);
     $order_status = $this->getUserStateFromRequest($this->context . '.filter.order_status', 'filter_order_status', null, 'string');
     $this->setState('filter.order_status', $order_status);
     $value = $app->getUserStateFromRequest($this->context . '.ordercol', 'filter_order', $ordering);
     $this->setState('list.ordering', $value);
     $value = $app->getUserStateFromRequest($this->context . '.orderdirn', 'filter_order_Dir', $direction);
     $this->setState('list.direction', $value);
     $fromdate = $this->getUserStateFromRequest($this->context . '.filter.from_date', 'filter_from_date', null, 'string');
     $fromdate = DateHelper::createFromFormatYmd($fromdate);
     $this->setState('filter.from_date', $fromdate);
     $todate = $this->getUserStateFromRequest($this->context . '.filter.to_date', 'filter_to_date', null, 'string');
     $todate = DateHelper::createFromFormatYmd($todate);
     $this->setState('filter.to_date', $todate);
 }
 function exportPDF()
 {
     $app = JFactory::getApplication();
     $input = $app->input;
     AImporter::helper('pdf', 'date');
     AImporter::model('transportreports');
     $model = new BookproModelTransportReports();
     $depart_date = DateHelper::createFromFormatYmd($input->get('filter_depart_date'));
     $state = $model->getState();
     $state->set('list.limit', NULL);
     $state->set('list.start', 0);
     $state->set('list.ordering', 'pickup');
     $state->set('list.direction', 'ASC');
     if ($app->isAdmin()) {
         $ticket_view = $this->getView('Transportreports', 'html', 'BookProView');
     } else {
         $ticket_view = $this->getView('AgentTransportreports', 'html', 'BookProView');
         $ticket_view->is_admin = 1;
     }
     $ticket_view->setModel($model, true);
     $ticket_view->setLayout('report');
     ob_start();
     $ticket_view->display();
     $pdf = ob_get_contents();
     ob_end_clean();
     //get flight name
     $order = new JObject();
     $order->name = "transport_report" . $input->get('filter_depart_date') . '_' . JHtml::_('date', 'now', 'YmdHis');
     $order->fontsize = 9;
     PrintPdfHelper::printTicket($pdf, $order, 'P');
     return;
 }
 function __construct()
 {
     parent::__construct();
     if (!class_exists('TablePackagerate')) {
         AImporter::table('packagerate');
     }
     $this->_table = $this->getTable('packagerate');
 }
Esempio n. 7
0
 static function getItems($ids = null, $model = false)
 {
     if (empty($model)) {
         AImporter::model('vehicles');
         $model = new BookproModelVehicles();
     }
     return $model->getItemByIds($ids);
 }
Esempio n. 8
0
 function __construct()
 {
     parent::__construct();
     if (!class_exists('TableTour')) {
         AImporter::table('tour');
     }
     $this->_table = $this->getTable('tour');
 }
Esempio n. 9
0
 public function getType()
 {
     AImporter::helper('transport');
     $type = TransportHelper::getType();
     $options = array();
     $options[] = JHTML::_('select.option', '', JText::_('COM_BOOKPRO_TYPE'), 'value', 'text');
     $options = array_merge($options, $type);
     return JHTML::_('select.genericlist', $options, 'filter_type', ' class="inputbox" ', 'value', 'text', $this->state->get('filter.type'), 'filter_type');
 }
Esempio n. 10
0
 function getCustomerSelectBox($select)
 {
     AImporter::model('customers');
     $model = new BookProModelCustomers();
     $state = $model->getState();
     $state->set('list.start', 0);
     $state->set('list.limit', 0);
     $fullList = $model->getItems();
     //getData();
     return AHtml::getFilterSelect('user_id', 'Select Customer', $fullList, $select, false, '', 'id', 'firstname');
 }
Esempio n. 11
0
 public function display($tpl = null)
 {
     AImporter::model('vehicles');
     $model = new BookproModelVehicles();
     $this->items = $model->getTypes();
     if (count($error = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     parent::display($tpl);
 }
Esempio n. 12
0
 function display($tpl = null)
 {
     $this->state = $this->get('State');
     AImporter::model('tour');
     $tourModel = new BookProModelTour();
     $tour = $tourModel->getItem($this->state->get('filter.obj_id'));
     $this->title = 'Room';
     $this->text = $tour->title;
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->addToolbar();
     parent::display($tpl);
 }
Esempio n. 13
0
 function getCitySelectBox($select)
 {
     AImporter::model('airports');
     $model = new BookProModelAirports();
     $state = $model->getState();
     $state->set('list.start', 0);
     $state->set('list.limit', 0);
     $state->set('list.state', 1);
     $state->set('list.province', 1);
     $state->set('list.parent_id', 1);
     $fullList = $model->getItems();
     return JHTML::_('select.genericlist', $fullList, 'jform[city]', ' class="inputbox" ', 'id', 'title', $select, 'jform[city]');
 }
Esempio n. 14
0
 protected function saveOrderInfo()
 {
     //save order info
     AImporter::table('orderinfo');
     AImporter::helper('date');
     $this->orderinfo['params']['start'] = DateHelper::createFromFormatYmd($this->orderinfo['params']['start']);
     $this->orderinfo['params']['end'] = DateHelper::createFromFormatYmd($this->orderinfo['params']['end']);
     $orderinfo = $this->orderinfo;
     $orderinfo['order_id'] = $this->table->id;
     $orderinfo['params'] = json_encode($this->orderinfo['params']);
     $orderinfo['start'] = $this->orderinfo['params']['start'];
     $TableOrderinfo = new TableOrderInfo($this->_db);
     return $TableOrderinfo->save($orderinfo);
 }
Esempio n. 15
0
 protected function getOptions()
 {
     AImporter::helper('vehicle');
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select('id AS value, title AS text');
     $query->from('#__bookpro_vehicle');
     $query->where('state = 1');
     $db->setQuery($query);
     $options = array();
     $options = $db->loadObjectList();
     $options = array_merge(parent::getOptions(), $options);
     return $options;
 }
Esempio n. 16
0
 static function getDayWeek($name)
 {
     AImporter::helper('date');
     $days = DateHelper::dayofweek();
     $daysweek = array();
     foreach ($days as $key => $value) {
         $object = new stdClass();
         $object->key = $key;
         $object->value = $value;
         $daysweek[] = $object;
     }
     $selected = array_keys($days);
     return AHtml::checkBoxList($daysweek, $name, '', $selected, 'key', 'value');
 }
Esempio n. 17
0
 public function delete()
 {
     JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
     $cid = JFactory::getApplication()->input->getInt('cid');
     if (!$cid) {
         $this->setMessage('Delete failed!');
     } else {
         AImporter::table('vehicletype');
         $db = JFactory::getDbo();
         $table = new TableVehicleType($db);
         $table->load($cid);
         $result = $table->delete();
     }
     if ($result) {
         $this->setMessage('Delete successfull!');
     } else {
         $this->setMessage('Delete failed!');
     }
     $this->directView();
 }
Esempio n. 18
0
 function deleteRateDate()
 {
     $id = JRequest::getInt('id', 0);
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     if ($id) {
         $query->delete('#__bookpro_tourrate');
         $query->where('id=' . $id);
         $db->setQuery($query);
         $db->query();
     }
     $calendar_attributes = array('min_select_year' => JFactory::getDate('-1 years')->format('Y'), 'max_select_year' => JFactory::getDate('+1 years')->format('Y'));
     if (isset($_REQUEST['action']) and $_REQUEST['action'] == 'pn_get_month_cal') {
         require_once JPATH_COMPONENT_ADMINISTRATOR . '/classes/calendar.php';
         AImporter::css('calendar');
         $calendar = new PN_Calendar($calendar_attributes);
         echo $calendar->draw(array(), $_REQUEST['year'], $_REQUEST['month']);
         exit;
     }
 }
Esempio n. 19
0
 public function postRequest()
 {
     $token = JSession::checkToken();
     if (!$token) {
         die('Invail request');
     }
     $app = jfactory::getApplication();
     AImporter::helper('email');
     AImporter::classes('order/custom');
     $order = new BookproCustomOrder();
     $order->orderinfo = $this->input->get('orderinfo', array(), 'array');
     $order->customer = $_POST;
     $db = JFactory::getDbo();
     if ($order->save()) {
         $mail = new EmailHelper($order->table->id);
         $mail->sendMail();
         $app->enqueueMessage(JText::_('COM_BOOKPRO_CUSTOM_THANKS_FOR_BOOKING'));
     }
     $app->redirect('index.php?option=com_bookpro&view=customservice');
     return;
 }
Esempio n. 20
0
 function getObjectByID($id)
 {
     AImporter::model('orderinfos', 'customer');
     $query = 'SELECT `obj`.*, c.mobile,c.firstname,c.email FROM `' . $this->_table->getTableName() . '` AS `obj` ';
     $query .= 'LEFT JOIN `#__bookpro_customer` AS `c` ON `c`.`id` = `obj`.`user_id` ';
     $query .= 'WHERE `obj`.`id` = ' . (int) $id;
     $this->_db->setQuery($query);
     $obj =& $this->_db->loadObject();
     //load orderinfo
     $infosmode = new BookProModelOrderinfos();
     $infolists = array('order_id' => $id);
     $infosmode->init($infolists);
     $infos = $infosmode->getData();
     $obj->infos = $infos;
     //load customer
     $customerModel = new BookProModelCustomer();
     //$customerModel->setId($obj->user_id);
     $customer = $customerModel->getItem($obj->user_id);
     //getObject();
     $obj->customer = $customer;
     return $obj;
 }
Esempio n. 21
0
 public function __construct($id = false, $typeChart = false, $option = false, $title = false)
 {
     if (!class_exists('BookProHelper')) {
         AImporter::helper('bookpro');
     }
     //Check is backend or frontend
     if (JFactory::getApplication()->isAdmin()) {
         $this->isBackend = true;
     } else {
         $this->isBackend = false;
     }
     $this->isAgent = BookProHelper::isAgent();
     if ($id) {
         $this->id = $id;
     }
     if ($typeChart) {
         $this->typeChart = $typeChart;
     } else {
         $this->typeChart = 'LineChart';
     }
     $this->optionChart = $option;
     $this->titleChart = $title;
 }
Esempio n. 22
0
 private function getPlugins()
 {
     $dispatcher = JDispatcher::getInstance();
     AImporter::helper('plugin');
     $payment_plugins = PluginHelper::getPluginsWithEvent('onBookproGetPaymentPlugins');
     $plugins = array();
     if ($payment_plugins) {
         foreach ($payment_plugins as $plugin) {
             $results = $dispatcher->trigger("onBookproGetPaymentOptions", array($plugin->element, ''));
             if (in_array(true, $results, true)) {
                 $plugins[] = $plugin;
             }
         }
     }
     if (count($plugins) == 1) {
         $plugins[0]->checked = true;
         ob_start();
         $this->getPaymentForm($plugins[0]->element);
         $html = json_decode(ob_get_contents());
         ob_end_clean();
         $this->assign('payment_form_div', $html->msg);
     }
     $this->assign('plugins', $plugins);
 }
Esempio n. 23
0
 public function addLanguage()
 {
     AImporter::helper('xml', 'params');
     $clone_lang = JFactory::getApplication()->input->getString('lang');
     $config = ParamesHelper::getLanguageConfig();
     //		$en_admin_list = preg_filter('/^/', $config['main_lang'].'.', $adminArray);
     //		$en_site_list = preg_filter('/^/', $config['main_lang'].'.', $siteArray);
     //
     //		$clone_admin_list = preg_filter('/^/', $clone_lang.'.', $adminArray);
     //		$clone_site_list = preg_filter('/^/', $clone_lang.'.', $siteArray);
     //copy file
     $addmin_path_main = $config['folder_admin'] . DS . $config['main_lang'] . DS . $config['main_lang'];
     $addmin_path_clone = $config['folder_admin'] . DS . $clone_lang . DS . $clone_lang;
     foreach ($config['file_admin'] as $value) {
         $check = JFile::copy($addmin_path_main . '.' . $value, $addmin_path_clone . '.' . $value);
     }
     $site_path_main = $config['folder_site'] . DS . $config['main_lang'] . DS . $config['main_lang'];
     $site_path_clone = $config['folder_site'] . DS . $clone_lang . DS . $clone_lang;
     foreach ($config['file_site'] as $value) {
         $check = JFile::copy($site_path_main . '.' . $value, $site_path_clone . '.' . $value);
     }
     $this->setRedirect('index.php?option=com_bookpro&view=languages&layout=list&language=' . $clone_lang, $check ? 'Add language success' : 'Add language false', $check ? null : 'error');
     return;
 }
<?php

/**
 * @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$
 **/
defined('_JEXEC') or die('Restricted access');
AImporter::helper('transport');
?>
	<?php 
echo JLayoutHelper::render('transport_process_bar', 5, JPATH_ROOT . '/components/com_bookpro/layouts');
?>
	<?php 
echo BookProHelper::renderLayout('transport_info', $this->orderComplex);
echo BookProHelper::renderLayout('passengers', $this->orderComplex->passengers);
echo BookProHelper::renderLayout('addons', $this->orderComplex->addons);
?>
	
		
		
		
Esempio n. 25
0
<?php

/**
 * @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: flight.php 105 2012-08-30 13:20:09Z quannv $
 **/
defined('_JEXEC') or die('Restricted access');
AImporter::model('bustrips', 'bustrip', 'passengers');
AImporter::helper('date');
$passModel = new BookProModelPassengers();
$lists = array('order_id' => $this->order->id);
$passModel->init($lists);
$passengers = $passModel->getData();
$config = AFactory::getConfig();
?>

<fieldset class="adminform">
	<legend>
	<?php 
echo JText::_('Trip Information');
?>
	</legend>

	<table class="table">
	
		<thead>
			<tr>
Esempio n. 26
0
<?php

/**
 * @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: view.html.php 26 2012-07-08 16:07:54Z quannv $
 **/
defined('_JEXEC') or die;
AImporter::helper('tour');
class BookProViewItineraries extends JViewLegacy
{
    protected $items;
    protected $state;
    protected $pagination;
    //protected $lists;
    public function display($tpl = null)
    {
        $this->tour_id = JFactory::getApplication()->input->get('tour_id');
        $this->items = $this->get('Items');
        $this->state = $this->get('State');
        if ($this->tour_id) {
            $this->state->set('filter.tour_id', $this->tour_id);
        } else {
            $this->tour_id = $this->state->get('filter.tour_id');
        }
        $this->pagination = $this->get('Pagination');
        $this->tours_filter = TourHelper::getToursFilter('tour_id', $this->tour_id);
        if (count($errors = $this->get('Errors'))) {
Esempio n. 27
0
<?php

defined('_JEXEC') or die('Restricted access');
AImporter::helper('date', 'js', 'html');
Aimporter::model('application');
class BookproViewCustomService extends JViewLegacy
{
    function display($tpl = null)
    {
        $model = new BookProModelApplication();
        $this->content = $model->getItemByCode('CUSTOMIZE_SERVICES');
        parent::display($tpl);
    }
    function getServices()
    {
        $options = array((object) array('value' => '', 'title' => JText::_('COM_BOOKPRO_CUSTOMIZE_SELECT')), (object) array('value' => 'TOUR', 'title' => JText::_('COM_BOOKPRO_CUSTOMIZE_TOUR')), (object) array('value' => 'EXECUTIVE_CAR', 'title' => JText::_('COM_BOOKPRO_CUSTOMIZE_EXECUTIVE_CAR')), (object) array('value' => 'LIMO', 'title' => JText::_('COM_BOOKPRO_CUSTOMIZE_LIMO')), (object) array('value' => 'OTHER', 'title' => JText::_('COM_BOOKPRO_CUSTOMIZE_OTHER')));
        return JHTML::_('select.genericlist', $options, 'orderinfo[type]', 'required class="inputbox required" ', 'value', 'title', null, 'orderinfo_type');
    }
}
<?php

defined('_JEXEC') or die('Restricted access');
AImporter::model('addons');
AImporter::helper('bookpro');
$service_depart = json_decode($this->trips['depart']->params);
$check = false;
foreach ($service_depart as $service) {
    if (!empty($service)) {
        $check = true;
    }
}
if ($this->cart->filter['roundtrip']) {
    $service_return = json_decode($this->trips['return']->params);
    foreach ($service_return as $service) {
        if (!empty($service)) {
            $check = true;
        }
    }
}
if (!$check) {
    return;
}
$model = new BookProModeladdons();
?>
<script type="text/javascript">

jQuery(document).ready(function($){	
    jQuery(".addonClick").click(function(){
           var addon= new Array();
           	  $('.addonClick').each(function(){
 public function exportPDF()
 {
     AImporter::controller('passengers');
     $controller = new BookproControllerPassengers();
     return $controller->exportpdf();
 }
Esempio n. 30
0
<?php

/**
 * @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 $
 **/
defined('_JEXEC') or die;
AImporter::model('tourrate', 'tour');
class BookproViewRatedetail extends JViewLegacy
{
    public function display($tpl = null)
    {
        $app = JFactory::getApplication();
        $input = $app->input;
        $this->tour_id = $input->get('tour_id', 0);
        $this->date = $input->get('date', null);
        $model = new BookProModelTourRate();
        $this->rates = $model->getRateTour($this->tour_id, $this->date);
        $tour_model = new BookProModelTour();
        $this->tour = $tour_model->getItem($this->tour_id);
        parent::display($tpl);
    }
}