Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: How to show CAPACITY and REGISTERED within JEvent

How to show CAPACITY and REGISTERED within JEvent 15 years 9 months ago #2128

  • serge06
  • serge06's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 17
  • Thank you received: 0
Hi,
I applied the hack for Jevents 1.4.3 to show \"Click here to register\" but is there any way to updated the code from the hack provided to us (below) so that it shows the values for Capacity and Registered? I think it is just a few more lines of code....??? Most users will probably benefit from this because of say, the event only has 2 spots left, and a group of 3 will try to register (because they do not see the capacity on the event calendar) they will have to go back to a different event and try again and again blindly for other dates until they find the tour that can accept 3 people.
<!-- Beginning of mod for DT Register -->
	<table width=\"100%\"><tr><td align=\"center\">
	<?php
	
	//Get max registration setting
	
	$sql=\"Select cut_off_date,if(CURDATE()>cut_off_date,\'y\',\'n\') as cut_off,max_registrations From #__dtregister_group_event Where eventId=$row->id limit 0,1\";
	$database->setQuery($sql);
	$database->loadObject($rowInfo);	
	$max_registration=$rowInfo->max_registrations;	
	//Get number of registered users
	
	
	$sql=\"Select sum(c.numberOfPerson)
		  From #__dtregister_user As a
		  Inner Join #__dtregister_group As b
		  on a.userId=b.useid
		  Inner join #__dtregister_group_amount As c
		  On b.groupId=c.groupId
		  
		  Where a.eventId=$row->id
		  Group by a.eventId
		\";
	$database->setQuery($sql);
	
	$numberRegistered=$database->loadResult();
	
	if(!$numberRegistered)
		$numberRegistered=0;
	
	
	if(($rowInfo->cut_off==\'y\') && ($rowInfo->cut_off_date!=\'0000-00-00\'))
		$task=\"cut_off_date\";	
	elseif(($numberRegistered>=$max_registration)&&($max_registration))
		$task=\"full_event_page\";	
	else 
		$task=\"pay_options\";	
			
	$queryReg = \"SELECT eventID FROM #__dtregister_group_event WHERE eventID = \" . $row->id;
	$database->setQuery( $queryReg );
	$eventReg = $database->loadResult();
	if ($eventReg != 0)
	{  ?>
		<a href=\"index.php?option=com_dtregister&eventId=<?php echo $row->id;?>&task=<?=$task?>\">	
			Click Here to Register for this Event 
	<?php
	}	?>
	</td></tr></table>
<!-- End of mod for DT Register -->

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.116 seconds