Jump to content

Recommended Posts

Posted

Can anyone help me with using this script on a 2-week timetable?

 

 

Room Day name Period

2 1Fri 1Fri:1

2 1Fri 1Fri:2

2 1Fri 1Fri:3

2 1Fri 1Fri:4

2 1Mon 1Mon:1

2 1Mon 1Mon:2

2 1Mon 1Mon:3

2 1Mon 1Mon:5

2 1Thu 1Thu:2

2 1Thu 1Thu:4

2 1Thu 1Thu:5

2 1Tue 1Tue:1

2 1Tue 1Tue:3

2 1Tue 1Tue:4

2 1Tue 1Tue:5

2 1Wed 1Wed:1

2 1Wed 1Wed:3

2 1Wed 1Wed:4

2 1Wed 1Wed:5

2 2Fri 2Fri:1

2 2Fri 2Fri:2

2 2Fri 2Fri:3

2 2Fri 2Fri:4

2 2Mon 2Mon:1

2 2Mon 2Mon:2

2 2Mon 2Mon:3

Posted
Can anyone help me with using this script on a 2-week timetable?

Hi Matt,

 

How much have you tried?

 

Have you seen my post #38 above?

 

Peter

Posted

Sorry Peter,

 

I was always the one that sat at the back of the class and wasn't paying attention! - I have now read your post 38# - I am now getting Scheduling Conflict? any ideas not much on this one....

 

edit_entry_handler.php?name=11b+Sb1+LS&description=19+Students&start_day=6&start_month=9&start_year=2013&start_seconds=43260&end_day=6&end_month=9&end_year=2013&end_seconds=43260&rooms%5B%5D=2&type=E&rep_type=6&rep_end_day=31&rep_end_month=7&rep_end_year=2014&rep_num_weeks=2&returl=&create_by=DATAIMPORT&rep_id=0&edit_type=series
Posted
Sorry Peter,

 

I was always the one that sat at the back of the class and wasn't paying attention! - I have now read your post 38#

Detention for you then...!

 

I am now getting Scheduling Conflict? any ideas not much on this one....

This isn't related to the script - it simply means you're trying to import a class into the bookings system where a booking has already been made.

 

It looks like 11b/Sb1 on the 6th of September or some future repeat thereof has already been entered manually?

 

Peter

Posted

That's strange as there's nothing in for the 6th September....

 

Do you think its to do with the naming of my periods, i'm guessing these need to be the same as the Export from SIMS?

Period:

08:40 - Period 1

09:40 - Period 2

10:40 - Tutor Time

11:20 - Period 3

12:20 - Period 4

13:20 - Lunch

14:00 - Period 5

15:00 - After School

  • 1 month later...
Posted (edited)

Dear all,

 

Version 1.3 of the script is now available, with the following improvements:

  • Import multiple rooms from a single file (you can select multiple rooms in SIMS, change all of the IDs in one go, and they should all be imported at once - saves time!)
  • Check for matching teachers when combining periods as well as room, class, and day

Download here: SIMStoMRBS1.3.zip

 

To install:

 

  1. Extract bulkYearMake.php and copy it to your main MRBS folder
  2. Extract Room Timetables.RptDef and import it into SIMS.Net

Edit bulkYearMake.php according to your own school's needs:

 

  • Default entry type for booking, and an alternative type for certain subjects if you want - see first few lines of the script.
  • MRBS period setup - search for 'PERIOD EXPLANATION' inside the source for more details. You need to tell it how the periods in the SIMS export file match up to the periods in MRBS. If you're not sure, there is some advice in the previous posts on this forum, or you could just run it against your MRBS as-is - but make a back up first!
  • (You don't need to map room names to numbers in the script any more - see below).

To use:

 

  1. Run the 'Room Timetables' report under SIMS.Net, select the room(s) that you want to import (can now import multiple rooms in one go), and save the file it generates
  2. EDIT the file that SIMS.Net generated - replace the name of each room (e.g. "Z") with the internal MRBS 'room' ID (e.g. "1"). To find the MRBS 'room' ID, open a room in MRBS, and look in the address bar for 'room=#'. It should look something like this when you are done:
    "Room","Day name","Period","Class","Initials","Subject code","Students"
    "3","Fri","Fri:1","9cr/Gr2","RS  ","Gr",22
    "3","Fri","Fri:10","8C/Ma","HO  ","Ma",32
    "3","Fri","Fri:2","9cr/Gr2","RS  ","Gr",22
    "6","Fri","Fri:5","13B6/Pe1a","MU  ","Pe",7
    "6","Fri","Fri:6","13B6/Pe1a","MU  ","Pe",7
    "6","Mon","Mon:10","13B4/Sp1","WS  ","Sp",8
    ...


  3. Navigate to bulkYearMake.php in your Web browser, change the 'Start of Term' and 'End of Term' fields if you want to, select the file you edited earlier, and click 'Go'. (You only need to change the edit_entry_handler.php field if you put bulkYearMake.php into a different area of the website to your main MRBS install).
  4. The script should load & create a series of frames within itself, each of which represents an attempt to book a period into MRBS. It may take some time to load - be patient! If it all works OK, you should see each of these displaying the MRBS calendar, and the necessary entries created. If not, you may see an MRBS error message or a Scheduling Conflict. If you get an error message, try importing again, just in case this helps. If you get a scheduling conflict, and you are running MRBS 1.4.8 or above, you should be able to tell it to ignore the conflict if you want to.
  5. Make sure you get rid of bulkYearMake.php from your MRBS directory when you're done. It's not insecure in the way it accesses the MRBS database, but it was hacked together & is probably full of XSS vulnerabilities.

The script was tested with MRBS 1.4.8 - let me know if it stops working in a later version. Can I also encourage you to upgrade MRBS to at least version 1.4.8 if you haven't done so already, as it supports the ability to ignore scheduling conflicts for repeat entries and create as many entries as it can, which is great if you already have bookings in your database.

 

It's released under the GPL as before, so if you do make any changes that others might find helpful, please post them back here so that we can all benefit.

For instructions to modify this script to ensure operation with MRBS 1.4.10 and above, see here:

 

http://www.edugeek.net/forums/scripts/40387-sims-mrbs-script-available-7.html#post1074321

Edited by witch
  • Thanks 1
Posted

Looks like my DB may be broken. I have 11 Periods Before School P1-2 Break P3-4 Lunch P5-6 After School 1-3

 

But P4, P6 and After School 1 don't show up when using the CSV to import?

 

Wes

Posted
How much of the code would need to change for a bi-weekly timetable with this new script?

 

Mmmm... looking at the changes in Post #38 I think it *should* work with just the same changes... Give it a try - if not howtarp will have to help!

Posted

Sorry if this is a simple one but, when I try and run the script I am getting a 404. The PHP file is defintely in the directory and the windows permissions are ok, do I need to do anythign with apache?

 

I am running it inside a WAMMP install. I do have a different IP for the Wamp install if that helps.

  • 1 month later...
Posted

Hi All,

I am new to this and I am trying to get my head around this great script by Minkus. Heres the scenario:

I have MRBS working and now would like to import the room info from SIMS. I came across this thread and downloaded the script SIMStoMRBS1.3. I have done as explained on the thread and I get the following errors:

 

Notice: Undefined offset: 2 in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 65 Notice: Undefined offset: 2 in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 66 Notice: Undefined offset: 1 in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 68 Notice: Undefined offset: 2 in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 69 Notice: Undefined offset: 3 in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 70 Notice: Undefined offset: 4 in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 71 Notice: Undefined offset: 5 in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 72 Notice: Undefined offset: 6 in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 73 Notice: Undefined offset: 28 in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 95

 

 

Warning: Invalid argument supplied for foreach() in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 131 Notice: Undefined variable: getData in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 136

Notice: Undefined variable: getData in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 133 Notice: Undefined variable: getData in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 133 edit_entry_handler.php?name=7yz+Ar3+STS&description=20+Students&start_day=6&start_month=9&start_year=2013&start_seconds=43260&end_day=6&end_month=9&end_year=2013&end_seconds=43320&rooms%5B%5D=6&type=E&rep_type=2&rep_end_day=31&rep_end_month=7&rep_end_year=2014&rep_num_weeks=&returl=&create_by=DATAIMPORT&rep_id=0&edit_type=series

 

Any help would be greatly appreciated.

Posted

You can ignore the Notices - it's just 'less than ideal' PHP coding.

 

Regarding the warnings - could you post a sample of the room data file you are uploading, to make sure it is all OK?

 

Kind regards,

Chris

Posted

Hi Chris,

 

Below is the room data file:

"Room","Day name","Period","Class","Staff Code","Subject code","Students"

"1","Fri","Fri:1","7uv/Fr1","SMA ","Fr",30

"1","Fri","Fri:2","7wx/Fr1","SMA ","Fr",29

"1","Fri","Fri:3","8S/Fr1","SMA ","Fr",26

"1","Fri","Fri:4","9SF1/Sp","SMA ","Sp",21

"1","Fri","Fri:5","83FR/Fr","SMA ","Fr",27

"1","Fri","Fri:6","8FG1/Fr","SMA ","Fr",26

"1","Fri","Fri:XRE","7Z/Tu","KK ","Tu",29

"1","Mon","Mon:1","7yz/Sp1","SMA ","Sp",29

"1","Mon","Mon:1","7yz/Sp1","GPT ","Sp",29

"1","Mon","Mon:2","83FR/Fr","SMA ","Fr",27

"1","Mon","Mon:3","8FG1/Gm","GD ","Gm",26

"1","Mon","Mon:4","9GF1/Fr","GD ","Fr",22

"1","Mon","Mon:5","10A/Fr2","CD ","Fr",17

"1","Mon","Mon:6","11A/Fr2","CD ","Fr",26

"1","Mon","Mon:XRE","7Z/Tu","KK ","Tu",29

"1","Thu","Thu:1","9SP2/Sp","LP ","Sp",24

"1","Thu","Thu:1","9SP2/Sp","SMA ","Sp",24

"1","Thu","Thu:3","11A/Fr2","CD ","Fr",26

"1","Thu","Thu:4","83FR/Fr","SMA ","Fr",27

"1","Thu","Thu:4","8GF1/Fr","CD ","Fr",27

"1","Thu","Thu:5","92SP/Sp","SMA ","Sp",28

"1","Thu","Thu:6","10A/Fr2","CD ","Fr",17

"1","Thu","Thu:XRE","7Z/Tu","KK ","Tu",29

"1","Tue","Tue:1","9S/Fr2","GD ","Fr",21

"1","Tue","Tue:2","8FG1/Gm","GD ","Gm",26

"1","Tue","Tue:3","7yz/Gm1","GD ","Gm",29

"1","Tue","Tue:4","9W/Fr1","CD ","Fr",27

"1","Tue","Tue:5","9SP2/Sp","SMA ","Sp",24

"1","Tue","Tue:5","9SP2/Sp","LP ","Sp",24

"1","Tue","Tue:6","7wx/Fr1","GPT ","Fr",29

"1","Tue","Tue:6","7wx/Fr1","SMA ","Fr",29

"1","Tue","Tue:XRE","7Z/Tu","KK ","Tu",29

"1","Wed","Wed:1","11D/Fr1","GD ","Fr",24

"1","Wed","Wed:2","11D/Fr1","GD ","Fr",24

"1","Wed","Wed:3","10A/Fr2","CD ","Fr",17

"1","Wed","Wed:4","11A/Fr2","CD ","Fr",26

"1","Wed","Wed:5","7yz/Sp1","LP ","Sp",29

"1","Wed","Wed:5","7yz/Sp1","SMA ","Sp",29

"1","Wed","Wed:6","9SP2/Sp","LP ","Sp",24

"1","Wed","Wed:6","9SP2/Sp","SMA ","Sp",24

"1","Wed","Wed:XRE","7Z/Tu","KK ","Tu",29

 

 

I am now getting a further error saying:

 

Invalid Booking

You have not entered a useful repeat frequency

 

Any help would be grateful.

Rooms Test.txt

Posted

It looks like your file has two teachers teaching the same class in the same period in a number of places:

 

e.g.:

 

"1","Mon","Mon:1","7yz/Sp1","SMA ","Sp",29

"1","Mon","Mon:1","7yz/Sp1","GPT ","Sp",29

 

Try combining these double entries into a single period, like so:

 

"1","Mon","Mon:1","7yz/Sp1","SMA GPT ","Sp",29

 

See if this helps. We don't have this situation in any of our timetabled classes - I suspect this is causing the issue.

 

If so I'm afraid you'll have to modify the script to handle this scenario - or just change the files before you import.

Posted

Selected a room where there are no 2 teachers at the same time:

 

"Room","Day name","Period","Class","Staff Code","Subject code","Students"

"A1","Fri","Fri:1","7yz/Ar3","STS ","Ar",20

"A1","Fri","Fri:2","7yz/Ar3","STS ","Ar",20

"A1","Fri","Fri:3","11C/Tx1","STS ","Tx",20

"A1","Fri","Fri:4","11C/Tx1","STS ","Tx",20

"A1","Fri","Fri:XRE","9Y/Tu","OY ","Tu",30

"A1","Mon","Mon:3","8y/Ar2","STS ","Ar",20

"A1","Mon","Mon:4","8y/Ar2","STS ","Ar",20

"A1","Mon","Mon:5","11C/Tx1","STS ","Tx",20

"A1","Mon","Mon:6","10C/Tx1","STS ","Tx",14

"A1","Mon","Mon:XRE","9Y/Tu","OY ","Tu",30

"A1","Thu","Thu:1","8w/Ar3","STS ","Ar",20

"A1","Thu","Thu:2","8w/Ar3","STS ","Ar",20

"A1","Thu","Thu:3","9u/Ar3","STS ","Ar",20

"A1","Thu","Thu:4","9u/Ar3","STS ","Ar",20

"A1","Thu","Thu:XRE","9Y/Tu","OY ","Tu",30

"A1","Tue","Tue:3","10C/Tx1","STS ","Tx",14

"A1","Tue","Tue:4","10C/Tx1","STS ","Tx",14

"A1","Tue","Tue:5","9s/Ar1","STS ","Ar",20

"A1","Tue","Tue:6","9s/Ar1","STS ","Ar",20

"A1","Tue","Tue:XRE","9Y/Tu","OY ","Tu",30

"A1","Wed","Wed:1","7st/Ar2","STS ","Ar",19

"A1","Wed","Wed:2","7st/Ar2","STS ","Ar",19

"A1","Wed","Wed:3","7uv/Ar2","STS ","Ar",20

"A1","Wed","Wed:4","7uv/Ar2","STS ","Ar",20

"A1","Wed","Wed:5","8u/Ar1","STS ","Ar",19

"A1","Wed","Wed:6","8u/Ar1","STS ","Ar",19

"A1","Wed","Wed:XRE","9Y/Tu","OY ","Tu",30

 

Went Further to delete the 'XRE' lines to see if that is giving the error.

 

Keep getting the below error everytime:

Warning: Invalid argument supplied for foreach() in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 131 Notice: Undefined variable: getData in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 136

 

Notice: Undefined variable: getData in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 133 Notice: Undefined variable: getData in /var/www/mrbs-1.4.10/web/bulkYearMake.php on line 133 edit_entry_handler.php?name=7yz+Ar3+STS&description=20+Students&start_day=6&start_month=9&start_year=2013&start_seconds=43260&end_day=6&end_month=9&end_year=2013&end_seconds=43320&rooms%5B%5D=6&type=E&rep_type=2&rep_end_day=31&rep_end_month=7&rep_end_year=2014&rep_num_weeks=&returl=&create_by=DATAIMPORT&rep_id=0&edit_type=series

 

Also: Invalid Booking. You have not entered a useful repeat frequency.

 

The error pointing to line: foreach($postData as $data). It is not getting the variables properly.

 

I cannot seem to figure it out, even with changes in the script.

Any thoughts would be helpful.

Posted

I've just tried importing the second file you supplied into our MRBS (with a fake room number) and it seems to work fine.

 

Have you fiddled with the script at all? What version of PHP are you using? I'm afraid I'm at a bit of a loss on this one.

Posted

Hello everyone,

 

I am having a similar problem to jsolanki with invalid bookings, I am using the script unedited and whenever I try import data all bookings returns the"Invalid Booking. You have not entered a useful repeat frequency." error.

Does anyone know what might be causing this or have any ideas to get it working?

 

Thank you.

Posted

Hi,

 

What version of MRBS are you using?

 

The script was last tested by me with 1.4.8 - I believe some of the repeat booking settings have changed since then, so the script may need some modification...

  • Thanks 1
Posted

I believe that was exactly what the problem was for me as well. I was using 1.4.10. I downgraded to the 1.4.8 and the script worked great. Still get a few Notices and Warnings, but essentially all the data is registered on the system.

When I get a chance I shall go back and try change the script to work with 1.4.10 and post again here once I have figured it out, or there may be someone else who will probably do it before me.

Thanks for all the help.

Posted

OK - that would be helpful. I would have a look but am completely snowed under, so no time to upgrade to 1.4.10, let alone modify the script with the changes!

 

All you need to do is find the new POST variables for the new frequency settings (which you should be able to find in the HTML source for the 'Add Entry' screen - look for the HTML tags), find out what they should be set to to replicate the previous settings (Weekly, Number of weeks: blank), and then modify the following parts of the script to reflect this:

 

			$postData[12][0] = "rep_type";
		$postData[12][1] = 2;
		$postData[13][0] = "rep_end_day";
		$postData[13][1] = date("j",$lastDOT);
		$postData[14][0] = "rep_end_month";
		$postData[14][1] = date("n",$lastDOT);
		$postData[15][0] = "rep_end_year";
		$postData[15][1] = date("Y",$lastDOT);
		$postData[16][0] = "rep_num_weeks";
		$postData[16][1] = "";

If you manage to get it working, please post your changes to the forum so that everyone can test them - if they are tested and work OK for most people, I'll release a new version of the script with the updated changes.

 

Good luck! :)

Posted

OK, So I managed to get it working. Like I said before I am relatively new to this so I don’t know if this is the correct work around or more of a bodge job that might have future problems.

 

I looked for the

 

None
Daily
Weekly
Monthly
Yearly

It looks like a weekly rep type is still 2.

 

So I stared to look at rep_nun_weeks and it seems simple changing to 1 rather than blank seems to make everything work.

 

$postData[12][0] = "rep_type";
                      $postData[12][1] = 2;
                      $postData[13][0] = "rep_end_day";
                      $postData[13][1] = date("j",$lastDOT);
                      $postData[14][0] = "rep_end_month";
                      $postData[14][1] = date("n",$lastDOT);
                      $postData[15][0] = "rep_end_year";
                      $postData[15][1] = date("Y",$lastDOT);
                      $postData[16][0] = "rep_num_weeks";
                      $postData[16][1] = 1;

 

And changing it to "$postData[16][1] = 2;" seems to be a work around for a two week time table, you will still need to split your CSV into week 1 and 2.

 

Does anyone see any potential problems with this?

Posted (edited)

Nope - if setting '$postData[16][1] = 1;' seems to fix the problem, you should be good to go.

 

I'll let a few other people test this as well, and once I get a chance to update our MRBS, I'll update the script too.

 

EDIT: The 1.3 download post is now updated with a link to post #97 above

Edited by Minkus
  • Thanks 1
  • 2 months later...

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...