I'm going to reply using SQL, because it works better for text messaging and is pretty widely understood. My suggestion is:
PHP Code:
CREATE TABLE employees (
employeeId INT NOT NULL
PRIMARY KEY (employeeId)
-- add other columns as needed
)
CREATE TABLE projekts (
projektId INT NOT NULL
PRIMARY KEY (projektId)
-- add other columns as needed
)
CREATE TABLE schedules (
scheduleId INT NOT NULL
PRIMARY KEY (scheduleId)
, employeeId INT NOT NULL
FOREIGN KEY (employeeId)
REFERENCES employees (employeeId)
, projektId INT NOT NULL
FOREIGN KEY (projektId)
REFERENCES projekts (projektId)
, dateBegin DATETIME NOT NULL
, dateEnd DATETIME NULL
)
This makes each schedule row dependant on an employee and a project. It also explicitly establishes that schedules must start, and may or may not end. It implicitly allows an employee to work on more than one project at a time, and for them to work on a project for a while, get pulled off for a while, then return to the project. These are key items that many scheduling schemas overlook!
-PatP