uawdijnntqw1x1x1
IP : 216.73.216.168
Hostname : server.fattispazio.it
Kernel : Linux server.fattispazio.it 3.10.0-1160.144.1.el7.tuxcare.els4.x86_64 #1 SMP Tue Apr 7 08:40:40 UTC 2026 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
poliximo
/
public_html
/
4690b
/
..
/
home_
/
libraries
/
..
/
plugins
/
system
/
rsfprsevents.php
/
/
<?php /** * @version 1.2.0 * @package RSform!Pro 1.2.0 * @copyright (C) 2007-2009 www.rsjoomla.com * @license Commercial License, http://www.rsjoomla.com/terms-and-conditions.html */ // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.plugin.plugin' ); /** * RSForm! Pro system plugin */ if(file_exists(JPATH_SITE.DS.'components'.DS.'com_rsevents'.DS.'helpers'.DS.'rsevents.php') && file_exists(JPATH_SITE.DS.'components'.DS.'com_rsevents'.DS.'models'.DS.'events.php') && file_exists(JPATH_SITE.DS.'components'.DS.'com_rsevents'.DS.'tables'.DS.'rsevents_events.php') && file_exists(JPATH_SITE.DS.'components'.DS.'com_rsform'.DS.'rsform.php')) { class plgSystemrsfprsevents extends JPlugin { /** * Constructor * * For php4 compatibility we must not use the __constructor as a constructor for plugins * because func_get_args ( void ) returns a copy of all passed arguments NOT references. * This causes problems with cross-referencing necessary for the observer design pattern. * * @access protected * @param object $subject The object to observe * @param array $config An array that holds the plugin configuration * @since 1.0 */ function plgSystemrsfprsevents( &$subject, $config ) { parent::__construct( $subject, $config ); parent::loadLanguage( 'plg_system_rsfprsevents' ); parent::loadLanguage( 'com_rsevents',JPATH_SITE ); $this->newComponents = array(16,17,18,19,20,26); } /* Event Triggered Functions */ function rsfp_bk_onInit() { global $RSadapter; $RSadapter->config['component_ids'] = array_merge($RSadapter->config['component_ids'],$this->newComponents); } function rsfp_bk_onAfterShowComponents() { global $mainframe; ?> <strong><?php echo JText::_('RSFP_RSEVENTS_LABEL');?></strong> <a href="#" onclick="displayTemplate('16');return false;" class="component" id="textfield"> <?php echo JText::_('RSFP_RSEVENTS_FNAME');?> </a><div title="componentEdit" id="componentEdit16" class="componentEdit"></div> <a href="#" onclick="displayTemplate('17');return false;" class="component" id="textfield"> <?php echo JText::_('RSFP_RSEVENTS_LNAME');?> </a><div title="componentEdit" id="componentEdit17" class="componentEdit"></div> <a href="#" onclick="displayTemplate('18');return false;" class="component" id="textfield"> <?php echo JText::_('RSFP_RSEVENTS_EMAIL');?> </a><div title="componentEdit" id="componentEdit18" class="componentEdit"></div> <a href="#" onclick="displayTemplate('19');return false;" class="component" id="select"> <?php echo JText::_('RSFP_RSEVENTS_TICKETS');?> </a><div title="componentEdit" id="componentEdit19" class="componentEdit"></div> <a href="#" onclick="displayTemplate('26');return false;" class="component" id="select"> <?php echo JText::_('RSFP_RSEVENTS_NUMTICKETS');?> </a><div title="componentEdit" id="componentEdit26" class="componentEdit"></div> <a href="#" onclick="displayTemplate('20');return false;" class="component" id="radio"> <?php echo JText::_('RSFP_RSEVENTS_PAYMENT');?> </a><div title="componentEdit" id="componentEdit20" class="componentEdit"></div> <?php } function rse_f_onAfterLoadRegistrationForm($args) { $db = &JFactory::getDBO(); //do we have payment on this event? $db->setQuery("SELECT SUM(TicketPrice) as Price, COUNT(*) as Cnt FROM `#__rsevents_tickets` WHERE `IdEvent` = '".$args['event']->IdEvent."'"); $ticketProperties = $db->loadObject(); $pieces = array(16=>16,17=>17,18=>18,19=>19,20=>20,26=>26); if(!$ticketProperties->Price) { unset($pieces[20]); unset($pieces[26]); if($ticketProperties->Cnt == 1) unset($pieces[19]); } $db->setQuery("SELECT DISTINCT f.FormId FROM #__rsform_forms f LEFT JOIN #__rsform_components c ON c.FormId=f.FormId WHERE c.ComponentTypeId IN ( ".implode(',',$pieces).") AND f.Published =1 AND c.Published=1 GROUP BY c.FormId HAVING COUNT(c.ComponentTypeId ) = '".count($pieces)."'"); $args['formids'] = $db->loadResultArray(); } function rsfp_f_onBeforeFormDisplay($args) { if($this->rsfp_containsComponents($args['formId'],$this->newComponents)) { $args['formLayout'] .= '<script type="text/javascript"> rse_hidePayment(document.getElementById(\'RSEventsTickets\').value,1); </script>'; } } function rsfp_f_onAfterFormProcess($args) { if($this->rsfp_containsComponents($args['formId'],$this->newComponents)) { require_once(JPATH_SITE.DS.'components'.DS.'com_rsevents'.DS.'helpers'.DS.'rsevents.php'); $db =& JFactory::getDBO(); $cid = intval(JRequest::getVar('cid',0,'request')); $option = JRequest::getVar('option',0,'request'); if($cid && $option == 'com_rsevents') { $db->setQuery("SELECT count(*) cnt FROM #__rsevents_events WHERE EventRegistrationForm = '".$args['formId']."' AND IdEvent = '".$cid."'"); if($db->loadResult()) { $post = JRequest::get('post'); $post = $post['form']; $db->setQuery("SELECT COUNT(IdSubscription) FROM #__rsevents_subscriptions WHERE IdEvent='".$cid."' AND Email='".$db->getEscaped($post['RSEventsEmail'])."'"); $row = $db->loadResult(); $db->setQuery("SELECT ConfigValue FROM #__rsevents_config WHERE ConfigName = 'event.multiple.reg' "); $multiplereg = $db->loadResult(); if($row && $multiplereg == 0) { $db->setQuery("DELETE FROM #__rsform_submission_values WHERE FormId = ".$post['formId']." AND SubmissionId = ".$args['SubmissionId']); $db->query(); $db->setQuery("DELETE FROM #__rsform_submissions WHERE FormId = ".$post['formId']." AND SubmissionId = ".$args['SubmissionId']); $db->query(); } rseventsHelper::saveRegistration($args['SubmissionId']); } } } } /* Task Functions */ /* Additional Functions */ function RSEventsGetSettings() { $db =& JFactory::getDBO(); $db->setQuery("SELECT * FROM `#__rsevents_config`"); $rseventsConfigDb = $db->loadObjectList(); $rseventsConfig = array(); foreach ($rseventsConfigDb as $rowConfig) $rseventsConfig[$rowConfig->ConfigName] = $rowConfig->ConfigValue; return $rseventsConfig; } function RSEventsGetEvent($cid) { require_once(JPATH_SITE.DS.'components'.DS.'com_rsevents'.DS.'models'.DS.'events.php'); require_once(JPATH_SITE.DS.'components'.DS.'com_rsevents'.DS.'tables'.DS.'rsevents_events.php'); return rseventsModelEvents::getEvent($cid); } function RSEventsTickets() { $info = plgSystemrsfprsevents::RSEventsGetSettings(); $db = &JFactory::getDBO(); $cid = JRequest::getVar('cid',0,'request'); $event = plgSystemrsfprsevents::RSEventsGetEvent($cid); $db->setQuery("SELECT IdTicket, TicketName, TicketPrice, TicketMaxAudience, TicketDescription FROM #__rsevents_tickets WHERE IdEvent='".$cid."' ORDER BY ordering"); $tickets = $db->loadObjectList(); $ticket_list = array(); $ticket_descriptions = ''; foreach($tickets as $i => $objTicketDetails) { $db->setQuery("SELECT SUM(st.TicketsSubscribed) FROM #__rsevents_subscription_tickets st LEFT JOIN #__rsevents_subscriptions s ON s.IdSubscription=st.IdSubscription WHERE st.IdTicket='".$objTicketDetails->IdTicket."' AND s.SubscriptionState IN (1,0)"); $result = $db->loadResult(); if($event->EventOverbooking == 0) { if($tickets[$i]->TicketMaxAudience > $result || $tickets[$i]->TicketMaxAudience == 0) { $objTicketDetails->value = (($objTicketDetails->TicketPrice == '0') ? $objTicketDetails->IdTicket.'|'.$objTicketDetails->TicketName . ' (' . JText::_('RSE_TICKETS_FREE').')' : $objTicketDetails->IdTicket.'|'.$objTicketDetails->TicketName . ' (' . number_format($objTicketDetails->TicketPrice,$info['payment.nrdecimals'], $info['payment.decimal'], $info['payment.thousands']).' '.$info['payment.currency'].')'); $ticket_list[] = $objTicketDetails->value; $ticket_descriptions .= '<p id="rsevents_ticket_'.$objTicketDetails->IdTicket.'" style="display:'.($i==0 ? 'inline':'none').';">'.$objTicketDetails->TicketDescription.'</p>'; } } else { $objTicketDetails->value = (($objTicketDetails->TicketPrice == '0') ? $objTicketDetails->IdTicket.'|'.$objTicketDetails->TicketName . ' (' . JText::_('RSE_TICKETS_FREE').')' : $objTicketDetails->IdTicket.'|'.$objTicketDetails->TicketName . ' (' . number_format($objTicketDetails->TicketPrice,$info['payment.nrdecimals'], $info['payment.decimal'], $info['payment.thousands']).' '.$info['payment.currency'].')'); $ticket_list[] = $objTicketDetails->value; $ticket_descriptions .= '<p id="rsevents_ticket_'.$objTicketDetails->IdTicket.'" style="display:'.($i==0 ? 'inline':'none').';">'.$objTicketDetails->TicketDescription.'</p>'; } } $ticket_list = implode("\n",$ticket_list); return $ticket_list; } function RSEventsGetEmail() { $db = &JFactory::getDBO(); $user = &JFactory::getUser(); $db->setQuery("SELECT email FROM #__users WHERE id=".$user->id); return $db->loadResult(); } function RSEventsGetInfo($what=0) { $user = &JFactory::getUser(); $name=explode(' ',$user->name); $fName=@$name[0]; $lName =''; if (count($name) > 1) { unset($name[0]); $lName = implode(' ',$name); } if($what == 0) return $fName; else return $lName; } function RSEventsGetPayment() { $info = plgSystemrsfprsevents::RSEventsGetSettings(); $payment_items = array(); if(defined('RSEVENTS_PAYPAL')) $payment_items[] = ($info['payment.default'] == 'paypal') ? 'paypal|'.JText::_('RSE_PAYPAL_METHOD').'[c]' : 'paypal|'.JText::_('RSE_PAYPAL_METHOD'); if(defined('RSEVENTS_WIRE')) $payment_items[] = ($info['payment.default'] == 'wire') ? 'wire|'.JText::_('RSE_WIRE_METHOD').'[c]' : 'wire|'.JText::_('RSE_WIRE_METHOD'); if(defined('RSEVENTS_2CO')) $payment_items[] = ($info['payment.default'] == '2co') ? '2co|'.JText::_('RSE_2CO_METHOD').'[c]' : '2co|'.JText::_('RSE_2CO_METHOD'); $payment_items = implode("\n",$payment_items); return $payment_items; } function rsfp_containsComponents($formId, $components) { global $RSadapter; $db = JFactory::getDBO(); $db->setQuery("SELECT count(*) CNT FROM #__rsform_components WHERE FormId='".$formId."' AND ComponentTypeId IN (".implode(',',$components).")"); return $db->loadResult(); } } }
/home/poliximo/public_html/4690b/../home_/libraries/../plugins/system/rsfprsevents.php