Computer Science Canada Inventory Management Etc. |
Author: | Velandil [ Wed Nov 02, 2005 1:17 am ] |
Post subject: | Inventory Management Etc. |
Currently working for a company who uses quick books to manage all their inventory and I frankly think it sucks . We have to enter in serial numbers for everything sold and shipped etc. which isn't very friendly in quick books. Basically, what I want to do is the following: Have a publically viewable sort of "shopping cart" that shows things by model number and how many we have in stock, with the ability to "order" some products and have an order form sent to us Have a back where I can enter in new product types Have another back end where I can pick a product type from a list, enter in it's serial number, where it's being stored, if there are any problems with it, etc. Have a page not publically viewable where we can add, remove, manage and what not current database items And, finally, be able to save and print a PDF or the like with an order form created by us and after the products have been ordered to have them removed from stock (example, if 10 are in stock and I print off an order for 2, it changes the stock to 8, and removes the serial numbers of the 2 I put on order from the list). I also want it to be secure (doesn't have to be military-base secure, just so people can't get in and goof around). Is this possible? Are there any resources for similar things? Thanks, Velandil (former comp sci student, now evolved to shipping / recieving at a company that sells networking equipment) |
Author: | rdrake [ Wed Nov 02, 2005 7:47 am ] |
Post subject: | |
Yes, this can be done. Most of what you want can easily be accomplished using a PHP/MySQL setup. Use PHP to modify the MySQL database which contains all product information. If you don't want to use MySQL, other databases can be used as well. As for security, you could build a login script which only allows certain people in to modify information. Also don't forget to use session variables which will ensure nobody tries accessing one of the other pages without logging in first. This information can still be viewed by another person though. To prevent this, you'll need a SSL certificate which will send only encrypted information to the person's browser. The only difficult thing to create for your project would be the PDF exporting feature. There are libraries available to create PDF files, but it's still not as easy as a simple command. Check out SourceForge to find a nice one. You might even be able to find a pre-existing project which'll do what you want. Just search around for product management systems. |
Author: | Velandil [ Wed Nov 02, 2005 9:54 pm ] | ||
Post subject: | |||
Awesome, thanks for the help. The PDF thing really is I guess the last thing I'm worried about. I think one of the things I need most help with is organizing the MySQL database. I don't have a whole ton of experiance with either to start, but I'm still much more comfortable with PHP than MySQL. I'm also a quick learner and I'm very set on getting something like this done. I poked around, and all the current IMS (Inventory Management Systems) seem to work okay, but they all also didn't have a good handful of the features I want. The only one that was easily customizable ran about 6 grand US for a 10 user license, which didn't interest me at all (looking to make something that makes my job easier, not cost me a fortune at the same time). This is more specifics of what I want:
That's essentially everything I want so far. I would love to expand it but I want the basics (although that's alot of typing up there) for now. Thanks a ton for any help here, I really aprecieate it. |
Author: | rdrake [ Wed Nov 02, 2005 10:49 pm ] |
Post subject: | |
If you prefer an easier way to set up the database initially, I'd highly recommend phpMyAdmin. You'll probably need a few tables, one being employees and another being inventory. I would create the following columns for the employees table:
The first few are pretty standard ones, you could even add things like DOB or whatever other information you need. The permission level is something like either disabled (0), readonly (1), readwrite(2). This way you can ensure that employees only do what they're suppost to and nothing to damage the system. For the inventory table, you'd probably want the following columns:
You can easily add/remove columns as desired. That should just about do it for the database. You'll probably need several pages in order to achieve this and keep things organized. Something like the following should do:
The index page would have a link to the inventory page if the user is still logged in, or would redirect the user to the login page if not. Once logged in, a person with the permission level of 1 could view the inventory items. A person with level 2 access could both view the items and add/modify/delete the items as well. I think that's about it for the planning. Just take what I've said and modify it to fit your needs, and you shouldn't have problems. If you have any more questions either about the design or coding, don't hesitate to ask. |
Author: | Velandil [ Thu Nov 03, 2005 12:31 am ] |
Post subject: | |
Blah I was typing this big long thing then power outage >.<. Apartment wiring is really messed up. Anyhow, I accidentally submitted my previous post early and had to edit it so I don't think you had the chance to read it all. I am currently using phpMyAdmin as yeah it does seem alot easier. I will try throwing together a database and then doing some light coding. I'll have to poke around the forums and what not to see how I can do this securely, as once I'm done testing and ready to put it on our work server, it won't be safe anymore . I'll post back here with my problems. As for tonight, gotta catch some sleep for a long day tomorrow . Thanks again. |
Author: | rdrake [ Thu Nov 03, 2005 7:33 am ] |
Post subject: | |
Just remember, never fully trust input from the user. It could contain harmful bits of information which will allow your site to be subject to attack. Remember to verify each bit of inputted information from the user before using it. |
Author: | Velandil [ Thu Nov 03, 2005 3:38 pm ] |
Post subject: | |
How do ya do that? |
Author: | rdrake [ Thu Nov 03, 2005 6:42 pm ] | ||
Post subject: | |||
Make sure certain things aren't in the input, such as ";". That would allow the person to potentially execute another query on your database. Be sure to create a user with a large and unique password that only has select, alter, and create privilidges. Doing so will only allow the users to do certain things, even if they make it around your security. They cannot drop tables and you will not lose important data. Just do other simple things like making sure certain fields have only what they're suppost to in them. For example, make sure the product id field only has numbers in it and just the right amount too. Something like the following should make sure the length is the right one. Change "10" to whatever it should be plus one.
|
Author: | Velandil [ Fri Nov 04, 2005 12:32 am ] |
Post subject: | |
Alrighty. Question then, if I do that code you entered in there, what exactly will happen? Will it reload the page, keep all current fields that are filled with the data that was in them before and post that error? Or what? Not much experience with forms and the such . |
Author: | rdrake [ Fri Nov 04, 2005 7:33 am ] |
Post subject: | |
How about I write a quick tutorial on handling forms in PHP? Here it is. |
Author: | Velandil [ Mon Nov 07, 2005 10:49 pm ] |
Post subject: | |
Another quick question, drop down menu's. As I mentioned before, I wanted to have certain sections when entering in a product to the inventory. A drop down menu would be best for this. For example, under the manufacturer company I'd want 2 options. Cisco and 3com. Now, I've never done a dropdown menu using php and mysql. I'd imagine the actual menu would be coded into the PHP, and then submit the result chosen into the mysql database, but how? . Thanks again for all the help. |
Author: | rdrake [ Mon Nov 07, 2005 11:33 pm ] | ||||
Post subject: | |||||
It's pretty easy to do that. Here's what you'd have for the HTML code.
|
Author: | Velandil [ Wed Nov 09, 2005 12:43 am ] |
Post subject: | |
Heh I was actually thinking (I think about this all day >.<), is it possible to manage that drop down list with the database? Like say I wanted to add another manufacturer to that list, could I just add it to the database or is that not possible (and therefor I would have to add it manually to the code)? Also, is it hard to make the form keep the results if say the form is submitted then the back button is pressed (or say the user hits submit, something goes wrong and he gets an error page, goes back, and everything is still there if ya know what I mean)? I really appreciate all the help . |
Author: | rdrake [ Wed Nov 09, 2005 7:41 am ] | ||
Post subject: | |||
Velandil wrote: is it possible to manage that drop down list with the database? It sure is. You just need some database code in order to pull them out.
|
Author: | Velandil [ Wed Nov 09, 2005 12:11 pm ] | ||||
Post subject: | |||||
Okay so I made a table called "inventory" and in it:
I want company, product, model and supplier to be drop down menu's. I tried putting your code in and changed what I thought was right. For example, I did:
but I keep getting the 0 results found. I imagine I need to tell it what field it should pull the info? And if so, where does that go? |
Author: | rdrake [ Wed Nov 09, 2005 3:48 pm ] | ||
Post subject: | |||
I might have forgotten some code there.
For some reason I forgot that, probably too early for thinking when I wrote it. That new code should work. If you keep getting the message "0 results returned" and your table does have some rows in it, then try just removing that line to see if it works. |
Author: | Velandil [ Thu Nov 10, 2005 11:37 pm ] | ||
Post subject: | |||
If I remove that line, I get:
Any idea? |
Author: | rdrake [ Fri Nov 11, 2005 7:26 am ] | ||
Post subject: | |||
The following is an example of this type of thing in action. I made it for a scheduling application, but I'm sure you could play around with the code and make it work with your app too. I don't know what's wrong with the code, provided you used the most recent code I gave you.
|