rows;
$allrooms = $this->allrooms;
$lim0 = $this->lim0;
$navbut = $this->navbut;
$orderby = $this->orderby;
$ordersort = $this->ordersort;
// list of IDs for which VCM should monitor the guest messages in the chat
$vcm_bids = array();
$dbo = JFactory::getDbo();
$app = JFactory::getApplication();
$vbo_app = VikBooking::getVboApplication();
$vbo_app->loadDatePicker();
$vbo_app->loadContextMenuAssets();
// JS lang def
JText::script('VBOGENINVOICES');
JText::script('VBCONFIRMGENINV');
JText::script('VBADMINNOTESTOGGLE');
JText::script('VBDASHUPRESONE');
JText::script('VBOCHANNEL');
JText::script('VBCOUPON');
JText::script('VBCUSTOMERNOMINATIVE');
$nowdf = VikBooking::getDateFormat(true);
if ($nowdf == "%d/%m/%Y") {
$df = 'd/m/Y';
} elseif ($nowdf == "%m/%d/%Y") {
$df = 'm/d/Y';
} else {
$df = 'Y/m/d';
}
$datesep = VikBooking::getDateSeparator(true);
$juidf = $nowdf == "%d/%m/%Y" ? 'dd/mm/yy' : ($nowdf == "%m/%d/%Y" ? 'mm/dd/yy' : 'yy/mm/dd');
$cid = VikRequest::getVar('cid', array());
$pcust_id = $app->getUserStateFromRequest("vbo.orders.cust_id", 'cust_id', 0, 'int');
$pconfirmnumber = VikRequest::getString('confirmnumber', '', 'request');
//Color tags
$colortags = VikBooking::loadBookingsColorTags();
$bctags_tip = '';
if (count($colortags) > 0) {
$bctags_tip = '
';
foreach ($colortags as $ctagk => $ctagv) {
$bctags_tip .= '
';
}
$bctags_tip .= '
';
}
//
if (empty($rows)) {
$rows = array();
?>
$spn) {
$tpp_key = $spkey;
break;
}
?>
setQuery($q);
$ord_channels = $dbo->loadAssocList();
if ($ord_channels) {
foreach ($ord_channels as $o_channel) {
$channel_parts = explode('_', $o_channel['channel']);
$channel_name = count($channel_parts) > 1 ? trim($channel_parts[1]) : trim($channel_parts[0]);
if (in_array($channel_name, $all_channels)) {
continue;
}
$all_channels[] = $channel_name;
}
}
// prepare modal
echo $vbo_app->getJmodalScript();
echo $vbo_app->getJmodalHtml('vbo-export-csv', JText::translate('VBCSVEXPORT'), '', 'width: 80%; height: 60%; margin-left: -40%; top: 20% !important;');
echo $vbo_app->getJmodalHtml('vbo-export-ics', JText::translate('VBICSEXPORT'), '', 'width: 80%; height: 60%; margin-left: -40%; top: 20% !important;');
$filters_set = false;
?>
0 && !empty($cid[0])) {
$oldinvdate = '';
$nextinvnum = VikBooking::getNextInvoiceNumber();
$invsuff = VikBooking::getInvoiceNumberSuffix();
$companyinfo = VikBooking::getInvoiceCompanyInfo();
//if editing an invoice (re-creating an existing invoice for a booking), do not increment the invoice number
if (count($cid) == 1) {
//the generate invoice btn of the booking details page can pass the invoice notes field via hidden field. If not empty, update invoice notes for this id
$pinvnotes = VikRequest::getString('invnotes', '', 'request', VIKREQUEST_ALLOWHTML);
if (!empty($pinvnotes)) {
$pinvnotes = strpos($pinvnotes, '
quote($pinvnotes)." WHERE `id`=".(int)$cid[0].";";
$dbo->setQuery($q);
$dbo->execute();
}
//
$q = "SELECT `number`,`for_date` FROM `#__vikbooking_invoices` WHERE `idorder`=" . (int)$cid[0];
$dbo->setQuery($q, 0, 1);
$prev_data = $dbo->loadAssoc();
if ($prev_data) {
$oldinvdate = $prev_data['for_date'];
$prev_inv_number = intval(str_replace($invsuff, '', $prev_data['number']));
if ($prev_inv_number > 0) {
$nextinvnum = $prev_inv_number;
}
}
}
//
?>