PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.15
VikBooking Hotel Booking Engine & PMS v1.8.15
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 1.7.3 All 36 releases
vikbooking / admin / views / getpro / view.html.php

view.html.php in VikBooking Hotel Booking Engine & PMS 1.8.15, at admin/views/getpro/view.html.php

80 lines 1.9 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 /**
14 * @wponly this View is only for WP
15 */
16
17 // import Joomla view library
18 jimport('joomla.application.component.view');
19
20 class VikBookingViewGetpro extends JViewVikBooking {
21
22 function display($tpl = null) {
23 // Set the toolbar
24 $this->addToolBar();
25
26 VikBookingLoader::import('update.changelog');
27 VikBookingLoader::import('update.license');
28
29 $version = VikRequest::getString('version', '', 'request');
30 if (!empty($version)) {
31 /**
32 * Download Changelog
33 *
34 * @since 1.2.12
35 */
36 $http = new JHttp;
37
38 $url = 'https://vikwp.com/api/?task=products.changelog';
39
40 $data = array(
41 'sku' => 'vbo',
42 'version' => $version,
43 );
44
45 $response = $http->post($url, $data);
46
47 if ($response->code == 200) {
48 VikBookingChangelog::store(json_decode($response->body));
49 }
50 }
51
52 $changelog = VikBookingChangelog::build();
53 $lic_key = VikBookingLicense::getKey();
54 $lic_date = VikBookingLicense::getExpirationDate();
55 $is_pro = VikBookingLicense::isPro();
56
57 if (!$is_pro) {
58 VikError::raiseWarning('', JText::translate('VBONOPROERROR'));
59 JFactory::getApplication()->redirect('index.php?option=com_vikbooking&view=gotopro');
60 exit;
61 }
62
63 $this->changelog = $changelog;
64 $this->lic_key = $lic_key;
65 $this->lic_date = $lic_date;
66 $this->is_pro = $is_pro;
67
68 // Display the template
69 parent::display($tpl);
70 }
71
72 /**
73 * Sets the toolbar
74 */
75 protected function addToolBar() {
76 JToolBarHelper::title(JText::translate('VBMAINGETPROTITLE'), 'vikbooking');
77 }
78
79 }
80