Jump to content

Planning DB structure and user authentification?


fbm

Recommended Posts

Hi,

 

I have been creating a few posts today but i hope by me creating new ones with new relevent titles is the correct way of doing things. Once one post has been solved i mark it as solved and post my thank you comments. I then move onto another area of my project which has a new issue and really requires a new post title which is relevent to the new question so being new here i hope creating a new relevent post is the best way to do things.

 

Now onto my next question :)

 

So i am developing my first PHP application and basing it around a CRM application which i plan to use with my clients. I want it to be simple but expandable as my first project i don't want to attempt anything hugely out of my reach as a begginer to PHP.

 

I have my first steps completed

 

- I have a DB with a table of clients info.

- I have the ability to add, edit, delete my clients from an admin area.

 

Next Step is to understand how to handle client specific information

 

I want to create an invoice section on my backend. This will be a simple form which i should be able to manage with my current skills. The form will consist of, client dropdown list to select a client, then the following fields, [date], [invoice number], [invoice title], [invoice value], [status] and a browse button to upload a PDF copy of the invoice which i create from another system external to this CRM.

 

So my questions

 

1. Creating the invoice table the right way? the end result will be an admin area where i login into and add invoices and a front end where my clients can login to view invoices relevent to them.

 

2. How do i tie the invoice data to the client account. In my client table i have setup the primary key as the ID and i am assuming by selecting my client from a drop down list when creating the invoice i will be able to add the clients ID into the invoice table making the client ID still the primary key. Does this sound like the best way to do it? everythign client specific should be linked to the client ID.

 

3. So once i complete the backend invoice tables and have the ebility to add invoices i will be moving onto the front end for the first tests. I have read that sessions are the best way to handle users logging in. After logging in i will want to show invoices relevent to there ID. Does my above plans cover this ability or should i change my plans now to avoid any problems?

 

4. I would like to create my first front end test which will be a login form and after logging in it just lists the clients info which is populated in the clients table relevent to the login details used. Where is a good place to start with this? i am thinkign by lookign at the frotn end approach now it may help me understand the process better and allow me to cater for future plans in the DB structure.

 

Cheers

Link to comment
Share on other sites

1. Invoice table, invoiceID(unique auto_inc), clientID, invoiceDate, number, title, value, status, pdf(this is the filename of your pdf), added.

 

2. You tie your client to your invoices by inserting their clientID in your invoice table

 

3. Yes it does, in your client table you may also want to add type, and use this field to determine user priveleges on your pages based on access level.

 

4. On successful login redirect to your user pages, using sessions you store user type, name and id in the sessions and you can call these on any page that you put session_start(); at the top of.

 

then its simply a matter of calling your queries based on your user priveleges

Link to comment
Share on other sites

Cheers dragon for confirming my DB structure and plans.

 

I have created my client directory and index.php page with login form. Can anyone offer any guidance on how to process the login for and create the session?

 

Cheers

 

Rick

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.