Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-12-2008, 09:35 PM   PM User | #1
mnewbegin
New Coder

 
Join Date: Nov 2008
Posts: 17
Thanks: 2
Thanked 0 Times in 0 Posts
mnewbegin is an unknown quantity at this point
Developing Inventory Software with (Assembleable) Pieces having problems

Here is my issue (STORY BELOW, and update of where I am)

I have the basics of this system programmed, but now I need to worry about assembled pieces.

i.e. (Product AAAA, is made up of 1 BBBB, 1 CCCC, and 4 DDDD's)

When shipping my items I want to pull these values from the database because they always go out assembled. What is the best way to do this?

I have only 1 vendor programmed into my database for testing, there will probably be 30 when I am done.



I can give you my whole code so far, and help would be appreciated.


message me or email me mnewbegin (at) gmail.com

Story: and Info

I have been developing Inventory Software:


So far have these functions done.

- Login System (including email / password(md5), system with captcha registration validation and country chooser
- Add Products (basic 4-5 inputs to update records in database)
- Edit Products (edit those 4-5 inputs in the database)



In Development, lost on some parts of this

- Updating stock counts when same product gets more items shipped in.
- Moving products out of products table into shipped table, once billed
- Generating Invoices from shipped table.
mnewbegin is offline   Reply With Quote
Old 11-13-2008, 04:32 PM   PM User | #2
tosbourn
Regular Coder

 
Join Date: Aug 2008
Location: Northern Ireland
Posts: 167
Thanks: 12
Thanked 6 Times in 6 Posts
tosbourn is on a distinguished road
The first thing that came to my mind was a case statement.

PHP Code:
switch($product)
{
case 
"AAAA"#remove items from Db
break;

default: 
#do nothing
break;

The other way would be to use an Object Orientated Approve, where each product is a class that is made up of the seperate items. This is probably the more elegant solution but depending on how you have coded the rest of your solution this may be a little pointless.
tosbourn is offline   Reply With Quote
Old 11-13-2008, 05:42 PM   PM User | #3
mnewbegin
New Coder

 
Join Date: Nov 2008
Posts: 17
Thanks: 2
Thanked 0 Times in 0 Posts
mnewbegin is an unknown quantity at this point
I'm at a loss at even how to handle these.


- All items are in inventory so there is a set number for each thing.


What I don't understand is how to associate a part when removed to check for the other parts that it needs to be assembled with.


So .


Prompt 1: Is the piece AAAA you chose being assembled,

Prompt 2: Y / N (Y choosen) then it shows this to screen.

Prompt 3: Item AAAA uses the following parts

1 BBBB
1 CCCC
4 DDDD

How many assembled items are being shipped


Prompt 4: 50 (50 typed into box)

[SUBMIT]


-------------------------------
page that loads saying complete:

Completed adding items to order

50 BBBB
50 CCCC
200 DDDD

----------------------------------


Is how I was going to structure it.



so it looks like a while or do while loop, and then it send the variables to mysql statement to remove that many from inventory?

Last edited by mnewbegin; 11-13-2008 at 05:46 PM..
mnewbegin is offline   Reply With Quote
Reply

Bookmarks

Tags
assembleable, inventory, software

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:20 AM.


Advertisement
Log in to turn off these ads.