Step based approval system using PHP and MySQL
I'm creating a system, that cre开发者_JAVA技巧ates an object that needs confirmation through various levels of corporate management, in other words, a form, that must be accepted by many boss'es.
The thing is, that they are of varying priority, and must not (for the sake of their time) see that there is a form waiting their accept. The number is finite, and each of them has a role. The accepting is done through a link, that is provided to them via an email, that is sent when the previous accept has been made. If it is not accepted, the line ends there.
Now what I'm asking here is:
How to implement such a step-based system?
I'm asking just for general pointers, like create these kinds of database tables, and this kind of script.
Thanks!
EDIT
I'll rephrase my question:
How to create a step based system using PHP and MySQL?
Consider the part above the edit background info. But the main question is this one.
This is called "workflow" or "Business Process Management" (BPM). It is a very large topic, and I suggest you Google these two terms. There are several OSS workflow engines available, and a whole sub-industry built around this.
EDIT: Google "php workflow" and you'll get a number of hits that will point you in the right direction. Do not reinvent the wheel, use one of the existing frameworks. If you're just starting you'll find that doing this right is a much bigger task than it seems at first.
The answer to this question:
Since the system is simple, with static amount of steps, I have defined a list, or a numbered array, if you will, with steps, and I simply check if the previous step is done, if the next step is required. If yes, do it. Repeat.
精彩评论