more

<!DOCTYPE html> <head> <title>simple RFID calulator</title> </head> <body> <div> General calculator </div> <div> SimpleRFID Cost </div> <form id="form1"> How many units of product do you sell each month? <input style="text-align: right;" name="unitsPerMonth" type="number" size="15"> </form> <button onclick="calcSimple()">Submit</button> <div> Approxiamtly how much SimpleRFID will Cost you per month: </div> <div id="totalPriceRFID"></div> <div> <br> Current Cost </div> <form id="form2"> How many man hours are used to complete an audit? <input style="text-align: right;" name="manHrs" type="number" size="7"> </form> <form id="form3"> How many orders are incorrectly shipped each month? <input style="text-align: right;" name="shipErr" type="number" size="5"> </form> <form id="form4"> How many hours a month do you spend inputting information into your systems? <input style="text-align: right;" name="inputHrs" type="number" size="5"> </form> <button onclick="clacCurrent()">Submit</button> <div> Approximate Total current cost: </div> <div id="currentCost"></div> <script> // Volume of 1 -5000 - $0.10 // Volume of 5001 -100,000 - $0.09 // Volume of +100,000 - $0.08 var pptList = { 'fiveThou' : .1, 'hunThou' : .09, 'million' : .08 }; // Volume of 1 -2000 - $0.10 // Volume of 2001 -5,000 - $0.09 // Volume of 5,001 - 10,000 - $0.10 // Volume of 10,000 - 20,000 - $0.09 // Volume of 20,000 -50,000 - $0.10 // Volume of 50,000 -100,000 - $0.09 var softPriceList = { 'twoThou': 69.99, 'fiveThou' : 129.99, 'tenThou' : 239.99, 'twentyThou' : 349.99, 'fiftyThou' : 479.99, 'hunThou' : 689.99 }; // Micro - $171.23/mo. = Volume of 1 -5000 // Basic - $220.01/mo. = Volume of 5000 -100,000 // Pro - $367.45/mo. = Volume of +100,000 var hardPriceList = { 'micro' : 171.23, 'basic' : 220.01, 'pro' : 367.45 }; function calcSimple(){ document.getElementById('totalPriceRFID').innerHTML=''; var form, numOfTags = 0, tagPrice = 0, softPrice = 0, hardPrice = 0, totalPrice = 0; form = document.getElementById('form1'); numOfTags = form.elements['unitsPerMonth'].value; console.log(numOfTags); if(numOfTags < 5000) { tagPrice = pptList.fiveThou; hardPrice = hardPriceList.micro; } else if(numOfTags <= 100000) { tagPrice = pptList.hunThou; hardPrice = hardPriceList.basic; } else if(numOfTags > 100000) { tagPrice = pptList.million; hardPrice = hardPriceList.pro; } else console.log("error on tagPrice and hardware price"); if(numOfTags < 2000) softPrice = softPriceList.twoThou; else if(numOfTags < 5000) softPrice = softPriceList.fiveThou; else if(numOfTags < 10000) softPrice = softPriceList.hunThou; else if(numOfTags < 50000) softPrice = softPriceList.fiftyThou; else if(numOfTags > 50000) softPrice = softPriceList.hunThou; else console.log("Error soft ware price"); console.log('tagPrice: ' + tagPrice); console.log('hardPrice: ' + hardPrice); console.log('softPrice: ' + softPrice); console.log('numOfTags ' + numOfTags); totalPrice = (numOfTags * tagPrice) + softPrice + hardPrice; totalPrice = totalPrice.toFixed(2); document.getElementById('totalPriceRFID').innerHTML='$ '; document.getElementById('totalPriceRFID').innerHTML+=totalPrice; } function clacCurrent(){ var firstForm, secondForm, thirdForm, manHours = 0, shipErrors = 0, inputHours = 0, totalCurrentCost = 0; firstForm = document.getElementById('form2'); secondForm = document.getElementById('form3'); thirdForm = document.getElementById('form4'); manHours = firstForm.elements['manHrs'].value; console.log('manHours'); shipErrors = secondForm.elements['shipErr'].value; inputHours = thirdForm.elements['inputHrs'].value; manHours *= 10; shipErrors *= 43; inputHours *= 10; totalCurrentCost = manHours + shipErrors + inputHours; totalCurrentCost.toFixed(2); document.getElementById('currentCost').innerHTML='$ '; document.getElementById('currentCost').innerHTML += totalCurrentCost; } </script> </body> </html>