function deleteRateDate() { $id = JRequest::getInt('id', 0); $db = JFactory::getDbo(); $query = $db->getQuery(true); if ($id) { $query->delete('#__bookpro_tourrate'); $query->where('id=' . $id); $db->setQuery($query); $db->query(); } $calendar_attributes = array('min_select_year' => JFactory::getDate('-1 years')->format('Y'), 'max_select_year' => JFactory::getDate('+1 years')->format('Y')); if (isset($_REQUEST['action']) and $_REQUEST['action'] == 'pn_get_month_cal') { require_once JPATH_COMPONENT_ADMINISTRATOR . '/classes/calendar.php'; AImporter::css('calendar'); $calendar = new PN_Calendar($calendar_attributes); echo $calendar->draw(array(), $_REQUEST['year'], $_REQUEST['month']); exit; } }
function calendar() { $date = JDate::createFromFormat('Y', $_POST['year']); $min_date = clone $date; $min_date = $min_date->modify('-1 year'); $max_date = $date->modify('+1 year'); $calendar_attributes = array('min_select_year' => $min_date->format('Y'), 'max_select_year' => $max_date->format('Y')); if (isset($_REQUEST['action']) and $_REQUEST['action'] == 'pn_get_month_cal') { AImporter::classes('dayoffcalendar'); AImporter::css('calendar'); $calendar = new PN_Calendar($calendar_attributes); echo $calendar->draw(array(), $_REQUEST['year'], $_REQUEST['month']); exit; } }
} }); }); </script> <div class="span10" id="j-main-container"> <div class="lead"> <?php echo $this->tour->from_name . ' - ' . $this->tour->to_name; ?> </div> <form action="index.php?option=com_bookpro&view=tourrates&tour_id=<?php echo $this->tour->id; ?> " method="post" name="adminForm" id="adminForm"> <?php $calendar = new PN_Calendar(); echo $calendar->draw(); ?> <input type="hidden" name="controller" value="tourrate" /> <input type="hidden" name="task" value="delete" /> <?php echo JHtml::_('form.token'); ?> </form> </div>