Jump to content

Help in database design and php logic


iceangel89

Recommended Posts

a long post but hope someone can help :)

 

i need to do a system as follows

 

its a employee claims system where employees can claim medical expenses etc. they will submit a claim request (this part has no problems) basically a form. then this claim will need to be forwarded to 0 (in the case of a boss for example) to many "managers" from what i understand. then finally it will reach the finance department.

 

as for database design, i was thinking:

 

Users table

- UserID

- Username

- Password

...

 

"ClaimSequence" < (dunno what to name it) table

- ID

- UserID          - UserID of the employee who submitted the claim

- Number          - Sequence number of the manager   

- ManagerID      - UserID of Manager in charge

- NextManager  - UserID of the next manager in charge

 

abit abstract so i will give an example:

 

say managers man1, man2 needs to approve my claim

the admin when registering me will set that

 

ClaimSequence 1:

- UserID        - ME

- Number        - 1 - indicating the 1st manager

- ManagerID    - UserID of "man1"

- NextManager - UserID of "man2"

 

ClaimSequence 2:

- UserID        - ME

- Number        - 2 - indicating the 2nd manager

- ManagerID    - UserID of "man2"

- NextManager - NULL - indicating no more managers, or maybe the finance ppl in charge, i'll probably ask if the finance is fixed people doing it for all employees anot...

 

what do u think of this?

 

then for the 2nd part to have "Management/Finance" being able to see and approve/process claims of subordinates/colleagues they are in charge of. maybe i dont need this? cos i just do like a

if UserID IN ClaimSequence.ManagerID then able to see the page something like that

OR

i can do a Roles table and put people with management/finance roles and able to see respective pages?

which is better?

 

what kind of Accerss control is best? i normally use restrict access to page server behaviour but think ts not really efficient. is there somtthing like web.config like in ASP that i can restrict access by folder?

Link to comment
Share on other sites

A lot depends on what software you plan to use

If you have an app framework like Cake or Symfony in PHP, for example, you can merrily do a lot of good things pretty quickly - including roles/permissions tables and stuff like that.

OTOH, if the app is smallish and has not much complexity behind it, and maybe will not scale up either, then a few ugly hacks can do the job.

how much time do you have and finally, how much is it worth... ;)

if it's something you would like to put on your CV/Bio then do it good, with a full framework et al, even if it's a bit slow coz i don't see a traffic of more than 10 users per second.

perl users sometimes use flat files for small apps (sounding just like this one)  :D

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.