McTedo Posted August 25, 2009 Posted August 25, 2009 (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: Place the PHP Script in the same folder as MRBS' config.inc.php Amend the PHP Script (see below) Amendments to make for your school: Room Names to ID Numbers (Script Lines 44-61, using mrbs_room table in database for reference) 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) 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: Export SIMS timetable for ONE ROOM using attached Report Definition Load PHP Script in Web Browser Fill out form, including File to Upload [start/End Term Dates auto-suggested] Press Go. CSV File Notes (auto-setup in Report Definition though): ONE ROOM ONLY Order of Columns: Room, Day, Period, Class, Teacher, Subject Code, NoStudents Period should be defined as 'Mon:7' or 'Mon:07' Hope this helps! Edited February 25, 2013 by vikpaw update notice | Reuploaded Attachment as Corrupted / Reuploaded under GPL 2
webman Posted August 25, 2009 Posted August 25, 2009 Hi Edward What licence have you released this under?
McTedo Posted August 25, 2009 Author Posted August 25, 2009 Released under GPL - sorry, hadn't thought of this. Added GPL statements and copy to zip file.
ChrisH Posted August 25, 2009 Posted August 25, 2009 Very nice I will have a good look at this soon .
Gatt Posted August 25, 2009 Posted August 25, 2009 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...
McTedo Posted September 7, 2009 Author Posted September 7, 2009 Bug Fix: Now allows lessons longer than 2 periods long; i.e. a triple or quadruple.SIMStoMRBS(1-0-1).zip
bonjour Posted September 7, 2009 Posted September 7, 2009 The contents of the compressed archive is a single file, 'SIMStoMRBS', which has no file extension and opens as gobbeldygook. Little help??
McTedo Posted September 7, 2009 Author Posted September 7, 2009 Downloads fine for me in Firefox, but not in IE!
OutToLunch Posted September 7, 2009 Posted September 7, 2009 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
bonjour Posted September 7, 2009 Posted September 7, 2009 Works fine through Firefox. Pesky IE8... Cheers guys.
bonjour Posted September 7, 2009 Posted September 7, 2009 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.
McTedo Posted September 7, 2009 Author Posted September 7, 2009 @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! 1
bonjour Posted September 7, 2009 Posted September 7, 2009 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.
McTedo Posted September 7, 2009 Author Posted September 7, 2009 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. 1
bonjour Posted September 7, 2009 Posted September 7, 2009 Thanks mate. My php isn't actually that bad, I just couldn't quite work it out.
bonjour Posted September 21, 2009 Posted September 21, 2009 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.
bonjour Posted September 21, 2009 Posted September 21, 2009 The problem would appear to be with line "require_once "HTTP/Request.php";
bonjour Posted September 22, 2009 Posted September 22, 2009 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?
walkden-high Posted October 2, 2009 Posted October 2, 2009 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');
lidderale Posted October 30, 2009 Posted October 30, 2009 Hi i am getting the same error as bonjour an example of what the csv file and php script should look like when edited would be helpful thanks j
Guest Guest Posted November 20, 2009 Posted November 20, 2009 (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 November 20, 2009 by Guest
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now