Skip to content

Instantly share code, notes, and snippets.

@farrukhsubhani
Last active February 9, 2016 21:09
Show Gist options
  • Save farrukhsubhani/5ad0c692fcb177439239 to your computer and use it in GitHub Desktop.
Save farrukhsubhani/5ad0c692fcb177439239 to your computer and use it in GitHub Desktop.
ROI Calculator
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex, nofollow">
<meta name="googlebot" content="noindex, nofollow">
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
<script type="text/javascript" src="http://code.angularjs.org/angular-1.0.1.js"></script>
<link rel="stylesheet" type="text/css" href="http://cdn.jsdelivr.net/flat-ui/2.2.2/css/vendor/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="http://cdn.jsdelivr.net/flat-ui/2.2.2/css/flat-ui.min.css">
<script type="text/javascript" src="http://cdn.jsdelivr.net/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://cdn.jsdelivr.net/flat-ui/2.2.2/js/flat-ui.min.js"></script>
<style type="text/css">
</style>
<title>ROI Calculator</title>
</head>
<body ng-app="myApp">
<div ng-controller="MyCtrl">
<h3>
ROI Calculator
</h3>
<div>
<form id="taskForm">
<div class="form-group">
<label>No Of Employees</label>
<div class="a_employeeslider"></div>
<input type="text" ng-model="a_nofemployees" class="form-control" name="title" />
</div>
<div class="form-group">
<label>Average Hour Worked Per week</label>
<input type="text" ng-model="b_averagehourworkedperweek" class="form-control" name="title" />
</div>
<div class="form-group">
<label>Average Hourly Wage</label>
<input type="text" ng-model="c_averagehourlywage" class="form-control" name="title" />
</div>
<div class="form-group">
<label>H</label>
ow Much Productivity Could You Recover?
<input type="text" ng-model="j_howMuchRecover" class="form-control" name="title" />
</div>
</form>
</div>
<table class="">
<tr>
<td>A</td>
<td>No of Employees=</td>
<td>{{a_nofemployees}}</td>
</tr>
<tr>
<td>B</td>
<td>Average Hours=</td>
<td>{{b_averagehourworkedperweek}}</td>
</tr>
<tr>
<td>C</td>
<td>Average Hourly Wage=</td>
<td>{{c_averagehourlywage}}</td>
</tr>
<tr class="hide">
<td>D</td>
<td>Full Hourly Wage=</td>
<td>{{d_fullhourlywage}}</td>
</tr>
<tr class="hide">
<td>E</td>
<td>Productivity Loss Ratio=</td>
<td>{{e_productivityLossRatio}}</td>
</tr>
<tr>
<td>F</td>
<td>Annual Loss=</td>
<td>{{f_AnnualLoss}}</td>
</tr>
<tr>
<td>G</td>
<td>Annual Loss Hours=</td>
<td>{{g_AnnualLossHours}}</td>
</tr>
<tr class="hide">
<td>H</td>
<td>secure Watch Cost Per Hour=</td>
<td>{{h_secureWatchCostPerHour}}</td>
</tr>
<tr class="hide">
<td>I</td>
<td>secure Watch Cost Annual=</td>
<td>{{i_secureWatchCostAnnual}}</td>
</tr>
<tr class="hide">
<td>J</td>
<td>how Much Recover=</td>
<td>{{j_howMuchRecover}}</td>
</tr>
<tr>
<td>K</td>
<td>Additional Working Hours=</td>
<td>{{k_additionalWorkingHours}}</td>
</tr>
<tr>
<td>L</td>
<td>Imporovement of Profit=</td>
<td>{{l_improvementOfProfit}}</td>
</tr>
<tr>
<td>Roi</td>
<td>ROi=</td>
<td>{{RoI}}</td>
</tr>
</table>
<button ng-click="updatevars()">
Update vars
</button>
</div>
<script type='text/javascript'>//<![CDATA[
var myApp = angular.module('myApp', []);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
$scope.name = 'Superhero';
$scope.a_nofemployees = 20;
$('.a_employeeslider').slider({
min: 1,
max: 50,
value: $scope.a_nofemployees,
orientation: "horizontal",
range: "min"
});
$scope.b_averagehourworkedperweek = 37.50;
$scope.c_averagehourlywage = 13.59;
$scope.d_fullhourlywage = ($scope.c_averagehourlywage * 1.35).toFixed(2);
$scope.e_productivityLossRatio = 0.15;
$scope.f_AnnualLoss = ($scope.a_nofemployees * $scope.b_averagehourworkedperweek * $scope.d_fullhourlywage * 52 * $scope.e_productivityLossRatio).toFixed(2);
$scope.g_AnnualLossHours = ($scope.f_AnnualLoss / $scope.d_fullhourlywage).toFixed(2);
$scope.h_secureWatchCostPerHour = 25;
$scope.i_secureWatchCostAnnual = ($scope.a_nofemployees * $scope.h_secureWatchCostPerHour * 12).toFixed(2);
$scope.j_howMuchRecover = 0.25;
$scope.k_additionalWorkingHours = ($scope.g_AnnualLossHours * $scope.j_howMuchRecover).toFixed(2);
$scope.l_improvementOfProfit = ($scope.k_additionalWorkingHours * $scope.d_fullhourlywage).toFixed(2);
$scope.RoI = ($scope.l_improvementOfProfit / $scope.i_secureWatchCostAnnual).toFixed(2);
$scope.updatevars = function()
{
$scope.d_fullhourlywage = ($scope.c_averagehourlywage * 1.35).toFixed(2);
$scope.e_productivityLossRatio = 0.15;
$scope.f_AnnualLoss = ($scope.a_nofemployees * $scope.b_averagehourworkedperweek * $scope.d_fullhourlywage * 52 * $scope.e_productivityLossRatio).toFixed(2);
$scope.g_AnnualLossHours = ($scope.f_AnnualLoss / $scope.d_fullhourlywage).toFixed(2);
$scope.h_secureWatchCostPerHour = 25;
$scope.i_secureWatchCostAnnual = ($scope.a_nofemployees * $scope.h_secureWatchCostPerHour * 12).toFixed(2);
//$scope.j_howMuchRecover = 0.25;//set here
$scope.k_additionalWorkingHours = ($scope.g_AnnualLossHours * $scope.j_howMuchRecover).toFixed(2);
$scope.l_improvementOfProfit = ($scope.k_additionalWorkingHours * $scope.d_fullhourlywage).toFixed(2);
$scope.RoI = ($scope.l_improvementOfProfit / $scope.i_secureWatchCostAnnual).toFixed(2);
}
}
//]]>
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment