weather works #16
@@ -1,17 +0,0 @@
|
||||
var options = {
|
||||
location: 40.7127+','+ 74.0059, // New York
|
||||
unit: 'c',
|
||||
success: function(weather) {
|
||||
html = '<h2><i class="sw icon-'+weather.code+'"></i> '
|
||||
html += weather.temp+'°'+weather.units.temp+'</h2>';
|
||||
html += '<ul><li>'+weather.city+', '+weather.region +'</li>';
|
||||
html += '<li class="currently">'+weather.currently+'</li>';
|
||||
|
||||
$("#weather").html(html);
|
||||
},
|
||||
error: function(error) {
|
||||
$("#weather").html('<p>'+error+'</p>');
|
||||
}
|
||||
}
|
||||
|
||||
Weather.options = options
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<template name="state">
|
||||
<div> </div>
|
||||
<div class="col-md-12">
|
||||
{{#with controller_state}}
|
||||
<img src="{{ bucket_image }}" class="img-responsive center-block" id="bucket_image" />
|
||||
|
||||
@@ -100,6 +100,8 @@ Template.state.helpers({
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
Template.state.events({
|
||||
'click #water_now': function() {
|
||||
var controller_id = Session.get('controller_id');
|
||||
|
||||
9
app/client/weather.html
Normal file
9
app/client/weather.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<template name="weather">
|
||||
|
||||
<div> </div>
|
||||
<div class="col-md-12">
|
||||
<div class="text-center">
|
||||
{{>simpleWeather}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
39
app/client/weather.js
Normal file
39
app/client/weather.js
Normal file
@@ -0,0 +1,39 @@
|
||||
var options = {
|
||||
|
||||
location: 44.0123 + ',' + 18.19455, // New Visoko
|
||||
unit: 'c',
|
||||
success: function(weather) {
|
||||
html = "<h2><i class='sw icon-" + weather.code + "'></i>";
|
||||
html += weather.temp + '°' + weather.units.temp + '</h2>';
|
||||
html += '<ul><li>' + weather.city + ', ' + weather.region + '</li>';
|
||||
html += "<li class='currently'>" + weather.currently + '</li>';
|
||||
html += '<hr />';
|
||||
|
||||
for (var i = 0; i < 5; i++) {
|
||||
var forecast = weather.forecast[i];
|
||||
html += '<div>';
|
||||
html += "<h2><i class='sw icon-" + forecast.code + "'></i>";
|
||||
html += forecast.high + '°' + weather.units.temp + '</h2>';
|
||||
html += "<li class='currently'>" + daysInBosnian[forecast.day] + ': ' + forecast.text + '</li>';
|
||||
html += "</div>";
|
||||
|
||||
}
|
||||
|
||||
$('#weather').html(html);
|
||||
},
|
||||
error: function(error) {
|
||||
$('#weather').html('<p>' + error + '</p>');
|
||||
}
|
||||
}
|
||||
|
||||
var daysInBosnian = {
|
||||
'Sun': 'Nedjelja',
|
||||
'Mon': 'Ponedjeljak',
|
||||
'Tue': 'Utorak',
|
||||
'Wed': 'Srijeda',
|
||||
'Thu': 'Četvrtak',
|
||||
'Fri': 'Petak',
|
||||
'Sat': 'Subota'
|
||||
};
|
||||
|
||||
Weather.options = options
|
||||
132
misc/kalkulator.html
Normal file
132
misc/kalkulator.html
Normal file
@@ -0,0 +1,132 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
|
||||
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
|
||||
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="jumbotron">
|
||||
<img src="http://zoblak.com/wp-content/uploads/2016/02/zoblak-1.png" /> <br />
|
||||
Zoblak Agrar Plus se isplati za 2 mjeseci. U periodu od 3 godine ostvaruje uštedu u novcu od 3000.00 KM, te uštedu u vremenu od 800 sati za ovaj konkretan slučaj.
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<p>Na troškove goriva mjesečno trošite 600 KM. Na rad potreban za zalijevanje trošite mjesečno 45 sati što uz zadanu satnicu iznosi 3000 KM. Zajedno to je 3600 KM troška na zalijevanje. </p>
|
||||
|
||||
<p>Okvirna cijena Zoblak Agrar Plus za navedeni broj ventila i pumpi iznosi 2500 KM</p>
|
||||
|
||||
<p class="bg-primary">NAPOMENA: finalna cijena može biti
|
||||
niža ili viša i poznata je nakon izrade projekta).</p>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6">
|
||||
<form method="post">
|
||||
<div class="form-group ">
|
||||
<label class="control-label " for="number">
|
||||
Vaša udaljenost od polja u km
|
||||
</label>
|
||||
<input class="form-control ulazni-parametar" id="udaljenost" type="number" min="1" max="200" step="0.1" value="5" />
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label class="control-label " for="number1">
|
||||
Prosjecna potrošnja automobila na 100 km
|
||||
</label>
|
||||
<input class="form-control ulazni-parametar" id="potrosnja" type="number" min="2" max="5" value="7" step="0.1" />
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label class="control-label " for="select">
|
||||
Koliko često treba zaljevati kulturu?
|
||||
</label>
|
||||
<select class="select form-control" id="frekvencija_zalijevanja">
|
||||
<option value="1">
|
||||
Svaki dan
|
||||
</option>
|
||||
<option value="2">
|
||||
Jednom u dva dana
|
||||
</option>
|
||||
<option value="3">
|
||||
Jednom u tri dana
|
||||
</option>
|
||||
<option value="4">
|
||||
Jednom u četiri dana
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label class="control-label " for="number2">
|
||||
Koliko vremena traje put prema polju (u oba smijera) i jedan ciklus zalijevanja? U satima.
|
||||
</label>
|
||||
<input class="form-control ulazni-parametar" id="vrijeme" type="number" min="2" max="10" value="1.5" step="0.5"/>
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label class="control-label " for="number3">
|
||||
Satnica osobe koja zalijeva u KM
|
||||
</label>
|
||||
<input class="form-control ulazni-parametar" id="satnica" type="number" min="5" max="100" value="20" step="5" />
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label class="control-label " for="number3">
|
||||
Trajanje sezone u mjesecima
|
||||
</label>
|
||||
<input class="form-control ulazni-parametar" id="sezona" type="number" min="1" max="12" value="4" step="1" />
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label class="control-label " for="number3">
|
||||
Broj ventila i pumpi koje Zoblak kontroliše
|
||||
</label>
|
||||
<input class="form-control ulazni-parametar" id="broj_ventila" type="number" min="2" max="50" value="2" step="1"/>
|
||||
</div>
|
||||
<div class="form-group ">
|
||||
<label class="control-label " for="number3">
|
||||
Na koliko godina/sezona se projekcija vrši
|
||||
</label>
|
||||
<input class="form-control ulazni-parametar" id="broj_sezona" type="number" min="1" max="10" value="1" step="1"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
function iskalkulisi() {
|
||||
// ulazi
|
||||
var udaljenost = parseFloat($('#udaljenost').val());
|
||||
var potrosnja = parseFloat($('#potrosnja').val());
|
||||
var frekvencija = parseInt($'#frekvencija_zalijevanja').val());
|
||||
var vrijeme = parseFloat($('#vrijeme').val());
|
||||
var satnica = parseFloat($('#satnica').val());
|
||||
var sezona = parseInt($'#sezona').val());
|
||||
var ventili = parseInt($'#broj_ventila').val());
|
||||
var brojSezona = parseInt($'#broj_sezona').val());
|
||||
var bazaCijeneZoblaka = 1400;
|
||||
var bazaCijeneVentila = 150;
|
||||
var godisnjeOdrzavanjeZoblaka = 200;
|
||||
|
||||
// rezultati
|
||||
var zalijevanjaMjesecno = Math.ceil(30 / frekvencija);
|
||||
var satiMjesecno = Math.ceil(vrijeme) * zalijevanjaMjesecno;
|
||||
var plata = satiMjesecno * satnica;
|
||||
var iznosGoriva = Math.ceil((potrosnja / 100) * (udaljenost * 2) * zalijevanjaMjesecno);
|
||||
var ukupnoTroskovaMjesecno = iznosGoriva + plata;
|
||||
var trosakZoblaka = bazaCijeneZoblaka + ((ventili - 2) * bazaCijeneVentila);
|
||||
var satiUProjekciji = satiMjesecno * sezona * brojSezona;
|
||||
var novcaUProjekciji = ukupnoTroskovaMjesecno * sezona * brojSezona;
|
||||
var iznosUstede =
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
$(document).ready(function(){
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user