PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.7.2
VikBooking Hotel Booking Engine & PMS v1.7.2
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
vikbooking / site / views / revstay / view.html.php

view.html.php in VikBooking Hotel Booking Engine & PMS 1.7.2, at site/views/revstay/view.html.php

61 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package VikBooking
4 * @subpackage com_vikbooking
5 * @author Alessio Gaggii - e4j - Extensionsforjoomla.com
6 * @copyright Copyright (C) 2018 e4j - Extensionsforjoomla.com. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE
8 * @link https://vikwp.com
9 */
10
11 defined('ABSPATH') or die('No script kiddies please!');
12
13 jimport('joomla.application.component.view');
14
15 class VikbookingViewRevstay extends JViewVikBooking
16 {
17 function display($tpl = null)
18 {
19 $dbo = JFactory::getDbo();
20 $mainframe = JFactory::getApplication();
21 $vbo_tn = VikBooking::getTranslator();
22
23 // data validation
24 $sid = VikRequest::getString('sid', '', 'request');
25 $ts = VikRequest::getString('ts', '', 'request');
26 if (empty($sid) || empty($ts)) {
27 showSelectVb(JText::translate('VBINSUFDATA'));
28 return;
29 }
30
31 // find booking details
32 $q = "SELECT `o`.* FROM `#__vikbooking_orders` AS `o` WHERE (`o`.`sid`=" . $dbo->quote($sid) . " OR `o`.`idorderota`=" . $dbo->quote($sid) . ") AND `o`.`ts`=" . $dbo->quote($ts) . " AND `o`.`status`='confirmed';";
33 $dbo->setQuery($q);
34 $dbo->execute();
35 if (!$dbo->getNumRows()) {
36 showSelectVb(JText::translate('VBORDERNOTFOUND'));
37 return;
38 }
39 $order = $dbo->loadAssoc();
40
41 // make sure a review can be left for this booking
42 if (!VikBooking::canBookingBeReviewed($order)) {
43 throw new Exception('Cannot leave a review at this time', 403);
44 }
45
46 // get customer information
47 $customer = VikBooking::getCPinIstance()->getCustomerFromBooking($order['id']);
48
49 // review services
50 $grev_services = VikBooking::guestReviewsServices();
51 $vbo_tn->translateContents($grev_services, '#__vikbooking_greview_service');
52
53 $this->order = $order;
54 $this->customer = $customer;
55 $this->grev_services = $grev_services;
56 $this->vbo_tn = $vbo_tn;
57
58 parent::display($tpl);
59 }
60 }
61