addToolBar(); $navbut = ""; $app = JFactory::getApplication(); $dbo = JFactory::getDbo(); // wizard $wizard = VikRequest::getInt('wizard', 0, 'request'); $rplanpub1 = VikRequest::getInt('rplanpub1', 0, 'request'); $rplanpub2 = VikRequest::getInt('rplanpub2', 0, 'request'); $rplanbk1 = VikRequest::getInt('rplanbk1', 0, 'request'); $rplanbk2 = VikRequest::getInt('rplanbk2', 0, 'request'); if ($wizard) { if (!JSession::checkToken()) { throw new Exception(JText::translate('JINVALID_TOKEN'), 403); } if ($rplanpub1) { $q = "INSERT INTO `#__vikbooking_prices` (`name`, `idiva`, `breakfast_included`, `free_cancellation`, `minlos`) VALUES (" . $dbo->quote(JText::translate('VBOSTANDARDRATE')) . ", 0, $rplanbk1, 1, 0);"; $dbo->setQuery($q); $dbo->execute(); } if ($rplanpub2) { $q = "INSERT INTO `#__vikbooking_prices` (`name`, `idiva`, `breakfast_included`, `free_cancellation`, `canc_deadline`, `minlos`) VALUES (" . $dbo->quote(JText::translate('VBONONREFRATE')) . ", 0, $rplanbk2, 0, 7, 0);"; $dbo->setQuery($q); $dbo->execute(); } $app->redirect('index.php?option=com_vikbooking&wizard=1'); exit; } $lim = $app->getUserStateFromRequest("com_vikbooking.limit", 'limit', $app->get('list_limit'), 'int'); $lim0 = VikRequest::getVar('limitstart', 0, '', 'int'); $q = "SELECT SQL_CALC_FOUND_ROWS * FROM `#__vikbooking_prices` ORDER BY `derived_id` ASC, `id` ASC"; $dbo->setQuery($q, $lim0, $lim); $rows = $dbo->loadAssocList(); if ($rows) { $dbo->setQuery('SELECT FOUND_ROWS();'); jimport('joomla.html.pagination'); $pageNav = new JPagination( $dbo->loadResult(), $lim0, $lim ); $navbut="
| ".$pageNav->getListFooter()." |