Why that file 'START_AND_DELETE_ME.php?
Orario_elettronico queries and updates a mysql database
via a set of php scripts. At the first installation mysql knows
nothing about this program, moreover the mysql server contains many
databases which orario_elettronico's users should not touch.
Therefore we need at least two users, one with administrator privileges, the other one only able to read the database
Therefore I could not use the root user, which is only one and has full privileges.
The script 'START_AND_DELETE_ME.php prepares the database to be used by orario_elettronico:
creates a database readable by orario_elettronico and named 'orario_elettronico', you shouldn't delete or overwrite this database: it contains data needed from the program which will be searched at every start.
creates two users (and their passwords) provided with the ability to read or modify the database
After this initialization you won't need this script any more, the user provided with full privileges will be able to create new databases and you won't need to login as root (under the condition that you gave the administrator full privileges on all databases - option * - otherwise you will have either to come back to this file or to use the command line as root in order to create new databases)
How do I set the available databases in orario_elettronico?
Orario_elettronico can read only databases with certain tables and
structure (databases created by orario_elettronico), therefore the
login page shows only databases whose names contain a certain string
which you MUST insert in the names of databases you create within orario_elettronico.
By default this string is 'orar' and you'll be able to see databases named orario, orar22, BUT NOT timetable1 or even orrario. You can modify this option in the file connect.php in the directory includes: just modify the variable '$db_expr'.
For instance, if you change it from
$db_expr = "orar";
$db_expr = "time";
after a new login you'll be able to consult all databases containing the expression 'time'.
What do '##', 'lib', 'free', 'ext', 'D', 'R' mean?
They are the constraints you insert before starting to
assign lessons. If you manually assign hours you can
use them as you like. If you use the automatic
allocation they have a meaning:
|ext||the teacher works in a different school; this is a severe constraint. Teachers in whose timetable appears 'ext' will have the priority in the allocation process.|
|##||Hours not to be used|
|lib or free||the teacher wishes this day to be free ( you'll have to mark all the hours of the day)|
|D or R||These options should be used only at the end. D should mean disposable , R should mean receiving parents/students|
WARNING Starting with version 5.0 the automatic allocation needs that hours marked with these symbols are locked. As you insert them they will be automatically locked ; if you unlock them remember either to delete them or to lock them again.
How does the automatic allocation of hours work?
The scripts for the automatic allocation are rather
complicated and required a lot of work, I hope it has been well
spent. In version 5.x automatic allocation starts from a main script which calls different functions; The operation takes place at different 'levels' and as you go on the allocation becomes slower and slower, on the other hand I think (the program was tested on 3 different databases) that at level 4 (sometimes level 5) every hour which can be allocated is set. The script should never (it would be a bug) break your constraints, therefore if you have inserted constraints which cannot be satisfied the program will try to satisy them by going deeper and deeper, with a great vaste of time and resources.
I have searched a workaround by limiting the automatic progress to level 4: from page 'AUTOMATIC ALLOCATION OF HOURS', as you press button 'fill it up', a page will be opened executing the script at level 0; after a sleep time of 60 seconds the script will realunch itself at level 1 and so on till level 4. After that you can go on to deeper levels only manually.
Anyway the execution may be very long: I suggest you to let it work over night.
The script works entirely in the RAM: after reading the database it builds an array of hours and modifies it. From time to time it writes the output to the database, therefore
1) You can see what is going on by loading and reloading the page 'CONTROL PANEL'
2) It may happen that you query the timetable while the program writes to the database, in this case you'll see lots of error messages. Just wait a little time and reload the page.
How do I know if the execution of a script is terminated?
1) Every browser has some icon showing that it is
working, look at it.
2) Look at the end of the page
A first remark: php and apache are not planned in order to make this job, by default php assigns a few seconds for the execution of scripts. If at the end of the page you'll find something like 'time exceeded' (you will certainly find it if you have not followed these instructions) the script was terminated before the end of the operation.
Find the file 'php.ini' (under linux systems it is in the directory '/etc', depending on distributions in folder 'apache' or 'apache2' or 'php' or 'http' or I dont know where. Under windows it should be in the folder 'php')
Warning: in recent linux distributions there are two files with this name, one for php as apache module, the other for php as stand alone application. You should modify the first one, but under a debian machine I have had to modify the second one. Modifying both of them should not hurt.
In the file (or files) php.ini go to the section
; Resource Limits ;
and modify the following entries:
max_execution_time = 30 --> increase it generously; I have set it to 172800 (48 hours); this may be too much - I had to debug the program - and you can set a lower limit; anyway should not hurt
max_input_time = 60 --> increase it generously; I have set it to 6000 (100 minutes).
memory_limit = 128M ---> increase this too, I have set it to 300M
I have also modified (but perhaps this is not needed) the line
mysql.connect_timeout = 60 setting it to
mysql.connect_timeout = -1 (no limit)
Then restart apache.
After this, at the end of the execution of each script you should find a short report about the operations and a 'back' button.
A second remark: In order to avoid freezes of the x-server the program gives very little output: it will seem to be sleeping for long times; how to stop the execution of the script? You have two ways:
1) Press the button 'stop loading' in your browser, this way is safe, but it will take effect only when the browser receives the next output from the script; it may take a long time.
2) From a shell, as root, restart apache. In my gentoo distribution : /etc/init.d/apache2 restart , in other distributions it will be different; in windows you'll find some button which gives this result. This way stops immediatly the execution of the script, but it may happen that the script is interrupted while it's writing the database; in this case you'll have a corrupted database.
TIP: before doing this, duplicate the database from a different page (use tabs!) and be sure that you have a working timetable.
Why so many warning messages?
You should NOT receive many warning messages, if you
have created the database with this version of orario_elettronico or
have updated your database using the appropriate script.
If you get them, you should check the warning level in the file php.ini. Search for the section 'Error handling and logging' and, if needed, set the appropriate level with the option:
error_reporting = E_ALL & ~E_NOTICE
(this should be necessary only under windows, on linux systems this is normally the default level).
Anyway, in the automatic allocation of hours,it is normal to receive some warning messages; if you do not find errors in the page 'CONTROL PANEL' do not worry about them.
Are there known bugs?
The manual allocation of hours has been well tested and
When you modify a class from the page 'administration' sometimes the 'special rooms' table is not appropriately updated. Use the script 'update the special rooms table' from the page 'automatic allocation of hours'.
I have fixed all the bugs I could find, but more bugs may be present.
If you find any, please submit them to my email address email@example.com, attaching a copy of your database and a short description of the steps you went through.
Why does the program not fully work under windows?
Well, first I do not like windows: I hate those non-sense error
messages and I hate being managed like a stupid (once I spent an
afternoon trying to install the driver for a modem - downloaded from
the net and well present on my hd, and many times win installed what
he wanted, not what I wanted). Why should I make a free software which
could encourage the use of this system?
Second: under linux I use tons of free software, orario_elettronico is a sort of restitution: I take a lot and give something. But I must pay all the few Microsoft programs om my computer, and I feel no debt.
Therefore I have inserted a condition which stops the execution of the program after 10 days of trial time. Windows users who want to have a full working version should contact me in order to take agreements. If I receive many requests I'll consider the opportunity of asking for a modest payment (something like 100 euros).
Anyway my trick in order to block windows is rather simple and naif, a php user should not find problems in eliminating it. Just try, and please, keep the secret for you.
How can I help?
Let me know if you use orario_elettronico and what you think about the program.
Submit bugs, I'll try to fix them.
My English is rather poor,suggestions in order to make better english pages are wellcome.
If you are windows user, contact me and pay the full program; if you are linux or mac users (does the program work under mac? A feed back would be greatly appreciated) donate to orario_elettronico from the sourceforge page.