It's rather unclear to me where your problem actually lies. Are you wondering what SQL to issue? Are you wondering how to format your output? I'm not sure what part of the architecture you mean. Do you mean small parts, like how to pass parameters to DBI? Do you mean large parts, like how to pass the information about what page to show between requests from the user(s)?
Often, it helps to show a very short, self-contained program that shows what you have. It shouldn't be hard to reduce your program to, say, 20 lines that show what you have, and to also tell us how it is not all you want.
| [reply] |
If it is an architecture question, then first you must answer some questions, such as: can we have more than one worker assigned to the same work and can one worker be assigned to more than one work?Usually, one would have (at least) three tables in the database: one for the works, one for the workers and one which makes a link between works and workers. In that way you can have a many-to-many relationship between works and workers. The way it looks now, is that your table "Workers" is a bit like a "Link" table, combined with a "Workers" table. In the long run and to have the maximum flexibility, it is better to split your "Workers" table into "Link" and "Workers". There are quite a bit of modules on CPAN for page navigation, such as Data::Paginate, Data::Page and Data::Page::Navigation, Data::Pageset, Data::Pager, (and the list goes on and on). Or for something that is more closely linked to the DBI: DBIx::Pager. Of course frameworks such as DBIx::Class and Catalyst have this functionality already built-in.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
| [reply] |