Ejemplo n.º 1
0
 function display($tpl = null)
 {
     $this->context = 'com_solidres.reservation.process';
     $this->config = JComponentHelper::getParams('com_solidres');
     $this->showPoweredByLink = $this->config->get('show_solidres_copyright', '1');
     if ($this->_layout == 'default') {
         $model = $this->getModel();
         $modelName = $model->getName();
         $this->reservation = $model->getItem();
         $this->app = JFactory::getApplication();
         $this->checkin = $model->getState($modelName . '.checkin');
         $this->checkout = $model->getState($modelName . '.checkout');
         $this->totalReservedRoom = $model->getState($modelName . '.totalReservedRoom');
         $this->countries = SolidresHelper::getCountryOptions();
         $this->geoStates = SolidresHelper::getGeoStateOptions($model->getState($modelName . '.countryId'));
         $this->userState = $this->app->getUserState($this->context);
         $this->raid = $model->getState($modelName . '.reservationAssetId');
         $this->uri = JURI::getInstance()->__toString();
         $this->roomTypeObj = SRFactory::get('solidres.roomtype.roomtype');
         $this->numberOfNights = $this->roomTypeObj->calculateDateDiff($this->checkin, $this->checkout);
         JHtml::_('jquery.framework');
     }
     JHtml::stylesheet('com_solidres/assets/main.css', false, true, false);
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     parent::display($tpl);
 }
Ejemplo n.º 2
0
 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     $html = array();
     $selectedId = (int) $this->form->getValue('country_id');
     $options = SolidresHelper::getCountryOptions();
     $html[] = JHtml::_('select.genericlist', $options, $this->name, 'class="country_select"', 'value', 'text', $selectedId);
     return implode($html);
 }
Ejemplo n.º 3
0
 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     // Initialize variables.
     $html = array();
     $options = array();
     $selectedId = (int) $this->form->getValue('country_id');
     $options = SolidresHelper::getCountryOptions();
     $html[] = JHtml::_('select.genericlist', $options, $this->name, null, 'value', 'text', $selectedId);
     return implode($html);
 }
Ejemplo n.º 4
0
    /**
     * Return html to display guest form in one-page reservation, data is retrieved from user session
     *
     * @return string HTML
     */
    public function getHtmlGuest()
    {
        $this->countries = SolidresHelper::getCountryOptions();
        $this->reservationDetails = $this->app->getUserState($this->context);
        // Try to get the customer information if he/she logged in
        if (!isset($this->reservationDetails->guest)) {
            // Process customer group
            JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables', 'SolidresTable');
            $customerTable = JTable::getInstance('Customer', 'SolidresTable');
            $user = JFactory::getUser();
            $customerTable->load(array('user_id' => $user->get('id')));
            if (!empty($customerTable->id)) {
                $this->reservationDetails->guest["customer_firstname"] = $customerTable->firstname;
                $this->reservationDetails->guest["customer_middlename"] = $customerTable->middlename;
                $this->reservationDetails->guest["customer_lastname"] = $customerTable->lastname;
                $this->reservationDetails->guest["customer_email"] = $user->get('email');
            }
        }
        $selectedCountryId = isset($this->reservationDetails->guest["customer_country_id"]) ? $this->reservationDetails->guest["customer_country_id"] : 0;
        $options = array();
        $options[] = JHTML::_('select.option', NULL, JText::_('SR_SELECT'));
        $this->geoStates = $selectedCountryId > 0 ? SolidresHelper::getGeoStateOptions($selectedCountryId) : $options;
        $html = '
			<div class="reservation-box-inner">
				<form enctype="multipart/form-data"
					  id="sr-reservation-form-guest"
					  class="sr-reservation-form form-stacked sr-validate"
					  action="' . JRoute::_("index.php?option=com_solidres&task=reservation.process&step=guest&format=json") . '"
					  method="POST">
					<div class="row-fluid">
						<div class="span6">
							<fieldset>
								<label for="firstname">
									' . JText::_("SR_FIRSTNAME") . '
								</label>
								<input id="firstname"
									   required
									   name="jform[customer_firstname]"
									   type="text"
									   class="inputbox"
									   value="' . (isset($this->reservationDetails->guest["customer_firstname"]) ? $this->reservationDetails->guest["customer_firstname"] : "") . '" />

								<label for="middlename">
									' . JText::_("SR_MIDDLENAME") . '
								</label>
								<input id="middlename"
									   name="jform[customer_middlename]"
									   type="text"
									   class="inputbox"
									   value="' . (isset($this->reservationDetails->guest["customer_middlename"]) ? $this->reservationDetails->guest["customer_middlename"] : "") . '" />

								<label for="lastname">
									' . JText::_("SR_LASTNAME") . '
								</label>
								<input id="lastname"
									   required
									   name="jform[customer_lastname]"
									   type="text"
									   class="inputbox"
									   value="' . (isset($this->reservationDetails->guest["customer_lastname"]) ? $this->reservationDetails->guest["customer_lastname"] : "") . '" />

								<label for="email">
									' . JText::_("SR_EMAIL") . '
								</label>
								<input id="email"
									   required
									   name="jform[customer_email]"
									   type="text"
									   class="inputbox"
									   value="' . (isset($this->reservationDetails->guest["customer_email"]) ? $this->reservationDetails->guest["customer_email"] : "") . '" />

								<label for="phonenumber">
									' . JText::_("SR_PHONENUMBER") . '
								</label>
								<input id="phonenumber"
									   required
									   name="jform[customer_phonenumber]"
									   type="text"
									   class="inputbox"
									   value="' . (isset($this->reservationDetails->guest["customer_phonenumber"]) ? $this->reservationDetails->guest["customer_phonenumber"] : "") . '" />

								<label for="company">
									' . JText::_("SR_COMPANY") . '
								</label>
								<input id="company"
									   name="jform[customer_company]"
									   type="text"
									   class="inputbox"
									   value="' . (isset($this->reservationDetails->guest["customer_company"]) ? $this->reservationDetails->guest["customer_company"] : "") . '" />
							</fieldset>
						</div>

						<div class="span6">
							<fieldset>
								<label for="address_1">
									' . JText::_("SR_ADDRESS_1") . '
								</label>
								<input id="address_1"
									   required
									   name="jform[customer_address1]"
									   type="text"
									   class="inputbox"
									   value="' . (isset($this->reservationDetails->guest["customer_address1"]) ? $this->reservationDetails->guest["customer_address1"] : "") . '" />

								<label for="address_2">
									' . JText::_("SR_ADDRESS_2") . '
								</label>
								<input id="address_2"
									   name="jform[customer_address2]"
									   type="text"
									   class="inputbox"
									   value="' . (isset($this->reservationDetails->guest["customer_address2"]) ? $this->reservationDetails->guest["customer_address2"] : "") . '" />

								<label for="city">' . JText::_("SR_CITY") . '</label>
								<input id="city"
									   required
									   name="jform[customer_city]"
									   type="text"
									   class="inputbox"
									   value="' . (isset($this->reservationDetails->guest["customer_city"]) ? $this->reservationDetails->guest["customer_city"] : "") . '" />

								<label for="zip">' . JText::_("SR_ZIP") . '</label>
								<input id="zip"
									   name="jform[customer_zipcode]"
									   type="text"
									   class="inputbox"
									   value="' . (isset($this->reservationDetails->guest["customer_zipcode"]) ? $this->reservationDetails->guest["customer_zipcode"] : "") . '" />

								<label for="jform[country_id]">' . JText::_("SR_COUNTRY") . '</label>';
        $selectedCountryId = isset($this->reservationDetails->guest["customer_country_id"]) ? $this->reservationDetails->guest["customer_country_id"] : 0;
        $html .= JHtml::_("select.genericlist", $this->countries, "jform[customer_country_id]", array("class" => "country_select inputbox", 'required'), "value", "text", $selectedCountryId, "country");
        $html .= '
								<label for="jform[customer_geo_state_id]">' . JText::_("SR_STATE") . '</label>';
        $selectedGeoStateId = isset($this->reservationDetails->guest["customer_geo_state_id"]) ? $this->reservationDetails->guest["customer_geo_state_id"] : 0;
        $html .= JHtml::_("select.genericlist", $this->geoStates, "jform[customer_geo_state_id]", array("class" => "state_select inputbox"), "value", "text", $selectedGeoStateId, "state");
        $html .= '<label for="note">' . JText::_("SR_NOTE") . '</label>
										<textarea id="note" name="jform[note]" rows="10" cols="30">' . (isset($this->reservationDetails->guest["note"]) ? $this->reservationDetails->guest["note"] : "") . '</textarea>
								<p class="help-block">' . JText::_("SR_RESERVATION_NOTE") . '</p>
							</fieldset>
						</div>
					</div>
					<div class="processing-indicator nodisplay"></div>
					<button class="btn btn-primary" id="" type="submit">
						' . JText::_("SR_BUTTON_RESERVATION_PARTIAL_SUBMIT") . '
					</button>
					' . JHtml::_("form.token") . '
					<input type="hidden" name="jform[next_step]" value="payment" />
				</form>
			</div>
		';
        echo $html;
        die(1);
    }
Ejemplo n.º 5
0
" title="<?php 
echo JText::_('SR_SEARCH_IN_TITLE');
?>
" />
		                    </th>
		                    <th>
		                        <select name="filter_published" class="inputbox" onchange="this.form.submit()">
		                            <option value=""></option>
		                            <?php 
echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true);
?>
		                        </select>
		                    </th>
		                    <th>
		                        <?php 
echo JHtml::_('select.genericlist', SolidresHelper::getCountryOptions(), 'filter_country', 'onchange="this.form.submit()"', 'value', 'text', $this->state->get('filter.country'));
?>
		                    </th>
		                    <th></th>
		                    <th></th>
		                </tr>
					</thead>
					<tfoot>
						<tr>
							<td colspan="7">
								<?php 
echo $this->pagination->getListFooter();
?>
							</td>
						</tr>
					</tfoot>
Ejemplo n.º 6
0
							</th>
							<!--
							<th>
								<select name="filter_category_id" class="inputbox" onchange="this.form.submit()">
									<option value=""></option>
									<?php 
echo JHtml::_('select.options', SolidresHelper::getCategoryOptions(), 'value', 'text', $this->state->get('filter.category_id'));
?>
								</select>
							</th>
							-->
							<th></th>
							<th>
								<select name="filter_country_id" class="inputbox" onchange="this.form.submit()">
									<?php 
echo JHtml::_('select.options', SolidresHelper::getCountryOptions(), 'value', 'text', $this->state->get('filter.country_id'));
?>
								</select>
							</th>
							<th>
								<select name="filter_access" class="inputbox" onchange="this.form.submit()">
									<option value=""></option>
									<?php 
echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'));
?>
								</select>
							</th>
							<th></th>
					   </tr>
					</thead>
					<tfoot>