| 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 |
$row = $this->row; |
| 14 |
$cats = $this->cats; |
| 15 |
$carats = $this->carats; |
| 16 |
$optionals = $this->optionals; |
| 17 |
$adultsdiff = $this->adultsdiff; |
| 18 |
|
| 19 |
JHtml::fetch('jquery.framework', true, true); |
| 20 |
JHtml::fetch('script', VBO_SITE_URI.'resources/jquery-ui.sortable.min.js'); |
| 21 |
|
| 22 |
$vbo_app = VikBooking::getVboApplication(); |
| 23 |
$vbo_app->loadSelect2(); |
| 24 |
$currencysymb = VikBooking::getCurrencySymb(true); |
| 25 |
$arrcats = array(); |
| 26 |
$arrcarats = array(); |
| 27 |
$arropts = array(); |
| 28 |
$oldcats = count($row) ? explode(";", (string)$row['idcat']) : array(); |
| 29 |
foreach ($oldcats as $oc) { |
| 30 |
if (!empty($oc)) { |
| 31 |
$arrcats[$oc] = $oc; |
| 32 |
} |
| 33 |
} |
| 34 |
$oldcarats = count($row) ? explode(";", (string)$row['idcarat']) : array(); |
| 35 |
foreach ($oldcarats as $ocr) { |
| 36 |
if (!empty($ocr)) { |
| 37 |
$arrcarats[$ocr] = $ocr; |
| 38 |
} |
| 39 |
} |
| 40 |
$oldopts = count($row) ? explode(";", (string)$row['idopt']) : array(); |
| 41 |
foreach ($oldopts as $oopt) { |
| 42 |
if (!empty($oopt)) { |
| 43 |
$arropts[$oopt] = $oopt; |
| 44 |
} |
| 45 |
} |
| 46 |
$wcats = ""; |
| 47 |
$wcarats = ""; |
| 48 |
$woptionals = ""; |
| 49 |
if (is_array($cats)) { |
| 50 |
$wcats = "<select name=\"ccat[]\" multiple=\"multiple\" id=\"categories_sel\" size=\"".(count($cats) + 1)."\">"; |
| 51 |
foreach ($cats as $cat) { |
| 52 |
$wcats .= "<option value=\"".$cat['id']."\"".(array_key_exists($cat['id'], $arrcats) ? " selected=\"selected\"" : "").">".$cat['name']."</option>\n"; |
| 53 |
} |
| 54 |
$wcats .= "</select>\n"; |
| 55 |
} |
| 56 |
if (is_array($carats)) { |
| 57 |
$wcarats = "<div class=\"vbo-roomentries-cont\">"; |
| 58 |
$nn = 0; |
| 59 |
foreach ($carats as $kcarat => $carat) { |
| 60 |
$wcarats .= "<div class=\"vbo-roomentry-cont\"><input type=\"checkbox\" name=\"ccarat[]\" id=\"carat".$kcarat."\" value=\"".$carat['id']."\"".(array_key_exists($carat['id'], $arrcarats) ? " checked=\"checked\"" : "")."/> <label for=\"carat".$kcarat."\">".$carat['name']."</label></div>\n"; |
| 61 |
$nn++; |
| 62 |
if (($nn % 3) == 0) { |
| 63 |
$wcarats .= "</div>\n<div class=\"vbo-roomentries-cont\">"; |
| 64 |
} |
| 65 |
} |
| 66 |
$wcarats .= "</div>\n"; |
| 67 |
} |
| 68 |
if (is_array($optionals)) { |
| 69 |
$woptionals = "<div class=\"vbo-roomentries-cont\">"; |
| 70 |
$nn = 0; |
| 71 |
foreach ($optionals as $kopt => $optional) { |
| 72 |
$woptionals .= "<div class=\"vbo-roomentry-cont\"><input type=\"checkbox\" name=\"coptional[]\" id=\"opt".$kopt."\" value=\"".$optional['id']."\"".(array_key_exists($optional['id'], $arropts) ? " checked=\"checked\"" : "")."/> <label for=\"opt".$kopt."\">".$optional['name']." ".(empty($optional['ageintervals']) ? ((int)$optional['pcentroom'] ? $optional['cost'].'%' : $currencysymb." ".$optional['cost']) : "")."</label></div>\n"; |
| 73 |
$nn++; |
| 74 |
if (($nn % 3) == 0) { |
| 75 |
$woptionals .= "</div>\n<div class=\"vbo-roomentries-cont\">"; |
| 76 |
} |
| 77 |
} |
| 78 |
$woptionals .= "</div>\n"; |
| 79 |
} |
| 80 |
//more images |
| 81 |
$morei = count($row) ? explode(';;', (string)$row['moreimgs']) : array(); |
| 82 |
$totmorei = count($morei); |
| 83 |
$actmoreimgs = ""; |
| 84 |
if ($totmorei > 0) { |
| 85 |
$notemptymoreim = false; |
| 86 |
$imgcaptions = json_decode((string)$row['imgcaptions'], true); |
| 87 |
$usecaptions = empty($imgcaptions) || !is_array($imgcaptions) || !(count($imgcaptions) > 0) ? false : true; |
| 88 |
foreach ($morei as $ki => $mi) { |
| 89 |
if (!empty($mi)) { |
| 90 |
$notemptymoreim = true; |
| 91 |
$actmoreimgs .= '<li class="vbo-editroom-currentphoto">'; |
| 92 |
$actmoreimgs .= '<a href="'.VBO_SITE_URI.'resources/uploads/big_'.$mi.'" target="_blank" class="vbomodal"><img src="'.VBO_SITE_URI.'resources/uploads/thumb_'.$mi.'" class="maxfifty"/></a>'; |
| 93 |
$actmoreimgs .= '<a class="vbo-toggle-imgcaption" href="javascript: void(0);" onclick="vbOpenImgDetails(\''.$ki.'\', this)"><i class="'.VikBookingIcons::i('cog').'"></i></a>'; |
| 94 |
$actmoreimgs .= '<div id="vbimgdetbox'.$ki.'" class="vbimagedetbox" style="display: none;"><div class="captionlabel"><span>'.JText::translate('VBIMGCAPTION').'</span><input type="text" name="caption'.$ki.'" value="'.($usecaptions === true && isset($imgcaptions[$ki]) ? $imgcaptions[$ki] : "").'" size="40"/></div><input type="hidden" name="imgsorting[]" value="'.$mi.'"/><input class="captionsubmit" type="button" name="updcatpion" value="'.JText::translate('VBIMGUPDATE').'" onclick="javascript: updateCaptions();"/><div class="captionremoveimg"><a class="vbimgrm btn btn-danger" href="index.php?option=com_vikbooking&task=removemoreimgs&roomid='.$row['id'].'&imgind='.$ki.'" title="'.JText::translate('VBREMOVEIMG').'"><i class="icon-remove"></i>'.JText::translate('VBREMOVEIMG').'</a></div></div>'; |
| 95 |
$actmoreimgs .= '</li>'; |
| 96 |
} |
| 97 |
} |
| 98 |
} |
| 99 |
//end more images |
| 100 |
//num adults charges/discounts only if the max numb of adults allowed is > than 1 and the minimum is less than the maximum |
| 101 |
$writeadultsdiff = false; |
| 102 |
if (count($row) && $row['toadult'] > 1 && $row['fromadult'] < $row['toadult']) { |
| 103 |
$writeadultsdiff = true; |
| 104 |
$stradultsdiff = ""; |
| 105 |
$startadind = $row['fromadult'] > 0 ? $row['fromadult'] : 1; |
| 106 |
$parseadultsdiff = array(); |
| 107 |
if (@is_array($adultsdiff)) { |
| 108 |
foreach ($adultsdiff as $adiff) { |
| 109 |
$parseadultsdiff[$adiff['adults']] = $adiff; |
| 110 |
} |
| 111 |
} |
| 112 |
for ($adi = $startadind; $adi <= $row['toadult']; $adi++) { |
| 113 |
$stradultsdiff .= "<p>"; |
| 114 |
$stradultsdiff .= '<span class="vbo-adults-usage">' . JText::sprintf('VBADULTSDIFFNUM', $adi) . "</span><select name=\"adultsdiffchdisc[]\"><option value=\"1\"".(array_key_exists($adi, $parseadultsdiff) && $parseadultsdiff[$adi]['chdisc'] == 1 ? " selected=\"selected\"" : "").">".JText::translate('VBADULTSDIFFCHDISCONE')."</option><option value=\"2\"".(array_key_exists($adi, $parseadultsdiff) && $parseadultsdiff[$adi]['chdisc'] == 2 ? " selected=\"selected\"" : "").">".JText::translate('VBADULTSDIFFCHDISCTWO')."</option></select>\n"; |
| 115 |
$stradultsdiff .= "<input type=\"number\" step=\"any\" name=\"adultsdiffval[]\" value=\"".(array_key_exists($adi, $parseadultsdiff) ? $parseadultsdiff[$adi]['value'] : "")."\" size=\"3\" style=\"width: 40px;\"/><input type=\"hidden\" name=\"adultsdiffnum[]\" value=\"".$adi."\"/>\n"; |
| 116 |
$stradultsdiff .= "<select name=\"adultsdiffvalpcent[]\"><option value=\"1\"".(array_key_exists($adi, $parseadultsdiff) && $parseadultsdiff[$adi]['valpcent'] == 1 ? " selected=\"selected\"" : "").">".$currencysymb."</option><option value=\"2\"".(array_key_exists($adi, $parseadultsdiff) && $parseadultsdiff[$adi]['valpcent'] == 2 ? " selected=\"selected\"" : "").">%</option></select>\n"; |
| 117 |
$stradultsdiff .= "<select name=\"adultsdiffpernight[]\"><option value=\"1\"".(array_key_exists($adi, $parseadultsdiff) && $parseadultsdiff[$adi]['pernight'] == 1 ? " selected=\"selected\"" : "").">".JText::translate('VBADULTSDIFFONPERNIGHT')."</option><option value=\"0\"".(array_key_exists($adi, $parseadultsdiff) && $parseadultsdiff[$adi]['pernight'] == 0 ? " selected=\"selected\"" : "").">".JText::translate('VBADULTSDIFFONTOTAL')."</option></select>\n"; |
| 118 |
$stradultsdiff .= "</p>\n"; |
| 119 |
} |
| 120 |
} |
| 121 |
// |
| 122 |
$editor = JEditor::getInstance(JFactory::getApplication()->get('editor')); |
| 123 |
?> |
| 124 |
<script type="text/javascript"> |
| 125 |
//Code to debug the size of the form to be submitted in case it will exceed the PHP post_max_size |
| 126 |
/* |
| 127 |
Joomla.submitbutton = function(task) { |
| 128 |
console.log(jQuery("#adminForm").not("[type='file']").serialize().length); |
| 129 |
Joomla.submitform(task, document.adminForm); |
| 130 |
} |
| 131 |
*/ |
| 132 |
// |
| 133 |
function showResizeSel() { |
| 134 |
if (document.adminForm.autoresize.checked == true) { |
| 135 |
document.getElementById('resizesel').style.display='inline-block'; |
| 136 |
} else { |
| 137 |
document.getElementById('resizesel').style.display='none'; |
| 138 |
} |
| 139 |
return true; |
| 140 |
} |
| 141 |
function showResizeSelMore() { |
| 142 |
if (document.adminForm.autoresizemore.checked == true) { |
| 143 |
document.getElementById('resizeselmore').style.display='inline-block'; |
| 144 |
} else { |
| 145 |
document.getElementById('resizeselmore').style.display='none'; |
| 146 |
} |
| 147 |
return true; |
| 148 |
} |
| 149 |
function addMoreImages() { |
| 150 |
var ni = document.getElementById('myDiv'); |
| 151 |
var numi = document.getElementById('moreimagescounter'); |
| 152 |
var num = (document.getElementById('moreimagescounter').value -1)+ 2; |
| 153 |
numi.value = num; |
| 154 |
var newdiv = document.createElement('div'); |
| 155 |
var divIdName = 'my'+num+'Div'; |
| 156 |
newdiv.setAttribute('id', divIdName); |
| 157 |
newdiv.setAttribute('class', 'vbo-first-imgup'); |
| 158 |
newdiv.innerHTML = '<input type=\'file\' name=\'cimgmore[]\' size=\'35\'/><div class=\'vbo-imgup-caption\'><span><?php echo addslashes(JText::translate('VBIMGCAPTION')); ?></span> <input type=\'text\' name=\'cimgcaption[]\' size=\'30\' value=\'\'/></div>'; |
| 159 |
ni.appendChild(newdiv); |
| 160 |
} |
| 161 |
function vbPlusMinus(what, how) { |
| 162 |
var inp = document.getElementById(what); |
| 163 |
var actval = inp.value; |
| 164 |
var newval = 0; |
| 165 |
if (how == 'plus') { |
| 166 |
newval = parseInt(actval) + 1; |
| 167 |
} else { |
| 168 |
if (parseInt(actval) >= 1) { |
| 169 |
newval = parseInt(actval) - 1; |
| 170 |
} |
| 171 |
} |
| 172 |
inp.value = newval; |
| 173 |
<?php |
| 174 |
if ($writeadultsdiff == true) { |
| 175 |
?> |
| 176 |
var origfrom = <?php echo $row['fromadult']; ?>; |
| 177 |
var origto = <?php echo $row['toadult']; ?>; |
| 178 |
if (what == 'fromadult') { |
| 179 |
if (newval == origfrom) { |
| 180 |
document.getElementById('vbadultsdiffsavemess').style.display = 'none'; |
| 181 |
document.getElementById('vbadultsdiffbox').style.display = 'block'; |
| 182 |
} else { |
| 183 |
document.getElementById('vbadultsdiffbox').style.display = 'none'; |
| 184 |
document.getElementById('vbadultsdiffsavemess').style.display = 'block'; |
| 185 |
} |
| 186 |
} |
| 187 |
if (what == 'toadult') { |
| 188 |
if (newval == origto) { |
| 189 |
document.getElementById('vbadultsdiffsavemess').style.display = 'none'; |
| 190 |
document.getElementById('vbadultsdiffbox').style.display = 'block'; |
| 191 |
} else { |
| 192 |
document.getElementById('vbadultsdiffbox').style.display = 'none'; |
| 193 |
document.getElementById('vbadultsdiffsavemess').style.display = 'block'; |
| 194 |
} |
| 195 |
} |
| 196 |
<?php |
| 197 |
} |
| 198 |
?> |
| 199 |
if (what == 'toadult' || what == 'tochild') { |
| 200 |
vbMaxTotPeople(); |
| 201 |
} |
| 202 |
if (what == 'fromadult' || what == 'fromchild') { |
| 203 |
vbMinTotPeople(); |
| 204 |
} |
| 205 |
return true; |
| 206 |
} |
| 207 |
function vbMaxTotPeople() { |
| 208 |
var toadu = document.getElementById('toadult').value; |
| 209 |
var tochi = document.getElementById('tochild').value; |
| 210 |
document.getElementById('totpeople').value = parseInt(toadu) + parseInt(tochi); |
| 211 |
var suggocc = document.getElementById('suggocc').value; |
| 212 |
if (!suggocc.length || (parseInt(suggocc) < 2 && parseInt(toadu) > 1)) { |
| 213 |
document.getElementById('suggocc').value = toadu; |
| 214 |
} |
| 215 |
return true; |
| 216 |
} |
| 217 |
function vbMinTotPeople() { |
| 218 |
var fadu = document.getElementById('fromadult').value; |
| 219 |
var fchi = document.getElementById('fromchild').value; |
| 220 |
document.getElementById('mintotpeople').value = parseInt(fadu) + parseInt(fchi); |
| 221 |
return true; |
| 222 |
} |
| 223 |
function togglePriceCalendarParam() { |
| 224 |
if (parseInt(document.getElementById('pricecal').value) == 1) { |
| 225 |
document.getElementById('defcalcostp').style.display = 'flex'; |
| 226 |
} else { |
| 227 |
document.getElementById('defcalcostp').style.display = 'none'; |
| 228 |
} |
| 229 |
} |
| 230 |
function toggleSeasonalCalendarParam() { |
| 231 |
if (parseInt(document.getElementById('seasoncal').value) > 0) { |
| 232 |
jQuery('.param-seasoncal').show(); |
| 233 |
} else { |
| 234 |
jQuery('.param-seasoncal').each(function(k, v) { |
| 235 |
if (k > 0) { |
| 236 |
jQuery(this).hide(); |
| 237 |
} |
| 238 |
}); |
| 239 |
} |
| 240 |
} |
| 241 |
var vbo_details_on = false; |
| 242 |
function vbOpenImgDetails(key, el) { |
| 243 |
if (vbo_details_on === true) { |
| 244 |
jQuery('.vbimagedetbox').not('#vbimgdetbox'+key).hide(); |
| 245 |
jQuery('.vbo-toggle-imgcaption.vbo-toggle-imgcaption-on').removeClass('vbo-toggle-imgcaption-on'); |
| 246 |
} |
| 247 |
if (document.getElementById('vbimgdetbox'+key).style.display == 'none') { |
| 248 |
document.getElementById('vbimgdetbox'+key).style.display = 'block'; |
| 249 |
jQuery(el).addClass('vbo-toggle-imgcaption-on'); |
| 250 |
vbo_details_on = true; |
| 251 |
} else { |
| 252 |
document.getElementById('vbimgdetbox'+key).style.display = 'none'; |
| 253 |
jQuery(el).removeClass('vbo-toggle-imgcaption-on'); |
| 254 |
vbo_details_on = false; |
| 255 |
} |
| 256 |
} |
| 257 |
function updateCaptions() { |
| 258 |
var ni = document.adminForm; |
| 259 |
var newdiv = document.createElement('div'); |
| 260 |
newdiv.innerHTML = '<input type=\'hidden\' name=\'updatecaption\' value=\'1\'/>'; |
| 261 |
ni.appendChild(newdiv); |
| 262 |
document.adminForm.task.value='updateroom'; |
| 263 |
document.adminForm.submit(); |
| 264 |
} |
| 265 |
function vboToggleRoomUpgrade() { |
| 266 |
if (jQuery('input[name="room_upgrade"]').is(':checked')) { |
| 267 |
jQuery('.vbo-roomupgrade-param').show(); |
| 268 |
} else { |
| 269 |
jQuery('.vbo-roomupgrade-param').hide(); |
| 270 |
} |
| 271 |
} |
| 272 |
function vboToggleMaxAdvNotice(is_checked) { |
| 273 |
if (!is_checked) { |
| 274 |
jQuery('.vbo-room-level-max_adv-notice').hide(); |
| 275 |
} else { |
| 276 |
jQuery('.vbo-room-level-max_adv-notice').show(); |
| 277 |
} |
| 278 |
} |
| 279 |
/* Start - Room Disctinctive Features */ |
| 280 |
var cur_units = <?php echo count($row) ? $row['units'] : '1'; ?>; |
| 281 |
|
| 282 |
jQuery(function() { |
| 283 |
jQuery('#share_with_sel, #categories_sel, #upgrade-rooms').select2(); |
| 284 |
jQuery(".vbo-sortable").sortable({ |
| 285 |
helper: 'clone' |
| 286 |
}); |
| 287 |
jQuery(".vbo-sortable").disableSelection(); |
| 288 |
jQuery('#vbo-distfeatures-toggle').click(function() { |
| 289 |
jQuery(this).toggleClass('btn-primary'); |
| 290 |
jQuery('.vbo-distfeatures-cont').fadeToggle(); |
| 291 |
}); |
| 292 |
jQuery('#room_units').change(function() { |
| 293 |
var to_units = parseInt(jQuery(this).val()); |
| 294 |
if (to_units > 1) { |
| 295 |
jQuery('.param-multiunits').show(); |
| 296 |
jQuery('.vbo-distfeature-row').css('display', 'flex'); |
| 297 |
<?php |
| 298 |
if (!count($row)) { |
| 299 |
// suggest last available param to 1 |
| 300 |
?> |
| 301 |
if (!jQuery('#lastavail').val().length || parseInt(jQuery('#lastavail').val()) < 1) { |
| 302 |
jQuery('#lastavail').val('1'); |
| 303 |
} |
| 304 |
<?php |
| 305 |
} |
| 306 |
?> |
| 307 |
} else { |
| 308 |
jQuery('.param-multiunits').hide(); |
| 309 |
jQuery('.vbo-distfeature-row').css('display', 'none'); |
| 310 |
} |
| 311 |
if (to_units > cur_units) { |
| 312 |
var diff_units = (to_units - cur_units); |
| 313 |
for (var i = 1; i <= diff_units; i++) { |
| 314 |
var unit_html = "<div class=\"vbo-runit-features-cont\" id=\"runit-features-"+(i + cur_units)+"\">"+ |
| 315 |
" <span class=\"vbo-runit-num\"><?php echo addslashes(JText::translate('VBODISTFEATURERUNIT')); ?>"+(i + cur_units)+"</span>"+ |
| 316 |
" <div class=\"vbo-runit-features\">"+ |
| 317 |
" <div class=\"vbo-runit-feature\">"+ |
| 318 |
" <input type=\"text\" name=\"feature-name"+(i + cur_units)+"[]\" value=\"\" size=\"20\" placeholder=\"<?php echo JText::translate('VBODISTFEATURETXT'); ?>\"/>"+ |
| 319 |
" <input type=\"hidden\" name=\"feature-lang"+(i + cur_units)+"[]\" value=\"\"/>"+ |
| 320 |
" <input type=\"text\" name=\"feature-value"+(i + cur_units)+"[]\" value=\"\" size=\"20\" placeholder=\"<?php echo JText::translate('VBODISTFEATUREVAL'); ?>\"/>"+ |
| 321 |
" <span class=\"vbo-feature-remove\"><i class=\"<?php echo VikBookingIcons::i('far fa-minus-square'); ?>\"></i></span>"+ |
| 322 |
" </div>"+ |
| 323 |
" <span class=\"vbo-feature-add btn vbo-config-btn\"><i class=\"icon-new\"></i><?php echo addslashes(JText::translate('VBODISTFEATUREADD')); ?></span>"+ |
| 324 |
" </div>"+ |
| 325 |
"</div>"; |
| 326 |
jQuery('.vbo-distfeatures-cont').append(unit_html); |
| 327 |
} |
| 328 |
cur_units = to_units; |
| 329 |
} else if (to_units < cur_units) { |
| 330 |
for (var i = cur_units; i > to_units; i--) { |
| 331 |
jQuery('#runit-features-'+i).remove(); |
| 332 |
} |
| 333 |
cur_units = to_units; |
| 334 |
} |
| 335 |
}); |
| 336 |
|
| 337 |
jQuery(document.body).on('click', '.vbo-feature-add', function() { |
| 338 |
var cfeature_id = jQuery(this).parent('div').parent('div').attr('id').split('runit-features-'); |
| 339 |
if (cfeature_id[1].length) { |
| 340 |
jQuery(this).before("<div class=\"vbo-runit-feature\">"+ |
| 341 |
" <input type=\"text\" name=\"feature-name"+cfeature_id[1]+"[]\" value=\"\" size=\"20\" placeholder=\"<?php echo JText::translate('VBODISTFEATURETXT'); ?>\"/>"+ |
| 342 |
" <input type=\"hidden\" name=\"feature-lang"+cfeature_id[1]+"[]\" value=\"\"/>"+ |
| 343 |
" <input type=\"text\" name=\"feature-value"+cfeature_id[1]+"[]\" value=\"\" size=\"20\" placeholder=\"<?php echo JText::translate('VBODISTFEATUREVAL'); ?>\"/>"+ |
| 344 |
" <span class=\"vbo-feature-remove\"><i class=\"<?php echo VikBookingIcons::i('far fa-minus-square'); ?>\"></i></span>"+ |
| 345 |
"</div>" |
| 346 |
); |
| 347 |
} |
| 348 |
}); |
| 349 |
|
| 350 |
jQuery(document.body).on('click', '.vbo-feature-remove', function() { |
| 351 |
jQuery(this).parent('div').remove(); |
| 352 |
}); |
| 353 |
}); |
| 354 |
/* End - Room Disctinctive Features */ |
| 355 |
</script> |
| 356 |
<?php |
| 357 |
$vbo_app->prepareModalBox('.vbomodal', '', true); |
| 358 |
?> |
| 359 |
<input type="hidden" value="0" id="moreimagescounter" /> |
| 360 |
|
| 361 |
<form name="adminForm" id="adminForm" action="index.php" method="post" enctype="multipart/form-data"> |
| 362 |
<?php |
| 363 |
if (count($row)) { |
| 364 |
?> |
| 365 |
<div class="vbo-mngroom-rtitle"> |
| 366 |
<h3><?php echo $row['name']; ?></h3> |
| 367 |
</div> |
| 368 |
<?php |
| 369 |
} |
| 370 |
?> |
| 371 |
<div class="vbo-admin-container"> |
| 372 |
<div class="vbo-config-maintab-left"> |
| 373 |
<fieldset class="adminform"> |
| 374 |
<div class="vbo-params-wrap"> |
| 375 |
<legend class="adminlegend"><?php echo JText::translate('VBOROOMLEGUNITOCC'); ?></legend> |
| 376 |
<div class="vbo-params-container"> |
| 377 |
<div class="vbo-param-container"> |
| 378 |
<div class="vbo-param-label"><?php echo JText::translate('VBNEWROOMFIVE'); ?></div> |
| 379 |
<div class="vbo-param-setting"><input type="text" name="cname" value="<?php echo count($row) ? htmlspecialchars($row['name']) : ''; ?>" size="40"/></div> |
| 380 |
</div> |
| 381 |
<div class="vbo-param-container"> |
| 382 |
<div class="vbo-param-label"><?php echo JText::translate('VBNEWROOMEIGHT'); ?></div> |
| 383 |
<div class="vbo-param-setting"><?php echo $vbo_app->printYesNoButtons('cavail', JText::translate('VBYES'), JText::translate('VBNO'), ((count($row) && intval($row['avail']) == 1) || !count($row) ? 'yes' : 0), 'yes', 0); ?></div> |
| 384 |
</div> |
| 385 |
<div class="vbo-param-container"> |
| 386 |
<div class="vbo-param-label"><?php echo JText::translate('VBNEWROOMNINE'); ?></div> |
| 387 |
<div class="vbo-param-setting"><input type="number" min="1" name="units" id="room_units" value="<?php echo count($row) ? $row['units'] : '1'; ?>" size="3" onfocus="this.select();" /></div> |
| 388 |
</div> |
| 389 |
<?php |
| 390 |
$room_features = count($row) ? VikBooking::getRoomParam('features', $row['params']) : array(1 => VikBooking::getDefaultDistinctiveFeatures()); |
| 391 |
if (!is_array($room_features)) { |
| 392 |
$room_features = array(); |
| 393 |
} |
| 394 |
if (!(count($room_features) > 0)) { |
| 395 |
$default_features = VikBooking::getDefaultDistinctiveFeatures(); |
| 396 |
for ($i = 1; $i <= $row['units']; $i++) { |
| 397 |
$room_features[$i] = $default_features; |
| 398 |
} |
| 399 |
} |
| 400 |
?> |
| 401 |
<div class="vbo-param-container vbo-distfeature-row" style="display: <?php echo count($row) && $row['units'] > 1 ? 'flex' : 'none'; ?>;"> |
| 402 |
<div class="vbo-param-label"><?php echo JText::translate('VBOROOMUNITSDISTFEAT'); ?></div> |
| 403 |
<div class="vbo-param-setting"> |
| 404 |
<div class="vbo-distfeatures-toggle-cont"> |
| 405 |
<span id="vbo-distfeatures-toggle" class="btn vbo-config-btn"><?php VikBookingIcons::e('binoculars'); ?><?php echo JText::translate('VBOROOMUNITSDISTFEATTOGGLE'); ?></span> |
| 406 |
</div> |
| 407 |
<div class="vbo-distfeatures-cont"> |
| 408 |
<?php |
| 409 |
$unitslim = count($row) ? $row['units'] : 1; |
| 410 |
for ($i=1; $i <= $unitslim; $i++) { |
| 411 |
?> |
| 412 |
<div class="vbo-runit-features-cont" id="runit-features-<?php echo $i; ?>"> |
| 413 |
<span class="vbo-runit-num"><?php echo JText::translate('VBODISTFEATURERUNIT'); ?><?php echo $i; ?></span> |
| 414 |
<div class="vbo-runit-features"> |
| 415 |
<?php |
| 416 |
if (array_key_exists($i, $room_features)) { |
| 417 |
foreach ($room_features[$i] as $fkey => $fval) { |
| 418 |
?> |
| 419 |
<div class="vbo-runit-feature"> |
| 420 |
<input type="text" name="feature-name<?php echo $i; ?>[]" value="<?php echo JText::translate($fkey); ?>" size="20"/> |
| 421 |
<input type="hidden" name="feature-lang<?php echo $i; ?>[]" value="<?php echo $fkey; ?>"/> |
| 422 |
<input type="text" name="feature-value<?php echo $i; ?>[]" value="<?php echo $fval; ?>" size="20"/> |
| 423 |
<span class="vbo-feature-remove"><?php VikBookingIcons::e('far fa-minus-square'); ?></span> |
| 424 |
</div> |
| 425 |
<?php |
| 426 |
} |
| 427 |
} |
| 428 |
?> |
| 429 |
<span class="vbo-feature-add btn vbo-config-btn"><?php VikBookingIcons::e('plus-circle'); ?> <?php echo JText::translate('VBODISTFEATUREADD'); ?></span> |
| 430 |
</div> |
| 431 |
</div> |
| 432 |
<?php |
| 433 |
} |
| 434 |
?> |
| 435 |
</div> |
| 436 |
</div> |
| 437 |
</div> |
| 438 |
<div class="vbo-param-container"> |
| 439 |
<div class="vbo-param-label"><?php echo JText::translate('VBNEWROOMADULTS'); ?></div> |
| 440 |
<div class="vbo-param-setting"> |
| 441 |
<div class="vbo-param-setting-group"> |
| 442 |
<div class="vbplusminuscont"> |
| 443 |
<span><?php echo JText::translate('VBNEWROOMMIN'); ?></span> |
| 444 |
<input type="number" min="0" id="fromadult" name="fromadult" value="<?php echo count($row) ? $row['fromadult'] : '1'; ?>" size="4" onchange="vbMinTotPeople();" style="width: 40px;"/> |
| 445 |
</div> |
| 446 |
<div class="vbplusminus-btns"> |
| 447 |
<span class="vbplusminus" onclick="vbPlusMinus('fromadult', 'plus');"><?php VikBookingIcons::e('far fa-plus-square'); ?></span> |
| 448 |
<span class="vbminus vbplusminus" onclick="vbPlusMinus('fromadult', 'minus');"><?php VikBookingIcons::e('far fa-minus-square'); ?></span> |
| 449 |
</div> |
| 450 |
</div> |
| 451 |
<div class="vbo-param-setting-group"> |
| 452 |
<div class="vbplusminuscont"> |
| 453 |
<span><?php echo JText::translate('VBNEWROOMMAX'); ?></span> |
| 454 |
<input type="number" min="0" id="toadult" name="toadult" value="<?php echo count($row) ? $row['toadult'] : '1'; ?>" size="3" onchange="vbMaxTotPeople();" style="width: 40px;"/> |
| 455 |
</div> |
| 456 |
<div class="vbplusminus-btns"> |
| 457 |
<span class="vbplusminus" onclick="vbPlusMinus('toadult', 'plus');"><?php VikBookingIcons::e('far fa-plus-square'); ?></span> |
| 458 |
<span class="vbminus vbplusminus" onclick="vbPlusMinus('toadult', 'minus');"><?php VikBookingIcons::e('far fa-minus-square'); ?></span> |
| 459 |
</div> |
| 460 |
</div> |
| 461 |
</div> |
| 462 |
</div> |
| 463 |
<?php |
| 464 |
if ($writeadultsdiff == true) { |
| 465 |
?> |
| 466 |
<div class="vbo-param-container"> |
| 467 |
<div class="vbo-param-label"><?php echo $vbo_app->createPopover(array('title' => JText::translate('VBNEWROOMADULTSDIFF'), 'content' => JText::translate('VBNEWROOMADULTSDIFFHELP'))); ?> <?php echo JText::translate('VBNEWROOMADULTSDIFF'); ?></div> |
| 468 |
<div class="vbo-param-setting"> |
| 469 |
<div id="vbadultsdiffsavemess" style="display: none;"> |
| 470 |
<span class="vbo-param-setting-comment"><?php echo JText::translate('VBNEWROOMNOTCHANGENUMMESS'); ?></span> |
| 471 |
</div> |
| 472 |
<div id="vbadultsdiffbox" style="display: block;"><?php echo $stradultsdiff; ?></div> |
| 473 |
</div> |
| 474 |
</div> |
| 475 |
<?php |
| 476 |
} else { |
| 477 |
?> |
| 478 |
<div class="vbo-param-container"> |
| 479 |
<div class="vbo-param-label"><?php echo $vbo_app->createPopover(array('title' => JText::translate('VBNEWROOMADULTSDIFF'), 'content' => JText::translate('VBNEWROOMADULTSDIFFHELP'))); ?> <?php echo JText::translate('VBNEWROOMADULTSDIFF'); ?></div> |
| 480 |
<div class="vbo-param-setting"> |
| 481 |
<span class="vbo-param-setting-comment"><?php echo JText::translate('VBNEWROOMADULTSDIFFBEFSAVE'); ?></span> |
| 482 |
</div> |
| 483 |
</div> |
| 484 |
<?php |
| 485 |
} |
| 486 |
?> |
| 487 |
<div class="vbo-param-container"> |
| 488 |
<div class="vbo-param-label"><?php echo JText::translate('VBNEWROOMCHILDREN'); ?></div> |
| 489 |
<div class="vbo-param-setting"> |
| 490 |
<div class="vbo-param-setting-group"> |
| 491 |
<div class="vbplusminuscont"> |
| 492 |
<span><?php echo JText::translate('VBNEWROOMMIN'); ?></span> |
| 493 |
<input type="number" min="0" id="fromchild" name="fromchild" value="<?php echo count($row) ? $row['fromchild'] : '0'; ?>" size="3" onchange="vbMinTotPeople();" style="width: 40px;"/> |
| 494 |
</div> |
| 495 |
<div class="vbplusminus-btns"> |
| 496 |
<span class="vbplusminus" onclick="vbPlusMinus('fromchild', 'plus');"><?php VikBookingIcons::e('far fa-plus-square'); ?></span> |
| 497 |
<span class="vbminus vbplusminus" onclick="vbPlusMinus('fromchild', 'minus');"><?php VikBookingIcons::e('far fa-minus-square'); ?></span> |
| 498 |
</div> |
| 499 |
</div> |
| 500 |
<div class="vbo-param-setting-group"> |
| 501 |
<div class="vbplusminuscont"> |
| 502 |
<span><?php echo JText::translate('VBNEWROOMMAX'); ?></span> |
| 503 |
<input type="number" min="0" id="tochild" name="tochild" value="<?php echo count($row) ? $row['tochild'] : '0'; ?>" size="3" onchange="vbMaxTotPeople();" style="width: 40px;"/> |
| 504 |
</div> |
| 505 |
<div class="vbplusminus-btns"> |
| 506 |
<span class="vbplusminus" onclick="vbPlusMinus('tochild', 'plus');"><?php VikBookingIcons::e('far fa-plus-square'); ?></span> |
| 507 |
<span class="vbminus vbplusminus" onclick="vbPlusMinus('tochild', 'minus');"><?php VikBookingIcons::e('far fa-minus-square'); ?></span> |
| 508 |
</div> |
| 509 |
</div> |
| 510 |
</div> |
| 511 |
</div> |
| 512 |
<div class="vbo-param-container"> |
| 513 |
<div class="vbo-param-label"><?php echo JText::translate('VBMAXTOTPEOPLE'); ?></div> |
| 514 |
<div class="vbo-param-setting"> |
| 515 |
<input type="number" min="1" name="totpeople" id="totpeople" value="<?php echo count($row) ? $row['totpeople'] : '1'; ?>" size="3" style="width: 40px;"/> |
| 516 |
<span class="vbo-param-setting-comment-inline"><?php echo JText::translate('VBMAXTOTPEOPLEDESC'); ?></span> |
| 517 |
</div> |
| 518 |
</div> |
| 519 |
<div class="vbo-param-container"> |
| 520 |
<div class="vbo-param-label"><?php echo JText::translate('VBMINTOTPEOPLE'); ?></div> |
| 521 |
<div class="vbo-param-setting"> |
| 522 |
<input type="number" min="1" name="mintotpeople" id="mintotpeople" value="<?php echo count($row) ? $row['mintotpeople'] : '1'; ?>" size="3" style="width: 40px;"/> |
| 523 |
<span class="vbo-param-setting-comment-inline"><?php echo JText::translate('VBMINTOTPEOPLEDESC'); ?></span> |
| 524 |
</div> |
| 525 |
</div> |
| 526 |
</div> |
| 527 |
</div> |
| 528 |
</fieldset> |
| 529 |
|
| 530 |
<fieldset class="adminform"> |
| 531 |
<div class="vbo-params-wrap"> |
| 532 |
<legend class="adminlegend"><?php echo JText::translate('VBOROOMLEGCARATCATOPT'); ?></legend> |
| 533 |
<div class="vbo-params-container"> |
| 534 |
<?php |
| 535 |
if (!empty($wcats)) { |
| 536 |
?> |
| 537 |
<div class="vbo-param-container"> |
| 538 |
<div class="vbo-param-label"><?php echo JText::translate('VBNEWROOMONE'); ?></div> |
| 539 |
<div class="vbo-param-setting"><?php echo $wcats; ?></div> |
| 540 |
</div> |
| 541 |
<?php |
| 542 |
} |
| 543 |
if (!empty($wcarats)) { |
| 544 |
?> |
| 545 |
<div class="vbo-param-container"> |
| 546 |
<div class="vbo-param-label"><?php echo JText::translate('VBNEWROOMTHREE'); ?></div> |
| 547 |
<div class="vbo-param-setting"><?php echo $wcarats; ?></div> |
| 548 |
</div> |
| 549 |
<?php |
| 550 |
} |
| 551 |
if (!empty($woptionals)) { |
| 552 |
?> |
| 553 |
<div class="vbo-param-container"> |
| 554 |
<div class="vbo-param-label"><?php echo JText::translate('VBNEWROOMFOUR'); ?></div> |
| 555 |
<div class="vbo-param-setting"><?php echo $woptionals; ?></div> |
| 556 |
</div> |
| 557 |
<?php |
| 558 |
} |
| 559 |
?> |
| 560 |
</div> |
| 561 |
</div> |
| 562 |
</fieldset> |
| 563 |
|
| 564 |
<fieldset class="adminform"> |
| 565 |
<div class="vbo-params-wrap"> |
| 566 |
<legend class="adminlegend"><?php echo JText::translate('VBNEWROOMPARAMS'); ?></legend> |
| 567 |
<div class="vbo-params-container"> |
| 568 |
<?php |
| 569 |
$multi_units = count($row) ? VikBooking::getRoomParam('multi_units', $row['params']) : 0; |
| 570 |
?> |
| 571 |
<div class="vbo-param-container param-multiunits" style="display: <?php echo (count($row) && $row['units'] > 0 ? 'flex' : 'none'); ?>;"> |
| 572 |
<div class="vbo-param-label"><label for="multi_units"><?php echo JText::translate('VBPARAMROOMMULTIUNITS'); ?></label></div> |
| 573 |
<div class="vbo-param-setting"> |
| 574 |
<select name="multi_units" id="multi_units"> |
| 575 |
<option value="0"><?php echo JText::translate('VBPARAMROOMMULTIUNITSDISABLE'); ?></option> |
| 576 |
<option value="1"<?php echo intval($multi_units) == 1 ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBPARAMROOMMULTIUNITSENABLE'); ?></option> |
| 577 |
</select> |
| 578 |
<span class="vbo-param-setting-comment"><?php echo JText::translate('VBPARAMROOMMULTIUNITSHELP'); ?></span> |
| 579 |
</div> |
| 580 |
</div> |
| 581 |
<div class="vbo-param-container"> |
| 582 |
<div class="vbo-param-label"><label for="lastavail"><?php echo JText::translate('VBPARAMLASTAVAIL'); ?></label></div> |
| 583 |
<div class="vbo-param-setting"> |
| 584 |
<input type="number" min="0" name="lastavail" id="lastavail" value="<?php echo count($row) ? (int)VikBooking::getRoomParam('lastavail', $row['params']) : '0'; ?>"/> |
| 585 |
<span class="vbo-param-setting-comment"><?php echo JText::translate('VBPARAMLASTAVAILHELP'); ?></span> |
| 586 |
</div> |
| 587 |
</div> |
| 588 |
<div class="vbo-param-container"> |
| 589 |
<div class="vbo-param-label"><label for="suggocc"><?php echo JText::translate('VBOPARAMSUGGOCC'); ?></label></div> |
| 590 |
<div class="vbo-param-setting"> |
| 591 |
<input type="number" min="0" name="suggocc" id="suggocc" value="<?php echo count($row) ? (int)VikBooking::getRoomParam('suggocc', $row['params']) : '1'; ?>"/> |
| 592 |
</div> |
| 593 |
</div> |
| 594 |
<div class="vbo-param-container"> |
| 595 |
<div class="vbo-param-label"><label for="custprice"><?php echo JText::translate('VBPARAMCUSTPRICE'); ?></label></div> |
| 596 |
<div class="vbo-param-setting"> |
| 597 |
<input type="text" name="custprice" id="custprice" value="<?php echo count($row) ? VikBooking::getRoomParam('custprice', $row['params']) : ''; ?>" size="5"/> |
| 598 |
<span class="vbo-param-setting-comment"><?php echo JText::translate('VBPARAMCUSTPRICEHELP'); ?></span> |
| 599 |
</div> |
| 600 |
</div> |
| 601 |
<div class="vbo-param-container"> |
| 602 |
<div class="vbo-param-label"><label for="custpricetxt"><?php echo JText::translate('VBPARAMCUSTPRICETEXT'); ?></label></div> |
| 603 |
<div class="vbo-param-setting"> |
| 604 |
<input type="text" name="custpricetxt" id="custpricetxt" value="<?php echo count($row) ? VikBooking::getRoomParam('custpricetxt', $row['params']) : ''; ?>" size="9"/> |
| 605 |
<span class="vbo-param-setting-comment"><?php echo JText::translate('VBPARAMCUSTPRICETEXTHELP'); ?></span> |
| 606 |
</div> |
| 607 |
</div> |
| 608 |
<div class="vbo-param-container"> |
| 609 |
<div class="vbo-param-label"><label for="custpricesubtxt"><?php echo JText::translate('VBPARAMCUSTPRICESUBTEXT'); ?></label></div> |
| 610 |
<div class="vbo-param-setting"> |
| 611 |
<input type="text" name="custpricesubtxt" id="custpricesubtxt" value="<?php echo count($row) ? htmlentities(VikBooking::getRoomParam('custpricesubtxt', $row['params'])) : ''; ?>" size="31"/> |
| 612 |
<span class="vbo-param-setting-comment"><?php echo JText::translate('VBPARAMCUSTPRICESUBTEXTHELP'); ?></span> |
| 613 |
</div> |
| 614 |
</div> |
| 615 |
<div class="vbo-param-container"> |
| 616 |
<div class="vbo-param-label"><label for="reqinfo"><?php echo JText::translate('VBORPARAMREQINFO'); ?></label></div> |
| 617 |
<div class="vbo-param-setting"><?php echo $vbo_app->printYesNoButtons('reqinfo', JText::translate('VBYES'), JText::translate('VBNO'), (count($row) && intval(VikBooking::getRoomParam('reqinfo', $row['params'])) == 1 ? 1 : 0), 1, 0); ?></div> |
| 618 |
</div> |
| 619 |
<?php |
| 620 |
$paramshowpeople = count($row) ? VikBooking::getRoomParam('maxminpeople', $row['params']) : ''; |
| 621 |
?> |
| 622 |
<div class="vbo-param-container"> |
| 623 |
<div class="vbo-param-label"><label for="maxminpeople"><?php echo JText::translate('VBPARAMSHOWPEOPLE'); ?></label></div> |
| 624 |
<div class="vbo-param-setting"> |
| 625 |
<select name="maxminpeople" id="maxminpeople"> |
| 626 |
<option value="0"><?php echo JText::translate('VBPARAMSHOWPEOPLENO'); ?></option> |
| 627 |
<option value="1"<?php echo ($paramshowpeople == "1" ? ' selected="selected"' : ''); ?>><?php echo JText::translate('VBPARAMSHOWPEOPLEADU'); ?></option> |
| 628 |
<option value="2"<?php echo ($paramshowpeople == "2" ? ' selected="selected"' : ''); ?>><?php echo JText::translate('VBPARAMSHOWPEOPLECHI'); ?></option> |
| 629 |
<option value="3"<?php echo ($paramshowpeople == "3" ? ' selected="selected"' : ''); ?>><?php echo JText::translate('VBPARAMSHOWPEOPLEADUTOT'); ?></option> |
| 630 |
<option value="4"<?php echo ($paramshowpeople == "4" ? ' selected="selected"' : ''); ?>><?php echo JText::translate('VBPARAMSHOWPEOPLECHITOT'); ?></option> |
| 631 |
<option value="5"<?php echo ($paramshowpeople == "5" ? ' selected="selected"' : ''); ?>><?php echo JText::translate('VBPARAMSHOWPEOPLEALLTOT'); ?></option> |
| 632 |
</select> |
| 633 |
</div> |
| 634 |
</div> |
| 635 |
<div class="vbo-param-container"> |
| 636 |
<div class="vbo-param-label"><label for="pricecal"><?php echo JText::translate('VBPARAMPRICECALENDAR'); ?></label></div> |
| 637 |
<div class="vbo-param-setting"> |
| 638 |
<select name="pricecal" id="pricecal" onchange="togglePriceCalendarParam();"> |
| 639 |
<option value="0"><?php echo JText::translate('VBPARAMPRICECALENDARDISABLED'); ?></option> |
| 640 |
<option value="1"<?php echo (count($row) && intval(VikBooking::getRoomParam('pricecal', $row['params'])) == 1 ? ' selected="selected"' : ''); ?>><?php echo JText::translate('VBPARAMPRICECALENDARENABLED'); ?></option> |
| 641 |
</select> |
| 642 |
<span class="vbo-param-setting-comment"><?php echo JText::translate('VBPARAMPRICECALENDARHELP'); ?></span> |
| 643 |
</div> |
| 644 |
</div> |
| 645 |
<div class="vbo-param-container vbo-param-nested" id="defcalcostp" style="display: <?php echo (count($row) && intval(VikBooking::getRoomParam('pricecal', $row['params'])) == 1 ? 'flex' : 'none'); ?>;"> |
| 646 |
<?php |
| 647 |
/** |
| 648 |
* The pricing calendar now relies on a default rate plan ID rather than on |
| 649 |
* a default cost per night in order to have a better accuracy on the result. |
| 650 |
* |
| 651 |
* @since 1.16.3 (J) - 1.6.3 (WP) |
| 652 |
*/ |
| 653 |
$room_rate_plans = $row ? VBORoomHelper::getInstance($row)->getRatePlans() : []; |
| 654 |
if ($row && $room_rate_plans) { |
| 655 |
$def_rplan_id = VikBooking::getRoomParam('defrplan', $row['params']); |
| 656 |
?> |
| 657 |
<div class="vbo-param-label"><label for="defrplan"><?php echo JText::translate('VBOROVWSELRPLAN'); ?></label></div> |
| 658 |
<div class="vbo-param-setting"> |
| 659 |
<select name="defrplan" id="defrplan"> |
| 660 |
<?php |
| 661 |
foreach ($room_rate_plans as $rplan) { |
| 662 |
?> |
| 663 |
<option value="<?php echo $rplan['id']; ?>"<?php echo $def_rplan_id == $rplan['id'] ? ' selected="selected"' : ''; ?>><?php echo $rplan['name']; ?></option> |
| 664 |
<?php |
| 665 |
} |
| 666 |
?> |
| 667 |
</select> |
| 668 |
<span class="vbo-param-setting-comment"><?php echo JText::translate('VBPARAMDEFCALCOSTHELP'); ?></span> |
| 669 |
</div> |
| 670 |
<?php |
| 671 |
} else { |
| 672 |
// default to the old calendar default (custom) cost |
| 673 |
?> |
| 674 |
<div class="vbo-param-label"><label for="defcalcost"><?php echo JText::translate('VBPARAMDEFCALCOST'); ?></label></div> |
| 675 |
<div class="vbo-param-setting"> |
| 676 |
<input type="number" min="0" step="any" name="defcalcost" id="defcalcost" value="<?php echo count($row) ? VikBooking::getRoomParam('defcalcost', $row['params']) : ''; ?>" placeholder="50.00"/> |
| 677 |
<span class="vbo-param-setting-comment"><?php echo JText::translate('VBPARAMDEFCALCOSTHELP'); ?></span> |
| 678 |
</div> |
| 679 |
<?php |
| 680 |
} |
| 681 |
?> |
| 682 |
</div> |
| 683 |
<?php |
| 684 |
$season_cal = count($row) ? VikBooking::getRoomParam('seasoncal', $row['params']) : 0; |
| 685 |
$season_cal_prices = count($row) ? VikBooking::getRoomParam('seasoncal_prices', $row['params']) : 0; |
| 686 |
$season_cal_restr = count($row) ? VikBooking::getRoomParam('seasoncal_restr', $row['params']) : 0; |
| 687 |
?> |
| 688 |
<div class="vbo-param-container param-seasoncal"> |
| 689 |
<div class="vbo-param-label"><label for="seasoncal"><?php echo JText::translate('VBPARAMSEASONCALENDAR'); ?></label></div> |
| 690 |
<div class="vbo-param-setting"> |
| 691 |
<select name="seasoncal" id="seasoncal" onchange="toggleSeasonalCalendarParam();"> |
| 692 |
<option value="0"><?php echo JText::translate('VBPARAMSEASONCALENDARDISABLED'); ?></option> |
| 693 |
<optgroup label="<?php echo JText::translate('VBPARAMSEASONCALENDARENABLED'); ?>"> |
| 694 |
<option value="1"<?php echo intval($season_cal) == 1 ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBPARAMSEASONCALENDARENABLEDALL'); ?></option> |
| 695 |
<option value="2"<?php echo intval($season_cal) == 2 ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBPARAMSEASONCALENDARENABLEDCHARGEDISC'); ?></option> |
| 696 |
<option value="3"<?php echo intval($season_cal) == 3 ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBPARAMSEASONCALENDARENABLEDCHARGE'); ?></option> |
| 697 |
</optgroup> |
| 698 |
</select> |
| 699 |
</div> |
| 700 |
</div> |
| 701 |
<div class="vbo-param-container vbo-param-nested param-seasoncal" style="display: <?php echo (intval($season_cal) > 0 ? 'flex' : 'none'); ?>;"> |
| 702 |
<div class="vbo-param-label"><label for="seasoncal_nights"><?php echo JText::translate('VBPARAMSEASONCALNIGHTS'); ?></label></div> |
| 703 |
<div class="vbo-param-setting"> |
| 704 |
<input type="text" name="seasoncal_nights" id="seasoncal_nights" size="10" value="<?php echo count($row) ? VikBooking::getRoomParam('seasoncal_nights', $row['params']) : ''; ?>" placeholder="1, 3, 7, 14"/> |
| 705 |
<span class="vbo-param-setting-comment"><?php echo JText::translate('VBPARAMSEASONCALNIGHTSHELP'); ?></span> |
| 706 |
</div> |
| 707 |
</div> |
| 708 |
<div class="vbo-param-container vbo-param-nested param-seasoncal" style="display: <?php echo (intval($season_cal) > 0 ? 'flex' : 'none'); ?>;"> |
| 709 |
<div class="vbo-param-label"><label for="seasoncal_prices"><?php echo JText::translate('VBPARAMSEASONCALENDARPRICES'); ?></label></div> |
| 710 |
<div class="vbo-param-setting"> |
| 711 |
<select name="seasoncal_prices" id="seasoncal_prices"> |
| 712 |
<option value="0"><?php echo JText::translate('VBPARAMSEASONCALENDARPRICESANY'); ?></option> |
| 713 |
<option value="1"<?php echo intval($season_cal_prices) == 1 ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBPARAMSEASONCALENDARPRICESLOW'); ?></option> |
| 714 |
</select> |
| 715 |
</div> |
| 716 |
</div> |
| 717 |
<div class="vbo-param-container vbo-param-nested param-seasoncal" style="display: <?php echo (intval($season_cal) > 0 ? 'flex' : 'none'); ?>;"> |
| 718 |
<div class="vbo-param-label"><label for="seasoncal_restr"><?php echo JText::translate('VBPARAMSEASONCALENDARLOS'); ?></label></div> |
| 719 |
<div class="vbo-param-setting"> |
| 720 |
<select name="seasoncal_restr" id="seasoncal_restr"> |
| 721 |
<option value="0"><?php echo JText::translate('VBPARAMSEASONCALENDARLOSHIDE'); ?></option> |
| 722 |
<option value="1"<?php echo intval($season_cal_restr) == 1 ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBPARAMSEASONCALENDARLOSSHOW'); ?></option> |
| 723 |
</select> |
| 724 |
</div> |
| 725 |
</div> |
| 726 |
|
| 727 |
<?php |
| 728 |
/** |
| 729 |
* Maximum advance booking offset can be defined at room-level. |
| 730 |
* |
| 731 |
* @since 1.16.3 (J) - 1.6.3 (WP) |
| 732 |
*/ |
| 733 |
if ($row) { |
| 734 |
// only in edit mode, not when creating a new room |
| 735 |
$room_level_max_adv_notice = VBOFactory::getConfig()->get("room_{$row['id']}_max_adv_notice"); |
| 736 |
// build default or current values |
| 737 |
$maxdate_val = 0; |
| 738 |
$maxdate_interval = 'y'; |
| 739 |
if (!empty($room_level_max_adv_notice)) { |
| 740 |
$maxdatefuture = $room_level_max_adv_notice; |
| 741 |
$maxdate_val = intval(substr($maxdatefuture, 1, (strlen($maxdatefuture) - 1))); |
| 742 |
$maxdate_interval = substr($maxdatefuture, -1, 1); |
| 743 |
} |
| 744 |
?> |
| 745 |
<div class="vbo-param-container"> |
| 746 |
<div class="vbo-param-label"><?php echo JText::translate('VBO_MAX_ADV_BOOK_NOTICE'); ?></div> |
| 747 |
<div class="vbo-param-setting"> |
| 748 |
<div> |
| 749 |
<?php |
| 750 |
echo $vbo_app->printYesNoButtons('max_adv_notice_room', JText::translate('VBYES'), JText::translate('VBNO'), (empty($room_level_max_adv_notice) || empty($maxdate_val) ? 0 : 1), 1, 0, 'vboToggleMaxAdvNotice(this.checked);'); |
| 751 |
?> |
| 752 |
</div> |
| 753 |
<div class="vbo-room-level-max_adv-notice" style="<?php echo empty($room_level_max_adv_notice) || empty($maxdate_val) ? 'display: none;' : ''; ?>"> |
| 754 |
<input type="number" name="maxdate" value="<?php echo $maxdate_val; ?>" min="0"/> |
| 755 |
<select name="maxdateinterval"> |
| 756 |
<option value="d"<?php echo $maxdate_interval == 'd' ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBCONFIGSEARCHPMAXDATEDAYS'); ?></option> |
| 757 |
<option value="w"<?php echo $maxdate_interval == 'w' ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBCONFIGSEARCHPMAXDATEWEEKS'); ?></option> |
| 758 |
<option value="m"<?php echo $maxdate_interval == 'm' ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBCONFIGSEARCHPMAXDATEMONTHS'); ?></option> |
| 759 |
<option value="y"<?php echo $maxdate_interval == 'y' ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBCONFIGSEARCHPMAXDATEYEARS'); ?></option> |
| 760 |
</select> |
| 761 |
</div> |
| 762 |
<span class="vbo-param-setting-comment"><?php echo JText::translate('VBO_MAX_ADV_BOOK_NOTICE_HELP'); ?></span> |
| 763 |
</div> |
| 764 |
</div> |
| 765 |
<?php |
| 766 |
} |
| 767 |
?> |
| 768 |
</div> |
| 769 |
</div> |
| 770 |
</fieldset> |
| 771 |
|
| 772 |
</div> |
| 773 |
|
| 774 |
<div class="vbo-config-maintab-right"> |
| 775 |
<fieldset class="adminform"> |
| 776 |
<div class="vbo-params-wrap"> |
| 777 |
<legend class="adminlegend"><?php echo JText::translate('VBOROOMLEGPHOTODESC'); ?></legend> |
| 778 |
<div class="vbo-params-container"> |
| 779 |
<div class="vbo-param-container"> |
| 780 |
<div class="vbo-param-label"><?php echo JText::translate('VBNEWROOMSIX'); ?></div> |
| 781 |
<div class="vbo-param-setting"> |
| 782 |
<div class="vbo-param-setting-block"> |
| 783 |
<?php echo (count($row) && !empty($row['img']) && file_exists(VBO_SITE_PATH.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.$row['img']) ? '<a href="'.VBO_SITE_URI.'resources/uploads/'.$row['img'].'" class="vbomodal vbo-room-img-modal" target="_blank"><i class="' . VikBookingIcons::i('image') . '"></i> ' . $row['img'] . '</a>' : ""); ?> |
| 784 |
<input type="file" name="cimg" size="35"/> |
| 785 |
</div> |
| 786 |
<div class="vbo-param-setting-block"> |
| 787 |
<span class="vbo-resize-lb-cont"> |
| 788 |
<label style="display: inline;" for="autoresize"><?php echo JText::translate('VBNEWOPTNINE'); ?></label> |
| 789 |
<input type="checkbox" id="autoresize" name="autoresize" value="1" onclick="showResizeSel();"/> |
| 790 |
</span> |
| 791 |
<span id="resizesel" style="display: none;"><span><?php echo JText::translate('VBNEWOPTTEN'); ?></span><input type="number" name="resizeto" value="250" min="0" class="vbo-medium-input"/> px</span> |
| 792 |
</div> |
| 793 |
</div> |
| 794 |
</div> |
| 795 |
<?php |
| 796 |
if (count($row)) { |
| 797 |
?> |
| 798 |
<div class="vbo-param-container"> |
| 799 |
<div class="vbo-param-label"> |
| 800 |
<div class="vbo-param-label-top"> |
| 801 |
<span><?php echo JText::translate('VBMOREIMAGES'); ?></span> |
| 802 |
<a href="javascript: void(0);" onclick="addMoreImages();" class="btn vbo-config-btn"> |
| 803 |
<?php VikBookingIcons::e('plus-circle'); ?> |
| 804 |
<?php echo JText::translate('VBADDIMAGES'); ?> |
| 805 |
</a> |
| 806 |
</div> |
| 807 |
<div class="vbo-bulkupload-cont"> |
| 808 |
<div class="vbo-bulkupload-inner"> |
| 809 |
<a href="javascript: void(0);" onclick="showBulkUpload();" class="btn vbo-config-btn"> |
| 810 |
<i class="icon-image" style="float: none;"></i><?php echo JText::translate('VBOBULKUPLOAD'); ?> |
| 811 |
</a> |
| 812 |
</div> |
| 813 |
</div> |
| 814 |
</div> |
| 815 |
<div class="vbo-param-setting"> |
| 816 |
<div class="vbo-editroom-currentphotos"> |
| 817 |
<ul class="vbo-sortable"><?php echo $actmoreimgs; ?></ul> |
| 818 |
</div> |
| 819 |
<div class="vbo-rmphotos-cont"> |
| 820 |
<a class="btn btn-danger" href="index.php?option=com_vikbooking&task=removemoreimgs&roomid=<?php echo $row['id']; ?>&imgind=-1" onclick="return confirm('<?php echo addslashes(JText::translate('VBORMALLPHOTOS')); ?>?');"> |
| 821 |
<i class="icon-cancel"></i><?php echo JText::translate('VBORMALLPHOTOS'); ?> |
| 822 |
</a> |
| 823 |
</div> |
| 824 |
<div class="vbo-first-imgup"> |
| 825 |
<input type="file" name="cimgmore[]" size="35"/> |
| 826 |
<div class="vbo-imgup-caption"> |
| 827 |
<span><?php echo JText::translate('VBIMGCAPTION'); ?></span> |
| 828 |
<input type="text" name="cimgcaption[]" size="30" value=""/> |
| 829 |
</div> |
| 830 |
</div> |
| 831 |
<div id="myDiv" style="display: block;"></div> |
| 832 |
<div class="vbo-param-setting-block"> |
| 833 |
<span class="vbo-resize-lb-cont"> |
| 834 |
<label style="display: inline;" for="autoresizemore"><?php echo JText::translate('VBRESIZEIMAGES'); ?></label> |
| 835 |
<input type="checkbox" id="autoresizemore" name="autoresizemore" value="1" onclick="showResizeSelMore();"/> |
| 836 |
</span> |
| 837 |
<span id="resizeselmore" style="display: none;"><span><?php echo JText::translate('VBNEWOPTTEN'); ?></span><input type="number" name="resizetomore" value="600" min="0" class="vbo-medium-input"/> px</span> |
| 838 |
</div> |
| 839 |
</div> |
| 840 |
</div> |
| 841 |
<?php |
| 842 |
} else { |
| 843 |
?> |
| 844 |
<div class="vbo-param-container"> |
| 845 |
<div class="vbo-param-label"> |
| 846 |
<div class="vbo-param-label-top"> |
| 847 |
<span><?php echo JText::translate('VBMOREIMAGES'); ?></span> |
| 848 |
<a class="btn vbo-config-btn" href="javascript: void(0);" onclick="addMoreImages();"> |
| 849 |
<?php VikBookingIcons::e('plus-circle'); ?> <?php echo JText::translate('VBADDIMAGES'); ?> |
| 850 |
</a> |
| 851 |
</div> |
| 852 |
<p class="vbo-small-p-info"><?php echo JText::translate('VBOBULKUPLOADAFTERSAVE'); ?></p> |
| 853 |
</div> |
| 854 |
<div class="vbo-param-setting"> |
| 855 |
<div class="vbo-first-imgup"> |
| 856 |
<input type="file" name="cimgmore[]" size="35"/> |
| 857 |
<div class="vbo-imgup-caption"> |
| 858 |
<span><?php echo JText::translate('VBIMGCAPTION'); ?></span> |
| 859 |
<input type="text" name="cimgcaption[]" size="30" value=""/> |
| 860 |
</div> |
| 861 |
</div> |
| 862 |
<div id="myDiv" style="display: block;"></div> |
| 863 |
<div class="vbo-param-setting-block"> |
| 864 |
<label style="display: inline;" for="autoresizemore"><?php echo JText::translate('VBRESIZEIMAGES'); ?></label> |
| 865 |
<input type="checkbox" id="autoresizemore" name="autoresizemore" value="1" onclick="showResizeSelMore();"/> |
| 866 |
<span id="resizeselmore" style="display: none;"><span><?php echo JText::translate('VBNEWOPTTEN'); ?></span><input type="text" name="resizetomore" value="600" size="3"/> px</span> |
| 867 |
</div> |
| 868 |
</div> |
| 869 |
</div> |
| 870 |
<?php |
| 871 |
} |
| 872 |
?> |
| 873 |
<div class="vbo-param-container"> |
| 874 |
<div class="vbo-param-label"><?php echo JText::translate('VBNEWROOMSMALLDESC'); ?></div> |
| 875 |
<div class="vbo-param-setting"><textarea name="smalldesc" rows="6" cols="50"><?php echo count($row) ? $row['smalldesc'] : ''; ?></textarea></div> |
| 876 |
</div> |
| 877 |
<div class="vbo-param-container vbo-param-container-full"> |
| 878 |
<div class="vbo-param-label"><?php echo JText::translate('VBNEWROOMSEVEN'); ?></div> |
| 879 |
<div class="vbo-param-setting"> |
| 880 |
<?php |
| 881 |
if (interface_exists('Throwable')) { |
| 882 |
/** |
| 883 |
* With PHP >= 7 supporting throwable exceptions for Fatal Errors |
| 884 |
* we try to avoid issues with third party plugins that make use |
| 885 |
* of the WP native function get_current_screen(). |
| 886 |
* |
| 887 |
* @wponly |
| 888 |
*/ |
| 889 |
try { |
| 890 |
echo $editor->display( "cdescr", (count($row) ? $row['info'] : ""), '100%', 300, 70, 20 ); |
| 891 |
} catch (Throwable $t) { |
| 892 |
echo $t->getMessage() . ' in ' . $t->getFile() . ':' . $t->getLine() . '<br/>'; |
| 893 |
} |
| 894 |
} else { |
| 895 |
// we cannot catch Fatal Errors in PHP 5.x |
| 896 |
echo $editor->display( "cdescr", (count($row) ? $row['info'] : ""), '100%', 300, 70, 20 ); |
| 897 |
} |
| 898 |
?> |
| 899 |
</div> |
| 900 |
</div> |
| 901 |
</div> |
| 902 |
</div> |
| 903 |
</fieldset> |
| 904 |
|
| 905 |
<?php |
| 906 |
if (count($this->rooms_map)) { |
| 907 |
?> |
| 908 |
<fieldset class="adminform"> |
| 909 |
<div class="vbo-params-wrap"> |
| 910 |
<legend class="adminlegend"><?php VikBookingIcons::e('calendar'); ?> <?php echo JText::translate('VBOROOMCALXREFSETTINGS'); ?></legend> |
| 911 |
<div class="vbo-params-container"> |
| 912 |
<div class="vbo-param-container"> |
| 913 |
<div class="vbo-param-label"><?php echo $vbo_app->createPopover(array('title' => JText::translate('VBOROOMSHARECALENDAR') . '...', 'content' => JText::translate('VBOROOMSHARECALENDARHELP'))); ?> <?php echo JText::translate('VBOROOMSHARECALENDAR'); ?></div> |
| 914 |
<div class="vbo-param-setting"> |
| 915 |
<select name="share_with[]" multiple="multiple" size="7" id="share_with_sel"> |
| 916 |
<?php |
| 917 |
foreach ($this->rooms_map as $k => $v) { |
| 918 |
?> |
| 919 |
<option value="<?php echo $k; ?>"<?php echo in_array($k, $this->cal_xref['shared_with']) ? ' selected="selected"' : ''; ?>><?php echo $v; ?></option> |
| 920 |
<?php |
| 921 |
} |
| 922 |
?> |
| 923 |
</select> |
| 924 |
</div> |
| 925 |
</div> |
| 926 |
<?php |
| 927 |
if (count($this->cal_xref['shared_by'])) { |
| 928 |
?> |
| 929 |
<div class="vbo-param-container"> |
| 930 |
<div class="vbo-param-label"><?php echo JText::translate('VBOROOMCALENDARSHAREDBY'); ?></div> |
| 931 |
<div class="vbo-param-setting"> |
| 932 |
<div class="vbo-room-calxref-sharedby"> |
| 933 |
<?php |
| 934 |
foreach ($this->cal_xref['shared_by'] as $v) { |
| 935 |
if (!isset($this->rooms_map[$v])) { |
| 936 |
continue; |
| 937 |
} |
| 938 |
?> |
| 939 |
<a href="index.php?option=com_vikbooking&task=editroom&cid[]=<?php echo $v; ?>" target="_blank"><?php VikBookingIcons::e('calendar'); ?> <?php echo $this->rooms_map[$v]; ?></a> |
| 940 |
<?php |
| 941 |
} |
| 942 |
?> |
| 943 |
</div> |
| 944 |
</div> |
| 945 |
</div> |
| 946 |
<?php |
| 947 |
} |
| 948 |
?> |
| 949 |
</div> |
| 950 |
</div> |
| 951 |
</fieldset> |
| 952 |
<?php |
| 953 |
} |
| 954 |
|
| 955 |
/** |
| 956 |
* Room's Geocoding information. |
| 957 |
* |
| 958 |
* @since 1.14 (J) - 1.4.0 (WP) |
| 959 |
*/ |
| 960 |
echo $this->loadTemplate('geocoding_info'); |
| 961 |
|
| 962 |
/** |
| 963 |
* Room upgrade relations. |
| 964 |
* |
| 965 |
* @since 1.16.0 (J) - 1.6.0 (WP) |
| 966 |
*/ |
| 967 |
if (count($this->rooms_map)) { |
| 968 |
$room_upgrade_options = count($row) ? VBOFactory::getConfig()->getArray('room_upgrade_options_' . $row['id'], []) : []; |
| 969 |
$room_upgrade_options['rooms'] = !empty($room_upgrade_options['rooms']) ? $room_upgrade_options['rooms'] : []; |
| 970 |
$room_upgrade_enabled = count($room_upgrade_options['rooms']) ? 1 : 0; |
| 971 |
?> |
| 972 |
<fieldset class="adminform"> |
| 973 |
<div class="vbo-params-wrap"> |
| 974 |
<legend class="adminlegend"><?php VikBookingIcons::e('gem'); ?> <?php echo JText::translate('VBO_ROOM_UPGRADE'); ?></legend> |
| 975 |
<div class="vbo-params-container"> |
| 976 |
<div class="vbo-param-container"> |
| 977 |
<div class="vbo-param-label"><?php echo $vbo_app->createPopover(array('title' => JText::translate('VBO_ROOM_UPGRADE'), 'content' => JText::translate('VBO_ROOM_UPGRADE_HELP'))); ?> <?php echo JText::translate('VBPARAMPRICECALENDARENABLED'); ?></div> |
| 978 |
<div class="vbo-param-setting"> |
| 979 |
<?php |
| 980 |
echo $vbo_app->printYesNoButtons('room_upgrade', JText::translate('VBYES'), JText::translate('VBNO'), $room_upgrade_enabled, 1, 0, 'vboToggleRoomUpgrade();'); |
| 981 |
?> |
| 982 |
</div> |
| 983 |
</div> |
| 984 |
</div> |
| 985 |
<div class="vbo-params-container vbo-roomupgrade-param" style="<?php echo !$room_upgrade_enabled ? 'display: none;' : ''; ?>"> |
| 986 |
<div class="vbo-param-container"> |
| 987 |
<div class="vbo-param-label"><?php echo JText::translate('VBO_ELIGIBLE_ROOMS'); ?></div> |
| 988 |
<div class="vbo-param-setting"> |
| 989 |
<select name="upgrade_rooms[]" id="upgrade-rooms" multiple="multiple"> |
| 990 |
<?php |
| 991 |
foreach ($this->rooms_map as $rid => $rname) { |
| 992 |
?> |
| 993 |
<option value="<?php echo $rid; ?>"<?php echo in_array($rid, $room_upgrade_options['rooms']) ? ' selected="selected"' : ''; ?>><?php echo $rname; ?></option> |
| 994 |
<?php |
| 995 |
} |
| 996 |
?> |
| 997 |
</select> |
| 998 |
</div> |
| 999 |
</div> |
| 1000 |
</div> |
| 1001 |
<div class="vbo-params-container vbo-roomupgrade-param" style="<?php echo !$room_upgrade_enabled ? 'display: none;' : ''; ?>"> |
| 1002 |
<div class="vbo-param-container"> |
| 1003 |
<div class="vbo-param-label"><?php echo JText::translate('VBAPPLYDISCOUNT'); ?></div> |
| 1004 |
<div class="vbo-param-setting"> |
| 1005 |
<div class="input-append"> |
| 1006 |
<input type="number" name="upgrade_discount" value="<?php echo isset($room_upgrade_options['discount']) ? (float)$room_upgrade_options['discount'] : 0; ?>" min="0" max="100" step="any" /> |
| 1007 |
<button type="button" class="btn" disabled>%</button> |
| 1008 |
</div> |
| 1009 |
</div> |
| 1010 |
</div> |
| 1011 |
</div> |
| 1012 |
</div> |
| 1013 |
</fieldset> |
| 1014 |
<?php |
| 1015 |
} |
| 1016 |
?> |
| 1017 |
|
| 1018 |
<fieldset class="adminform"> |
| 1019 |
<div class="vbo-params-wrap"> |
| 1020 |
<legend class="adminlegend"><?php echo JText::translate('VBOADMINLEGENDSETTINGS'); ?></legend> |
| 1021 |
<div class="vbo-params-container"> |
| 1022 |
<?php |
| 1023 |
$custptitle = count($row) ? VikBooking::getRoomParam('custptitle', $row['params']) : ''; |
| 1024 |
$custptitlew = count($row) ? VikBooking::getRoomParam('custptitlew', $row['params']) : ''; |
| 1025 |
$metakeywords = count($row) ? VikBooking::getRoomParam('metakeywords', $row['params']) : ''; |
| 1026 |
$metadescription = count($row) ? VikBooking::getRoomParam('metadescription', $row['params']) : ''; |
| 1027 |
if (defined('_JEXEC')) { |
| 1028 |
/** |
| 1029 |
* @wponly removed SEF alias |
| 1030 |
*/ |
| 1031 |
?> |
| 1032 |
<div class="vbo-param-container"> |
| 1033 |
<div class="vbo-param-label"><label for="sefalias"><?php echo JText::translate('VBROOMSEFALIAS'); ?></label></div> |
| 1034 |
<div class="vbo-param-setting"> |
| 1035 |
<input type="text" id="sefalias" name="sefalias" value="<?php echo count($row) ? $row['alias'] : ''; ?>" placeholder="double-room-superior"/> |
| 1036 |
</div> |
| 1037 |
</div> |
| 1038 |
<?php |
| 1039 |
} |
| 1040 |
?> |
| 1041 |
<div class="vbo-param-container"> |
| 1042 |
<div class="vbo-param-label"><label for="custptitle"><?php echo JText::translate('VBPARAMPAGETITLE'); ?></label></div> |
| 1043 |
<div class="vbo-param-setting"> |
| 1044 |
<input type="text" id="custptitle" name="custptitle" value="<?php echo $custptitle; ?>"/> |
| 1045 |
</div> |
| 1046 |
</div> |
| 1047 |
<div class="vbo-param-container vbo-param-child"> |
| 1048 |
<div class="vbo-param-label"></div> |
| 1049 |
<div class="vbo-param-setting"> |
| 1050 |
<select name="custptitlew"> |
| 1051 |
<option value="before"<?php echo $custptitlew == 'before' ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBPARAMPAGETITLEBEFORECUR'); ?></option> |
| 1052 |
<option value="after"<?php echo $custptitlew == 'after' ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBPARAMPAGETITLEAFTERCUR'); ?></option> |
| 1053 |
<option value="replace"<?php echo $custptitlew == 'replace' ? ' selected="selected"' : ''; ?>><?php echo JText::translate('VBPARAMPAGETITLEREPLACECUR'); ?></option> |
| 1054 |
</select> |
| 1055 |
</div> |
| 1056 |
</div> |
| 1057 |
<div class="vbo-param-container"> |
| 1058 |
<div class="vbo-param-label"><label for="metakeywords"><?php echo JText::translate('VBPARAMKEYWORDSMETATAG'); ?></label></div> |
| 1059 |
<div class="vbo-param-setting"> |
| 1060 |
<textarea name="metakeywords" id="metakeywords" rows="3" cols="40"><?php echo $metakeywords; ?></textarea> |
| 1061 |
</div> |
| 1062 |
</div> |
| 1063 |
<div class="vbo-param-container"> |
| 1064 |
<div class="vbo-param-label"><label for="metadescription"><?php echo JText::translate('VBPARAMDESCRIPTIONMETATAG'); ?></label></div> |
| 1065 |
<div class="vbo-param-setting"> |
| 1066 |
<textarea name="metadescription" id="metadescription" rows="4" cols="40"><?php echo $metadescription; ?></textarea> |
| 1067 |
</div> |
| 1068 |
</div> |
| 1069 |
</div> |
| 1070 |
</div> |
| 1071 |
</fieldset> |
| 1072 |
|
| 1073 |
</div> |
| 1074 |
</div> |
| 1075 |
|
| 1076 |
<input type="hidden" name="task" value=""> |
| 1077 |
<?php |
| 1078 |
if (count($row)) { |
| 1079 |
?> |
| 1080 |
<input type="hidden" name="whereup" value="<?php echo $row['id']; ?>"> |
| 1081 |
<input type="hidden" name="actmoreimgs" id="actmoreimgs" value="<?php echo $row['moreimgs']; ?>"> |
| 1082 |
<?php |
| 1083 |
} |
| 1084 |
?> |
| 1085 |
<input type="hidden" name="option" value="com_vikbooking"> |
| 1086 |
<?php echo JHtml::fetch('form.token'); ?> |
| 1087 |
</form> |
| 1088 |
|
| 1089 |
<?php |
| 1090 |
/** |
| 1091 |
* Room's Geocoding information - modal. |
| 1092 |
* |
| 1093 |
* @since 1.14 (J) - 1.4.0 (WP) |
| 1094 |
*/ |
| 1095 |
echo $this->loadTemplate('geocoding_modal'); |
| 1096 |
?> |
| 1097 |
|
| 1098 |
<div class="vbo-info-overlay-block"> |
| 1099 |
<a class="vbo-info-overlay-close" href="javascript: void(0);"></a> |
| 1100 |
<div class="vbo-info-overlay-content"> |
| 1101 |
<!-- The fileinput-button span is used to style the file input field as button --> |
| 1102 |
<span class="btn vbo-config-btn fileinput-button"> |
| 1103 |
<?php VikBookingIcons::e('plus-circle'); ?> |
| 1104 |
<span><?php echo JText::translate('VBOSELORDRAGFILES'); ?></span> |
| 1105 |
<!-- The file input field used as target for the file upload widget --> |
| 1106 |
<input id="fileupload" type="file" name="bulkphotos[]" multiple> |
| 1107 |
</span> |
| 1108 |
<!-- The global progress bar --> |
| 1109 |
<div id="progress" class="progress"> |
| 1110 |
<div class="progress-bar"></div> |
| 1111 |
</div> |
| 1112 |
<!-- The container for the uploaded files --> |
| 1113 |
<div id="files" class="files"></div> |
| 1114 |
<div class="vbo-upload-done"> |
| 1115 |
<button type="button" class="btn btn-success" onclick="vboCloseModal();"><i class="icon-save"></i><?php echo JText::translate('VBOUPLOADFILEDONE'); ?></button> |
| 1116 |
</div> |
| 1117 |
</div> |
| 1118 |
</div> |
| 1119 |
|
| 1120 |
<?php |
| 1121 |
// the Load Image plugin is included for the preview images and image resizing functionality |
| 1122 |
$vbo_app->addScript(VBO_ADMIN_URI . 'resources/js_upload/load-image.all.min.js'); |
| 1123 |
// the Iframe Transport is required for browsers without support for XHR file uploads |
| 1124 |
$vbo_app->addScript(VBO_ADMIN_URI . 'resources/js_upload/jquery.iframe-transport.js'); |
| 1125 |
// the basic File Upload plugin |
| 1126 |
$vbo_app->addScript(VBO_ADMIN_URI . 'resources/js_upload/jquery.fileupload.js'); |
| 1127 |
// the File Upload processing plugin |
| 1128 |
$vbo_app->addScript(VBO_ADMIN_URI . 'resources/js_upload/jquery.fileupload-process.js'); |
| 1129 |
// the File Upload image preview & resize plugin |
| 1130 |
$vbo_app->addScript(VBO_ADMIN_URI . 'resources/js_upload/jquery.fileupload-image.js'); |
| 1131 |
// the File Upload validation plugin |
| 1132 |
$vbo_app->addScript(VBO_ADMIN_URI . 'resources/js_upload/jquery.fileupload-validate.js'); |
| 1133 |
?> |
| 1134 |
|
| 1135 |
<script type="text/javascript"> |
| 1136 |
var vbo_overlay_on = false; |
| 1137 |
function showBulkUpload() { |
| 1138 |
jQuery(".vbo-info-overlay-block").fadeIn(); |
| 1139 |
vbo_overlay_on = true; |
| 1140 |
} |
| 1141 |
function vboCloseModal() { |
| 1142 |
jQuery(".vbo-info-overlay-block").fadeOut(400, function() { |
| 1143 |
jQuery(this).attr("class", "vbo-info-overlay-block"); |
| 1144 |
}); |
| 1145 |
vbo_overlay_on = false; |
| 1146 |
} |
| 1147 |
jQuery(document).ready(function() { |
| 1148 |
togglePriceCalendarParam(); |
| 1149 |
toggleSeasonalCalendarParam(); |
| 1150 |
|
| 1151 |
jQuery(document).mouseup(function(e) { |
| 1152 |
if (!vbo_overlay_on) { |
| 1153 |
return false; |
| 1154 |
} |
| 1155 |
var vbo_overlay_cont = jQuery(".vbo-info-overlay-content"); |
| 1156 |
if (!vbo_overlay_cont.is(e.target) && vbo_overlay_cont.has(e.target).length === 0) { |
| 1157 |
vboCloseModal(); |
| 1158 |
} |
| 1159 |
}); |
| 1160 |
jQuery(document).keyup(function(e) { |
| 1161 |
if (e.keyCode == 27) { |
| 1162 |
if (vbo_overlay_on) { |
| 1163 |
vboCloseModal(); |
| 1164 |
} |
| 1165 |
if (vbo_details_on) { |
| 1166 |
vbo_details_on = false; |
| 1167 |
jQuery('.vbimagedetbox').hide(); |
| 1168 |
} |
| 1169 |
} |
| 1170 |
}); |
| 1171 |
}); |
| 1172 |
jQuery(function() { |
| 1173 |
var url = 'index.php?option=com_vikbooking&task=multiphotosupload&roomid=<?php echo count($row) ? $row['id'] : '0'; ?>', |
| 1174 |
uploadButton = jQuery('<button/>') |
| 1175 |
.addClass('btn btn-primary') |
| 1176 |
.prop('disabled', true) |
| 1177 |
.text('Processing...') |
| 1178 |
.on('click', function () { |
| 1179 |
var $this = jQuery(this), |
| 1180 |
data = $this.data(); |
| 1181 |
$this |
| 1182 |
.off('click') |
| 1183 |
.text('Abort') |
| 1184 |
.on('click', function () { |
| 1185 |
$this.remove(); |
| 1186 |
data.abort(); |
| 1187 |
}); |
| 1188 |
data.submit().always(function () { |
| 1189 |
$this.remove(); |
| 1190 |
}); |
| 1191 |
}); |
| 1192 |
jQuery('#fileupload').fileupload({ |
| 1193 |
url: url, |
| 1194 |
dataType: 'json', |
| 1195 |
autoUpload: true, |
| 1196 |
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, |
| 1197 |
maxFileSize: 999000, |
| 1198 |
disableImageResize: true, |
| 1199 |
previewMaxWidth: 100, |
| 1200 |
previewMaxHeight: 100, |
| 1201 |
previewCrop: true |
| 1202 |
}).on('fileuploadadd', function (e, data) { |
| 1203 |
data.context = jQuery('<div/>').addClass('vbo-upload-photo').appendTo('#files'); |
| 1204 |
jQuery.each(data.files, function (index, file) { |
| 1205 |
var node = jQuery('<p/>') |
| 1206 |
.append(jQuery('<span/>').text(file.name)); |
| 1207 |
if (!index) { |
| 1208 |
node.append(uploadButton.clone(true).data(data)); |
| 1209 |
} |
| 1210 |
node.appendTo(data.context); |
| 1211 |
}); |
| 1212 |
}).on('fileuploadprocessalways', function (e, data) { |
| 1213 |
var index = data.index, |
| 1214 |
file = data.files[index], |
| 1215 |
node = jQuery(data.context.children()[index]); |
| 1216 |
if (file.preview) { |
| 1217 |
node.prepend(file.preview); |
| 1218 |
} |
| 1219 |
if (file.error) { |
| 1220 |
node.append(jQuery('<span class="text-danger"/>').text(file.error)); |
| 1221 |
} |
| 1222 |
if (index + 1 === data.files.length) { |
| 1223 |
data.context.find('button') |
| 1224 |
.text('Upload') |
| 1225 |
.prop('disabled', !!data.files.error); |
| 1226 |
} |
| 1227 |
}).on('fileuploadprogressall', function (e, data) { |
| 1228 |
var progress = parseInt(data.loaded / data.total * 100, 10); |
| 1229 |
jQuery('#progress .progress-bar').css( |
| 1230 |
'width', |
| 1231 |
progress + '%' |
| 1232 |
); |
| 1233 |
if (progress > 99) { |
| 1234 |
jQuery('#progress .progress-bar').addClass("progress-bar-success"); |
| 1235 |
} else { |
| 1236 |
if (jQuery('#progress .progress-bar').hasClass("progress-bar-success")){ |
| 1237 |
jQuery('#progress .progress-bar').removeClass("progress-bar-success"); |
| 1238 |
} |
| 1239 |
} |
| 1240 |
}).on('fileuploaddone', function (e, data) { |
| 1241 |
jQuery.each(data.result.files, function (index, file) { |
| 1242 |
if (file.url) { |
| 1243 |
var link = jQuery('<a>') |
| 1244 |
.attr('target', '_blank') |
| 1245 |
.attr('class', 'vbomodal') |
| 1246 |
.prop('href', file.url); |
| 1247 |
jQuery(data.context.children()[index]) |
| 1248 |
.wrap(link); |
| 1249 |
data.context.find('button') |
| 1250 |
.hide(); |
| 1251 |
jQuery('.vbo-upload-done') |
| 1252 |
.fadeIn(); |
| 1253 |
} else if (file.error) { |
| 1254 |
var error = jQuery('<span class="text-danger"/>').text(file.error); |
| 1255 |
jQuery(data.context.children()[index]) |
| 1256 |
.append('<br>') |
| 1257 |
.append(error); |
| 1258 |
} else { |
| 1259 |
jQuery(data.context.children()[index]) |
| 1260 |
.append('<br>') |
| 1261 |
.append('Generic Error.'); |
| 1262 |
} |
| 1263 |
}); |
| 1264 |
if (data.result.hasOwnProperty('actmoreimgs')) { |
| 1265 |
jQuery('#actmoreimgs').val(data.result.actmoreimgs); |
| 1266 |
} |
| 1267 |
if (data.result.hasOwnProperty('currentthumbs')) { |
| 1268 |
jQuery('.vbo-editroom-currentphotos').html(data.result.currentthumbs); |
| 1269 |
} |
| 1270 |
if (typeof reloadFancybox === 'function') { |
| 1271 |
reloadFancybox(); |
| 1272 |
} |
| 1273 |
}).on('fileuploadfail', function (e, data) { |
| 1274 |
jQuery.each(data.files, function (index) { |
| 1275 |
var error = jQuery('<span class="text-danger"/>').text('File upload failed.'); |
| 1276 |
jQuery(data.context.children()[index]) |
| 1277 |
.append('<br>') |
| 1278 |
.append(error); |
| 1279 |
}); |
| 1280 |
}).prop('disabled', !jQuery.support.fileInput) |
| 1281 |
.parent().addClass(jQuery.support.fileInput ? undefined : 'disabled'); |
| 1282 |
}); |
| 1283 |
</script> |
| 1284 |
|