PluginProbe
VikBooking Hotel Booking Engine & PMS / trunk
VikBooking Hotel Booking Engine & PMS vtrunk
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 1.7.4 All 35 releases
vikbooking / admin / fields / vbcategory.php

vbcategory.php in VikBooking Hotel Booking Engine & PMS trunk, at admin/fields/vbcategory.php

37 lines 1.1 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.form.formfield');
14
15 class JFormFieldVbcategory extends JFormField {
16 protected $type = 'vbcategory';
17
18 function getInput() {
19 $categories="";
20 $dbo = JFactory::getDBO();
21 $q="SELECT * FROM `#__vikbooking_categories` ORDER BY `#__vikbooking_categories`.`name` ASC;";
22 $dbo->setQuery($q);
23 $dbo->execute();
24 if ($dbo->getNumRows() > 0) {
25 $allvbc=$dbo->loadAssocList();
26 foreach($allvbc as $vbc) {
27 $categories.='<option value="'.$vbc['id'].'"'.($this->value == $vbc['id'] ? " selected=\"selected\"" : "").'>'.$vbc['name'].'</option>';
28 }
29 }
30 $html = '<select class="widefat" name="' . $this->name . '" >';
31 $html .= '<option value="">--</option>';
32 $html .= $categories;
33 $html .='</select>';
34 return $html;
35 }
36 }
37