Hi,
I would like some help on the following problem please if anyone can
help me. I have two datasets as follows:
* Carers
* Clients
Each client needs X amount of hours to be looked after and each carer
can afford Y amount of hours to give their services. So each Client is
allocated a value X which indicates how long they need treatment for
and each carer is allocated a Y value to indicate how much time they
can afford.
I want to sort this out so that a group of clients are allocated to a
carer. Obviously, the total amount of X hours must be less than or
equal to the Y value of a give carer
E.G.
Client 01: 2 Hours |
Client 02: 3 Hours | Carer 01: 10 Hours
Client 03: 4 Hours |
Client 04: 1 Hours |
Client 05: 2 Hours |
Client 06: 5 Hours | Carer 02: 12 hours
Client 07: 4 Hours | (One hour to spare but next client is has
X=2)
Client 08: 2 Hours |
Client 09: 2 Hours |
Client 10: 3 Hours | Carer 03: 18 Hours
Client 11: 4 Hours |
Client 12: 5 Hours |
The clients and carers will be sorted alpahabetically so we'll group
as many of the clients (that are ordered alphabetiaclly) to the 1st
carer (alphabetically and repeat this so that when the 'Nth' carer is
full, then we'll go to 'N+1' carer and start allocating them clients
from where we left of.
Is this possible to do via a MySQL database which stores the data and
PHP scripts to manipulate the sorting? If so, can anyone help?
Many thanks,
Janusz
I would like some help on the following problem please if anyone can
help me. I have two datasets as follows:
* Carers
* Clients
Each client needs X amount of hours to be looked after and each carer
can afford Y amount of hours to give their services. So each Client is
allocated a value X which indicates how long they need treatment for
and each carer is allocated a Y value to indicate how much time they
can afford.
I want to sort this out so that a group of clients are allocated to a
carer. Obviously, the total amount of X hours must be less than or
equal to the Y value of a give carer
E.G.
Client 01: 2 Hours |
Client 02: 3 Hours | Carer 01: 10 Hours
Client 03: 4 Hours |
Client 04: 1 Hours |
Client 05: 2 Hours |
Client 06: 5 Hours | Carer 02: 12 hours
Client 07: 4 Hours | (One hour to spare but next client is has
X=2)
Client 08: 2 Hours |
Client 09: 2 Hours |
Client 10: 3 Hours | Carer 03: 18 Hours
Client 11: 4 Hours |
Client 12: 5 Hours |
The clients and carers will be sorted alpahabetically so we'll group
as many of the clients (that are ordered alphabetiaclly) to the 1st
carer (alphabetically and repeat this so that when the 'Nth' carer is
full, then we'll go to 'N+1' carer and start allocating them clients
from where we left of.
Is this possible to do via a MySQL database which stores the data and
PHP scripts to manipulate the sorting? If so, can anyone help?
Many thanks,
Janusz
Comment