PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.6.4
VikBooking Hotel Booking Engine & PMS v1.6.4
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 / admin / views / rooms / tmpl / default.php

default.php in VikBooking Hotel Booking Engine & PMS 1.6.4, at admin/views/rooms/tmpl/default.php

262 lines 12.5 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 $dbo = JFactory::getDbo();
14 $app = JFactory::getApplication();
15
16 $vbo_app = VikBooking::getVboApplication();
17 $vbo_app->loadSelect2();
18
19 $config = VBOFactory::getConfig();
20
21 $rows = $this->rows;
22 $lim0 = $this->lim0;
23 $navbut = $this->navbut;
24 $orderby = $this->orderby;
25 $ordersort = $this->ordersort;
26
27 $prname = $app->getUserStateFromRequest("vbo.rooms.rname", 'rname', '', 'string');
28 $pidcat = $app->getUserStateFromRequest("vbo.rooms.idcat", 'idcat', 0, 'int');
29 ?>
30 <div class="vbo-list-form-filters vbo-btn-toolbar">
31 <form action="index.php?option=com_vikbooking&amp;task=rooms" method="post" name="roomsform">
32 <div style="width: 100%; display: inline-block;" class="btn-toolbar" id="filter-bar">
33 <div class="btn-group pull-left">
34 <select name="idcat" id="idcat" onchange="document.roomsform.submit();">
35 <option value=""><?php echo JText::translate('VBOCATEGORYFILTER'); ?></option>
36 <?php
37 foreach ($this->allcats as $cat) {
38 ?>
39 <option value="<?php echo $cat['id']; ?>"<?php echo $cat['id'] == $pidcat ? ' selected="selected"' : ''; ?>><?php echo $cat['name']; ?></option>
40 <?php
41 }
42 ?>
43 </select>
44 </div>
45 <div class="btn-group pull-left input-append">
46 <input type="text" name="rname" id="rname" value="<?php echo $prname; ?>" size="40" placeholder="<?php echo JText::translate('VBPVIEWROOMONE'); ?>"/>
47 <button type="button" class="btn btn-secondary" onclick="document.roomsform.submit();"><i class="icon-search"></i></button>
48 </div>
49 <div class="btn-group pull-left">
50 <button type="button" class="btn btn-secondary" onclick="document.getElementById('rname').value='';document.getElementById('idcat').value='';document.roomsform.submit();"><?php echo JText::translate('JSEARCH_FILTER_CLEAR'); ?></button>
51 </div>
52 </div>
53 <input type="hidden" name="task" value="rooms" />
54 <input type="hidden" name="option" value="com_vikbooking" />
55 </form>
56 </div>
57 <script type="text/javascript">
58 jQuery(function() {
59 jQuery('#idcat').select2();
60 });
61 </script>
62 <?php
63 if (empty($rows)) {
64 ?>
65 <p class="warn"><?php echo JText::translate('VBNOROOMSFOUND'); ?></p>
66 <form action="index.php?option=com_vikbooking" method="post" name="adminForm" id="adminForm">
67 <input type="hidden" name="task" value="" />
68 <input type="hidden" name="option" value="com_vikbooking" />
69 </form>
70 <?php
71 } else {
72 ?>
73 <form action="index.php?option=com_vikbooking" method="post" name="adminForm" id="adminForm" class="vbo-list-form">
74 <div class="table-responsive">
75 <table cellpadding="4" cellspacing="0" border="0" width="100%" class="table table-striped vbo-list-table">
76 <thead>
77 <tr>
78 <th width="20">
79 <input type="checkbox" onclick="Joomla.checkAll(this)" value="" name="checkall-toggle">
80 </th>
81 <th class="title left" width="150">
82 <a href="index.php?option=com_vikbooking&amp;task=rooms&amp;vborderby=name&amp;vbordersort=<?php echo ($orderby == "name" && $ordersort == "ASC" ? "DESC" : "ASC"); ?>" class="<?php echo ($orderby == "name" && $ordersort == "ASC" ? "vbo-list-activesort" : ($orderby == "name" ? "vbo-list-activesort" : "")); ?>">
83 <?php echo JText::translate('VBPVIEWROOMONE').($orderby == "name" && $ordersort == "ASC" ? '<i class="'.VikBookingIcons::i('sort-asc').'"></i>' : ($orderby == "name" ? '<i class="'.VikBookingIcons::i('sort-desc').'"></i>' : '<i class="'.VikBookingIcons::i('sort').'"></i>')); ?>
84 </a>
85 </th>
86 <th class="title center" align="center" width="75">
87 <a href="index.php?option=com_vikbooking&amp;task=rooms&amp;vborderby=toadult&amp;vbordersort=<?php echo ($orderby == "toadult" && $ordersort == "ASC" ? "DESC" : "ASC"); ?>" class="<?php echo ($orderby == "toadult" && $ordersort == "ASC" ? "vbo-list-activesort" : ($orderby == "toadult" ? "vbo-list-activesort" : "")); ?>">
88 <?php echo JText::translate('VBPVIEWROOMADULTS').($orderby == "toadult" && $ordersort == "ASC" ? '<i class="'.VikBookingIcons::i('sort-asc').'"></i>' : ($orderby == "toadult" ? '<i class="'.VikBookingIcons::i('sort-desc').'"></i>' : '<i class="'.VikBookingIcons::i('sort').'"></i>')); ?>
89 </a>
90 </th>
91 <th class="title center" align="center" width="75">
92 <a href="index.php?option=com_vikbooking&amp;task=rooms&amp;vborderby=tochild&amp;vbordersort=<?php echo ($orderby == "tochild" && $ordersort == "ASC" ? "DESC" : "ASC"); ?>" class="<?php echo ($orderby == "tochild" && $ordersort == "ASC" ? "vbo-list-activesort" : ($orderby == "tochild" ? "vbo-list-activesort" : "")); ?>">
93 <?php echo JText::translate('VBPVIEWROOMCHILDREN').($orderby == "tochild" && $ordersort == "ASC" ? '<i class="'.VikBookingIcons::i('sort-asc').'"></i>' : ($orderby == "tochild" ? '<i class="'.VikBookingIcons::i('sort-desc').'"></i>' : '<i class="'.VikBookingIcons::i('sort').'"></i>')); ?>
94 </a>
95 </th>
96 <th class="title center" align="center" width="75">
97 <a href="index.php?option=com_vikbooking&amp;task=rooms&amp;vborderby=totpeople&amp;vbordersort=<?php echo ($orderby == "totpeople" && $ordersort == "ASC" ? "DESC" : "ASC"); ?>" class="<?php echo ($orderby == "totpeople" && $ordersort == "ASC" ? "vbo-list-activesort" : ($orderby == "totpeople" ? "vbo-list-activesort" : "")); ?>">
98 <?php echo JText::translate('VBPVIEWROOMTOTPEOPLE').($orderby == "totpeople" && $ordersort == "ASC" ? '<i class="'.VikBookingIcons::i('sort-asc').'"></i>' : ($orderby == "totpeople" ? '<i class="'.VikBookingIcons::i('sort-desc').'"></i>' : '<i class="'.VikBookingIcons::i('sort').'"></i>')); ?>
99 </a>
100 </th>
101 <th class="title center" width="75"><?php echo JText::translate( 'VBPVIEWROOMTWO' ); ?></th>
102 <th class="title center" align="center" width="75"><?php echo JText::translate( 'VBPVIEWROOMTHREE' ); ?></th>
103 <th class="title center" align="center" width="75"><?php echo JText::translate( 'VBPVIEWROOMFOUR' ); ?></th>
104 <th class="title center" align="center" width="100"><?php echo JText::translate( 'VBOCHANNELS' ); ?></th>
105 <th class="title center" align="center" width="75">
106 <a href="index.php?option=com_vikbooking&amp;task=rooms&amp;vborderby=units&amp;vbordersort=<?php echo ($orderby == "units" && $ordersort == "ASC" ? "DESC" : "ASC"); ?>" class="<?php echo ($orderby == "units" && $ordersort == "ASC" ? "vbo-list-activesort" : ($orderby == "units" ? "vbo-list-activesort" : "")); ?>">
107 <?php echo JText::translate('VBPVIEWROOMSEVEN').($orderby == "units" && $ordersort == "ASC" ? '<i class="'.VikBookingIcons::i('sort-asc').'"></i>' : ($orderby == "units" ? '<i class="'.VikBookingIcons::i('sort-desc').'"></i>' : '<i class="'.VikBookingIcons::i('sort').'"></i>')); ?>
108 </a>
109 </th>
110 <th class="title center" align="center" width="100"><?php echo JText::translate( 'VBPVIEWROOMSIX' ); ?></th>
111 </tr>
112 </thead>
113 <?php
114 $vcm_logos = VikBooking::getVcmChannelsLogo('', true);
115 $website_source_lbl = JText::translate('VBORDFROMSITE');
116 $kk = 0;
117 $i = 0;
118 for ($i = 0, $n = count($rows); $i < $n; $i++) {
119 $row = $rows[$i];
120 $categories = "";
121 if (strlen(trim(str_replace(";", "", $row['idcat']))) > 0) {
122 $cat = explode(";", $row['idcat']);
123 $catsfound = false;
124 $q = "SELECT `name` FROM `#__vikbooking_categories` WHERE ";
125 foreach ($cat as $k => $cc) {
126 if (!empty($cc)) {
127 $q .= "`id`=".$dbo->quote($cc)." ";
128 if ($cc != end($cat) && !empty($cat[($k + 1)])) {
129 $q .= "OR ";
130 }
131 $catsfound = true;
132 }
133 }
134 $q .= ";";
135 if ($catsfound) {
136 $dbo->setQuery($q);
137 $lines = $dbo->loadAssocList();
138 if ($lines) {
139 $categories = array();
140 foreach($lines as $ll) {
141 $categories[] = $ll['name'];
142 }
143 $categories = implode(", ", $categories);
144 }
145 }
146 }
147
148 $caratteristiche = "";
149 if (!empty($row['idcarat'])) {
150 $tmpcarat = explode(";", $row['idcarat']);
151 $caratteristiche = '<span class="label">' . VikBooking::totElements($tmpcarat) . '</span>';
152 }
153
154 $optionals = "";
155 if (!empty($row['idopt'])) {
156 $tmpopt = explode(";", $row['idopt']);
157 $optionals = '<span class="label">' . VikBooking::totElements($tmpopt) . '</span>';
158 }
159
160 if ($row['fromadult'] == $row['toadult']) {
161 $stradult = $row['fromadult'];
162 } else {
163 $stradult = $row['fromadult'].' - '.$row['toadult'];
164 }
165 if ($row['fromchild'] == $row['tochild']) {
166 $strchild = $row['fromchild'];
167 } else {
168 $strchild = $row['fromchild'].' - '.$row['tochild'];
169 }
170
171 // shared calendar icon
172 $sharedcal = '';
173 if (!empty($row['sharedcals'])) {
174 $sharedcal = '<span class="vbo-room-sharedcalendar" title="' . htmlspecialchars(JText::translate('VBOROOMCALENDARSHARED')) . '"><i class="' . VikBookingIcons::i('calendar-check') . '"></i></span> ';
175 }
176
177 // VCM room's channels mapped
178 $website_source_lbl_short = substr($website_source_lbl, 0, 1);
179 if (function_exists('mb_substr')) {
180 $website_source_lbl_short = mb_substr($website_source_lbl, 0, 1, 'UTF-8');
181 }
182 $roomchannels = array($website_source_lbl => strtoupper($website_source_lbl_short));
183 $otachannels = is_object($vcm_logos) && method_exists($vcm_logos, 'getVboRoomLogosMapped') ? $vcm_logos->getVboRoomLogosMapped($row['id']) : array();
184 $roomchannels = count($otachannels) ? array() : $roomchannels;
185 $roomchannels = array_merge($roomchannels, $otachannels);
186
187 // room upgrade option
188 $room_upgrade_options = $config->getArray('room_upgrade_options_' . $row['id'], []);
189 $room_upgrade_enabled = (!empty($room_upgrade_options['rooms']) && $room_upgrade_options['rooms']);
190 ?>
191 <tr class="row<?php echo $kk; ?>">
192 <td><input type="checkbox" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $row['id']; ?>" onclick="Joomla.isChecked(this.checked);"></td>
193 <td class="vbo-highlighted-td"><a href="index.php?option=com_vikbooking&amp;task=editroom&amp;cid[]=<?php echo $row['id']; ?>"><?php echo $row['name']; ?></a></td>
194 <td class="center"><?php echo $stradult; ?></td>
195 <td class="center"><?php echo $strchild; ?></td>
196 <td class="center"><?php echo $row['mintotpeople'].' - '.$row['totpeople']; ?></td>
197 <td class="center"><?php echo $categories; ?></td>
198 <td class="center">
199 <?php
200 if (strpos($row['params'], 'geo":{"enabled":1') !== false) {
201 ?>
202 <span class="vbo-room-sharedcalendar" title="<?php echo $this->escape(JText::translate('VBO_GEO_INFO')); ?>"><?php VikBookingIcons::e('map-marked-alt'); ?></span>
203 <?php
204 }
205 if ($room_upgrade_enabled) {
206 ?>
207 <span class="vbo-room-sharedcalendar" title="<?php echo $this->escape(JText::translate('VBO_ROOM_UPGRADE')); ?>"><?php VikBookingIcons::e('gem'); ?></span>
208 <?php
209 }
210 echo $caratteristiche;
211 ?>
212 </td>
213 <td class="center"><?php echo $optionals; ?></td>
214 <td class="center">
215 <div class="vbo-room-channels-mapped-wrap">
216 <?php
217 foreach ($roomchannels as $source => $churi) {
218 $is_img = (strpos($churi, 'http') !== false);
219 ?>
220 <div class="vbo-room-channels-mapped-ch">
221 <span class="vbo-room-channels-mapped-ch-lbl" title="<?php echo ucfirst($source); ?>">
222 <?php
223 if ($is_img) {
224 ?>
225 <img src="<?php echo $churi ?>" alt="<?php echo $source; ?>" />
226 <?php
227 } else {
228 ?>
229 <span><?php echo $churi; ?></span>
230 <?php
231 }
232 ?>
233 </span>
234 </div>
235 <?php
236 }
237 ?>
238 </div>
239 </td>
240 <td class="center"><?php echo $sharedcal . '<span class="label label-info">' . $row['units'] . '</span>'; ?></td>
241 <td class="center">
242 <a href="<?php echo VBOFactory::getPlatform()->getUri()->addCSRF('index.php?option=com_vikbooking&task=modavail&cid[]=' . $row['id'], true); ?>"><?php echo (intval($row['avail'])=="1" ? "<i class=\"".VikBookingIcons::i('check', 'vbo-icn-img')."\" style=\"color: #099909;\" title=\"".JText::translate('VBMAKENOTAVAIL')."\"></i>" : "<i class=\"".VikBookingIcons::i('times-circle', 'vbo-icn-img')."\" style=\"color: #ff0000;\" title=\"".JText::translate('VBMAKEAVAIL')."\"></i>"); ?></a>
243 </td>
244 </tr>
245 <?php
246 $kk = 1 - $kk;
247 unset($categories);
248 }
249 ?>
250 </table>
251 </div>
252 <input type="hidden" name="option" value="com_vikbooking" />
253 <input type="hidden" name="task" value="rooms" />
254 <input type="hidden" name="boxchecked" value="0" />
255 <input type="hidden" name="rname" value="<?php echo $prname; ?>" />
256 <input type="hidden" name="idcat" value="<?php echo $pidcat; ?>" />
257 <?php echo JHtml::fetch('form.token'); ?>
258 <?php echo $navbut; ?>
259 </form>
260 <?php
261 }
262