Simple Inventory System Using PHP/MySQLi with Source Code

Language

Project: Simple Inventory System Using PHP/MySQLi with Source Code

About

I developed this code for those beginner programmers who found difficulties in creating their inventory system using PHP/MySQLi. The has a secure login because I have used md5 encryption for login and registration. It also generates reports such as daily, weekly, monthly, and yearly. To try this system just download and run this system. The inventory table or the list of products on the inventory page will serve also as the form for the sales. The use will select a product then by clicking the row, the product quantity sold cell will change into a text area where can the user enter the quantity sold, and by clicking anywhere on the page the value of the quantity sold input will be automatically saved in the database without leaving or refreshing the page.

Features

  • Login Page
    • The page where the system users submit their system credentials to access the data and functionalities of the simple inventory system.
  • Registration Panel
    • This panel can be navigated by clicking the register ribbon at the top-right of the Login panel. This page is the form for creating a new system user and this requires the admin password.
  • Inventory Page
    • The page where the users will be redirected by default after logging into the system. This page displays the list of products and their details and at the same time, each row has a live editing feature and serves as the sale transaction form of the system.
  • Sales Page
    • The page where the total sales within the 2 selected dates are being displayed.
  • Add Item Page
    • The page where can system users add new stock for each product.
  • Add Product Page
    • The page where the system users submit the new product details.
  • Edit Price Page
    • The page where the system users update the price of the product.

How to Run

  1. Download the source code and extract the zip file.
  2. Download or set up any local web server that runs PHP script.
  3. Open the web-server database and create a new database name it "liveedit".
  4. Import the SQL file located in the database folder of the source code.
  5. Copy and paste the source code to the location where your local web server accessing your local projects. Example for XAMPP('C:\xampp\htdocs')
  6. Open a web browser and browse the project. E.g [http://localhost/inventory]

Default Admin Access

Username: admin
Password: admin

Demo

I hope this Simple Inventory System Using PHP/MySQLi project for beginners will help you with what you are looking for, feel free to download and modify the source code.

Explore more on this website for more source codes and tutorials.

Enjoy!

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

I would like to thank you personally. This is a big help for me learning php

username and password not found..

bakit po hindi ako maka log in? Opps some thing went wrong po ung lumalabas... I need ur help po...

hi eto na lang po yung problem ko sa tableedit.php
Notice: Undefined variable: a in C:\xampp\htdocs\inventory\tableedit.php on line 283

Notice: Undefined variable: b in C:\xampp\htdocs\inventory\tableedit.php on line 283

anu po gagawin ko para matangal yung msg na yan tnx u po

pde po bang pahinge ng copy ng documentation ninyo jan tnx u ... kung ok lng po isend ninyo na lng sa y.m ko po na [email protected] tnx u

For those with errors on line 283/284, you need to select a date range first. Working fine here, with the exception of a few typo's which had to be changed to reflect the names in the corresponding tables. Thank you

bakit hindi po ako maka log-in???,,,,query failed po yung lumalabas tapos sa registration,,pag nag register ako....you cannot add another user yung lumalabas???,,,please pm me @ [email protected]

when i log in and set the usernama and password to admin. its a message that said something went wrong.how i fixed it? pls help me.... pls

I can not add items thorough the additem button..? please help

Am short of words what more can I say than "Thanks so much..."?

Error when trie to loging Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at login.php:3) in login.php on line 5 Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in login.php on line 55 Warning: Cannot modify header information - headers already sent by (output started at login.php:3) in login.php on line 61

- in original code : ---------

sales error i found so what are the code for sales

sir bakit hindi ko po ma import yung database eto poh yung lumalabas Error SQL query: -- -------------------------------------------------------- -- -- Table structure for table `inventory` -- CREATE TABLE IF NOT EXISTS `inventory` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT , `item` VARCHAR( 100 ) NOT NULL , `qtyleft` INT( 11 ) NOT NULL , `qty_sold` INT( 11 ) NOT NULL , `price` INT( 11 ) NOT NULL , `sales` INT( 11 ) NOT NULL , PRIMARY KEY ( `id` ) ) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =6; MySQL said: Documentation #1017 - Can't find file: 'inventory' (errno: 2)??? help poh newb lang poh kc ako sa php

ahhm... sir , how can i add a sold items ??? when i click the row it won't work.. plzz . help me .

sir, how can i add a sold items.. it won't work if i click the row .. in your codes

In reply to by chess (not verified)

if you are able to click the row and able to create input, all you have to do is refresh the page. thats the only flaw of this inventory sys. :)

its not working . login error !

In reply to by raffy (not verified)

If you are having login error, you might want to check the index.php to login.php to db.php check if all the code is connected to your database. admin admin

Hmmmm... Nice Keep up to help others... at same time you gats update your scripts...

for sure, galing lang itong codes na ito sa ibang website, kya ignore lang ang gngwa instead of debugging the errors..

Hi Argie,

Just looked at the code and I liked it.
I head a bit of headwind working through all the errors but with 2 hours if coding, all is working properly (at least for me :) ).
The code is nice and easy to read/adjust, but if I may, I would like to make some suggestions:
- for the Notice error: 'undefined index id' that everyone is complaining there are two simple mechanisms to put in place to make sure it doesn't show in the browser:
1. In index.php put the following lines:
if(isset($_GET['id'])){
$remark=$_GET['id'];
if($remark=='success'){
echo '<ul>';
echo '<li>'." Registration Success You can now login ".'</li>';
echo '</ul>';
}
}
Normally this would not show if the error reporting level is set to low, so ...

2. Instruct users to set a lower error logging level like E_STRICT or E_ERROR or to exclude notice with ~E_NOTICE.

I would not suggest method 2 especially when you are in development mode :).

- mysql statement is deprecated in MySQL 5 so my suggestion is to use mysqli statements instead. This worked for me.

All in all, good code and really good effort. Keep on coding.

I dnt knw how to run the project please help me

I have help for php

I've error everytime I log in.. The error is : Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\inventory\inventory\db.php:6 Stack trace: #0 C:\xampp\htdocs\inventory\inventory\login.php(6): require_once() #1 {main} thrown in C:\xampp\htdocs\inventory\inventory\db.php on line 6 Can anyone fix this error for me? God bless you..

why is the log in broken? its just saying oops something went wrong? help me please

very good best !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

thanks so much i hope the project will help me greatly...

do you have a boyfriend?

sir, send me the modules and system requirements to this project( UML diagrams and module descriptions). THANK U

Notice: Undefined index: date in C:-\inventory\inventory\tableedit.php on line 173 i didn't get what is the problem here and one more thing is here in inventory column the date is automatically changes which means the date is updated when we open the system. rectify and clarify me sir......its good coding. thank you so much

anyone can please help for: Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\inventory\inventory\inventory\db.php:6 Stack trace: #0 C:\xampp\htdocs\inventory\inventory\inventory\login.php(6): require_once() #1 {main} thrown in C:\xampp\htdocs\inventory\inventory\inventory\db.php on line 6

Excuse me are you using xammp because i use xammp for my project

hey i have imported the database and replace every where mysql to mysqli after doing all these i am having this error username missing and password is missing

I just want to ask why is not working it always says this Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO) in C:\xampp\htdocs\inventory\inventory\db.php on line 6 Opps some thing went wrong if I log in

Add new comment