( function($) {
$("#resetID").on("click", function(){
location.reload();
});
function getData() {
$.getJSON("https://nic.uniza.sk/webservices/getDirectory.php", {
q: $("#meno").val(),
m: '3000',
w: '03130',
f: $("#fID").val()
}, function (data) {
if (data.report == null) {
$('#directory').html('');
var html = '';
$.each(data.directory, function (index, item) {
itemFunction = item.function == "" ? 'zamestnanec' : item.function;
html += '
';
html += '
';
html += '
' + item.name + '
';
html += '
Pracovisko: ' + item.job + '
';
html += '
Oddelenie: ' + item.job + '
';
html += '
Miestnosť: ' + (item.room.length > 0 ? item.room : 'nie je uvedená') + '
';
html += '
Telefón: ' + item.tel + '
';
html += '
Mobil: ' + (item.mobil.length > 0 ? item.mobil : 'nie je k dispozícii') + '
';
html += '
E-mail: ' + (item.mail.length > 0 ? item.mail : 'nie je uvedený') + '
';
html += '
Funkcia: ' + itemFunction + '
';
html += '
';
html += '
';
var funcico = "";
if (itemFunction == "zamestnanec") {
funcico = "fa-zamestnanec";
} else if (
itemFunction == "dekan") {
funcico = "fa-dekan";
} else if (
itemFunction == "rektor") {
funcico = "fa-rektor";
} else if (
itemFunction == "vedúci katedry") {
funcico = "fa-veduci-katedra";
} else if (itemFunction == "prorektor pre vzdelávanie") {
funcico = "fa-prorektor-4"
} else if (itemFunction == "prorektor pre medzinárodné vzťahy a marketing") {
funcico = "fa-prorektor-2"
} else if (itemFunction == "prorektor pre vedu a výskum") {
funcico = "fa-prorektor-3"
} else if (itemFunction == "prorektor pre rozvoj") {
funcico = "fa-prorektor-5"
} else if (itemFunction == "prorektor pre informačné systémy") {
funcico = "fa-prorektor-1"
} else if (itemFunction == "prodekan pre pedagogickú činnosť" || itemFunction == "prodekan pre rozvoj a zahraničné vzťahy" || itemFunction == "prodekan pre vedu a výskum" || itemFunction == "prodekan pre spoluprácu s priemyslom") {
funcico = "fa-prodekan"
} else if (itemFunction == "tajomník") {
funcico = "fa-tajomnik"
} else if (itemFunction == "vedúci oddelenia") {
funcico = "fa-veduci_oddelenia"
} else if (itemFunction == "riaditeľ") {
funcico = "fa-riaditel"
} else if (itemFunction == "kvestor") {
funcico = "fa-kvestor"
} else {
funcico = "fa-zamestnanec"
}
html += '' + '';
html += '
';
html += '
';
html += '
';
});
$('#directory').append(html);
}
else {
$("#directory").html(data.report);
}
});
}
getData();
})( jQuery );