Wednesday, April 1, 2020

Toiletroll stock calculator

For an index to all my stories click this text

What's the worst thing that can happen during the corona crisis ? Getting Covid-19 ??? No there is something even worse. Running out of toiletpaper. That is why everyone is stashing toiletpaper.

But how do you know you have enough. Guessing in these kind of situations is totally out of order, You NEED to know if you have enough stock. So therefore I created the TOILETROLL STOCK calculator.




Above shows you the screen on an Android phone. I made an APP because you certainly want to take this to your grocery store when filling up your stash. Just fill in all the fields and you will know how long your stock will last.

Where to get the app.

There are several ways to get the app.




If you have a QR code reader on your phone you can scan the QR code shown above. The QR-code program will then re-direct you to the webpage where the APP can be downloaded.

The second method is to point the browser on your phone to the following URL:

https://www.appcreator24.com/app957076

You can do this with any browser on your phone. My favorite is Firefox.




The above screen will be presented. Press the download button.



The above screen asks to confirm that you want to complete the action.



After loading you will get a notification that the APP has been loaded.



With the file program in Android you will find the APP in the download folder. Click on it and install it. When Android asks you if it is OK to do so. Just agree and install. There are no dependencies. The app does not want your location or access to your contacts. It needs no permissions at all. It does not use your data bundle and it will also work off-line.

How does the app work.

Well actually it is just a piece of Javascript code made into a web-app. As always I give you the source code here. You can download it, save it as an HTML file and use it on your browser also!!



<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<body style='background-color:powderblue;'>
<body>

<style>
table 
{ 
  display: table;
  border-collapse: separate;
  border-spacing: 2px;
  border-color: gray;
}

th 
{
  text-align: left;
}

h1 
{
  color: red;
text-align: center;
}
</style>

<h1>Toiletrol stock lifespan</h1>

<table>
<tr>
<th>How many toilet rolls do you have </th>
<th><input type="text" id="myText1" maxlength="4" size="4" value="0"></th>
</tr>

<tr>
<th>How many sheets are there per roll </th>
<th><input type="text" id="myText2" maxlength="4" size="4" value="0"></th>
</tr>

<tr>
</tr>

<tr>
<th>How often do you visit the toilet per day </th>
<th><input type="text" id="myText3" maxlength="2" size="2" value="0"></th>
</tr>

<tr>
<th>How many sheets do you use per visit </th>
<th><input type="text" id="myText4" maxlength="2" size="2" value="0"></th>
</tr>

<tr>
</tr>

<tr>
<th>How many people in your household </th>
<th><input type="text" id="myText5" maxlength="2" size="2" value="0"></th>
</tr>

</table>
<br>

<p>Click the "Calculate" button to get the amount of days.</p>

<button onclick="myFunction()">Calculate</button>

<h1> Your stock wil last &nbsp<a id="demo1"></a> days</h1>



<script>
function myFunction() 
{
  var x1 = document.getElementById("myText1").value;
  var x2 = document.getElementById("myText2").value;
  var x3 = document.getElementById("myText3").value;
  var x4 = document.getElementById("myText4").value;
  var x5 = document.getElementById("myText5").value;

  var totvel = x1 * x2;
  var totvisit = x3 * x4 * x5;
  var days = totvel / totvisit;

  document.getElementById("demo1").innerHTML = Math.round(days);
}
</script>

</body>
</html>

Stay safe and healthy
and have fun.

Luc Volders