Jump to content

Recommended Posts

Posted (edited)

IMPORTANT - The script has been updated, please jump to post 50 for the latest working version.

The old attachment has been removed to prevent confusion.

 

Dear all,

 

Please find attached to this thread a script allowing you to import your SIMS Room Timetable into MRBS, by exporting to CSV first.

 

To Set Up:

  1. Place the PHP Script in the same folder as MRBS' config.inc.php
  2. Amend the PHP Script (see below)

 

Amendments to make for your school:

  1. Room Names to ID Numbers (Script Lines 44-61, using mrbs_room table in database for reference)
  2. Default Entry Type for Booking, and an alternate entry type, along with which subjects to use this entry type for (Script Lines 17-19, using MRBS config.inc.php for reference)
  3. Your Periods/Break/Lunch system, as MRBS treats each period as a 'booking slot' and break/lunch as a 'booking slot', so Period 10 = 0 (first 'slot') + 1 (registration) + 9 (periods past) + 1 (break) + 1 (lunch) = Slot 12, see script lines 203-217 with longer explanation.

 

Instructions for use:

  1. Export SIMS timetable for ONE ROOM using attached Report Definition
  2. Load PHP Script in Web Browser
  3. Fill out form, including File to Upload [start/End Term Dates auto-suggested]
  4. Press Go.

 

CSV File Notes (auto-setup in Report Definition though):

  1. ONE ROOM ONLY
  2. Order of Columns: Room, Day, Period, Class, Teacher, Subject Code, NoStudents
  3. Period should be defined as 'Mon:7' or 'Mon:07'

 

Hope this helps!

Edited by vikpaw
update notice | Reuploaded Attachment as Corrupted / Reuploaded under GPL
  • Thanks 2
Posted

Tried this but my second line in the exported CSV file ws just:

 

61,,,,,,,,

 

Not sure if its jsut cos the timetable doesn't take effect until 3rd September so will try again next week...

  • 2 weeks later...
Posted

The contents of the compressed archive is a single file, 'SIMStoMRBS', which has no file extension and opens as gobbeldygook.

 

Little help??

Posted
The contents of the compressed archive is a single file, 'SIMStoMRBS', which has no file extension and opens as gobbeldygook.

 

Little help??

 

Download with wget/download manager? Contents should be :

 

#  Archive C:\SIMStoMRBS(1-0-1).zip
2009-09-04 10:25          9645          3719  bulkYearMake.php
2009-08-25 14:43         35147         12112  gpl.txt
2009-08-25 11:18          4279          4272  Room Timetables.RptDef
#
# Total                   Size        Packed  Files
#                        49071         20103  3

Posted

Sorry, two quick questions..

 

1. Do the room names ID Numbers on lines 44+ have to match exactly with the names and numbers in the MRBS_room table?

2. Does a room name / number entry have to be created for every bookable item in MRBS? We have some equipment on there that we obviously don't have a timetable for.

 

Cheers.

Posted

@bonjour:

 

1. Names don't need to match, ID numbers do. (e.g. Sims knows one of our rooms as 'CON', and the name of the room in MRBS is 'Connexions'. The ID number to convert CON into must be the same as in the mrbs_room table.

 

2. No; just the ones you are going to import with the script.

 

Hope this helps!

  • Thanks 1
Posted

Cheers dude.

 

One other thing..

 

I understand how MRBS deals with periods / slots, but I'm unsure exactly as to what I have to change in the bulkYearMake script.

 

The bookable periods we have (that appear in MRBS) are 'Before school', 'Period 1', 'Period 2', 'Period 3', 'Period 4', 'Lunch', 'Period 5' and 'After School'. How would this transpose into the bulkYearMake script.

 

Thanks ever so much for your help. This will save an immense amount of time in the coming years.

Posted

Before School = Slot 0

Period 1 = Slot 1

Period 2 = Slot 2

Period 3 = Slot 3

Period 4 = Slot 4

Lunch = Slot 5

Period 5 = Slot 6

After School = Slot 7.

 

You need some sort of code that manages the period number and adds one; e.g.

if(substr($period[$item],4,2) == "Rg"){ 
$pmrbs = 0; 
} else {
$pmrbs = (int)substr($period[$item],4,2);
if($pmrbs >= 5){$pmrbs += 1;}
}

 

i.e. If the Period >= 5, then Add 1 to make the Slot Number correct.

  • Thanks 1
  • 2 weeks later...
Posted

Sorry, me again.

 

Finally received the timetables from our data manager in .CSV format.

 

Whenever I try to import a room's timetable, though, I get the following errors:

 

 

Notice: Undefined offset: 2 in /home/ileagorg/public_html/aps_mrbs/bulkYearMake.php on line 83 - Same error for lines 84 through to 91, 93, 95 and 111

 

 

Warning: require_once(HTTP/Request.php) [function.require-once]: failed to open stream: No such file or directory in /home/ileagorg/public_html/aps_mrbs/bulkYearMake.php on line 140

 

Fatal error: require_once() [function.require]: Failed opening required 'HTTP/Request.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ileagorg/public_html/aps_mrbs/bulkYearMake.php on line 140

 

Have I just done something silly, or is it more serious?

 

Cheers.

Posted

Also, at the top of bulkYearMake.php, I get the line Notice: Undefined index: csvfile in /home/ileagorg/public_html/aps_mrbs/bulkYearMake.php on line 28

.

 

Is this normal?

  • 2 weeks later...
Posted

Hi there

 

Has anyone got an example of what the script should look like for importing in to edit_enty_handler.php everytime I fill in the form and press go nothing happens it just says results with a white screen.

 

Below is what I have so far as a test for one period every monday I have saved it as rm10.csv

 

('ROOM10','MON:07','1','11E','SDW','EN4','I','0');

  • 4 weeks later...
  • 3 weeks later...
Posted (edited)

Has anyone got this to work yet? Getting the "require_once "HTTP/Request.php"; error, and the report def doesnt seem to output the teacher name entry.

 

We have 5 periods per day, 2 week calender. Thats it, no bookings any other time.

 

 

Anyone fancy sending me their working bulkYearMake.php?

Edited by Guest

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...