Ejemplo n.º 1
0
 function getmeals($meals)
 {
     //$meals=strtolower($meals);
     //$meals=explode(';',$meals);
     $lists = TourHelper::getMealList();
     return AHtml::bootrapCheckBoxList($lists, 'jform[meal][]', '', $meals, 'id', 'title');
 }
Ejemplo n.º 2
0
 function getGroupselect($selected, $name)
 {
     $model = new BookProModelCGroups();
     $lists = array('state' => 1);
     $model->init($lists);
     $fullList = $model->getData();
     return AHtml::getFilterSelect('group_id', 'Select Group', $fullList, $selected, false, '', 'id', 'title');
 }
Ejemplo n.º 3
0
 function getCategoryBox($select)
 {
     $model = new BookProModelCategories();
     $state = $model->getState();
     $state->set('filter.type', 'TOUR');
     $items = $model->getItems();
     return AHtml::getFilterSelect('filter_cat_id', JText::_('COM_BOOKPRO_SELECT_CATEGORY'), $items, $select, true, '', 'id', 'title');
 }
Ejemplo n.º 4
0
    /**
     * Setting the toolbar
     */
    protected function addToolBar()
    {
        $title = '<div class="lead"><span class="icon-edit"></span>&nbsp&nbsp' . JText::_('COM_BOOKPRO_PASSENGER_MANAGER') . '</div>
				<div class="clearfix"></div>';
        $save = AHtml::addButton('JSAVE', 'save', 'btn btn-primary', 'agenttransportreport.apply', false);
        $saveAndClose = AHtml::addButton('COM_BOOKPRO_SAVE_AND_CLOSE', 'save', 'btn btn-primary', 'agenttransportreport.save', false);
        $cancel = AHtml::addButton('JCANCEL', 'cancel', 'btn btn-primary', 'agenttransportreport.cancel', false);
        echo '<div class="row-fluid clearfix">' . $title . $save . $saveAndClose . $cancel . '</div>';
    }
Ejemplo n.º 5
0
    function getToolbar()
    {
        $title = '<div class="lead"><span class="icon-edit"></span>&nbsp&nbsp' . JText::_('COM_BOOKPRO_PASSENGER_MANAGER') . '</div>
				<div class="clearfix"></div>';
        $save = AHtml::addButton('JSAVE', 'save', 'btn btn-primary', 'agentpassenger.apply', false);
        $saveAndClose = AHtml::addButton('COM_BOOKPRO_SAVE_AND_CLOSE', 'save', 'btn btn-primary', 'agentpassenger.save', false);
        $cancel = AHtml::addButton('JCANCEL', 'cancel', 'btn btn-primary', 'agentpassenger.cancel', false);
        return $title . $save . $saveAndClose . $cancel;
    }
Ejemplo n.º 6
0
 function getCitySelectBox($select, $country_id)
 {
     $model = new BookProModelAirports();
     //$lists=array('order'=>'id','order_Dir' => 'ASC','country_id'=>$country_id);
     //$model->init($lists);
     $state = $model->getState();
     $state->set('filter.country_id', (int) $country_id);
     $fullList = $model->getItems();
     return AHtml::getFilterSelect('city', 'Select City', $fullList, $select, false, '', 'id', 'title');
 }
Ejemplo n.º 7
0
 function getCountrySelect($select)
 {
     $model = new BookProModelCountries();
     $state = $model->getState();
     $state->set('list.start', 0);
     $state->set('list.limit', 0);
     $state->set('filter.state', 1);
     $list = $model->getItems();
     return AHtml::getFilterSelect('country_id', JText::_('COM_BOOKPRO_SELECT_COUNTRY'), $list, $select, false, 'id="country_id" onchange="changeCountry(this)"', 'id', 'country_name');
 }
Ejemplo n.º 8
0
 /**
  * @param int $msg_id
  * @return array
  */
 public function getMessage($msg_id)
 {
     $this->markAsRead($msg_id);
     $query = $this->db->query("SELECT * FROM " . $this->db->table("messages") . " WHERE msg_id = " . (int) $msg_id);
     $row = $query->row;
     if ($row) {
         // replace html-links in message
         $row['message'] = $this->html->convertLinks($row['message'], 'message');
     }
     return $row;
 }
Ejemplo n.º 9
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');
 }
Ejemplo n.º 10
0
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     //set customer type for each layout
     $filter_user_type = $this->state->get('filter.group_id');
     if (!$filter_user_type) {
         $this->state->set('filter.group_id', -3);
     }
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     // Include the component HTML helpers.
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     $this->customergroup = AHtml::getCustomerGroupSelect($this->state->get('filter.group_id'));
     $this->addToolbar();
     parent::display($tpl);
 }
Ejemplo n.º 11
0
 function getOrderStatusSelect()
 {
     OrderStatus::init();
     return AHtml::getFilterSelect('filter_order_status', JText::_('COM_BOOKPRO_SELECT_ORDER_STATUS'), OrderStatus::$map, $this->state->get('filter.order_status'), true, 'class="input input-medium"', 'value', 'text');
 }
?>
</label>
	<div class="controls">
		<?php 
echo AHtml::calendar(JFactory::getDate($params->start)->format($php_format), 'orderinfo[params][start]', 'orderinfo_date', DateHelper::getConvertDateFormat('J'), 'class="hasDatepicker"');
?>
	</div>
</div>
<div class="control-group">
	<label class="control-label"><?php 
echo JText::_('COM_BOOKPRO_DATE_END');
?>
</label>
	<div class="controls">
		<?php 
echo AHtml::calendar(JFactory::getDate($params->end)->format($php_format), 'orderinfo[params][end]', 'orderinfo_date_end', DateHelper::getConvertDateFormat('J'), 'class="hasDatepicker"');
?>
	</div>
</div>
<div class="control-group">
	<label class="control-label"><?php 
echo JText::_('COM_BOOKPRO_NO_OF_PASSENGER');
?>
</label>
	<div class="controls">
		<input type="number" min="1" name="orderinfo[adult]" class="input-mini" required value="<?php 
echo $this->orderinfo[0]->adult;
?>
"/>
	</div>
</div>
Ejemplo n.º 13
0
 function getCountrySelectBox($select)
 {
     $model = new BookProModelCountries();
     $fullList = $model->getItems();
     return AHtml::getFilterSelect('country_id', JText::_('COM_BOOKPRO_SELECT_COUNTRY'), $fullList, $select, false, '', 'id', 'country_name');
 }
Ejemplo n.º 14
0
 /**
  * Display reservation interval.
  *
  * @param TableReservation $reservation
  */
 function interval(&$reservation, $offset = null)
 {
     if ($reservation->rtype == RESERVATION_TYPE_DAILY) {
         if (AHtml::date($reservation->from, ADATE_FORMAT_MYSQL_TIME, $offset) == '00:00:00' && AHtml::date($t = $reservation->to, ADATE_FORMAT_MYSQL_TIME, $offset) == '23:59:00') {
             if (AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset) == AHtml::date($reservation->to, ADATE_FORMAT_NORMAL, $offset)) {
                 return JText::sprintf('Interval date', AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset));
             } else {
                 return JText::sprintf('Interval from to', AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset), AHtml::date($reservation->to, ADATE_FORMAT_NORMAL, $offset));
             }
         } else {
             return JText::sprintf('Interval from to time up down', AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset), AHtml::date($reservation->from, ATIME_FORMAT_SHORT, $offset), AHtml::date($reservation->to, ADATE_FORMAT_NORMAL, $offset), AHtml::date($reservation->to, ATIME_FORMAT_SHORT, $offset));
         }
     }
     return JText::sprintf('Interval date time up down', AHtml::date($reservation->from, ADATE_FORMAT_NORMAL, $offset), AHtml::date($reservation->from, ATIME_FORMAT_SHORT, $offset), AHtml::date($reservation->to, ATIME_FORMAT_SHORT, $offset));
 }
Ejemplo n.º 15
0
 static function getCountryList($name, $select, $att = '', $ordering = "id")
 {
     if (!class_exists('BookProModelCountries')) {
         AImporter::model('countries');
     }
     $model = new BookProModelCountries();
     $state = $model->getState();
     $state->set('list.start', 0);
     $state->set('list.limit', 0);
     //$state->set('list.ordering', 'ASC');
     $state->set('filter.state', 1);
     $list = $model->getItems();
     return AHtml::getFilterSelect($name, JText::_("COM_BOOKPRO_SELECT_COUNTRY"), $list, $select, false, $att, 'id', 'country_name');
 }
Ejemplo n.º 16
0
?>
</label>
			<div class="controls">
				<?php 
echo AHtml::calendar('', 'orderinfo[params][start]', 'orderinfo_date', DateHelper::getConvertDateFormat('J'), 'class="hasDatepicker"');
?>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><?php 
echo JText::_('COM_BOOKPRO_DATE_END');
?>
</label>
			<div class="controls">
				<?php 
echo AHtml::calendar('', 'orderinfo[params][end]', 'orderinfo_date_end', DateHelper::getConvertDateFormat('J'), 'class="hasDatepicker"');
?>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><?php 
echo JText::_('COM_BOOKPRO_NO_OF_PASSENGER');
?>
</label>
			<div class="controls">
				<input type="number" min="1" name="orderinfo[adult]" class="input-mini" required/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><?php 
echo JText::_('COM_BOOKPRO_REQUEST_DESC');
Ejemplo n.º 17
0
 static function getToursFilter($name = "tour_id", $selected, $autoSubmit = false)
 {
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select('*');
     $query->from('#__bookpro_tour AS tour');
     $sql = (string) $query;
     $db->setQuery($sql);
     $items = $db->loadObjectList();
     return AHtml::getFilterSelect($name, JText::_('COM_BOOKPRO_SELECT_TOUR'), $items, $selected, $autoSubmit, '', 'id', 'title');
 }
Ejemplo n.º 18
0
</script>
<form action="<?php 
echo JRoute::_('index.php?option=com_bookpro&view=agenttransportreports');
?>
" method="post" name="adminForm" id="adminForm">
	<div id="j-main-container">
		<div class="well well-small" >
			<div class="row-fluid">
				<div class="span9">
					<div class="btn-toolbar">
						<div class="filter-search btn-group"><?php 
echo AHtml::calendar($this->state->get('filter.from_date'), 'filter_from_date', 'filter_from_date', $date_format_js, 'for =1 placeholder="From date" style="width: 100px;"');
?>
</div>
						<div class="filter-search btn-group"><?php 
echo AHtml::calendar($this->state->get('filter.to_date'), 'filter_to_date', 'filter_to_date', $date_format_js, 'for =1 placeholder="To date" style="width: 100px;"');
?>
</div>
						<div class="filter-search btn-group"><?php 
echo JsHelper::timepicker($this->state->get('filter.from_time'), 'filter_from_time', 'filter_from_time', 'class="input-mini" title="From time" placeholder="From time"', 'showMeridian : false,defaultTime: false');
?>
</div>
						<div class="filter-search btn-group"><?php 
echo JsHelper::timepicker($this->state->get('filter.to_time'), 'filter_to_time', 'filter_to_time', 'class="input-mini" title="To time" placeholder="To time"', 'showMeridian : false,defaultTime: false');
?>
</div>
						
						<div><?php 
echo $this->getTransportType();
echo $this->getRoute();
?>
Ejemplo n.º 19
0
 function getPayStatusSelect($select)
 {
     PayStatus::init();
     return AHtml::getFilterSelect('filter_pay_status', JText::_('COM_BOOKPRO_SELECT_PAY_STATUS'), PayStatus::$map, $select, true, 'class="input input-medium"', 'value', 'text');
 }
Ejemplo n.º 20
0
 function getGroupSelectBox($select)
 {
     $model = new BookProModelCGroups();
     $fullList = $model->getData(array('state' => 1));
     return AHtml::getFilterSelect('cgroup_id', JText::_('Group'), $fullList, $select, false, '', 'id', 'title');
 }
Ejemplo n.º 21
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: view.html.php 26 2012-07-08 16:07:54Z quannv $
 **/
defined('_JEXEC') or die('Restricted access');
//import needed Joomla! libraries
jimport('joomla.application.component.view');
//import needed JoomLIB helpers
AImporter::helper('route', 'bookpro', 'request');
AImporter::model('tours', 'tourratelogs');
//import custom icons
AHtml::importIcons();
class BookProViewTourRateLogs extends JViewLegacy
{
    /**
     * Array containing browse table filters properties.
     * 
     * @var array
     */
    var $lists;
    /**
     * Array containig browse table subjects items to display.
     *  
     * @var array
     */
    var $items;
    /**
Ejemplo n.º 22
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');
 }
Ejemplo n.º 23
0
 function getCountriesBox($select)
 {
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select('`a`.*');
     $query->from('#__bookpro_country AS a');
     $query->where("a.state = 1");
     $sql = (string) $query;
     $db->setQuery($sql);
     $items = $db->loadObjectList();
     return AHtml::getFilterSelect('filter.country_id', JText::_('COM_BOOKPRO_SELECT_COUNTRY'), $items, $select, true, '', 'id', 'country_name');
 }
Ejemplo n.º 24
0
 function getcity()
 {
     $country_id = JRequest::getInt('country_id', 0);
     AImporter::model('airports');
     $model = new BookProModelAirports();
     $state = $model->getState();
     $state->set('list.start', 0);
     $state->set('list.limit', 0);
     $state->set('filter.order_Dir', 'ASC');
     $state->set('filter.country_id', $country_id);
     $fullList = $model->getItems();
     echo AHtml::getFilterSelect('city', JText::_('COM_BOOKPRO_SELECT_CITY'), $fullList, $select, false, 'id="city"', 'id', 'title');
     return;
 }
Ejemplo n.º 25
0
 public function getHtml()
 {
     //Build pagination data and dysplay
     /**
      * @var $registry Registry
      */
     $registry = $this->data['registry'];
     $html = new AHtml($registry);
     $s = $this->sts;
     //some more defaults
     if ($s['page'] < 1 || !is_numeric($s['page'])) {
         $s['page'] = 1;
     }
     if (!$s['limit'] || !is_numeric($s['limit'])) {
         $s['limit'] = 10;
     }
     if (!$s['limits']) {
         $s['limits'][0] = $x = $s['split'] ? $s['split'] : $registry->get('config')->get('config_catalog_limit');
         while ($x <= 50) {
             $s['limits'][] = $x;
             $x += 10;
         }
     }
     $s['url'] = str_replace('{limit}', $s['limit'], $s['url']);
     $s['total_pages'] = ceil($s['total'] / $s['limit']);
     if ($s['page'] > 1) {
         //not first page
         $this->view->assign('first_url', str_replace('{page}', 1, $s['url']));
         $this->view->assign('prev_url', str_replace('{page}', $s['page'] - 1, $s['url']));
     }
     if ($s['total_pages'] > 1) {
         if ($s['total_pages'] <= $s['num_links']) {
             $s['start'] = 1;
             $s['end'] = $s['total_pages'];
         } else {
             $s['start'] = $s['page'] - floor($s['num_links'] / 2);
             $s['end'] = $s['page'] + floor($s['num_links'] / 2);
             if ($s['start'] < 1) {
                 $s['end'] += abs($s['start']) + 1;
                 $s['start'] = 1;
             }
             if ($s['end'] > $s['total_pages']) {
                 $s['start'] -= $s['end'] - $s['total_pages'];
                 $s['end'] = $s['total_pages'];
             }
         }
     } else {
         $s['start'] = $s['end'] = 1;
     }
     if ($s['page'] < $s['total_pages']) {
         $this->view->assign('next_url', str_replace('{page}', $s['page'] + 1, $s['url']));
         $this->view->assign('last_url', str_replace('{page}', $s['total_pages'], $s['url']));
     }
     $replace = array($s['total'] ? ($s['page'] - 1) * $s['limit'] + 1 : 0, ($s['page'] - 1) * $s['limit'] > $s['total'] - $s['limit'] ? $s['total'] : ($s['page'] - 1) * $s['limit'] + $s['limit'], $s['total'], $s['total_pages']);
     if (!in_array($s['limit'], $s['limits'])) {
         $s['limits'][] = $s['limit'];
         sort($s['limits']);
     }
     $options = array();
     foreach ($s['limits'] as $item) {
         $options[$item] = $item;
     }
     $limit_select = $html->buildSelectbox(array('name' => 'limit', 'value' => $s['limit'], 'options' => $options, 'style' => 'input-mini', 'attr' => ' onchange="location=\'' . str_replace('{page}', 1, $s['url']) . '&limit=\'+this.value;"'));
     $limit_select = str_replace('&', '&amp;', $limit_select);
     $this->view->assign('limit_select', $limit_select);
     $find = array('{start}', '{end}', '{total}', '{pages}', '{limit}');
     $s['text'] = str_replace($find, $replace, $s['text']);
     $this->view->batchAssign($s);
     $return = $this->view->fetch('form/pagination.tpl');
     return $return;
 }
Ejemplo n.º 26
0
 function getToolbar()
 {
     $edit = AHtml::addButton('JGLOBAL_EDIT', 'edit', 'btn', 'agentpassenger.edit', true);
     $delete = AHtml::addButton('JACTION_DELETE', 'delete', 'btn', 'agentpassengers.delete', true);
     return $edit . $delete;
 }