+ Post New Thread
Results 1 to 5 of 5
Web Development Thread, Custom fields in MRBS in Coding and Web Development; Hi, Can you add custom fields to the MRBS booking form part where you book the rooms? I've created the ...
  1. #1

    Join Date
    May 2007
    Location
    Barnsley
    Posts
    121
    Thank Post
    5
    Thanked 2 Times in 2 Posts
    Rep Power
    15

    Custom fields in MRBS

    Hi,

    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?

  2. #2

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,969
    Thank Post
    673
    Thanked 1,383 Times in 1,145 Posts
    Rep Power
    350
    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.

  3. #3

    Join Date
    May 2007
    Location
    Barnsley
    Posts
    121
    Thank Post
    5
    Thanked 2 Times in 2 Posts
    Rep Power
    15
    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
    Attached Images Attached Images

  4. #4

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,969
    Thank Post
    673
    Thanked 1,383 Times in 1,145 Posts
    Rep Power
    350
    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.

    Code:
    <input id="duration" name="duration" value="<?php echo $duration;?>">
    sorry i'm not much more help. maybe someone else is around that has done it before or can test it for you first.

    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.

  5. #5

    Join Date
    May 2007
    Location
    Barnsley
    Posts
    121
    Thank Post
    5
    Thanked 2 Times in 2 Posts
    Rep Power
    15
    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.

    Cheers, Ben

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 2
    Last Post: 9th June 2010, 05:14 PM
  2. clean up old fields
    By itgeek in forum Scripts
    Replies: 1
    Last Post: 26th February 2010, 11:34 AM
  3. Script to populate AD fields
    By FN-GM in forum Scripts
    Replies: 21
    Last Post: 29th July 2009, 01:14 PM
  4. Formatting Data Fields
    By tw15ns in forum MIS Systems
    Replies: 1
    Last Post: 3rd January 2009, 03:38 PM
  5. [MS Office - 2003] Access - Calculated Fields
    By garethedmondson in forum Office Software
    Replies: 2
    Last Post: 11th December 2008, 03:22 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •