Hey everybody I want to let you know that I have undertaken the grueling task of getting the heck away from WordPress. I was so sick of the problems and updates I had to do all the time. I am now using my ezbloo system and I am integrating all my old posts into the new system. It sucks, but in the end, I will save bundles of time. I needed to keep things simple and that is why I created ezbloo. I'll have more on this later for you guys after I am done with the total integration of my old posts here. So if you are looking for a post and need it faster, shoot me an email and I will make it a priority. [email protected]

So I just got done programming the best home inventory management software. I wanted it to be free and easy to use for all my friends, neighbors and subscribers. Last September, I hit the big 50. I have stuff I never knew I had. A person accumulates things over time naturally. Then there was stuff that I knew I had but could not find it. Oh, my, how frustrating that was! I would end up buying the same item repeatedly. Many times I would have like 4 or 5 of the same item. This was driving me crazy, so here is what I did. To see the most recent updates to the Home Inventory App Click Here


Home Inventory Bins

My next plan of attack was to buy a lot of bins from Wal-Mart, Dollar general and other places. AH HA, I thought, I'll just store them all in bins! Problem solved, right? Wrong! Now I have 50 bins and did not know what is in each bin. I spent my life organizing other people's businesses and did not even know where my stuff was. What a hypocrite, I thought to myself. I'm like the auto body worker that drives around a rust pile, lol.

Home Inventory Management Software

This is when my brainstorm moved in, hey I'll just download home inventory management software. While looking for the app and software, I ran into all kinds of red flags. I did not want to buy a subscription; I wanted it to be fast, track value, upload picture, be secure, etc. All the searching that I did, I could find nothing that matched my criteria.

Programming Home Inventory Software

Well, the programming software logic was coming to me. I had several enormous projects that I was working on, but if I could just spend a couple of hours a day, I could make it work. I have a rule that I only program for 90 minutes at a time. After that, I am fried and have to get off the computer. Besides, I have a Belgian Malinois puppy and he requires a lot of exercise and time. Isn't he cute! Home inventory management software

For The Non-Programmers Features

If you are not a programmer, then this will probably be the last paragraph you read in this article. Basically, I wanted fast, free features in this app. Here they are!
  • INSTANT FREE ACCOUNT
  • INSTANTLY ADD ITEMS
  • INSTANTLY FIND ITEMS
  • INSTANTLY EDIT
  • INSTANTLY SEE VALUES
  • INSTANTLY DELETE
  • NOTHING TO DOWNLOAD!
  • WORKS ON ALL DEVICES ANDROID, IOS, COMPUTERS AND TABLES
  • 100% FREE
  • UNLIMITED ITEMS
  • SECURE AND ENCRYPTED
Here is the Home Inventory App. See it in action. Enjoy!

Alternative Home Inventory Apps

OK, just to be fair, I'll list the alternative home inventory apps. There is a catch with each one of these. I programmed mine to be free and fast because Home Inventory is not my business just something that I need to have. My app also works on all devices, no matter what they are! Here are the apps that I checked out.

For The Programmers

No, I did not forget about my programming buddies! If you wanted to see how I programmed this simple app go to the next page so we don't overload this one!

First Steps in Programming

The first steps in programming is I wrote everything down. Mainly it was the features above. Additionally, I knew people needed to create and accountlog-in and log-out. I used my codes that I have on this website like I do for all the applications that I program. I started with the basics like I taught about in the intermediate web development course that I have on the website here. There are a lot of files, so let me explain what I did for each of them. These files will work but I added several things onto them. You can do the same thing in your programming. https://youtu.be/JS9OTJY0zfI

Header

In the header you see, I started with the php session. We set the time zone to America, New York. It may be beneficial to take that out when people around the world start using the app, I am sure that would frustrate people seeing the wrong time, lol.  I also wanted to see any PHP errors, so I included error reporting. You can slo see that I have a functions file included in the header. Not the next thing that I did was get a session variable called id. This, of course, would be the users id in the database when they login. If they are not logged in, I set their session variable to 0. I then include my CDN scripts and put the time at the top of the page.
<?php if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
date_default_timezone_set('America/New_York');
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include_once('functions.php');
    if (isset($_SESSION['id'])) {
    $uid=$_SESSION['id'];
    $result = $con->query("SELECT * FROM users WHERE id='$uid' ") ;
    while ($row = $result->fetch_assoc()) {
    $name=strtoupper($row['name']);
    }
    }else{
    $name='';
    $uid='0';
  }

?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Home Inventory App</title>
  <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
<div class="well"><?php $date = date('m/d/Y h:i:s a', time()); echo $date; ?></div>

Functions

OK since I included functions.php on the previous page, then we will discuss it here.  Notice I included the config file here. That is my connection to the database. I wanted to use pagination on the details page so I created a function to get the next and previous page.
<?php 
include_once('config.php');

function getnextid($var){
  global $con;
  global $uid;
  $result = $con->query("SELECT user, id FROM merch WHERE user='$uid' AND id>'$var' ORDER BY id ASC") ;
  $total=$result->num_rows;
  if($total>0){
  while ($row = $result->fetch_assoc()) {
  $usernextitem= $row['id'];
  }
  }else{
    $usernextitem=0;
  }
  return $usernextitem;
}

function getprevid($var){
  global $con;
  global $uid;
  $result = $con->query("SELECT user, id FROM merch WHERE user='$uid' AND id<'$var' ORDER BY id ASC") ;
  $total=$result->num_rows;
  if($total>0){
  while ($row = $result->fetch_assoc()) {
  $usernextitem= $row['id'];
  }
  }else{
    $usernextitem=0;
  }
  return $usernextitem;
}
?>

Footer

In the footer I wanted to see if we set a session. If so, I wanted to show a different menu for logged in users and logged out users. I handle this with CSS and PHP.
<?php
    if (isset($_SESSION['id'])) {
    echo '<style> 
    #hidee{display:none;}
    #show{display:block;}
    </style>';
    }else{
    echo '<style> 
    #hidee{display:block;}
    #show{display:none;}
    </style>';
  }
 ?>
</div>
</body>
</html>

Menu

Of course I am using bootstrap because it's outstanding for mobile and desktops. However, notice the class names of hidee and show. If you look at the footer.php script above you will see that we are hiding menu items for logged in and logged out users.
<nav class="navbar navbar-default">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="index.php"><?php echo $name; ?></a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li><a href="index.php">Home <span class="sr-only">(current)</span></a></li>
        <li><a href="login.php" id="hidee">Log In</a></li>
    <li><a href="signup.php" id="hidee">Signup</a></li>
    <li><a href="inventory.php" id="show">Inventory</a></li>
    <li><a href="enterinventory.php" id="show">Enter Inventory</a></li>
        <li id="hidee"><a href="lostpass.php">Lost Password</a></li>
        <li id="show"><a href="logout.php">Log Out</a></li>
      </ul>
      <form class="navbar-form navbar-right" method="post" action="search.php">
        <div class="form-group">
          <input type="text" name="search" class="form-control" placeholder="Search">
        </div>
        <button type="submit" class="btn btn-default">Submit</button>
      </form>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>

Index File

Of course, the index file is pretty simple. We just include the header, menu and footer files.
<?php include_once('header.php');?>
<?php include_once('menu.php');?>
<h1>Inventory</h1>
<p>Create account to keep track of your home inventory</p>

<?php include_once('footer.php'); ?>

Sign-up Script

Well, the first thing everyone sees on an app is a sign up page. We made this nice and easy and used a little bit of AJAX to process the script.
<?php include_once('header.php');?>
<?php include_once('menu.php');?>
<h1>Inventory Signup Page</h1>
<form>
<div class="form-group">
<label for="name">Name:</label>
<input id="name" class="form-control" type="text" placeholder="Name">
<label for="email">Email:</label>
<input id="email" class="form-control" type="email" placeholder="Email">
<label for="password">Password:</label>
<input id="pass" class="form-control" type="password" placeholder="Password">
<label for="spam">Spam Control: Type Yes in the box below</label>
<input id="spam" class="form-control" type="text" placeholder="Yes">
<button type="submit" id="submit" class="btn btn-default">Submit</button>
</div>
</form>
<div id="display"></div>
<script>
$(document).ready(function(){
$("#submit").click(function(){
var name = $("#name").val();
var email = $("#email").val();
var pass = $("#pass").val()
var spam = $("#spam").val()
var dataString = 'name1='+ name + '&email1='+ email+ '&pass1='+ pass+'&spam1='+ spam;
if(name==''||email==''||pass==''||spam=='')
{
$("#display").html("Please Fill All Fields");
}
else
{
$.ajax({
type: "POST",
url: "processor.php",
data: dataString,
cache: false,
success: function(result){
$("#display").html(result);
}
});
}
return false;
});
});
</script>
<?php include_once('footer.php'); ?>

Processor File

Here is where we process the sign ups. We enter all the data into the database, filter and sanitize it all. We also use PASSWORD_BCRYPT to create the password. Then we echo it all back to the user via AJAX. :-)
<?php
include_once('config.php');
$name = filter_var($_POST['name1'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);
$email = filter_var($_POST['email1'], FILTER_SANITIZE_EMAIL, FILTER_FLAG_STRIP_HIGH);
$pass = filter_var($_POST['pass1'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);
$spam = filter_var($_POST['spam1'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);
if($spam == 'Yes'){
  $hash=password_hash($pass, PASSWORD_BCRYPT);
mysqli_query($con,"INSERT INTO users(`name`, `email`, `password`)VALUES('$name','$email','$hash')");
echo '<strong>'.$name.'</strong><br/>';
echo '<strong>'.$email.'</strong><br/>';
echo 'This is the password:<strong>'.$pass.'</strong><br/>';
echo 'This is the encrypted password: <strong>'.$hash.'</strong><br/>';
$con->close();
}else{
  echo '<div class="alert alert-danger">You need to type Yes in the spam box.</div>';
  die();
}
?>

The Zip File

I have to tell you that this would be an awfully long article so I am just going to give you all the scripts. You can go over them all and contact me if you have questions. Watch the programming video for this is you like, it is very long. Here is the zip file.