Custom fields in MRBS
Can you add custom fields to the MRBS booking form part where you book the rooms? I've created the fields in MYSQL but didnt know whether i need to do anything special to make them appear in the booking form part?
Anyone else done this kind of thing?
If it's a new field, you probably need to change the booking page to show it. It's a php page right, you should be able to see the location from the URL.
If you've just added entries to a dropdown field, e.g. an extra room, then it should just work.
Arrrgh I see.
I'm not a php nerd (yet) so i might ask them at MRBS if they can point out what i might need to be doing. The edit_entry.php file is below:
The fields i've added to the entry table are in the attachment.
also here the is the entry.php code
mrbs - Windows Live
okay, sorry, i'm not at work so it's not easy for me to check and test things, but it will be harder than you'd think if you have no experience.
You'll need a good editor, something like notepad++ which will colour and tab the file for you to see better.
it's basically html with extra code. well, it's php, which is then translated into a html page after doing something fancy with data. if you have any html experience you'll recognise bits of it.
i haven't done this before so i'm just guessing based on how these things normally work.
you'll have to add a to the row of GET statements at the top to extract the field from the form itself once it's been entered by the user once.
you'll need to add the field names into any SQL select statements that you see where it looks like it's pulling in info about the booking e.g. room name / id. i looked it's a bit confusing.
lastly (hopefully), you'll have to add to the html form itself space for the field.
probably clone a free text box if there is one. give it a unique id/lable, and in the value use a php code similar to below. the echo command will insert the data referenced into the html. you would reference the $name that you added for the variable earlier on.
sorry i'm not much more help. maybe someone else is around that has done it before or can test it for you first.
<input id="duration" name="duration" value="<?php echo $duration;?>">
it's worth a play as once you get the hang of it, it's nice to be able to fiddle with the code, the whole intranet i inherited here was php and i've had to do lots of customisations.
naturally make a backup of the file first. it's difficult to use a test file, because they often rely on calling themselves, and linking to other files e.g. the handler, so you'd need to edit all entries in the code that refer to the file itself, like on form actions etc.
it's much easier to test when no-one is around and you can play with the real filenames.
p.s. i didn't look at the handler yet, just the first file to get my head around it a little, there's probably a bit more to process on the handler too like the insertion into the db via sql.
Thanks very much for your reply it makes sense. I've done little bits and bobs with mysql and html but dont do it every day so a bit out of the loop. I might ask at the MRBS forum. We can use it at the minute but tracking using the system might be a bit basic for what we need without the extra fields.