[[script type="text/javascript"]]
( function($) {
$.getJSON("https://nic.uniza.sk/webservices/getMainWorkplace.php", {}, function(data) {
var items = '';
$.each(data.mainWorkplace, function(index,item) {
$('#pracMainID').append($('[[option]]', {value: item.id, text : item.name }));
});
});
$.getJSON("https://nic.uniza.sk/webservices/getFunction.php", {}, function(data) {
var items = '';
$.each(data.wFunction, function(index,item) {$('#fID').append($('[[option]]', {value: item.id, text : item.name }));
});
});
$("#resetID").on("click", function(){
location.reload();
});
$("#pracMainID").on("change", function() {
$.getJSON("https://nic.uniza.sk/webservices/getWorkplace.php", {w:this.value}, function(data) {
var items = '';
var $select = $('#pracID');
$('option[value!=""]',$select).remove();
$.each(data.Workplace, function(index,item) {$('#pracID').append($('[[option]]', {value: item.id, text : item.name }));
});
});
});
function getData(){
$.getJSON("https://nic.uniza.sk/webservices/getDirectory.php", {q:$("#meno").val(), m:$("#pracMainID").val(), w:$("#pracID").val(), f:$("#fID").val()}, function(data) {
if (data.report == null) {
$('#directory').html('');
$('#directory').append('[[div style="background-color: #641220; margin-top: 40px; color: #FFFFFF; padding: 10px 0px 10px 20px;"]][[h4]]' + 'Výsledok vyhľadávania' + '[[/h4]][[/div]]');
var html = '';
$.each(data.directory, function(index,item) {
itemFunction = item.function == "" ? 'zamestnanec' : item.function;html += '[[div class="row paddingtop20"]]';
html += '[[div class="col-lg-10 col-md-10 col-sm-10"]]';
html += '[[h4]]' + item.name + '[[/h4]]';
html += '[[div]][[strong]]Pracovisko: [[/strong]]' + item.job + '[[/div]]';
html += '[[div]][[strong]]Oddelenie: [[/strong]]' + item.job + '[[/div]]';
//html += '[[div]][[strong]]Miestnosť: [[/strong]]' + 'AA01' + '[[/div]]';
html += '[[div]][[strong]]Klapka: [[/strong]]' + item.tel + '[[/div]]';
html += '[[div]][[strong]]E-mail: [[/strong]]' + item.mail + '[[/div]]';
html += '[[div]][[strong]]Funkcia: [[/strong]]' + itemFunction + '[[/div]]';
html += '[[/div]]';html += '[[div class="col-lg-2 col-md-2 col-sm-2"]]';
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 += '[[span class="fa '+funcico+'" style="background-color:#641220; color:#FFFFFF; font-size:160px; margin-top:10px;"]]' + '[[/span]]';
html += '[[/div]]';html += '[[/div]]';html += '[[div style="border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; padding-top: 20px;"]][[/div]]';});
$('#directory').append(html);}else$("#directory").html(data.report);});}
$(document).ready( function() {
$("#searchID").click(function(event) {getData();});
$(document).keypress(function(e) {if(e.which == 13) {getData();}});$('#pracID').change(function(e){getData();});});} ) ( jQuery );
[[/script]]