PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
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
← All changes | admin/views/managecategory/view.html.php +75 -0 1.6.3 → 1.8.16 View file →
@@ -1,0 +1,75 @@
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 +// import Joomla view library
14 +jimport('joomla.application.component.view');
15 +
16 +class VikBookingViewManagecategory extends JViewVikBooking {
17 +
18 + function display($tpl = null) {
19 + // Set the toolbar
20 + $this->addToolBar();
21 +
22 + $cid = VikRequest::getVar('cid', array(0));
23 + if (!empty($cid[0])) {
24 + $id = $cid[0];
25 + }
26 +
27 + $row = array();
28 + $dbo = JFactory::getDBO();
29 + if (!empty($cid[0])) {
30 + $q = "SELECT * FROM `#__vikbooking_categories` WHERE `id`=".(int)$id.";";
31 + $dbo->setQuery($q);
32 + $dbo->execute();
33 + if ($dbo->getNumRows() != 1) {
34 + VikError::raiseWarning('', 'Not found.');
35 + $mainframe = JFactory::getApplication();
36 + $mainframe->redirect("index.php?option=com_vikbooking&task=categories");
37 + exit;
38 + }
39 + $row = $dbo->loadAssoc();
40 + }
41 +
42 + $this->row = $row;
43 +
44 + // Display the template
45 + parent::display($tpl);
46 + }
47 +
48 + /**
49 + * Sets the toolbar
50 + */
51 + protected function addToolBar() {
52 + $cid = VikRequest::getVar('cid', array(0));
53 +
54 + if (!empty($cid[0])) {
55 + //edit
56 + JToolBarHelper::title(JText::translate('VBMAINCATTITLEEDIT'), 'vikbooking');
57 + if (JFactory::getUser()->authorise('core.edit', 'com_vikbooking')) {
58 + JToolBarHelper::save( 'updatecat', JText::translate('VBSAVE'));
59 + JToolBarHelper::spacer();
60 + }
61 + JToolBarHelper::cancel( 'cancelcat', JText::translate('VBANNULLA'));
62 + JToolBarHelper::spacer();
63 + } else {
64 + //new
65 + JToolBarHelper::title(JText::translate('VBMAINCATTITLENEW'), 'vikbooking');
66 + if (JFactory::getUser()->authorise('core.create', 'com_vikbooking')) {
67 + JToolBarHelper::save( 'createcat', JText::translate('VBSAVE'));
68 + JToolBarHelper::spacer();
69 + }
70 + JToolBarHelper::cancel( 'cancelcat', JText::translate('VBANNULLA'));
71 + JToolBarHelper::spacer();
72 + }
73 + }
74 +
75 +}