- Posts: 70
- Thank you received: 1
More useful registrant exports
- abarrow
- Offline
- Senior Member
I've been playing the past couple of days with doing this using SQL queries on an imported CSV registrants file. For the life of me, I can't see how to do a direct query on the Events Booking database that would extract custom fields into database columns, so I need an additional step to export the CSV file then import it to a MySQL table that I can do queries on. The "gotcha" here is that MySQL CSV exports don't include the header row, with adds an additional layer of complexity. Also, the name has to be concatenated from first and last name, proper case (why can't people find their shift key when they register?) and various other things.
I want to do it this way because I can create a number of output files using queries, for example a single page per sailor they can sign, a smaller page that can be printed to an ID card, export for Sailwave, etc.
While I agree that there's probably a limited audience for this, I think a good suite of Joomla components that support sailing events would probably attract many clubs to the platform. There is already a small plugin to import results files to Joomla articles (I think you wrote it!). To my knowledge, there certainly isn't anything available for Wordpress, and the only other option is to go for one of the commercial pay-as-you-go platforms, which can get pretty expensive for small clubs.
Perhaps we should chip in to get Tuan to write the code!
If you want to discuss this offline, send me a PM.
Please Log in or Create an account to join the conversation.
- Calum
- Offline
- Elite Member
- Posts: 257
- Thank you received: 34
Yip thats what I would do for myself. But I will have about 10-15 event managers each year who should be able to download their entrants the night before the event depending when they set the cutoff date.I can't always be there to download it for them, and I have my doubts they would all cope. I have my doubts some of them will cope with clicking a button labelled "Download"abarrow wrote: Yes, it's Sailwave. My process now is to use Google Spreadsheets. My sailing event has 5 classes, so I just export the entire registrants list to the first sheet of a spreadsheet, then have several other sheets that draw data from the first sheet. When registrations change, I just overwrite the first sheet and the others change. Google spreadsheets has a nice process for importing CSV files and overwriting and existing sheet with it. Makes it fairly quick to update - just an Event Booking export, then an import to Google Sheets that overwrites the previous CSV file.
I haven't looked at the DB structure at all. But that sounds an awfully complex approach!I've been playing the past couple of days with doing this using SQL queries on an imported CSV registrants file. For the life of me, I can't see how to do a direct query on the Events Booking database that would extract custom fields into database columns, so I need an additional step to export the CSV file then import it to a MySQL table that I can do queries on. The "gotcha" here is that MySQL CSV exports don't include the header row, with adds an additional layer of complexity. Also, the name has to be concatenated from first and last name, proper case (why can't people find their shift key when they register?) and various other things.
I suspect the SW guys might say those pages should actually be in SW! So import the competitors to SW and print whatever.I want to do it this way because I can create a number of output files using queries, for example a single page per sailor they can sign, a smaller page that can be printed to an ID card, export for Sailwave, etc.
We've never gone down the ID card route.
Yip. So the SW results solution for CMS's is to export and paste into an article.While I agree that there's probably a limited audience for this, I think a good suite of Joomla components that support sailing events would probably attract many clubs to the platform. There is already a small plugin to import results files to Joomla articles (I think you wrote it!). To my knowledge, there certainly isn't anything available for Wordpress, and the only other option is to go for one of the commercial pay-as-you-go platforms, which can get pretty expensive for small clubs.
The xtd-editor button is mine. I got it working and then lost the will when I discovered Sailwave4Joomla and similar names are blocked by Joomla Extension Directory. I still have plans to progress that to have some form of results menu that picks up the files etc from the FTP directory
I think the snag with that approach is lets say it costs £500 for Tuan to develop in developer time. If we split it thats quite pricey for I guess two small clubs to simplify something we can already do in a spreadsheet. If we said to Tuan we will chip in £50 each he needs to find 8 others to chip in and either doesn't develop until he has the money in the bank (we could be waiting a while!) or develops and carries the risk...Perhaps we should chip in to get Tuan to write the code!
...So my suggestion would be that I develop the basic code and share either through this site if they are happy to have it, or as an extension on the extension directory. But let me have a look at the DB structure first...
Please Log in or Create an account to join the conversation.
- Calum
- Offline
- Elite Member
- Posts: 257
- Thank you received: 34
drive.google.com/file/d/0B8JydPjJg0oEM3Z...bDA/view?usp=sharing
Please Log in or Create an account to join the conversation.
- abarrow
- Offline
- Senior Member
- Posts: 70
- Thank you received: 1
Please Log in or Create an account to join the conversation.
- abarrow
- Offline
- Senior Member
- Posts: 70
- Thank you received: 1
Please Log in or Create an account to join the conversation.
- Calum
- Offline
- Elite Member
- Posts: 257
- Thank you received: 34
Please Log in or Create an account to join the conversation.
- abarrow
- Offline
- Senior Member
- Posts: 70
- Thank you received: 1
Clearly I'm not even close to a SQL expert - I can usually figure out what others have done, but that's about it!
Please Log in or Create an account to join the conversation.
- Calum
- Offline
- Elite Member
- Posts: 257
- Thank you received: 34
bitbucket.org/shinysolutions/plg_sw_eb_extract/wiki/SQL
Please Log in or Create an account to join the conversation.
- abarrow
- Offline
- Senior Member
- Posts: 70
- Thank you received: 1
I think this is going to be tough to scale - in my case I have 41 custom fields spread across 6 different EB events, some of which I need to do calculations on (for example, with Optimist, I need to calculate age at the start of the event). Sailwave has a LOT of data fields that people could be using.
I think exporting the fields to another database once, then updating it as necessary, would reduce the complexity of the coding and greatly simplify troubleshooting. The code used in components/com_eventbooking/view/registrantlist/tmpl/default.php might be a good place to start. Just a thought.
Please Log in or Create an account to join the conversation.
- Calum
- Offline
- Elite Member
- Posts: 257
- Thank you received: 34
Interesting point on the maths. I've just been working on an event which had a requirement for parental consent for <18's at the start of an event, other events have requirements for child to be under a specified age at the end of an event. I'd actually prefer to populate that age into a field during registration, with validation applying to that during the registration process either to ensure entry requirements met, or to make a different price apply. But I can see that there will always be a requirement to do something in the SQL.
Its a lot of code (a) because I've laid it out for ease of reading (b) because it is! But adding an extra field would just add something like:
And then in the very first selection statement you'd add either just dob.DateOfBirth to the list or if you were calculating you might do something like:JOIN (
S-E-L-E-C-T
fv.registrant_id AS 'id',
fv.field_value AS 'DateOfBirth'
FROM jos_eb_field_values fv
JOIN jos_eb_fields f ON fv.field_id = f.id
WHERE f.title = 'Date of Birth'
) AS dob ON dob.id = core.id
To me the advantage of not creating a temporary table is that you may still need to run of and create joins from the temp table to other information in you database such as start and end dates etc. Unless your entrant database is humongous I don't think the performance hit is likely to be noticeable.
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.