231 lines
9.6 KiB
Plaintext
231 lines
9.6 KiB
Plaintext
<!DOCTYPE html>
|
|
<html>
|
|
<%- include partial/head.ejs %>
|
|
<body>
|
|
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyC5fplFpd1KiS4bXqllt9v-KKp5bJH-oNE"></script>
|
|
<div class="container-fluid" id="container">
|
|
<div class="row row-offcanvas row-offcanvas-left">
|
|
<%- include partial/stranski-menu.ejs %>
|
|
<div class="container-fluid main col-sm-12">
|
|
<div id="opozorilo"></div>
|
|
<div class="page-header">
|
|
<h1 id="imeorgana"><%= subjekt[0].naziv %><button type="button" id="priljubljeneGumb" class="btn btn-success btn-sm"><i class="fa fa-heart"></i> Dodaj med priljubljene</button></h1>
|
|
</div>
|
|
<%- include partial/iskalnik.ejs %>
|
|
<div class="card">
|
|
<div class="card-img-top" id="basicMap" style="height:400px">
|
|
</div><!--card-img-top-->
|
|
<div class="card-block">
|
|
<small id="oorganu">
|
|
<img src="/images/loading.gif" />
|
|
</small>
|
|
</div><!--card-block-->
|
|
</div><!-- card -->
|
|
<% if(lokacijaJS.length > 0) { %>
|
|
<script type="text/javascript">
|
|
var iconFeatures=[];
|
|
var iconFeature = new ol.Feature({
|
|
geometry: new ol.geom.Point(ol.proj.transform([<%= lokacijaJS[0].longitude %>, <%= lokacijaJS[0].latitude %>], 'EPSG:4326',
|
|
'EPSG:3857')),
|
|
name: 'Null Island',
|
|
population: 4000,
|
|
rainfall: 500
|
|
});
|
|
iconFeatures.push(iconFeature);
|
|
var vectorSource = new ol.source.Vector({
|
|
features: iconFeatures //add an array of features
|
|
});
|
|
var iconStyle = new ol.style.Style({
|
|
image: new ol.style.Icon(/** @type {olx.style.IconOptions} */ ({
|
|
anchor: [0.5, 46],
|
|
anchorXUnits: 'fraction',
|
|
anchorYUnits: 'pixels',
|
|
opacity: 0.75,
|
|
src: '/images/icon.png'
|
|
}))
|
|
});
|
|
var vectorLayer = new ol.layer.Vector({
|
|
source: vectorSource,
|
|
style: iconStyle
|
|
});
|
|
|
|
var map = new ol.Map({
|
|
target: 'basicMap',
|
|
layers: [
|
|
new ol.layer.Tile({
|
|
source: new ol.source.OSM()
|
|
}),
|
|
|
|
],
|
|
view: new ol.View({
|
|
center: new ol.geom.Point([<%= lokacijaJS[0].longitude %>, <%= lokacijaJS[0].latitude %>])
|
|
.transform('EPSG:4326', 'EPSG:3857').getCoordinates(),
|
|
zoom: 16
|
|
})
|
|
})
|
|
map.addLayer(vectorLayer)
|
|
</script>
|
|
<% } else { %>
|
|
<script type="text/javascript">
|
|
var address = '<%= subjekt[0].naslov %>, <%= subjekt[0].postna_stevilka %> <%= subjekt[0].posta %>';
|
|
var map = new google.maps.Map(document.getElementById('basicMap'), {
|
|
mapTypeId: google.maps.MapTypeId.TERRAIN,
|
|
zoom: 16
|
|
});
|
|
var geocoder = new google.maps.Geocoder();
|
|
geocoder.geocode({
|
|
'address': address
|
|
},
|
|
function(results, status) {
|
|
if(status == google.maps.GeocoderStatus.OK) {
|
|
new google.maps.Marker({
|
|
position: results[0].geometry.location,
|
|
map: map
|
|
});
|
|
map.setCenter(results[0].geometry.location);
|
|
var xhttp = new XMLHttpRequest();
|
|
xhttp.open("POST", "/ajax", true);
|
|
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
|
xhttp.send("davcna="+<%= subjekt[0].davcna %>+"&location="+results[0].geometry.location);
|
|
}
|
|
});
|
|
</script>
|
|
<% } %>
|
|
<h2>Transakcije</h2>
|
|
<div id="transakcije-graf">
|
|
<canvas id="canvas" height="150" width="600"></canvas>
|
|
</div>
|
|
<table class="table table-striped" id="transakcije">
|
|
<thead class="thead-inverse">
|
|
<tr>
|
|
<th>Naziv prejemnika</th>
|
|
<th>Vsota transakcij</th>
|
|
<th>Nepovratna sredstva</th>
|
|
<th>Fiduciarni posli</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
<div>
|
|
<!-- Nav tabs -->
|
|
<ul class="nav nav-tabs" role="tablist">
|
|
<li class="nav-item"><a class="nav-link active" href="#omejitve" role="tab" data-toggle="tab">Omejitve poslovanja</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="#narocila" role="tab" data-toggle="tab">Naročila</a></li>
|
|
</ul>
|
|
<!-- Tab panes -->
|
|
<div class="tab-content">
|
|
<div role="tabpanel" class="tab-pane active" id="omejitve">
|
|
<div class="card">
|
|
<div class="card-block">
|
|
<%- include partial/omejitve-org.ejs %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div role="tabpanel" class="tab-pane" id="narocila">
|
|
<div class="card">
|
|
<div class="card-block">
|
|
<%- include partial/narocila-organ.ejs %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<%- include partial/barchart.ejs %>
|
|
</div>
|
|
</div>
|
|
</div> <!-- /container -->
|
|
<%- include partial/eof.ejs %>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$.getJSON('/api/getrpu/<%- sifrapu %>', function(rpu) {
|
|
$('#oorganu').html('<h5 class="card-title">' + rpu.NAZIV + '</h5>');
|
|
$('#oorganu').append('<label>Naslov:</label> ' + rpu.NASLOV + ', ' + rpu.POSTNA_STEVILKA + ' ' + rpu.POSTA + ' | ');
|
|
$('#oorganu').append('<label>Matična številka:</label> ' + rpu.MATICNA + ' | ');
|
|
$('#oorganu').append('<label>Šifra proračunskega uporabnika:</label> ' + rpu.SIFRA_PU + ' | ');
|
|
$('#oorganu').append('<label>Davčna številka:</label> ' + rpu.DAVCNA + ' | ');
|
|
$('#oorganu').append('<label>Občina:</label> ' + rpu.OBCINA);
|
|
//$('#imeorgana').html(rpu.NAZIV);
|
|
});
|
|
////////////////////////////////////////////
|
|
$('#transakcije').DataTable({
|
|
"ajax": {
|
|
"url": "/api/getdupu/organ/<%= sifrapu %>",
|
|
"cache": "true"
|
|
},
|
|
"columnDefs": [
|
|
{ className: "dt-right", "targets": [ 1, 2, 3 ] }
|
|
],
|
|
"bSort": false,
|
|
"columns": [
|
|
{"data": "naziv_zs"},
|
|
{"data": "vsota_prejemkov"},
|
|
{"data": "nepovratna_sredstva"},
|
|
{"data": "fiduciarni_posli"},
|
|
],
|
|
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
|
|
$('td:eq(0)', nRow).html('<a href="/podj/' + aData.davcna_stevilka + '">' +
|
|
aData.naziv_zs + '</a>');
|
|
$('td:eq(1)', nRow).html('<a href="/razmerje/' + aData.sifra_pu + '/'+ aData.davcna_stevilka + '">' +
|
|
parseFloat(aData.vsota_prejemkov).format(2, 3, '.', ',') + ' €</a>');
|
|
$('td:eq(2)', nRow).html('' + parseFloat(aData.nepovratna_sredstva).format(2, 3, '.', ',') + ' €</a>');
|
|
$('td:eq(3)', nRow).html('' + parseFloat(aData.fiduciarni_posli).format(2, 3, '.', ',') + ' €</a>');
|
|
return nRow;
|
|
},
|
|
language: {
|
|
decimal: ",",
|
|
thousands: ".",
|
|
processing: "Obdelava v teku...",
|
|
search: "Išči:",
|
|
lengthMenu: "Prikaži _MENU_ elementov",
|
|
info: "Elementi od _START_ do _END_ od skupaj _TOTAL_ elementov",
|
|
infoEmpty: "Ni elementov za prikaz",
|
|
infoFiltered: "(filtrirano od _MAX_ elementov)",
|
|
infoPostFix: "",
|
|
loadingRecords: "Rezultati se nalagajo ...",
|
|
zeroRecords: "Noben element ne ustreza",
|
|
emptyTable: "Ni podatkov za prikaz",
|
|
paginate: {
|
|
first: "Prva",
|
|
previous: "<",
|
|
next: ">",
|
|
last: "Zadnja"
|
|
},
|
|
aria: {
|
|
sortAscending: ": razvrsti naraščajoče",
|
|
sortDescending: ": razvrsti padajoče"
|
|
}
|
|
}
|
|
})
|
|
$("#priljubljeneGumb").on('click', function() {
|
|
var organi = localStorage.getItem("organi")
|
|
var organiArray = []
|
|
if(organi) {
|
|
organiArray = organi.split(',')
|
|
}
|
|
if(organiArray.indexOf("<%= sifrapu %>") < 0) {
|
|
organiArray.push(<%= sifrapu %>)
|
|
organiArray.sort()
|
|
localStorage.setItem("organi", organiArray)
|
|
$('#opozorilo').html(
|
|
'<div class="alert alert-success alert-dismissible fade in" role="alert">'+
|
|
' <button type="button" class="close" data-dismiss="alert" aria-label="Close">'+
|
|
' <span aria-hidden="true">×</span>'+
|
|
' </button>'+
|
|
' <strong>Uspeh:</strong> Organ je bil uspešno dodan na seznam priljubljenih.'+
|
|
'</div>'
|
|
);
|
|
} else {
|
|
$('#opozorilo').html(
|
|
'<div class="alert alert-info alert-dismissible fade in" role="alert">'+
|
|
' <button type="button" class="close" data-dismiss="alert" aria-label="Close">'+
|
|
' <span aria-hidden="true">×</span>'+
|
|
' </button>'+
|
|
' <strong>Info:</strong> Organ je že na seznamu priljubljenih.'+
|
|
'</div>'
|
|
);
|
|
}
|
|
})
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|